Download Oracle 11g Streams Implementer`s Guide

Transcript
Chapter 6
3. Create the database link (dblink) for the Non-Oracle Gateway.
Note: for the USING clause, you can specify the gateway tnsalias in your
tnsnames.ora or the "description" syntax for the alias. Also, make sure to
specify a user that is configured at the Non-Oracle database that has the
necessary DML privileges on target tables.
CREATE DATABASE LINK TG_SYBASE.oracle.com CONNECT TO "<sybase_
user>"
IDENTIFIED BY "&password" USING 'TG_Sybase';
or
CREATE DATABASE LINK TG_SYBASE.oracle.com CONNECT TO "<sybase_
user>"
IDENTIFIED BY "&password"
USING '(DESCRIPTION=
(ADDRESS=(PROTOCOL=tcp)(HOST=sybase-server)(PORT=1521))
(CONNECT_DATA=
(SERVICE_NAME=sybasegw)
)
(HS=ok)))
)';
4. Test the link by running a basic select statement using the dblink
select ... from "tablename"@tg_sybase.oracle.com;
5. Create the Apply process using the DBMS_APPLY_ADM.CREATE_APPLY
procedure setting
BEGIN
DBMS_APPLY_ADM.CREATE_APPLY(
queue_name
=> 'strmadmin.CAPT_ALL',
apply_name
=> 'APPLY_Sybase',
apply_database_link => 'TG_SYBASE.oracle.com',
apply_captured
=> TRUE);
END;
/
6. Add an Apply Rule to the Apply process
BEGIN
DBMS_STREAMS_ADM.ADD_TABLE_RULES(
table_name
=> 'hr.jobs',
streams_type
=> 'apply',
streams_name
=> 'APPLY_Sybase',
queue_name
=> 'strmadmin.streams_queue',
include_dml
=> TRUE,
include_ddl
=> FALSE,
[ 237 ]