Set up below parameters on both databases (db1, db2) 1. Enable ARCHIVELOG MODE on both database Reference: http://dbataj.blogspot.com/2007/09/how-to-enable-archivelog-mode.html
2. Create Stream administrator User Source Database: DB1 SQL> conn sys@db1 as sysdba Enter password: Connected. SQL> create user strmadmin identified by strmadmin;
6. Setup Schema for streams Schema: SCOTT Table: Taj NOTE: Unlock scott schema because in 10g scott schema is locked by default Source Database: DB1 SQL> conn sys@db1 as sysdba Enter password: Connected. SQL> alter user scott account unlock identified by tiger;
User altered.
SQL> conn scott/tiger@db1 Connected. SQL> create table TAJ ( no number primary key,name varchar2(20),ddate date);
Table created.
Target Database: DB2 SQL> conn sys@db2 as sysdba Enter password: Connected. SQL> alter user scott account unlock identified by tiger;
User altered.
SQL> conn scott/tiger@db2 Connected. SQL> create table TAJ ( no number primary key,name varchar2(20),ddate date);
Table created.
7. Setup Supplemental logging at the source database Source Database: DB1 SQL> conn scott/tiger@db1 Connected. SQL> alter table taj 2 add supplemental log data (primary key,unique) columns;
PL/SQL procedure successfully completed. NOTE: Stream replication environment is ready, just needed to test it. SQL> conn scott/tiger@db1 Connected. SQL> --DDL operation SQL> alter table taj add (flag char(1));
Table altered.
SQL> --DML operation SQL> begin 2 insert into taj values (1,'first_entry',sysdate,1); 3 commit; 4 end; 5 /
PL/SQL procedure successfully completed.
SQL> conn scott/tiger@db2 Connected. SQL> --TEST DDL operation SQL>desctaj Name Null? Type ----------------------------------------- -------- ----------------------------
NO NOT NULL NUMBER NAME VARCHAR2(20) DDATE DATE FLAG CHAR(1)
SQL> --TEST DML operation SQL> select * from taj;
NO NAME DDATE F ---------- -------------------- --------- - 1 first_entry 24-JAN-08 1