Generating configuration scripts with Oracle Streams Wizard ____oracle

Source: Internet
Author: User
Guide:
The last few days are used package to complete the streams configuration, but in the management of OEM will feel more intuitive, of course, all the relevant package very understanding, it is almost. In the 9i OEM, it looks like the streams function is not very strong. Just a few simple applications. There is time to engage in 10gr2, want to skip 10gr1. The following is a process script that creates a single table copy in an OEM.
SOURCE database: GATES
Target database: CLONE
   1. Set up Operation
-Turn on supplemental logging and switch log file at source database.
-Create and set default tablespace for Logminer at source database.
-Capture the following tables in the source database, and then propagate and apply the changes to the target database.
"SCOTT". " BONUS "
   2. Export/import Operations
-Export all objects selected from the source database.
-Import them to the target database.
   3. Start Operation
-Start the application process in the target database first.
-Initiates the capture process in the source database.
-- Setup Operations:
  
  
  
Rem
  
  
REM The following sections setup streams at the destination database
  
  
Rem
  
  
ACCEPT dest_strmadmin_passwd PROMPT ' Please enter target database
  
  
Password for user strmadmin in CLONE: ' HIDE
  
  
Connect Strmadmin/&dest_strmadmin_passwd@clone
  
  
  
  
  
Rem
  
  
REM addapply rules fortables at the destination database
  
  
Rem
  
  
BEGIN
  
  
Dbms_streams_adm. Add_table_rules (
  
  
table_name => ' SCOTT. ' BONUS "',
  
  
Streams_type => ' APPLY ',
  
  
Streams_name => ' Strmadmin_gates_vongates_ ',
  
  
Queue_name => ' "Strmadmin". Streams_queue "',
  
  
Include_dml =>true,
  
  
Include_ddl =>true,
  
  
Source_database => ' GATES. Vongates. COM ');
  
  
End;
  
  
/
  
  
  
  
  
Rem
  
  
REM The following sections setup streams at the source database
  
  
Rem
  
  
ACCEPT source_strmadmin_passwd PROMPT ' Please enter the source database
  
  
Password of user strmadmin in GATES: ' HIDE
  
  
Connect SYS/&SOURCE_DBA_PASSWD@GATESASSYSDBA
  
  
  
  
  
Rem
  
  
REM Turn onsupplemental Logging
  
  
Rem
  
  
Alterdatabaseaddsupplemental Logdata (Primarykey,uniqueindex)
  
  
COLUMNS;
  
  
  
  
  
Rem
  
  
REM Switch LogFile
  
  
Rem
  
  
Altersystem SWITCH LOGFILE;
  
  
  
  
  
Rem
  
  
REM Createlogminer tablespace
  
  
Rem
  
  
Createtablespace logmnrts datafile ' logmnrts_gates.dbf '
  
  
SIZE 25M Reuse
  
  
Autoextend Onmaxsize Unlimited;
  
  
  
  
  
Rem
  
  
REM Setlogminer tablespace
  
  
Rem
  
  
BEGIN
  
  
Dbms_logmnr_d.set_tablespace (' logmnrts ');
  
  
End;
  
  
/
  
  
Connect strmadmin/&source_strmadmin_passwd@gates
  
  
  
  
  
Rem
  
  
REM addcapture rules fortables at the source database
  
  
Rem
  
  
BEGIN
  
  
Dbms_streams_adm. Add_table_rules (
  
  
table_name => ' SCOTT. ' BONUS "',
  
  
Streams_type => ' CAPTURE ',
  
  
Streams_name => ' Strmadmin_capture ',
  
  
Queue_name => ' "Strmadmin". Streams_queue "',
  
  
Include_dml =>true,
  
  
Include_ddl =>true,
  
  
Source_database => ' GATES. Vongates. COM ');
  
  
End;
  
  
/
  
  
  
  
  
Rem
  
  
REM addpropagation rules fortables at the source database
  
  
Rem
  
  
BEGIN
  
  
Dbms_streams_adm. Add_table_propagation_rules (
  
  
table_name => ' SCOTT. ' BONUS "',
  
  
Streams_name => ' Strmadmin_propagate ',
  
  
Source_queue_name => ' "Strmadmin". Streams_queue "',
  
  
Destination_queue_name => ' "Strmadmin". Streams_queue "@CLONE. Vongates. COM ',
  
  
Include_dml =>true,
  
  
Include_ddl =>true,
  
  
Source_database => ' GATES. Vongates. COM ');
  
  
End;
  
  
/
  
  
--export/import Operations:
  
  
Expuserid= "strmadmin" @GATESTABLES = "SCOTT". " BONUS "
  
  
File=tables.dmp grants=y rows=y Log=exporttables.log
  
  
Object_consistent=y indexes=y
  
  
  
  
  
Imp userid= "strmadmin" @CLONEFULL =y constraints=y file=tables.dmp
  
  
Ignore=y grants=y rows=y commit=y log=importtables.log
  
  
Streams_configuration=y streams_instantiation=y
  
  
  
  
  
--startup Operations:
  
  
ACCEPT dest_strmadmin_passwd PROMPT ' Please enter target database
  
  
Password for user strmadmin in CLONE: ' HIDE
  
  
Connect Strmadmin/&dest_strmadmin_passwd@clone
  
  
  
  
  
Rem
  
  
REM Start apply process at the destination database
  
  
Rem
  
  
DECLARE
  
  
v_started Number;
  
  
BEGIN
  
  
Selectdecode (
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.