Returns replication marking status; marks all user tables or a specified table for replication; unmarks all marked tables or a specified table; or enables or disables replication for all marked tables or a specified table.
pdb_setreptable [ { tablename[, [repname,] { mark [ { , immediate | , owner[, force] } ] | unmark[, force] | enable | disable}] | all, { mark | unmark[, force] | enable | disable } } ]For IBM DB2:
pdb_setreptable [ { tablename[, [repname,] { mark [ , owner[, force] ] | unmark[, force] | enable | disable }] | all, { mark | unmark[, force] | enable | disable } } ]
pdb_setreptable tablename
pdb_setreptable all, mark
pdb_setreptable all, {unmark[, force]|enable|disable}
pdb_setreptable tablename, {mark[, owner][, force] | unmark[, force] |enable|disable}
pdb_setreptable tablename, repname, mark[, owner][, force]
pdb_setreptable tablename, mark[, immediate]
pdb_setreptable
owner.table
This parameter can be delimited with quote characters to specify the character case.
"Owner".table
"Owner"."Table"
Each mixed case element of the tablename option must be delimited separately, as shown in the previous example.
"table name"
owner."table name"
owner."table.name"
"table.owner"."table.name"
repowner.reptable
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.
The owner keyword turns on the SEND OWNER mode. When you specify the owner of a table in a replication definition, you must always use the owner keyword if you want to enable the SEND OWNER mode.
owner mode sets a flag in the LTL telling Replication Server that any table level Replication definition must be owner qualified to match this table.
If the owner mode is set, the replication definition must be owner qualified. If the owner mode is not set, the replication definition must not be owner qualified.
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. When the force keyword follows the unmark keyword and the all keyword, pdb_setreptable immediately removes replication marking from all marked tables in the primary database, regardless of their enable status.
The force keyword also forces complete execution of the unmarking script, even if errors occur during the unmarking process. 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.
Errors were encountered and ignored during FORCED script execution. See error log for details.
For UDB and Oracle:
When the force keyword follows the mark keyword, the pdb_setreptable command allows a table that contains one or more columns with unsupported datatypes to be marked for replication. No data for the unsupported columns is sent to Replication Server. As a result, any replicate table must have a suitable default value defined for the unsupported columns, since no data is received by the replicate database to be inserted into the unsupported columns.
The force keyword cannot be used in combination with the all keyword. Tables with unsupported datatypes must be individually marked using the pdb_setreptable command and the force keyword (they will never be automatically marked, or marked by default if they have columns with unsupported datatypes).
In addition, tables with unsupported datatypes are not automatically marked when the pdb_automark_tables configuration parameter is true. Tables with unsupported datatypes must be individually marked using the pdb_setreptable command and the mark and force keywords. For a list of supported and unsupported datatypes, see the Replication Agent Primary Database Guide.
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. The primary table name in the replication definition must be authors.
pdb_setreptable authors, mark, owner
This command marks for replication the table named “authors” in the primary database so that the OWNER_MODE is enabled in the LTL. Therefore, any table replication definition created for this table must also be owner qualified.
pdb_setreptable ptable, rtable, mark, ownerThe primary table name in the replication definition must be:
powner.rtable
pdb_setreptable ptable, rowner.rtable, mark,ownerThe primary table name in the replication definition must be:
rowner.rtable
pdb_setreptable ptable, rowner.rtable, mark,ownerThe primary table name in the replication definition must be:
rowner.rtable
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.
pdb_setreptable authors, mark, force
This command forces table authors” to be marked, even if it contains columns with unsupported datatypes. The columns with unsupported datatypes will not be replicated.
When pdb_setreptable is invoked with no option, Replication Agent returns a list of all marked tables in the primary database.
Tables marked for replication are listed in the marked objects table. All other user tables are considered unmarked.
For tables listed as unmarked or disabled, transactions will not be captured for replication.
When a table is marked for replication and the owner mode is set to on, the replication definition must contain the owner name in the “with primary table named” clause, or the with all tables named clause. If the owner mode setting and the existence of the owner name in the replication definition do not match, the replication definition is not used.
pdb_setreptable “mytable”, mark, owner
create replication definition ra$0xda_”mytable”
with primary at ora102.dco with primary table named “qa4user”.”mytable” with replicate table named “qa4user”.”mytable” . . .
pdb_setreptable “mytable”, mark
create replication definition ra$0xda_”mytable”
with primary at ora102.dco with primary table named ”mytable”
with replicate table named “qa4user”.”mytable” . . .
When a marked table is renamed or dropped and a new table with the original name is created, you must explicitly mark the new table because the new table has no marking-related information from the original table. The marking information is maintained internally by object ID, not table name.
If you create a new table using a table name that was previously marked you must mark the new table by executing the pdb_setreptable command with the mark option, even if you did not unmark the previous table.
(UDB only) If the mark script fails, it is stored in a file (mark.sql) in the RAX-15_5\inst_name\scripts\tablename directory, the table is not marked, and transaction log objects are not updated. You can examine the script by viewing the mark.sql file.
When you use the unmark keyword to remove replication marking from a primary table, 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.
Could not unmark the following objects: ... See error log for details.
pdb_setreptable all, unmark, force
pdb_setreptable table=unmark, markThis is true for both primary table names and replicated names.
If pdb_setreptable is invoked with a table name and the mark keyword, it marks the specified table in the primary database for replication.
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 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 pdb_setreptable is invoked with a table name and the disable keyword, it disables replication for the specified marked table in the primary database.
Could not disable the following objects: ... See error log for details.
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 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 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.
How you use the pdb_setreptable command depends on the type of replication definition that you have created at Replication Server. If you have created a database replication definition with no table replication definition, then the replicate procedure in the pdb_setreptable command refers to the table in the replicate database. However, if you have created a table replication definition, then the replicate table in the pdb_setreptable command refers to the name of the table replication definition, and it is the table replication definition that must map to the table in the replicate database.
When the table in the replicate database has the same name as the table in the primary database, use:
pdb_setreptable pdb_table, mark
where pdb_table is the name of the table in the primary database that you want to mark for replication.
When the table in the replicate database has the different name than the table in the primary database, use:
pdb_setreptable pdb_table, rep_table, mark
where rep_table is the name of the table in the replicate database.
When the primary table in the table definition has the same name as the table in the primary database:
pdb_setreptable pdb_table, mark
create replication definition my_table_repdef with primary at data_server.database with all tables named pdb_table …
create replication definition my_table_repdef with primary at data_server.database with primary table named pdb_table with replicate table name rep_table …
When the name of the table replication definition is different than the table in the primary database, use:
pdb_setreptable pdb_table, rdpri_table, mark
where rdpri_table is the name of the primary table in the replication definition.
create replication definition my_table_repdef with primary at data_server.database with all tables named rdpri_table …
create replication definition my_table_repdef with primary at data_server.database
with primary table named rdpri_table with replicate table name rep_table …
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.
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.
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.
Command <pdb_setreptable> failed - Table <MYTABLE> could not be marked because:The table contains an unsupported data type.To force the table to be marked, excluding the unsupported datatype columns from replication, add the force keyword to the pdb_setreptable command.
If the Replication Agent transaction log does not exist in the primary database (UDB) or the RASD is not initialized (Oracle and Microsoft SQL Server), the pdb_setreptable command returns an error.
If the table name you specify does not exist in the primary database, the pdb_setreptable command returns an error.
If the primary table name you specify does not exist in the primary database, the pdb_setreptable command returns an error.
Could not enable the following objects: ... See error log for details.
To replicate a table that contains column names that have spaces, you must set structured_tokens to true.