Returns replication marking status; marks all user tables or a specified table for replication; unmarks all marked tables or a specified table; enables or disables replication for all marked tables or a specified table.
To return replication marking status:
pdb_setreptable [tablename|mark|unmark|enable|disable]
To mark all user tables (available only for Oracle):
pdb_setreptable all, mark
To unmark, enable, or disable all marked tables:
pdb_setreptable all, {unmark[, force]|enable|disable}
To mark, unmark, enable, or disable a specified table:
pdb_setreptable tablename, {mark[, owner]| unmark[, force] |enable|disable}
To mark a specified table for replication with a replicated name:
pdb_setreptable tablename, repname, mark[, owner]
The name of a user table in the primary database.
The tablename parameter can be owner-qualified to include the primary table owner name, with each element separated by a period. For example:
owner.table
This parameter can be delimited with quote characters to specify the character case.
If mixed character case (both uppercase and lowercase) is required, the name must be delimited. For example:
"Owner".table
"Owner"."Table"
Each mixed case element of the tablename option must be delimited separately, as shown in the previous example.
If an object name contains any non-alphanumeric characters, such as spaces or periods, it must be delimited with quote characters. For example:
"table name"
owner."table name"
If an object name contains a period, it must be both owner-qualified and delimited with quote characters. For example:
owner."table.name"
"table.owner"."table.name"
The name of the table specified in the replication definition for a primary table.
The replicated name you specify with the pdb_setreptable command must
match a table name specified by a with primary table named clause
in a Replication Server replication definition for the primary database
connection. The Sybase Replication Agent cannot validate the replication definition,
but if it does not exist, or if the with primary table
named clause does not match the replicated name specified
with pdb_setreptable, replication from
the primary table will fail.
The repname option can be owner-qualified to include the replicate table owner name, with each element separated by a period. For example:
repowner.reptable
If you want to use an owner-qualified replicate table
name with the replicate owner’s name, use the owner keyword
with the pdb_setreptable command. If
you specify an unqualified replicate table name, the primary table owner
name is sent with the replicate table name in the LTL.
The repname option can also be delimited with quote characters to specify the character case. See the previous description of the tablename option for details.
If the replicate table name contains a period (for example, table.name), without
owner qualification, you must set the value of the Sybase Replication Agent use_rssd parameter
to true.
A keyword that refers to all tables in the primary database. By using the all keyword, you can mark all user tables, or apply an unmark, enable, or disable operation to all marked tables.
A keyword that refers to replication marking. For trigger-based instances for Microsoft SQL, Sybase Replication Agent must be in Admin state in order to unmark a table.
A keyword that refers to the mark operation.
When the optional owner keyword follows the mark keyword, the pdb_setreptable command marks the specified table in the primary database so that when operations against that table are replicated, the owner name is included with the table name in the form owner.tablename in the LTL sent to the Replication Server.
If you want to use an owner-qualified replicate table
name with the replicate owner’s name, use the owner keyword
with the pdb_setreptable command. If
you specify an unqualified replicate table name, the primary table owner
name is sent with the replicate table name in the LTL.
A keyword that refers to unmarking a marked table.
A keyword that refers to the unmark operation.
When the force keyword follows the unmark keyword, the pdb_setreptable command immediately removes replication marking for the specified table in the primary database, without first checking the enable status of the table or checking for pending operations in the transaction log. When the force keyword follows the unmark keyword and the all keyword, the pdb_setreptable command immediately removes replication marking from all marked tables in the primary database, regardless of their enable status or any pending operations in the transaction log.
The force keyword also forces complete execution of the unmarking script, even if errors occur during the unmarking process (Microsoft only). Normally, when errors occur during script execution, the script terminates immediately without completing. The force keyword can be useful when a previous script execution failed and left the unmarking operation incomplete.
When errors occur during a forced script execution, the pdb_setreptable command returns the following message:
Errors were encountered and ignored during FORCEd script execution. See error log for details.
A keyword that refers to enabling replication for marked tables.
A keyword that refers to disabling replication for marked tables.
pdb_setreptable authors
This command returns replication marking information for the table named “authors” in the primary database.
pdb_setreptable mark
This command returns replication marking information for all marked tables in the primary database.
pdb_setreptable disable
This command returns replication marking information for all marked tables for which replication has been disabled in the primary database.
pdb_setreptable all, unmark, force
This command forces unmarking for all marked tables in the primary database.
pdb_setreptable all, enable
This command enables replication for all marked tables in the primary database.
pdb_setreptable authors, mark
This command marks for replication the table named “authors” in the primary database.
pdb_setreptable authors, mark, owner
This command marks for replication the table named “authors” in the primary database so that the name of the primary table owner will be passed along with the table name in the LTL.
pdb_setreptable authors, auth_name, mark
This command marks for replication the table named “authors” in the primary database with a replicate name “auth_name.”
pdb_setreptable authors, auth_name, mark, owner
This command marks for replication the table named “authors” in the primary database with a replicate name “auth_name” so that the name of the primary table owner will be passed along with the replicate name in the LTL.
pdb_setreptable authors, bob.auth_name, mark, owner
This command marks for replication the table named “authors” in the primary database with a replicate name “auth_name” so that the name of the replicate table owner “bob” will be passed along with the replicate name in the LTL.
pdb_setreptable authors, enable
This command enables replication for the marked table “authors” in the primary database.
pdb_setreptable table=mark, enable
This command enables replication for the marked table named “mark” in the primary database.
pdb_setreptable authors, unmark, force
This command forces unmarking for the marked table “authors” in the primary database.
When pdb_setreptable is invoked, its function is determined by the keywords and options you specify.
When multiple keywords and options are specified, each must be separated by a comma. Blank space before or after a comma is optional. For example:
pdb_setreptable all, unmark, force
When you specify a primary table in the pdb_setreptable command, you must use the name of a valid user table.
You cannot specify the following items as a primary table in the pdb_setreptable command:
System tables
Views
Sybase Replication Agent transaction log tables
If you specify an alias or synonym as a primary table in the pdb_setreptable command, the actual table that the alias or synonym refers to is acted upon. The actual table name is the table name sent to the primary Replication Server.
If a table name in the primary database is the same as a keyword, it can be identified by adding the table=string to the beginning of the name. For example:
pdb_setreptable table=unmark, mark
This is true for both primary table names and replicated names.
When pdb_setreptable is invoked to mark a table for replication, trigger-based Sybase Replication Agent (for Microsoft SQL Server only) do the following:
Generate a SQL script that creates the tables, procedures, and triggers required for the transaction log in the primary database.
Save the generated script in a file called mark.sql in the RAX-15_0\inst_name\scripts\tablename directory, where inst_name is the name of the Sybase Replication Agent instance, and tablename is the name of the table being marked.
If the value of the pdb_auto_run_scripts configuration
parameter is false, the mark.sql script
will be saved but not executed automatically. To manually re-run
the script, you must first set pdb_auto_run_scripts to true and
then re-run the command.
Execute the script to mark the table and create the transaction log objects in the primary database (if the value of pdb_auto_run_scripts is true).
After the script completes successfully, move the mark.sql file to the RAX-15_0\inst_name\scripts\tablename\installed directory.
If a user trigger exists on the table, modify the user trigger to add code that captures data and generates Sybase Replication Agent transaction log records.
If the mark script fails, it is stored in a file (mark.sql) in the RAX-15_0\inst_name\scripts\tablename directory, the table is not marked, and transaction log objects are not created. You can examine the script by viewing the mark.sql file.
When pdb_setreptable is invoked to unmark a marked primary table, trigger-based Sybase Replication Agents (for Microsoft SQL Server) do the following:
Generate a SQL script that removes the tables, procedures, and triggers required for the transaction log in the primary database.
Save the generated script in a file called unmark.sql in the RAX-15_0\inst_name\scripts\tablename directory, where inst_name is the name of the Sybase Replication Agent instance and tablename is the name of the table being unmarked.
If the value of the pdb_auto_run_scripts configuration
parameter is false, the mark.sql script
will be saved but not executed automatically. To manually re-run
the script, you must first set pdb_auto_run_scripts to true and
then re-run the command.
Execute the script to unmark the table and remove the transaction log objects in the primary database (if the value of pdb_auto_run_scripts is true).
After the script completes successfully, move the unmark.sql file to the RAX-15_0\inst_name\scripts\tablename\installed directory.
If a user trigger existed on the table when it was marked, modify the user trigger to remove Sybase Replication Agent code that captures data and generates transaction log records.
If the unmark script fails, it is stored in a file (unmark.sql) in the RAX-15_0\inst_name\tablename\scripts directory, the table is not unmarked, and the transaction log objects are not removed. You can examine the script by viewing the unmark.sql file. When the unmark script execution encounters a fatal error on any database object, the pdb_setreptable command returns the following message:
Could not unmark the following objects: ... See error log for details.
When you use the unmark keyword to remove replication marking from a primary table, the Sybase Replication Agent verifies that replication is disabled for that table and checks to make sure that there are no pending (unprocessed) operations for that table in the transaction log. If replication is not disabled, or there is a pending operation for that table in the transaction log, pdb_setreptable returns an error.
When you use the unmark keyword to remove replication marking from primary tables, you can also specify the force keyword to immediately remove replication marking from primary tables, without regard to whether replication is disabled or pending operations exist in the transaction log.
The force keyword also ignores script execution errors. If the unmark script execution encounters a fatal error on any database object, the pdb_setreptable command returns the following message:
Could not unmark the following objects: ... See error log for details.
When pdb_setreptable is invoked with either no option or a single option, it returns marking information about the user tables in the primary database:
If pdb_setreptable is invoked with no option, it returns a list of all marked tables in the primary database.
Invoking the pdb_setreptable command
with no option produces the same result as invoking the pdb_setreptable with
the mark keyword.
If pdb_setreptable is invoked with a table name, it returns complete marking information about the specified primary table.
If pdb_setreptable is invoked with the mark keyword, it returns a list of all marked tables in the primary database.
If pdb_setreptable is invoked with the unmark keyword, it returns a list of all unmarked tables in the primary database.
If pdb_setreptable is invoked with the enable keyword, it returns a list of all marked tables in the primary database for which replication is enabled.
If pdb_setreptable is invoked with the disable keyword, it returns a list of all marked tables in the primary database for which replication is disabled.
Tables marked for replication are listed in the marked objects table. All other user tables are considered unmarked.
The Sybase Replication Agent transaction log tables and shadow tables
are not included in the list of unmarked tables. Also not included
are any synonyms, views, or aliases of these database objects.
For tables listed as unmarked or disabled, transactions will not be captured for replication.
When pdb_setreptable is invoked with the all keyword and an action keyword (mark, unmark, enable, or disable), the action specified is applied to either all user tables in the primary database, or all marked tables in the primary database.
If pdb_setreptable is invoked with the all and mark keywords, all user tables in the primary database are marked for replication.
If pdb_setreptable is invoked with the all and unmark keywords, it removes replication marking from all marked tables in the primary database.
You can specify the force keyword after the unmark keyword to force immediate unmarking of all marked tables, or to unmark tables for which replication is still enabled or pending operations remain in the transaction log, or to force the script execution to ignore errors and continue an unmarking operation that failed previously.
If pdb_setreptable is invoked with the all and enable keywords, it enables replication for all marked tables in the primary database.
If pdb_setreptable is invoked with the all and disable keywords, it disables replication for all marked tables in the primary database.
When pdb_setreptable is invoked with a valid user table name, followed by an action keyword (mark, unmark, enable, or disable), the action specified is applied to the specified table.
If pdb_setreptable is invoked with a table name and the mark keyword, it marks the specified table in the primary database for replication.
You can specify the owner keyword after the mark keyword so that when operations against the table are replicated, the primary table object owner name will be attached to the table name in the form owner.tablename in the LTL sent to the Replication Server.
If you want to use owner-qualified table names for either primary
tables or replicate tables, you must set the value of the Sybase Replication Agent use_rssd parameter
to true.
If pdb_setreptable is invoked with a table name and the unmark keyword, it removes replication marking from the specified table in the primary database.
You can specify the force keyword after the unmark keyword to force immediate unmarking of the specified table, to unmark a table for which replication is still enabled or pending operations remain in the transaction log, or to force the script execution to ignore errors and continue an unmarking operation that failed previously.
If pdb_setreptable is invoked with a table name and the enable keyword, it enables replication for the specified marked table in the primary database.
If the enable script execution encounters a fatal error on any database object, the pdb_setreptable command returns the following message:
Could not enable the following objects: ... See error log for details.
If pdb_setreptable is invoked with a table name and the disable keyword, it disables replication for the specified marked table in the primary database.
If the disable script execution encounters a fatal error on any database object, the pdb_setreptable command returns the following message:
Could not disable the following objects: ... See error log for details.
If the table name you specify does not exist in the primary database, the pdb_setreptable command returns an error.
When pdb_setreptable is invoked with a primary table name and a replicated name, followed by the mark keyword, the primary table is marked for replication with the specified replicated name.
If the primary table name you specify does not exist in the primary database, the pdb_setreptable command returns an error.
By specifying a replicated name, transactions can be replicated to a table in the replicate database that has a different name from the primary table.
The replicated name you specify with the pdb_setreptable command must
match a table name specified by a with all tables named clause
in a Replication Server replication definition for the primary database connection.
The Sybase Replication Agent cannot validate the replication definition, but if
it does not exist, or if the with all tables named clause
does not match the replicated name specified with pdb_setreptable,
replication from the primary table will fail.
You can also specify the owner keyword after the mark keyword so that when operations against the primary table are replicated, the primary table owner name will be attached to the replicate table name in the form owner.tablename.
If you want to use an owner-qualified replicate table
name with the replicate owner’s name, use the owner keyword
with the pdb_setreptable command. If
you specify an unqualified replicate table name, the primary table
owner name is sent with the replicate table name in the LTL.
If the Sybase Replication Agent transaction log does not exist in the primary database (DB2 UDB or Microsoft SQL Server) or the RASD is not initialized (Oracle), the pdb_setreptable command returns an error.
To replicate a table that contains column names that have spaces, you must set structured_tokens to true.