To replicate DDL in Oracle, the pdb_setrepddl command must be used to set filtering rules accordingly. You must also set the Replication Agent ddl_username and ddl_password parameters. The ddl_username parameter is the database user name that should be used to execute the replicated DDL command at the target database. This user must have permission to execute all replicated DDL commands at the target database. The ddl_password parameter is the password corresponding to the database user name. In addition, the ddl_username database user must have permission to issue the ALTER SESSION SET CURRENT_SCHEMA command for any primary database user that might issue a DDL command to be replicated. See the Replication Agent Reference Manual.
The value of the ddl_username parameter cannot be the same as the value of the maintenance user defined in Replication Server for the replicate connection. If these names are the same, a Replication Server error results.
The value of the ddl_username parameter is sent in the LTL for all replicated DDL statements. When DDL is replicated, Replication Server connects to the replicate database using the user ID and password specified by the ddl_username and ddl_password parameters. Replication Server then issues the following command:
ALTER SESSION SET CURRENT_SCHEMA=user
Here, user is the user ID that generated the DDL operation at the primary database. The actual DDL command is then executed against the replicate database. If the user ID specified in ddl_username does not have permission to issue the ALTER SESSION SET CURRENT_SCHEMA or to execute the DDL command against the user schema, the command fails.
To replicate DDL, Replication Server must have a database-level replication
definition with replicate DDL set in the definition.
See the Replication Server Reference Manual.
The following DDL commands are not replicated:
alter database
alter system
create database link
drop database link
alter session
create snapshot
create snapshot log
alter snapshot
alter snapshot log
drop snapshot
drop snapshot/log
alter rollback segment
create rollback segment
drop rollback segment
create control file
create pfile from spfile
create schema authorization
create spfile from pfile
explain
lock table
rename
set constraints
set role
set transaction
analyze
audit
no audit
create tablespace
alter tablespace
drop tablespace
The following objects are not replicated:
Any objects that are owned by SYS.
Any object owned by users defined in the list of non-replicated users. You can modify this list using the pdb_ownerfilter command. In addition, Sybase has provided a default list of owners whose objects will not be replicated. However, you cannot remove the SYS owner. Use the pdb_ownerfilter command to return, add, or remove the list of owners whose objects will not be replicated. See the Replication Agent Reference Manual.
The truncate table command is replicated
as rs_truncate.