High Availbility

OS & Virtualization

Thursday, January 17, 2008

Oracle Streams setup

Streams is basically a queuing technology.

Here is how I get started. You can use Oracle 10g Enterprise Manager to create a schema level stream but apparently it has some bugs and work only on the later version.

Login as stradmin

This is a simple example of streaming data (one way) from source schema to target schema
  1. run @startup.sql
  2. On the source database , turn on supplemental logging for table or database:
    ALTER TABLE scott.dept ADD SUPPLEMENTAL LOG GROUP dept_pk(deptno) ALWAYS;
    or
    alter database add supplemental log data (primary key, unique index) columns;
  3. export schema from the source database.
    exp USERID=SYSTEM/manager@rep2 OWNER=SCOTT FILE=scott.dmp LOG=exportTables.log OBJECT_CONSISTENT=Y STATISTICS = NONE
  4. import schema into target database.
    imp USERID=SYSTEM@pluto FULL=Y CONSTRAINTS=Y FILE=scott.dmp IGNORE=Y COMMIT=Y LOG=importTables.log STREAMS_INSTANTIATION=Y
  5. run @startup.sql

No comments: