Press "Enter" to skip to content

Stopping Drop Table At Target Schema in Oracle Streams

Run this script in stream admin user at target database, to prevent drop for the tables.

Example

conn STRMADMIN/[email protected]

create or replace procedure
 IGNORE_DROP_TABLE (in_any IN SYS.ANYDATA
 )

 is
 lcr SYS.LCR$_DDL_RECORD;
 rc PLS_INTEGER;

 begin
 rc := in_any.GETOBJECT(lcr);

 if lcr.GET_COMMAND_TYPE != ‘DROP TABLE’
 then
     lcr.execute();
 end if;
 END;
 /

 begin
 dbms_apply_adm.alter_apply(
 apply_name => ‘STREAMS_APPLY’,
 ddl_handler => ‘IGNORE_DROP_TABLE’);
 end;
 /

Oracle Streams