Show TOC

sysadmin searchLocate this document in the navigation structure

Searches the replication path for transactions being replicated, even if the ticket has not yet reached the rs_ticket_history table. The command returns information on the location of the transaction, transaction backlog, or the estimated time until replication is complete.

Syntax
sysadmin search <primary_connection_ID>, <replicate_connection_ID>,
<table_name>,{I | U | D}[, <col_name>, <col_value>] ...
[,<row_number>]
sysadmin search <primary_connection_ID>, <replicate_connection_ID>,
"rs_ticket"[, <header_level>, <header_value>][,<row_number>]
Parameters
primary_connection_ID
The connection ID to the primary database.
replicate_connection_ID
The connection ID to the replicate database.
table_name

The name of the table whose changes you're searching for.

I, U, or D

Identifies the SQL command you're searching for: insert, update, or delete. Required with <table_name>.

col_name

The name of the column in <table_name> whose changes you're searching for. You can enter up to ten col_name/col_value pairs.

col_value

The value of the column in <table_name> whose changes you're searching for.

row_number

The number of the row in <table_name> or rs_ticket whose changes you're searching for.

rs_ticket
Specifies that you're searching for an rs_ticket rather than a table. rs_ticket is a Replication Server keyword, so enclose it in quotes to ensure that Replication Server interprets it as part of the sysadmin search command.
header_level
Ticket header information in short varchar strings: h1, h2, h3, and so on. Use only with rs_ticket.
header_value

The value of the h1, h2, or h3 header in the rs_ticket you're searching for.

Examples
Example 1
This command searches all insert operations in the table named searchTest:
sysadmin search,103,104,searchTest,I
Example 2
This command searches all update operations in the table named searchTest:
sysadmin search,103,104,searchTest,U
Example 3
This command searches all insert operations in the table named searchTest where the value of the column col2 is 2:
sysadmin search,103,104,searchTest,I,col2,2
Example 4
This command searches all insert operations in the table named searchTest where the value of the column col19 is "col19 varchar" (a varchar type value):
sysadmin search,103,104,searchTest,I,col19,"col19 varchar"
Example 5
This command searches all insert operations in the table named searchTest where the value of the column col20 is "col20 char20" (a char type value):
sysadmin search,103,104,searchTest,I,col20,"col20 char20"
Example 6
This command searches all rs_tickets in the current Replication Server:
sysadmin search,103,104,"rs_ticket"
Example 7
This command searches the current Replication Server for all rs_tickets whose H1 tag value is "start":
sysadmin search,103,104,"rs_ticket",H1,start
Example 8
This command searches all insert operations in which the value of the column col19 is "col19 varchar" and the value of column col2 is 2:
sysadmin search,103,104,searchTest,I,col19,"col19 varchar",col2,2
Usage
  • Use sysadmin search to determine whether replication of particular transactions is complete, whether an apparent problem is a delay or a more serious problem like a fatal error, or where data is backing up if replication appears to be stuck or slow.

  • For queries involving the char data type with a specified char width, you don't need to pad the value. For example, to search for the value "abc" in a column with a width of char(20), you can enter "abc":
    sysadmin search,108,109,myTable,U,col4,"abc"
  • The behavior of sysadmin search and the results it returns depend on where you execute it:
    • If you execute sysadmin search on a primary Replication Server, it first searches the inbound queue. If it finds the transaction you're searching for, it returns the location of the transaction. If the transaction isn't in the inbound queue, the command searches the route queue. If it doesn't find the transaction in the route queue, sysadmin search returns a message telling you that the transaction isn't currently on this Replication Server.

    • If you execute sysadmin search on a replicate Replication Server, it first searches the outbound queue. If it finds the transaction you're searching for, it returns the location of the transaction. Otherwise, sysadmin search returns a message telling you that the transaction isn't currently on this Replication Server.

    • If you execute sysadmin search on a route Replication Server (connected to neither the primary database nor the replicate), it searches only the route queue.

    Thus, you might need to run the command on several Replication Servers to find a missing or delayed transaction.