Вы находитесь на странице: 1из 3

Step1:(Source Database --> usqa)

Step2:(Destination Database --> ukqa)


Note:
Pre-requisites
Both databases should have spfile
sga_max_size=300m (Minimum)
pga_target=200m (Minimum)
Database should be in Archive Log Mode
Both Databases should have the same username
Step2:
Create the Listener
Step1:
Create the tnsnames
Step1:
Create the Schema by running utlsampl.sql without removing the constraints
SQL> User Prompt
SQL> alter table emp add supplemental log data(all) columns;
Export the Schema
$ exp file=qa.dmp object_consistent=y owner=qa
Step2: Import the Schema
$ imp file=qa.dmp fromuser=qa touser=qa streams_instantiation=y
Note:
--------------------------------------------------
The same below steps on both databases Step1|Step2
--------------------------------------------------
Create tablespace by name streams(50m)
Create one user by name strmadmin
Grant connect,resource,dba,select any dictionary, select_catalog_role to strmadm
in
SQL> exec dbms_streams_auth.grant_admin_privilege-
(grantee=>'strmadmin',grant_privileges=>true);
__________________________________________________
Note:
--------------------------------------------------
The same below steps on both databases Step1|Step2
--------------------------------------------------
Check the following Parmaeters
global_names
Default value is false, make it true,dynamic parameter
compatiable=10.2.0.1.0
job_queue_processes
Minimum value is 10, dynamic parameter
streams_pool_size (Static Parameter
Minimum values is 200mb (startup force)
_________________________________________________________
Step1:
SQL> select dbms_flashback.get_system_change_number() from dual;
SCN --> 456424
Step2:
Execute the following package
SQL> exec dbms_apply_adm.set_table_instantiation_scn
(source_object_name=>'qa.emp',
source_database_name=>'usqa',
instantiation_scn=>456424);
Step1:
Create the Database link
SQL> conn strmadmin/strmadmin
SQL> create database link ukqa
connect to stramadmin identified by strmadmin using 'toukqa';
SQL> exec dbms_streams_adm.set_up_queue();
SQL> exec dbms_streams_adm.add_table_rules
(table_name=>'qa.emp',streams_type=>'capture',
streams_name=>'streams_capture',
queue_name=>'streams_queue',include_ddl=>true,
include_dml=> true, inclusion_rule=>true);
SQL> exec dbms_streams_adm.add_table_propagation_rules
(table_name=>'qa.emp',streams_name='propagation_streams',
source_queue_name=>'streams_queue',
destination_queue_name=>'strmadmin.streams_queue@ukqa',
include_ddl=>true,include_dml=> true,
include_tagged_lcr=>false,inclusion_rule=>true);
Step2:
conn strmadmin/strmadmin
exec dbms_streams_adm.set_up_queue();

SQL> exec dbms_streams_adm.add_table_rules


(table_name=>'qa.emp',streams_type=>'apply',
streams_name=>'streams_apply',
queue_name=>'streams_queue',include_ddl=>true,
include_dml=> true, source_database=>'USQA');
Step1:
exec dbms_capture_adm.start_capture
(capture_name=>'streams_capture');
Step2:
exec dbms_apply_adm.set_parmaeter
(apply_name='streams_apply',
parameter=>'disable_on_error',
value=>'n');
exec dbms_apply_adm.start_apply
(apply_name=>'streams_apply');
Step1:
conn qa/qa;
delete emp where deptno=10;
commit;
conn / as sysdba
alter system switch logfile;