DBMS_STREAMS_ADM.MAINTAIN_SCHEMAS procedure
I am configuring streams on a 10gR2 RAC cluster and I am not sure if the dbms_streams_adm.maintain_schemas procedure creates a queue-to-queue propogation, or am I going to need to do all the steps by hand.
I cant' tell from the documentation that I am looking at...
Oracle PL/SQL Packages and Types Reference pg 106-85
Any insight would be appreciated.
thanks,
mike
By default on 10gr2 , using maintain_schemas will setup your propagation to be queue to queue.....After you are done creating, just query the dba_propagation....
Similar Messages
-
Hi,
I am tring to configure upstream replication. I have done reqired configurations of creating stream admin, db link at both source and target. Gettiing following error when i execute folli\owing script.
Script:
========================================================
BEGIN
DBMS_STREAMS_ADM.MAINTAIN_SCHEMAS(
schema_names => 'TEST1',
source_database => 'BASE51.REGRESS.RDBMS.DEV.US.ORACLE.COM',
source_directory_object => 'STREAMS_DIR',
destination_database => 'ORCL.LOCALDOMAIN',
destination_directory_object => 'STREAMS_DIR',
include_ddl => TRUE
END;
Error:
==============================================
BEGIN
ERROR at line 1:
ORA-06502: PL/SQL: numeric or value error
ORA-06512: at "SYS.DBMS_STREAMS_MT", line 2963
ORA-06512: at "SYS.DBMS_STREAMS_MT", line 6338
ORA-06512: at "SYS.DBMS_STREAMS_MT", line 7524
ORA-06512: at "SYS.DBMS_STREAMS_ADM", line 2624
ORA-06512: at "SYS.DBMS_STREAMS_ADM", line 2685
ORA-06512: at line 2
I am unable to find the root cause for above error.
Following are entires created for additional information:
> select script_id,status from DBA_RECOVERABLE_SCRIPT ;
Script ID Status
B4BED3FE81B255EEE040007F01003A84 GENERATING
select * from dba_recoverable_script_errors;no rows selected
select * from DBA_RECOVERABLE_SCRIPT_BLOCKS;no rows selected
Let me know if you need any more info which could helpAny help would be appreciated. Experts please guide me.
-
DBMS_STREAMS_ADM.MAINTAIN_SCHEMAS error
Oracle Db version - 10.1.0.2
When I try to run the following command as below I got an error PLS-00302: component 'instantiation_schema_network' must be declared
BEGIN
DBMS_STREAMS_ADM.MAINTAIN_SCHEMAS(
schema_names => 'HR',
source_database => 'orcl',
destination_database => 'orclrep',
capture_name => 'capture_hr',
capture_queue_table => 'rep_capture_queue_table',
capture_queue_name => 'rep_capture_queue',
capture_queue_user => NULL,
apply_name => 'apply_hr',
apply_queue_table => 'rep_dest_queue_table',
apply_queue_name => 'rep_dest_queue',
apply_queue_user => NULL,
propagation_name => 'prop_hr',
log_file => 'export_hr.log',
bi_directional => false,
include_ddl => true,
instantiation => dbms_streams_adm.instantiation_schema_network,
perform_actions => false,
script_name => 'schema_replication_HR.sql',
script_directory_object => 'exp_orcl'
END;
Edited by: user12259190 on Mar 18, 2010 1:18 AMOpen an SR at metalink.
-
Oracle stream - Table instantiation
Hi,
I have included DDL rules in capture process. Everthing goes fine except when I am creating new table in source. It gives below error.
ORA-26687: no instantiation SCN provided for "PCAT_NT"."" in source database "PCAT"
My DDL rules are as below :
BEGIN
DBMS_STREAMS_ADM.ADD_SCHEMA_RULES(
schema_name => 'PCAT_NT',
streams_type => 'CAPTURE',
streams_name => 'PCAT_NT_CAPTURE',
queue_name => 'STRMADMIN.STRMPCAT_QUEUE',
include_dml => false,
include_ddl => true,
source_database => 'PCAT',
inclusion_rule => TRUE,
and_condition => '(:ddl.get_command_type() = ''TRUNCATE TABLE'')'
END;
BEGIN
DBMS_STREAMS_ADM.ADD_SCHEMA_RULES(
schema_name => 'PCAT_NT',
streams_type => 'CAPTURE',
streams_name => 'PCAT_NT_CAPTURE',
queue_name => 'STRMADMIN.STRMPCAT_QUEUE',
include_dml => false,
include_ddl => true,
source_database => 'PCAT',
inclusion_rule => TRUE,
and_condition => '(:ddl.get_command_type() = ''ALTER TABLE'')'
END;
BEGIN
DBMS_STREAMS_ADM.ADD_SCHEMA_RULES(
schema_name => 'PCAT_NT',
streams_type => 'CAPTURE',
streams_name => 'PCAT_NT_CAPTURE',
queue_name => 'STRMADMIN.STRMPCAT_QUEUE',
include_dml => false,
include_ddl => true,
source_database => 'PCAT',
inclusion_rule => TRUE,
and_condition => '(:ddl.get_command_type() = ''CREATE INDEX'')'
END;
BEGIN
DBMS_STREAMS_ADM.ADD_SCHEMA_RULES(
schema_name => 'PCAT_NT',
streams_type => 'CAPTURE',
streams_name => 'PCAT_NT_CAPTURE',
queue_name => 'STRMADMIN.STRMPCAT_QUEUE',
include_dml => false,
include_ddl => true,
source_database => 'PCAT',
inclusion_rule => TRUE,
and_condition => '(:ddl.get_command_type() = ''CREATE TABLE'')'
END;
RegardsI followed document id 733691.1 for downstream setup and cudn't see DBMS_STREAMS_ADM.MAINTAIN_SCHEMAS procedure there.
Regards -
Oracle Streams ORA-23616: Failure in executing block 167 for script
oracle : Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production
os : linux i686 i686 i386 GNU/Linux
application : testing streams for schema ROOT
1. Both the databases INDCTRAK, INDDTRAK are in archive.
2. DB link created
CREATE DATABASE LINK dbl_INDDTRAK CONNECT TO strmadmin IDENTIFIED BY strmadmin USING 'INDDTRAK';
3. tbs created
CREATE TABLESPACE streams_tbs datafile '/u02/oradata/INDDTRAK/streams01.dbf' size 100m;
4 user created
CREATE USER strmadmin IDENTIFIED BY strmadmin DEFAULT TABLESPACE streams_tbs TEMPORARY TABLESPACE temp
QUOTA UNLIMITED ON streams_tbs;
5. All req. grants
GRANT CONNECT, RESOURCE, DBA ,Select_CATALOG_ROLE,
SELECT ANY DICTIONARY TO strmadmin;
6. grants
BEGIN
DBMS_STREAMS_AUTH.GRANT_ADMIN_PRIVILEGE (Grantee => 'strmadmin',Grant_privileges => true);
END;
PL/SQL procedure successfully completed.
7. Created directory
CREATE OR REPLACE DIRECTORY ADMIN AS '/u02/oradata/INDDTRAK/streams';
step 2-7 executed without errors
8.run with perform_actions as false
SQL> BEGIN
2 DBMS_STREAMS_ADM.MAINTAIN_SCHEMAS(
3 schema_names =>'ROOT',
4 source_directory_object =>'ADMIN',
5 destination_directory_object =>'ADMIN',
6 source_database => 'INDCTRAK',
7 destination_database => 'INDDTRAK',
8 perform_actions => false,
9 script_name => 'schema_replication.sql',
10 script_directory_object => 'admin',
11 dump_file_name => 'ROOT.DMP',
12 capture_name => 'capture_ROOT',
13 capture_queue_table => 'rep_capture_queue_table',
14 capture_queue_name => 'rep_capture_queue',
15 capture_queue_user => null,
16 propagation_name => 'prop_ROOT',
17 apply_name => 'apply_ROOT',
18 apply_queue_table => 'rep_dest_queue_table',
19 apply_queue_name => 'rep_dest_queue',
20 apply_queue_user => null,
21 log_file => 'exp.log',
22 bi_directional => false,
23 include_ddl => true,
24 instantiation => dbms_streams_adm.instantiation_schema_network);
25 END;
26 /
9. when running perform_actions true getting error
SQL> BEGIN
2 DBMS_STREAMS_ADM.MAINTAIN_SCHEMAS(
3 schema_names =>'ROOT',
4 source_directory_object =>'ADMIN',
5 destination_directory_object =>'ADMIN',
6 source_database => 'INDCTRAK',
7 destination_database => 'INDDTRAK',
8 perform_actions => TRUE,
9 script_name => 'schema_replication.sql',
10 script_directory_object => 'admin',
11 dump_file_name => 'ROOT.DMP',
12 capture_name => 'capture_ROOT',
13 capture_queue_table => 'rep_capture_queue_table',
14 capture_queue_name => 'rep_capture_queue',
15 capture_queue_user => null,
16 propagation_name => 'prop_ROOT',
17 apply_name => 'apply_ROOT',
18 apply_queue_table => 'rep_dest_queue_table',
19 apply_queue_name => 'rep_dest_queue',
20 apply_queue_user => null,
21 log_file => 'exp.log',
22 bi_directional => false,
23 include_ddl => true,
24 instantiation => dbms_streams_adm.instantiation_schema_network);
25 END;
26 /
BEGIN
ERROR at line 1:
ORA-23616: Failure in executing block 167 for script
4D2E52386C84C1CAE040A8C0FC015222
ORA-06512: at "SYS.DBMS_RECOVERABLE_SCRIPT", line 560
ORA-06512: at "SYS.DBMS_RECOVERABLE_SCRIPT", line 583
ORA-06512: at "SYS.DBMS_STREAMS_MT", line 7673
ORA-06512: at "SYS.DBMS_STREAMS_ADM", line 2606
ORA-06512: at "SYS.DBMS_STREAMS_ADM", line 2667
ORA-06512: at line 2
10 errors
SQL> select * from dba_recoverable_script_errors;
SCRIPT_ID BLOCK_NUM ERROR_NUMBER
ERROR_MESSAGE
ERROR_CRE
4D2E52386C84C1CAE040A8C0FC015222 167 -39001
ORA-39001: invalid argument value
ORA-06512: at "SYS.DBMS_RECO_SCRIPT_INVOK", line 130
ORA-06512: at "SYS.DBMS_STREAMS_RPC", line 447
14-MAY-08
I could not find much explanation on net.
pl. help in case it is already solved.Hi,
we are implementing datavault on an existing 11g DB.The database is up and running fine , but DBCA shows this error when I am trying to configure datavault using DBCA.
I have created a spfile from the same pfile, and Db does not show any error while coming up or shutting down. The issue comes only while using DBCA. I shall try minimizing the parameters and try again.
Thanks
Pankaj -
Truncate, then reload causes ora-00001 unique constraint on apply side
I setup schema level replication using the maintain_schema procedure. Its replicating DML and not DDL.
I have a source side process that truncates a table then reloads it every day. Since DDL is not replicating, the reload produces generates an ora-00001 errors in apply process.
I don't want to replicate all DDL because of apply errors it creates
I've added a DDL schema rule to replicate truncate statements on the capture and apply rule, but the truncate is still not replicating. Here are the rules I'm using:
dbms_streams_adm.add_schema_rules(
schema_name => 'PRODUCT',
streams_type => 'CAPTURE',
streams_name => '&src_db$CAP',
queue_name => 'STRMADMIN.&src_db$CAPQ',
include_dml => TRUE,
include_ddl => FALSE,
include_tagged_lcr => TRUE,
source_database => '&src_db..&gbl_nm',
inclusion_rule => TRUE);
DBMS_STREAMS_ADM.add_schema_rules (
schema_name => 'PRODUCT',
streams_type => 'CAPTURE',
streams_name => '&src_db$CAP',
queue_name => 'STRMADMIN.&src_db$CAPQ',
include_dml => FALSE,
include_ddl => TRUE,
source_database => '&src_db..&gbl_nm',
inclusion_rule => TRUE,
and_condition => '(:ddl.get_command_type() = ''TRUNCATE TABLE'')');Here's the capture rule_condition from dba_streams_rules:
((:dml.get_object_owner() = 'PRODUCT') and :dml.get_source_database_name() = 'PKIO.LOUDCLOUD.COM' )
((((:ddl.get_object_owner() = 'PRODUCT' or :ddl.get_base_table_owner() = 'PRODUCT') and :ddl.is_null_tag() = 'Y' and :ddl.get_source_database_name() = 'PKIO.LOUDCLOUD.COM' )) and ((:ddl.get_command_type() = 'TRUNCATE TABLE')))
On the apply side I have the following
dbms_streams_adm.add_schema_rules(
schema_name => 'PRODUCT',
streams_type => 'APPLY',
streams_name => '',
queue_name => 'STRMADMIN.&src_db$APPQ',
include_dml => TRUE,
include_ddl => FALSE,
include_tagged_lcr => TRUE,
source_database => '&src_db..&gbl_nm',
inclusion_rule => TRUE);
DBMS_STREAMS_ADM.add_schema_rules (
schema_name => 'PRODUCT',
streams_type => 'APPLY',
streams_name => '',
queue_name => 'STRMADMIN.&src_db$APPQ',
include_dml => FALSE,
include_ddl => TRUE,
source_database => '&src_db..&gbl_nm',
inclusion_rule => TRUE,
and_condition => '(:ddl.get_command_type() = ''TRUNCATE TABLE'')');And the corresponding rule_conditions look like:
((:dml.get_object_owner() = 'PRODUCT') and :dml.get_source_database_name() = 'PKIO.LOUDCLOUD.COM' )
((((:ddl.get_object_owner() = 'PRODUCT' or :ddl.get_base_table_owner() = 'PRODUCT') and :ddl.is_null_tag() = 'Y' and :ddl.get_source_database_name() = 'PKIO.LOUDCLOUD.COM' )) and ((:ddl.get_command_type() = 'TRUNCATE TABLE')))
When the source side process that truncates and reloads the table, the apply process crashes. To workaround this I manually truncate the table on the target side and execute DBMS_APPLY_ADM.EXECUTE_ALL_ERRORS then restart apply.
What do I need to do to replicate truncate statements with out replicating other DDL statements?
Thanks!Hi,
You can create rule for truncate using below:
BEGIN
DBMS_RULE_ADM.CREATE_RULE(
rule_name => 'TRUNCATE_RULE',
condition => '(:ddl.get_object_owner() = ''HR'' AND ' ||
':ddl.get_object_name() = ''TEST'') AND ' ||
':ddl.get_command_type() = ''TRUNCATE TABLE'' ');
END;
Thanks,
Reena -
ORA-00258: manual archiving in NOARCHIVELOG mode must identify log
Hi I am new to oracle streams. I am trying to setup a one way replication from one database to another using Oracle 10g (10.2.0.1.0) on Windows XP SP3 (32 bit).
I ran the following proc as the streams admin schema:
begin
dbms_streams_adm.maintain_schemas(
schema_names => 'XXCOW',
source_directory_object => 'repl_exp_dir',
destination_directory_object => 'repl_imp_dir',
source_database => 'PWBSD',
destination_database => 'PDVSD',
perform_actions => true,
dump_file_name => 'exp_app23.dmp',
capture_queue_table => 'rep_capt_table',
capture_queue_name => 'rep_capt_queue',
capture_queue_user => NULL,
apply_queue_table => 'rep_dest_table',
apply_queue_name => 'rep_dest_queue',
apply_queue_user => NULL,
capture_name => 'capture_pubs',
propagation_name => 'prop_pubs',
apply_name => 'apply_pubs',
log_file => 'exp_app23.log',
bi_directional => false,
include_ddl => true,
instantiation => dbms_streams_adm.instantiation_schema);
end;
The script failed the first time because i forgot to configure the source database in archive log mode.
The steps i followed to change to archivelog mode:
SQL> select name from v$database;
NAME
PWBSD
SQL> alter system set LOG_ARCHIVE_DEST = 'D:\data\oracle\oradata\PWBSD\archive' scope=both;
System altered.
SQL> conn sys/sys@pwbsd as sysdba
Connected.
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount
ORACLE instance started.
Total System Global Area 612368384 bytes
Fixed Size 1250428 bytes
Variable Size 197135236 bytes
Database Buffers 406847488 bytes
Redo Buffers 7135232 bytes
Database mounted.
SQL> alter database archivelog;
Database altered.
SQL> alter database open;
Database altered.
SQL>
I configured it in archive log mode and ran the proc above again.
I got the following output this time:
job finished
begin
ERROR at line 1:
ORA-23616: Failure in executing block 90 for script
959ECF1D1159402A8C16687AE5E3B5CD
ORA-06512: at "SYS.DBMS_RECOVERABLE_SCRIPT", line 457
ORA-06512: at "SYS.DBMS_STREAMS_MT", line 2201
ORA-06512: at "SYS.DBMS_STREAMS_MT", line 7486
ORA-06512: at "SYS.DBMS_STREAMS_ADM", line 2624
ORA-06512: at "SYS.DBMS_STREAMS_ADM", line 2685
ORA-06512: at line 2
I ran the following to check the error:
select * from dba_recoverable_script_errors;
The output is:
SCRIPT ID: 959ECF1D1159402A8C16687AE5E3B5CD
BLOCK NUM: 90
ERROR_NUMBER: -258
ERROR_MESSAGE: ORA-00258: manual archiving in NOARCHIVELOG mode must identify log
ORA-06512: at "SYS.DBMS_RECO_SCRIPT_INVOK", line 129
ORA-06512: at "SYS.DBMS_STREAMS_RPC", line 358
It seemed like it was still complaining about archive log mode,
I verified that the PWBSD db is in archivelog mode by running the following:
select name, log_mode from v$database;
NAME: PWBSD
LOG_MODE: ARCHIVELOG
What could be the problem and how do i proceed to fix it?Hi Parthiv,
The steps given by you is not clear.
please try to fallow the steps given in the below link. It may be helpful to you to setup schema level streams:
http://gssdba.wordpress.com/2011/04/20/steps-to-implement-schema-level-oracle-streams/
Thanks and Regards,
Satish.G.S
gssdba.wordpress.com -
What level suplemental logging requires to setup Streams at Schema level
Hi,
Working on setting-up streams from 10g to 11g db @ schema level. And the session is hanging with statement "ALTER DATABASE ADD SUPPLEMENTAL LOG DATA" while running following command - generated using DBMS_STREAMS_ADM.MAINTAIN_SCHEMAS.
Begin
dbms_streams_adm.add_schema_rules(
schema_name => '"DPX1"',
streams_type => 'CAPTURE',
streams_name => '"CAPTURE_DPX1"',
queue_name => '"STRMADMIN"."CAPTURE_QUEUE"',
include_dml => TRUE,
include_ddl => TRUE,
include_tagged_lcr => TRUE,
source_database => 'DPX1DB',
inclusion_rule => TRUE,
and_condition => get_compatible);
END;
The generated script also setting each table with table-level logging "'ALTER TABLE "DPX1"."DEPT" ADD SUPPLEMENTAL LOG DATA (PRIMARY KEY, FOREIGN KEY, UNIQUE INDEX) COLUMNS'".
So my question is: Is Database level supplemental logging required to setup schema-level replication? If answer is no then why the following script is invoking "ALTER DATABASE ADD SUPPLEMENTAL LOG DATA" command.
Thanks in advance.
Regards,
SridharHi sri dhar,
From what I found, the "ALTER DATABASE ADD SUPPLEMENTAL LOG DATA" is required for the first capture you create in a database. Once it has been run, you'll see V$DATABASE with the column SUPPLEMENTAL_LOG_DATA_MIN set to YES. It requires a strong level of locking - for example, you cannot run this alter database while an index rebuild is running (maybe an rebuild online?)
I know it is called implicitly by DBMS_STREAMS_ADM.add_table_rules for the first rule created.
So, you can just run the statement once in a maintenance window and you'll be all set.
Minimal Supplemental Logging - http://www.oracle.com/pls/db102/to_URL?remark=ranked&urlname=http:%2F%2Fdownload.oracle.com%2Fdocs%2Fcd%2FB19306_01%2Fserver.102%2Fb14215%2Flogminer.htm%23sthref2006
NOT to be confused with database level supplemental log group.
http://download.oracle.com/docs/cd/B19306_01/server.102/b14228/mon_rep.htm#BABHHCCC
Hope this helps,
Regards, -
Run the following to setup streams but it failing.
BEGIN
DBMS_STREAMS_ADM.maintain_schemas
(schema_names => 'hr',
source_directory_object => NULL,
destination_directory_object => NULL,
source_database => 'orcl1',
destination_database => 'orcl2',
perform_actions => TRUE,
--script_name => 'stream_hr_schema.sql',
--script_directory_object => 'STREAM_SCRIPTS',
capture_name => 'capture_hr,
capture_queue_table => 'rep_capture_queue_table',
capture_queue_name => 'rep_capture_queue',
capture_queue_user => NULL,
propagation_name => 'prop_hr',
apply_name => 'apply_hr',
apply_queue_table => 'rep_dest_queue_table',
apply_queue_name => 'rep_dest_queue',
apply_queue_user => NULL,
--log_file => 'exp_hr.log',
bi_directional => TRUE,
include_ddl => TRUE,
instantiation => DBMS_STREAMS_ADM.instantiation_schema_network
END;
ERROR:
BEGIN
ERROR at line 1:
ORA-23616: Failure in executing block 177 for script
2A2A7AFA67CB73C3E0440003BA5D101D
ORA-06512: at "SYS.DBMS_RECOVERABLE_SCRIPT", line 560
ORA-06512: at "SYS.DBMS_RECOVERABLE_SCRIPT", line 583
ORA-06512: at "SYS.DBMS_STREAMS_MT", line 2201
ORA-06512: at "SYS.DBMS_STREAMS_MT", line 7486
ORA-06512: at "SYS.DBMS_STREAMS_ADM", line 2624
ORA-06512: at "SYS.DBMS_STREAMS_ADM", line 2685
ORA-06512: at line 2strange error. what is wrong with this script..
1 BEGIN
2 DBMS_STREAMS_ADM.MAINTAIN_SCHEMAS(
3 schema_names => 'TAX',
4 SOURCE_DIRECTORY_OBJECT => null,
5 DESTINATION_DIRECTORY_OBJECT => null,
6 source_database => 'STRMSRC',
7 destination_database => 'STRMTRGT',
8 capture_name => 'A1_TAX_CAPTURE',
9 capture_queue_table => 'A1_TAX_CAPTURE_QT',
10 capture_queue_name => 'A1_TAX_CAPTURE_Q',
11 capture_queue_user => null,
12 apply_name => 'A2_TAX_APPLY',
13 apply_queue_table => 'A2_TAX_APPLY_QT',
14 apply_queue_name => 'A2_TAX_APPLY_Q',
15 apply_queue_user => null,
16 propagation_name => 'prop_tax',
17 log_file => 'exp.log',
18 bi_directional => false,
19 include_ddl => true,
20 instantiation => dbms_streams_adm.instantiation_schema_network,
21 perform_actions => false,
22 script_name => 'tax_schema_replication.sql',
23 script_directory_object => 'admin' );
24* END;
SQL> /
BEGIN
ERROR at line 1:
ORA-02019: connection description for remote database not found
ORA-06512: at "SYS.DBMS_STREAMS_MT", line 903
ORA-06512: at "SYS.DBMS_STREAMS_MT", line 7444
ORA-06512: at "SYS.DBMS_STREAMS_ADM", line 2624
ORA-06512: at "SYS.DBMS_STREAMS_ADM", line 2685
ORA-06512: at line 2
SQL> select * from global_name@STRMTRGT;
GLOBAL_NAME
TAXTEST.LITTON.C_BASS.COM -
Multi-user streams replication error in 10gR2
hi, i am testing multi-user streams replication,using the following sql statement:
begin
dbms_streams_adm.maintain_schemas(
schema_names => 'hr,scott,ddup',
source_directory_object => null,
destination_directory_object => null,
source_database => 'yjsh.oracle.com',
destination_database => 'test1.oracle.com',
perform_actions => true,
bi_directional => false,
include_ddl => true,
instantiation => dbms_streams_adm.instantiation_schema_network,
SCRIPT_DIRECTORY_OBJECT => 'admindir',
SCRIPT_NAME => 'generated_schemas_script.sql' );
end;
all objects in scott,ddup were successfully replicated to target database.
but in hr schema,only EMP_DETAILS_VIEW was replicated to target db.
all other objects were not replicated.
and there was no error in alert.log and dba_apply_error.
sqlplus hr/hr@test1
HR > select * from tab;
TNAME TABTYPE CLUSTERID
EMP_DETAILS_VIEW VIEW
1 row selected.
anyone know how to resolve this problem?
Your feedback is greatly appreciated !Hi
did you find a solution to your problem?I too have the same problerm. But what I understand is , When the driver fails to connect to the database due to wrong password or username, It repeatedly attempts to connect. So is there any way to restrict the number os attempts made by the driver?I guess Jconnect driver has some attributes to do this.Does someone know if there are any other drivers? -
Hi experts,
I am new to streams ... Could anyone provide me the steps to drop one table from stream environment completely .
Client ask me do it ... Please help me......Hello,
That sort of depends how the table is brought into the stream.
If there is a rule to capture the table, you just have to drop the rule.
The Pl/SQL procedures manual is your friend.
You would need the DBMS_STREAMS_ADM.REMOVE_RULE procedure.
http://download.oracle.com/docs/cd/E11882_01/appdev.112/e16760/d_streams_adm.htm#CDEFCADF
Hope it helps.
Avraam Jack Dectis -
Streams Setup from RAC to Single instance
Does anyone have a document to setup streams from RAC to Non RAC. I successfully setup streams on 2 single instances but I am having issues in replicating, Streams is setup on node1 or Rac and Apply process is also setup on single node. but data is not replicating.
Appreciate any suggestions.From Metalink Note 418755.1:
Additional Configuration for RAC Environments for a Source Database Archive Logs
The archive log threads from all instances must be available to any instance
running a capture process. This is true for both local and downstream capture.
Queue Ownership
When Streams is configured in a RAC environment, each queue table has an
"owning" instance. All queues within an individual queue table are owned by
the same instance. The Streams components (capture/propagation/apply) all
use that same owning instance to perform their work. This means that
+ a capture process is run at the owning instance of the source queue.
+ a propagation job must run at the owning instance of the queue
+ a propagation job must connect to the owning instance of the target queue.
Ownership of the queue can be configured to remain on a specific instance,
as long as that instance is available, by setting the PRIMARY _INSTANCE
and/or SECONDARY_INSTANCE parameters of DBMS_AQADM.ALTER_QUEUE_TABLE.
If the primary_instance is set to a specific instance (ie, not 0), the queue
ownership will return to the specified instance whenever the instance is up.
Capture will automatically follow the ownership of the queue.If the ownership
changes while capture is running, capture will stop on the current instance
and restart at the new owner instance.
For queues created with Oracle Database 10g Release 2, a service will be
created with the service name= schema.queue and the network name
SYS$schema.queue.global_name for that queue. If the global_name of the
database does not match the db_name.db_domain name of the database, be sure
to include the global_name as a service name in the init.ora.
For propagations created with the Oracle Database 10g Release 2 code with
the queue_to_queue parameter to TRUE, the propagation job will deliver only
to the specific queue identified. Also, the source dblink for the target
database connect descriptor must specify the correct service (global name of
the target database ) to connect to the target database. For example, the
tnsnames.ora entry for the target database should include the CONNECT_DATA
clause in the connect descriptor for the target database. This claus should
specify (CONNECT_DATA=(SERVICE_NAME='global_name of target database')).
Do NOT include a specific INSTANCE in the CONNECT_DATA clause.
For example, consider the tnsnames.ora file for a database with the global name
db.mycompany.com. Assume that the alias name for the first instance is db1 and
that the alias for the second instance is db2. The tnsnames.ora file for this
database might include the following entries:
db.mycompany.com=
(description=
(load_balance=on)
(address=(protocol=tcp)(host=node1-vip)(port=1521))
(address=(protocol=tcp)(host=node2-vip)(port=1521))
(connect_data=
(service_name=db.mycompany.com)))
db1.mycompany.com=
(description=
(address=(protocol=tcp)(host=node1-vip)(port=1521))
(connect_data=
(service_name=db.mycompany.com)
(instance_name=db1)))
db2.mycompany.com=
(description=
(address=(protocol=tcp)(host=node2-vip)(port=1521))
(connect_data=
(service_name=db.mycompany.com)
(instance_name=db2)))
Use the italicized tnsnames.ora alias in the target database link USING clause.
DBA_SERVICES lists all services for the database. GV$ACTIVE_SERVICES identifies
all active services for the database In non_RAC configurations, the service
name will typically be the global_name. However, it is possible for users to
manually create alternative services and use them in the TNS connect_data
specification . For RAC configurations, the service will appear in these views
as SYS$schema.queue.global_name.
Propagation Restart
Use the procedures START_PROPAGATION and STOP_PROPAGATION from
DBMS_PROPAGATION_ADM to enable and disable the propagation schedule.
These procedures automatically handle queue_to_queue propagation.
Example:
exec DBMS_PROPAGATION_ADM.stop_propagation('name_of_propagation'); or
exec DBMS_PROPAGATION_ADM.stop_propagation('name_of_propagation',force=>true);
exec DBMS_PROPAGATION_ADM.start_propagation('name_of_propagation');
If you use the lower level DBMS_AQADM procedures to manage the propagation schedule,
be sure to explicitly specify the destination_queue name when queue_to_queue propagation has been configured.
Example:
DBMS_AQADM.UNSCHEDULE_PROPAGATION('source_queue_name','destination',destination_queue=>'specific_queue');
DBMS_AQADM.SCHEDULE_PROPAGATION('source_queue_name','destination',destination_queue=>'specific_queue');, DBMS_AQADM.ENABLE_PROPAGATION_SCHEDULE('source_queue_name','destination',destination_queue=>'specific_queue');,
DBMS_AQADM.DISABLE_PROPAGATION_SCHEDULE('source_queue_name','destination',destination_queue=>'specific_queue');, DBMS_AQADM.ALTER_PROPAGATION_SCHEDULE('source_queue_name','destination',destination_queue=>'specific_queue');
Changing the GLOBAL_NAME of the Source Database
See the OPERATION section on Global_name below. The following are some
additional considerations when running in a RAC environment.
If the GLOBAL_NAME of the database is changed, ensure that any propagations
are dropped and recreated with the queue_to_queue parameter set to TRUE.
In addition, if the GLOBAL_NAME does not match the db_name.db_domain of the
database, include the global_name for the queue (NETWORK_NAME in DBA_QUEUES)
in the list of services for the database in the database parameter
initialization file.
Section 4. Target Site Configuration
The following recommendations apply to target databases, ie, databases in which
Streams apply is configured.
1. Privileges
Grant Explicit Privileges to APPLY_USER for the user tables
Examples:
Privileges for table level DML: INSERT/UPDATE/DELETE,
Privileges for table level DDL: CREATE (ANY) TABLE , CREATE (ANY) INDEX,
CREATE (ANY) PROCEDURE
2. Instantiation
Set Instantiation SCNs manually if not using export/import. If manually
configuring the instantiation scn for each table within the schema, use the
RECURSIVE=>TRUE option on the DBMS_STREAMS_ADM.SET_SCHEMA_INSTANTIATION_SCN
procedure
For DDL Set Instantiation SCN at next higher level(ie,SCHEMA or GLOBAL level).
3. Conflict Resolution
If updates will be performed in multiple databases for the same shared
object, be sure to configure conflict resolution. See the Streams
Replication Administrator's Guide Chapter 3 Streams Conflict Resolution,
for more detail.
To simplify conflict resolution on tables with LOB columns, create an error
handler to handle errors for the table. When registering the handler using
the DBMS_APPLY_ADM.SET_DML_HANDLER procedure, be sure to specify the
ASSEMBLE_LOBS parameter as TRUE.
In Streams Concepts manual 10.2 chapter 22: Monitoring Apply
Displaying detailed information about Apply errors.
4. Apply Process Configuration
A. Rules
If the maintain_* procedures are not suitable for your environment,
please use the ADD_RULES procedures (ADDTABLE_RULES , ADD_SCHEMA_RULES ,
ADD_GLOBAL_RULES (for DML and DDL), ADD_SUBSET_RULES (DML only).
These procedures minimize the number of steps required to configure Streams
processes. Also, it is possible to create rules for non-existent objects,
so be sure to check the spelling of each object specified in a rule carefully.
APPLY can be configured with or without a ruleset. The ADD_GLOBAL_RULES can
be used to apply all changes in the queue for the database. If no ruleset is
specified for the apply process, all changes in the queue are processed by the apply process.
A single Streams apply can process rules for multiple tables or schemas
located in a single queue that are received from a single source database .
For best performance, rules should be simple. Rules that include LIKE clauses are
not simple and will impact the performance of Streams.
To eliminate changes for particular tables or objects, specify the
include_tagged_lcr clause along with the table or object name in the
negative rule set for the Streams process. Setting this clause will
eliminate all changes, tagged or not, for the table or object.
B. Parameters
Set the following parameters after a apply process is created:
+ DISABLE_ON_ERROR=N Default: Y
If Y, then the apply process is disabled on the first unresolved error,
even if the error is not fatal.
If N, then the apply process continues regardless of unresolved errors.
+ PARALLELISM=3* Number of CPU Default: 1
Apply parameters can be set using the SET_PARAMETER procedure from the
DBMS_APPLY_ADM package. For example, to set the DISABLE_ON_ERROR parameter
of the streams apply process named APPLY_EX, use the following syntax while
logged in as the Streams Administrator:
exec dbms_apply_adm.set_parameter('apply_ex','disable_on_error','n');
Change the apply parallelism parameter recommendation to a lower number.
In general, try 4 or 8 and increase or decrease as necessary for your workload.
In some cases, performance can be improved by setting the following hidden
parameter. This parameter should be set when the major workload is UPDATEs
and the updates are performed on just a few columns of a many-column table.
+ DYNAMICSTMTS=Y Default: N
If Y, then for UPDATE statements, the apply process will optimize the
generation of SQL statements based on required columns.
CHECKPOINTFREQUENCY=1000
Increase the frequency of logminer checkpoints especially in a
database with significant LOB or DDL activity.
exec dbms_capture_adm.set_parameter('capture_ex','_checkpoint_frequency','1000');
5. Additional Configuration for RAC Environments for a Apply Database
Queue Ownership
When Streams is configured in a RAC environment, each queue table has an
"owning" instance. All queues within an individual queue table are owned
by the same instance. The Streams components (capture/propagation/apply)
all use that same owning instance to perform their work. This means that
the database link specified in the propagation must connect to the owning
instance of the target queue. the apply process is run at the owning instance
of the target queue
Ownership of the queue can be configured to remain on a specific instance,
as long as that instance is available, by setting the PRIMARY _INSTANCE and
SECONDARY_INSTANCE parameters of DBMS_AQADM.ALTER_QUEUE_TABLE. If the
primary_instance is set to a specific instance (ie, not 0), the queue
ownership will return to the specified instance whenever the instance is up.
Apply will automatically follow the ownership of the queue. If the ownership
changes while apply is running, apply will stop on the current instance and
restart at the new owner instance.
Changing the GLOBAL_NAME of the Database
See the OPERATION section on Global_name below. The following are some
additional considerations when running in a RAC environment.
If the GLOBAL_NAME of the database is changed, ensure that the queue is
empty before changing the name and that the apply process is dropped and
recreated with the apply_captured parameter = TRUE. In addition, if the
GLOBAL_NAME does not match the db_name.db_domain of the database, include
the GLOBAL_NAME in the list of services for the database in the database
parameter initialization file. -
Error 01741 executing a procedure
While executing a procedure I'm getting the following error:
BEGIN
ERROR at line 1:
ORA-01741: illegal zero-length identifier
ORA-06512: at "SYS.DBMS_STREAMS_ADM_UTL_INVOK", line 289
ORA-06512: at "SYS.DBMS_STREAMS_ADM", line 439
ORA-06512: at "SYS.DBMS_STREAMS_ADM", line 397
ORA-06512: at line 2I mean you can try using this code:
BEGIN
DBMS_STREAMS_ADM.ADD_SCHEMA_RULES(
schema_name => 'MYSCHEMA',
streams_type => 'capture',
streams_name => 'capture_process',
queue_name => 'capture_queue',
include_dml => true,
include_ddl => true,
include_tagged_lcr => false,
source_database => 'ANAG',
inclusion_rule => true);
END;
Just try and let me know... -
DBMS_STREAMS_ADM.ADD_SUBSET_RULES ORA-00936 ORA-06512
I need help, why i got this error???
SQL> BEGIN
2 DBMS_STREAMS_ADM.ADD_SUBSET_RULES(
3 table_name => 'piramide.lancamento',
4 dml_condition => 'where empresa=100 and filial=101 or empresa=102 and filial=102 or empresa=102 and filial=103',
5 streams_type => 'apply',
streams_name => 'lancamento_apply',
6 7 queue_name => 'STRMADMIN.LANCAMENTO_Q',
8 include_tagged_lcr => false);
9 END;
10 /
BEGIN
ERROR at line 1:
ORA-00936: missing expression
ORA-06512: at "SYS.DBMS_STREAMS_ADM", line 1032
ORA-06512: at "SYS.DBMS_STREAMS_ADM", line 1181
ORA-06512: at "SYS.DBMS_STREAMS_ADM", line 1073
ORA-06512: at line 2
SQL>
Tks,
ElberHI, tks for you help, but i executed this procedure using CAPTURE and it works fine, so, i dont think that the problem is that.
##################THIS WORK AT SOURCE#################
BEGIN
DBMS_STREAMS_ADM.ADD_SUBSET_RULES(
table_name => '"PIRAMIDE"."LANCAMENTO"',
dml_condition => 'where empresa=100 and filial=101 or empresa=102 and filial=102 or empresa=102 and filial=103',
streams_type => 'capture',
streams_name => '"LANCAMENTO_CAPTURE"',
queue_name => '"STRMADMIN"."LANCAMENTO_CAPTURE_Q"',
include_tagged_lcr => false);
END;
I find one BUG on metalink that i think this is my problem. BUG n 6331369 ORA-936 WHEN CREATING STREAMS SUBSET RULE
If you can, please help me.
Tks,
Elber Portugal -
Wht's wrong with this stream procedure.????
Am running this procedure and this is giving me an error..."wrong number or type of arguments to the call.."
declare
tab_array dbms_utility.uncl_array;
begin
tab_array(0) := 'scot.emp';
tab_array(1) := 'scot.dept';
dbms_streams_adm.maintain_tables(
table_name => tab_array,
source_directory_object => 'c:\oracle\kndl_src_strm_dir',
destination_directory_object => 'c:\oracle\kndl_dst_strm_dir',
source_database => 'twus',
destination_database => 'twuk',
perform_action => true,
caoture_name => 'Stream_Capture',
apply_name => 'Stream_Apply',
bidirectional => false,
instantiation => dbms_streams_adm.instantiation_table_network
end;
PLease help!!
Kapiltoo manny spelling mistakes of arguments......
am sorry guys for inconvenience...
Kapil
Maybe you are looking for
-
Syncing apps to iTunes with Family Sharing
I recently got a new iPhone 6 Plus and decided to use my own Apple ID instead of using my fathers, which I used on my old phone. I got all the apps that I wanted from the new family sharing option. However, when I sync my phone to my computer, unde
-
Dynamic creation of input values
Hi All, My Req is: FROM APPLICATION:- (drill down combo box) TO APPLICATION:- (drill down combo box) the user selects an application from the list of the appset.Their respective dimensions needs to be displayed as prompts. eg:- appset:
-
Error: Javax.mail does not exist, please help
I have copies mail.jar and activation.jar in the classpath directory as instructed, then try to compile but got the below error: package javax.mail does not exist please help. G:\CRD>javac SendMailBean.java SendMailBean.java:22: package javax.mail do
-
How to compile and execute a generated file
Hi, Can somebody help me please? My program goes like this: I'm creating a program wherein there are two TextArea, left and right, and a button. The role of the left TextArea is where I will type a Java code (what i mean is a class). After typing, th
-
Unable to buy additional storage using my iTunes card?
Unable to buy additional storage using my iTunes card credit?