Initiates a coordinated transaction dump.
Creates an rs_dumptran function string to execute a stored procedure named dumptran_proc. The stored procedure manages the dump devices and then executes the rs_update_lastcommit stored procedure, passing it the rs_origin, rs_origin_qid, -rs_secondary_qid, and rs_origin_commit_time parameters.
create function string rs_dumptran for sqlserver_derived_class output language 'execute dumptran_proc ?rs_dump_dbname!sys?, ?rs_dump_label!sys?, ?rs_dump_timestamp!sys?, ?rs_destination_db!sys?, ?rs_origin!sys?, ?rs_origin_qid!sys?, ?rs_secondary_qid!sys? ?rs_origin_commit_time!sys?'
If the server crashes after the dump is complete but before the rs_lastcommit system table is updated, Replication Server restarts the backup.
For an example of how dumptran_proc can be written, see the dumpdb_proc stored procedure example in rs_dumpdb.
There is no guarantee that the dump and the rs_update_lastcommit procedure will be executed atomically, because Adaptive Server does not allow the dump command to be included in a transaction with other commands. If the rs_lastcommit system table is not updated successfully, an additional dump may be performed.
Alters the rs_dumptran function string that you created in the first example to execute as a remote procedure call.
alter function string rs_dumptran for sqlserver_derived_class output rpc 'execute dumptran_proc ?rs_dump_dbname!sys?, ?rs_dump_label!sys?, ?rs_dump_timestamp!sy‘s?, ?rs_destination_db!sys?, ?rs_origin!sys?, ?rs_origin_qid!sys?, ?rs_secondary_qid!sys?, ?rs_origin_commit_time!sys?!'
Replication Server coordinates transaction dumps by inserting an rs_dumptran function call at the same place in the stream of transactions it distributes to all replicate Replication Servers.
rs_dumptran has function-string-class scope.
Replication Server does not initialize or generate rs_dumptran function strings for the system-provided function-string classes. You must create a function string before using a coordinated dump with Adaptive Server.
Create an rs_dumptran function string at the Replication Server that is the primary site for the class.
The rs_lastcommit system table should be updated when the rs_dumptran function string executes so that a restarted Replication Server does not perform duplicate dumps. See rs_commit for information about rs_lastcommit.
To account for different dump devices at multiple replicate sites, create a stored procedure in each replicate database that performs a transaction dump, then write the rs_dumptran function string to execute the stored procedure.
Table 4-3 lists the system variables used in rs_dumptran function strings.
Variable name |
Datatype |
Description |
---|---|---|
rs_dump_dbname |
varchar(30) |
The name of the database where the dump originated. |
rs_dump_label |
varchar(30) |
Label information for the dump. For Adaptive Server, this variable contains a datetime value for the time the dump began. |
rs_dump_timestamp |
varbinary(16) |
An Adaptive Server database timestamp taken when the dump was started at the origin. The variable is used for informational purposes only. |
create function string, rs_commit, rs_dumpdb, rs_get_lastcommit