Returns the names of transaction log base objects; creates transaction log base objects in the primary database; or removes transaction log base objects from the primary database.
For Oracle and Microsoft SQL Server, this command verifies permissions are valid for the Replication Agent to obtain system data from the primary database. It also checks the condition of the primary database to determine if archiving is turned on or off, and then loads the RASD with system data from the primary database.
Because the pdb_xlog create command
is deprecated, Sybase recommends that you use pdb_xlog
init.
pdb_xlog [[[init |create | remove] [, force]] | move_truncpt]
The keyword for moving the truncation point to the end of the transaction log.
The keyword for creating a transaction log. Deprecated; use the init keyword instead.
The keyword for removing a transaction log.
A keyword that refers to the remove or the init operation.
A keyword that moves the truncation point; for Oracle and Microsoft SQL Server only.
pdb_xlog init
This command initializes the Replication Agent, creating any required transaction log base components.
pdb_xlog init, force
This command re-initializes the Replication Agent, creating or re-loading any required transaction log base components.
pdb_xlog remove
This command removes any Replication Agent transaction log base components.
pdb_xlog remove, force
This command removes any Replication Agent transaction log base components and ignores any individual errors that occur during removal.
pdb_xlog init, move_truncpt
This command moves the transaction log truncation point to the end of the current transaction log (Oracle and Microsoft SQL Server).
When pdb_xlog is invoked with no option, it returns the actual names (not synonyms or aliases) of all Replication Agent transaction log base objects in the primary database. For Oracle and Microsoft SQL Server, if you have initialized the Replication Agent, it returns the name of the component and the primary database instance name.
See the chapter for your specific primary data server
in the Replication Agent Primary Database Guide for
more information on Replication Agent object names.
If pdb_xlog is invoked with no option, and the Replication Agent transaction log base objects do not exist in the primary database, or the RASD has not been initialized (For Oracle and Microsoft SQL Server), the command returns no information.
If pdb_xlog is invoked with the init keyword, the truncation point is established at the end of the primary database transaction log.
For Microsoft SQL Server, during the pdb_xlog
init process, Replication Agent may connect to the Microsoft
SQL Server using pds_dac_port_number.
For more information, see the Replication Agent Primary
Database Guide.
If pdb_xlog is invoked with the init, force keywords, the truncation point is moved to the end of the log if the Replication Agent is not already initialized. However, if the Replication Agent is already initialized, the truncation point is not moved.
pdb_xlog init with the force keyword
should only be used when advised by Sybase Technical support.
If pdb_xlog is invoked with the move_truncpt keyword, the truncation point is moved to the end of the log without change or modification to any Replication Agent components. (For Oracle, this is the end of the current online redo log.) The move_truncpt option has no effect if the Replication Agent has not been initialized.
To prevent Replication Server from requesting a log
starting point that occurs earlier in the log than the location
established by the move_truncpt option,
the Replication Server's LTM locator value for the primary connection
must be zeroed. Execute Replication Server System Database (RSSD)
command rs_zeroltm against the primary
database connection to zero the LTM locator.
(For Oracle and Microsoft SQL Server) If you move the secondary truncation point to the end of the primary database transaction log using pdb_xlog init, move_truncpt, you risk skipping over any DDL commands record in the log. The DDL commands might have been used by the Replication Agent to update information stored within the Replication Agent System Database (RASD). If the RASD contents are incorrect due to skipping processing of some log records, you may force all of the schema information in the RASD to be refreshed using command pdb_xlog init, force. If only the schema for a single object stored in the RASD is of concern, you can unmark and remark just that single object, which will force the schema of the object to be reread into the RASD.
When pdb_xlog is invoked with the init keyword, Replication Agent does the following:
Generates a SQL script that creates the Replication Agent tables and procedures in the primary database.
Saves the generated script in a file called partinit.sql in the RAX-15_5\inst_name\scripts\xlog directory, where inst_name is the name of the Replication Agent instance.
If the value of the pdb_auto_run_scripts configuration
parameter is false, the partinit.sql script
will be saved but not executed. However, you cannot manually run
the script. To complete initializing Replication Agent, you must
first set pdb_auto_run_scripts to true, then
re-run the pdb_xlog init command.
Executes the script to create the Replication Agent transaction log base objects in the primary database (if the value of the pdb_auto_run_scripts configuration parameter is true).
After the script completes successfully, moves the partinit.sql file to the RAX-15_5\inst_name\scripts\xlog\installed directory.
If the create script fails, it is stored in a file (partinit.sql) in the RAX-15_5\inst_name\scripts\xlog directory and the transaction log is not created. You can examine the script by viewing the partinit.sql file.
If pdb_xlog is invoked with the init keyword and the Replication Agent objects already exist in the primary database or the RASD has been initialized (For Oracle and Microsoft SQL Server), then pdb_xlog returns an error message.
When pdb_xlog is invoked with the remove keyword, Replication Agent does the following:
For UDB, pdb_xlog remove command will uninstall the jar files from the primary database (the jars are installed by the pdb_xlog init command).It is necessary to use pdb_xlog remove command to de-initialize Replication Agent for UDB, and remove the truncation stored procedures and jars from the database.
Generates a SQL script that deletes the tables and procedures required for the transaction log base objects in the primary database.
Saves the generated script in a file called partdeinit.sql in the RAX-15_5\inst_name\scripts\xlog directory, where inst_name is the name of the Replication Agent instance.
If the value of the pdb_auto_run_scripts configuration
parameter is false, the partdeinit.sql script
will be saved but not executed automatically. You cannot manually
run the script. To complete
de-initializing Replication Agent, you must first set pdb_auto_run_scripts to true,
then re-run the pdb_xlog remove command.
Executes the script to delete the Replication Agent objects from the primary database (if the value of the pdb_auto_run_scripts configuration parameter is true).
After the script completes successfully, moves the partdeinit.sql file to the RAX-15_5\inst_name\scripts\xlog\installed directory.
If the script fails, it is stored in a file (partdeinit.sql) in the RAX-15_5\inst_name\scripts\xlog directory and the Replication Agent objects are not deleted from the primary database. You can examine the script by viewing the partdeinit.sql file.
When pdb_xlog is invoked with the remove keyword followed by the force keyword, the partdeinit.sql script continues executing, even if errors occur. The force keyword may be useful when a previous remove operation failed and the partdeinit.sql script terminated with an error.
If pdb_xlog is invoked with the remove keyword, and Replication Agent objects do not exist in the primary database or the RASD has not been initialized (For Oracle or Microsoft SQL Server), then pdb_xlog returns an error message.
If pdb_xlog is invoked with the remove keyword and any objects in the primary database are still marked for replication, then pdb_xlog returns an error message.
You can use the pdb_setrepproc and pdb_setreptable commands to determine which stored procedures and tables in the primary database are still marked. You also can use the pdb_setrepddl command to determine if DDL is enabled.
Even if objects are marked in the primary database, you can use the pdb_xlog command with the remove keyword followed by the force keyword to unmark any marked objects, and then remove the transaction log objects.
If pdb_xlog is invoked with no option, the command is valid when the Replication Agent instance is in the Admin, Replicating, or Replication Down states.
If pdb_xlog is invoked with either the init or remove keyword, the command is valid only when the Replication Agent instance is in the Admin or Replication Down state.
The pdb_xlog init command will verify that the following privileges have been granted to pds_username:
EXECUTE_CATALOG_ROLE
SELECT ON V_$LOGMNR_CONTENTS
SELECT ON V_$LOGMNR_LOGS
These privileges are necessary for the ra_dumptran and ra_helpop commands to function properly. These privileges are not required for replication, only for using the ra_dumptran and ra_helpop commands, which are used in debugging and troubleshooting. If these privileges have not been granted at the time pdb_xlog init is invoked, a warning message is returned and logged in the Replication Agent log file.
For more information about the Replication Agent transaction log, see the chapter for your specific primary data server in the Replication Agent Primary Database Guide.