Initializing the Standby Database

Use Adaptive Server commands and utilities to initialize the standby database.

This example uses the “dump marker” option to initially materialize the standby database. See the Replication Server Administration Guide Volume 1 > Manage Database Connections for information on how to grant permissions to the maintenance user ID for all the tables in the database.

  1. Log in to the active data server and dump the active database:
    dump database pubs2 to '/backup/data/sybase1550/ASE-
    15_5/pubs2.dmp'
    Note: Make sure that the Backup Server is running. Dumps and loads are performed through Backup Server.
  2. Exit from the active database.
  3. Load the standby database with the dump from the active database:
    load database pubs2 from
    '/backup/data/sybase1550/ASE-15_5/pubs2.dmp'
  4. After completing the load operations, bring the standby database online:
    online database pubs2
    go
    Started estimating recovery log boundaries for
    database 'pubs2'.
    Database 'pubs2', checkpoint=(1564, 65),
    first=(1564, 65), last=(1565, 17).
    Completed estimating recovery log boundaries for
    database 'pubs2'.
    Started ANALYSIS pass for database 'pubs2'.
    Completed ANALYSIS pass for database 'pubs2'.
    Recovery of database 'pubs2' will undo incomplete
    nested top actions.
    Database 'pubs2' is now online
    
  5. Check the “suid” for the maintenance user defined for the standby database at the server level:
    use master
    go
    
    select suid,name from syslogins
    where name ='pubs2_maint'
    go
    
    suid     name
    ------- -----------
    3        pubs2_maint
  6. Check the “suid” for the maintenance user defined in the standby database:
    use pubs2
    go
    
    select suid,name from sysusers
    where name = 'pubs2_maint'
    go
    
    suid     name
    ------- -----------
    8        pubs2_maint
    Note: If the suid for the maintenance user does not exist, add it with the sp_addlogin command.
  7. Change the “suid” in the sysusers table in the standby database to match the “suid” in the ASE server that hosts the standby database:
    sp_configure "allow updates to system tables",1
    go
    Parameter Default Memory Used Config Value Run Value Unit Type
    allow updates to system tables 0 0 1 1 switch dynamic
    Configuration option changed. ASE need not be rebooted
    since the option is dynamic.
    Changing the value of 'allow updates to system tables'
    does not increase the amount of memory Adaptive Server
    uses.
    (return status = 0)
    update sysusers set suid = 3 where name = "pubs2_maint"
    go
    (1 row affected)  
    Note: If there is a difference in the server user IDs (suids) assigned to the users at the active database versus the standby database, modify the sysusers table in the newly loaded database to match both the logins.

    If the maintenance user does not exist on the database, add the user with the sp_adduser command and skip step 7.

  8. Exit the isql session.
  9. Log in to Replication Server and resume the connection to the standby database:
    resume connection to wingak1505i.pubs2
    go
    	
    Connection to 'wingak1505i.pubs2' is resumed
    Note: Validate that the connection is not suspended or down. If the connection is down, check the Replication Server log for errors and correct the errors, and then resume the connection.
  10. Check the warm standby status:
    admin logical_status
    go

    The output generated from admin logical_status is similar to:

    Logical Connection Name Active Connection Name Active Conn State Standby Connection Name Standby Conn State
    [102] pubs2a.pubs2s [103] sunak1505i.pubs2 Active/ [104] wingak1505i.pubs2 Active`
    Controller RS Operation in Progress State of Operation in Progress Spid
    [16777317] PRS None None  
  11. Release the secondary truncation point of the standby database server:
    isql -Usa -P -Swingak1505i
    use pubs2
    go
    
    dbcc settrunc ('ltm','ignore')
    go