



















Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
This document describes the steps required to enable WS and table replication
Typology: Exercises
1 / 27
This page cannot be seen from the preview
Don't miss anything!




















ICT Professional Services
ICT Professional Services
This document describes the Technical Architecture and implementation of the Warm Standby and Table replication for the continuous availability of the i MAL database.
This document deals with the Technical Architecture, i.e.: the hardware, software and protocols that underlie and support the functional applications. It does not specify or discuss the functionality of those applications except where necessary to clarify the use of the application technology. It includes the configuration, project implementation, and related procedures.
Term Meaning ASE Sybase Adaptive Server Enterprise RS Sybase Replication Server RSSD Replication Server System Database RA / RepAgent Sybase Replication Agent, Sybase thread that captures and forwards the transactions in the database DSI Sybase Data Server Interface that applies the captured transactions to the Disaster Recovery site WS Warm Standby DDL Data Definition Language (object schema changes) DML Data Manipulation Language (insert, update, delete statements)
The main objective of the project is to setup the production database with continuous availability. Apart from the benefit of disaster recovery, the solution can be used for testing and planned maintenance.
i MAL is a 24x7 environment which cannot accept planned or unplanned downtimes. “Sybase Replication Server Warm Standby Configuration” Solution guarantees an online, state- consistent copy of the production databases. Replication Server replicates DDL commands as well as DML commands in a transactional and selective manner thus assuring the consistency between the active and standby sites. Sybase replication server works asynchronously thus reducing the impact on the active site. Replication can be enabled or disabled dynamically in Server, database, object, and session or command level without affecting the production system. Standby databases can be rebuilt or synchronized on the fly, without interrupting the production operation. Sybase Control Center monitors the Sybase ASE and RS servers in the domain and can be OP17F08 – Setup Details Issue Date: 09-04- Version 1.0 Last Revision Date: 09-04-
ICT Professional Services used to automatically trigger defined actions.
The WS Solution for i MAL database consists of three main logical Sybase server environments, namely Production ASE, Replication Server, and Standby ASE environments.
A warm standby system is a pair of state-consistent Adaptive Server databases linked by a single Replication Server Active database — the Adaptive Server database to which clients are currently connected Standby database — an online copy of the active database at a separate Adaptive Server on a separate machine Replication Server — forwards all commands performed in the active to the standby State consistency means that the standby database is consistent with the active database at an earlier point in time Unlike hot standby solutions, Replication Server does not use two phases commit Instead, commands are forwarded to the standby as they occur in the active During the latency period, commands may be: Waiting in the active database log to be read by the RepAgent Traversing the network Waiting in a Replication Server stable queue for processing Awaiting execution at the standby dataserver There are two types of Warm Standby implementation: Automatic Replication is enabled at the database level Replicates both data definition language (DDL) and data manipulation language (DML) Requires Adaptive Server and Replication Server 11.5 or later Semiautomatic Replication is enabled at the table level Replicates only DML Requires Adaptive Server 10.0 or later and Replication Server 11.5 or later Automatic Warm Standby: Replicates an identical image of the active database, including changes to object schemas All attributes of the standby should match the active: Users and permissions Object and device names All tables in the database are marked for replication at once DDL transactions are issued in the standby using the same login and password that executed them in the active database DML transactions are issued by the maintenance user Only the results of triggers are replicated Replication Server turns off triggers for connections to the standby using set triggers off OP17F08 – Setup Details Issue Date: 09-04- Version 1.0 Last Revision Date: 09-04-
ICT Professional Services
Before starting the replication configuration, the following should be ready:
The user databases involved for the warm standby setup are "imaldb" and "imaldb_con" OP17F08 – Setup Details Issue Date: 09-04- Version 1.0 Last Revision Date: 09-04-
ICT Professional Services
a) Make sure DR ASE Server is ready and configured with all the databases created with the matching sizes b) Stop any scheduled dump database jobs on these databases till we complete the WS configuration c) Double check the connectivity between Production & DR site for the ASE with respect to the firewalls and rules d) Make sure tables syslogings and sysloginroles are identical on PROD and DR ASE (you can use bcp in/out – refer to bcp section) e) Add the server entry called REP on the replication server o In Windows add the below to the sql.ini file: [REP] master=TCP,10.20.209.11, query=TCP, 10.20.209.11, o In UNIX add the below to the interfaces file: REP master tcp ether 10.20.209.11 4488 query tcp ether 10.20.209.11 4488 f) Create two maintenance user logins at both ASEs (production & DR) use master go sp_addlogin imaldb_maint, "imaldb_maint_ps", imaldb go sp_role 'grant', 'replication_role', 'imaldb_maint' go g) Enable rep agent threads at both ASEs sp_configure "enable rep agent threads", 1 h) Run sp_reptostandby ALL for each one of the 2 databases at both ASEs use imaldb go sp_reptostandby imaldb, "ALL" go i) Create two database devices called RSSD_data and RSSD_log at imalrssd with respective sizes 8GB data and 2GB log disk init name = RSSD_data, physname = "c:\Sybase\data\RSSD_data.dat", size = '8192M' go OP17F08 – Setup Details Issue Date: 09-04- Version 1.0 Last Revision Date: 09-04-
ICT Professional Services
Using rs_init add the connections to the databases a) First add active database imaldb to the replication system b) Then add standby database imaldb to the replication system
a) Dump the active databases b) Load the standby databases & bring them online ON DR use master go use imaldb go sp_dropuser imaldb_maint, imaldb go sp_addalias imaldb_maint, dbo go sp_role 'grant', 'replication_role', 'imaldb_maint' go c) Connect to REP and issue resume connection to imaldr.imaldb go d) Check the connection status using admin who_is_down go admin logical_status go e) Run the below on REP to exclude the listed tables from replication to DR: suspend connection to imaldr.imaldb go alter connection to imaldr.imaldb for replicate table named SYNC_LASTPINGDATE set dsi_command_convert to 'u2none,d2none,i2none' go alter connection to imaldr.imaldb for replicate table named TMP_CASH_FLOW_ACC_BAL set dsi_command_convert to 'u2none,d2none,i2none' go alter connection to imaldr.imaldb for replicate table named TMP_REPORT_DEALS_SETL_DET set dsi_command_convert to 'u2none,d2none,i2none' go alter connection to imaldr.imaldb OP17F08 – Setup Details Issue Date: 09-04- Version 1.0 Last Revision Date: 09-04-
ICT Professional Services for replicate table named DOF_TMP set dsi_command_convert to 'u2none,d2none,i2none' go alter connection to imaldr.imaldb for replicate table named TMP_MT701_OUT set dsi_command_convert to 'u2none,d2none,i2none' go alter connection to imaldr.imaldb for replicate table named TRS_DOF_TMP set dsi_command_convert to 'u2none,d2none,i2none' go alter connection to imaldr.imaldb for replicate table named TMP_PASTDUE set dsi_command_convert to 'u2none,d2none,i2none' go alter connection to imaldr.imaldb for replicate table named TRS_POLICY_DATA_ALL set dsi_command_convert to 'u2none,d2none,i2none' go alter connection to imaldr.imaldb for replicate table named TRSSETLPOLICYREPORT set dsi_command_convert to 'u2none,d2none,i2none' go alter connection to imaldr.imaldb for replicate table named CARDLIST set dsi_command_convert to 'u2none,d2none,i2none' go resume connection to imaldr.imaldb go f) Create all replication definitions(refer to appendix 6.4)
a) Make sure that the “ trunc log on checkpoint ” is enabled for all the databases at imaldr & imalrssd On imaldr: use master go exec sp_dboption imaldb,"trunc. log on chkpt",true go exec sp_dboption imaldb_con,"trunc. log on chkpt",true go On imalrssd: use master go exec sp_dboption REP_RSSD,"trunc. log on chkpt",true go OP17F08 – Setup Details Issue Date: 09-04- Version 1.0 Last Revision Date: 09-04-
ICT Professional Services
set replication off go use imaldb go exec sp_stop_rep_agent imaldb go exec sp_config_rep_agent imaldb, "connect dataserver","imalp1" exec sp_config_rep_agent imaldb, "scan batch size", "20000" exec sp_config_rep_agent imaldb, "fade timeout", "60" exec sp_config_rep_agent imaldb, "retry timeout", "30" exec sp_config_rep_agent imaldb, "scan timeout", "15" exec sp_config_rep_agent imaldb, "skip ltl errors",true exec sp_config_rep_agent imaldb, "skip unsupported features",true exec sp_config_rep_agent imaldb, "send buffer size", "16K" exec sp_config_rep_agent imaldb, "priority", "4" exec sp_config_rep_agent imaldb, "short ltl keywords" ,"true" exec sp_config_rep_agent imaldb, "send structured oqids","true" go exec sp_start_rep_agent imaldb go set replication on go
use imaldb go exec sp_stop_rep_agent imaldb go exec sp_config_rep_agent imaldb, "connect dataserver","imaldr" exec sp_config_rep_agent imaldb, "scan batch size", "20000" exec sp_config_rep_agent imaldb, "fade timeout", "60" exec sp_config_rep_agent imaldb, "retry timeout", "30" exec sp_config_rep_agent imaldb, "scan timeout", "15" exec sp_config_rep_agent imaldb, "skip ltl errors",true exec sp_config_rep_agent imaldb, "skip unsupported features",true exec sp_config_rep_agent imaldb, "send buffer size", "16K" exec sp_config_rep_agent imaldb, "priority", "4" exec sp_config_rep_agent imaldb, "short ltl keywords" ,"true" exec sp_config_rep_agent imaldb, "send structured oqids","true" exec sp_start_rep_agent imaldb go
configure replication server set "cm_max_connections" to "128" configure replication server set "exec_cmds_per_timeslice" to "10000" --For Windows 2003, the maximum value for memory_limit is 2047 --For Other platform, set the memory_limit to 70% of the server memory configure replication server set "memory_limit" to "8192" configure replication server set smp_enable to 'on' configure replication server set "num_client_connections" to "100" configure replication server set "num_concurrent_subs" to "100" configure replication server set "num_msgqueues" to "800" configure replication server set dsi_row_count_validation to 'off' configure replication server set "num_msgs" to "204800" configure replication server set "num_mutexes" to "6000" configure replication server set "num_threads" to "5000" configure replication server set "dsi_bulk_copy" to "off" configure replication server set "sqt_max_cache_size" to "402653184" configure replication server set "stats_sampling" to "on" configure replication server set "sts_cachesize" to "10000" configure replication server set "sub_daemon_sleep_time" to "10000" configure replication server set "sub_sqm_write_request_limit" to "2097152" configure replication server set "exec_sqm_write_request_limit" to "2097152" configure replication server set "sts_full_cache_rs_classes" to "on" OP17F08 – Setup Details Issue Date: 09-04- Version 1.0 Last Revision Date: 09-04-
ICT Professional Services configure replication server set "sts_full_cache_rs_columns" to "on" configure replication server set "sts_full_cache_rs_config" to "on" configure replication server set "sts_full_cache_rs_databases" to "on" configure replication server set "sts_full_cache_rs_datatype" to "on" configure replication server set "sts_full_cache_rs_diskaffinity" to "on" configure replication server set "sts_full_cache_rs_columns" to "on" configure replication server set "sts_full_cache_rs_objects" to "on" configure replication server set "sts_full_cache_rs_functions" to "on" configure replication server set "sts_full_cache_rs_queues" to "on" configure replication server set "sts_full_cache_rs_repdbs" to "on" configure replication server set "sts_full_cache_rs_repobjs" to "on" configure replication server set "sts_full_cache_rs_dbreps" to "on" --Reboot REP
suspend connection to "imalp1"."imaldb" go configure connection to "imalp1"."imaldb" set dsi_cmd_batch_size to '32768' go configure connection to "imalp1"."imaldb" set dsi_keep_triggers to 'off' go configure connection to "imalp1"."imaldb" set dsi_sqt_max_cache_size to '104857600' go configure connection to "imalp1"."imaldb" set dsi_xact_group_size to '261424' go configure connection to "imalp1"."imaldb" set dsi_max_xacts_in_group to '60' go configure connection to "imalp1"."imaldb" set db_packet_size to '4096' go configure connection to "imalp1"."imaldb" set dsi_commit_control to 'on' go configure connection to "imalp1"."imaldb" set exec_cmds_per_timeslice to '10000' go configure connection to "imalp1"."imaldb" set exec_sqm_write_request_limit to "1048576" go configure connection to "imalp1"."imaldb" set md_sqm_write_request_limit to "1048576" go resume connection to "imalp1"."imaldb" go
suspend connection to "imaldr"."imaldb" go configure connection to "imaldr"."imaldb" set dsi_cmd_batch_size to '32768' go configure connection to "imaldr"."imaldb" set dsi_keep_triggers to 'off' go configure connection to "imaldr"."imaldb" set dsi_sqt_max_cache_size to '1677721600' go configure connection to "imaldr"."imaldb" set dsi_xact_group_size to '261424' go OP17F08 – Setup Details Issue Date: 09-04- Version 1.0 Last Revision Date: 09-04-
ICT Professional Services Repeat the same steps with the following information: SQL Server name: imalp Sa user : sa Sa Password: ****** Database: phx_rep Will the database be replicated : now Maintenance user: phoenix_maint Maintenance password: phoenix_maint_ps 3- Follow the steps mentioned in the text files located under “d:\phoenix\Table Replication Steps” for each table to setup the replication
sybinit.release_directory: /sybrs sybinit.product: rs rs.rs_operation: rs_install rs.rs_idserver_name: REP rs.rs_idserver_pass: sybase rs.rs_id_server_is_rs_server: yes rs.rs_name: REP rs.rs_requires_ltm: no rs.rs_charset: cp rs.rs_language: USE_DEFAULT rs.rs_sortorder: binary rs.rs_rs_errorlog: C:\Sybase\REP-15_5\install\REP.log rs.rs_rs_cfg_file: C:\Sybase\REP-15_5\install\REP.cfg rs.rs_rssd_sqlsrvr: imalp rs.rs_rssd_db: REP_RSSD rs.rs_rs_sa_pass: sybase OP17F08 – Setup Details Issue Date: 09-04- Version 1.0 Last Revision Date: 09-04-
ICT Professional Services rs.rs_create_rssd: yes rs.rs_rssd_sa_login: sa rs.rs_rssd_sa_pass: sybase rs.rs_rs_pass: sybase rs.rs_ltm_rs_pass:sybase rs.rs_rssd_prim_pass: Sybase rs.rs_rssd_maint_user: imaldb_maint rs.rs_rssd_maint_pass: imaldb_maint_ps rs.rs_rsdddb_size: 8192M rs.rs_rssd_log_size: 2048M rs.rs_rssd_db_device_name: RSSD_data rs.rs_create_rssd_database_dev: no rs.rs_rssd_log_device_name: RSSD_log rs.rs_create_rssd_log_dev: no rs.rs_diskp_name: D:\sybase\data\stableq\part01.dat rs.rs_diskp_lname: part rs.rs_diskp_size: 204 rs.rs_diskp_vstart: 0 rs.ltm_name: ltmprs rs.rs_ltm_errorlog: USE_DEFAULT rs.rs_ltm_cfg_file: USE_DEFAULT rs.do_add_replication_server: no rs.do_add_ltm: no
The below can be used to bcp out the logins and roles: bcp master..syslogins out syslogins.out -c -Usa –P****** -Simalp bcp master..sysroles out sysroles.out -c -Usa –P****** -Simalp bcp master..sysloginroles out sysloginroles.out -c -Usa –P****** -Simalp bcp master..syssrvroles out syssrvroles.out -c -Usa –P****** -Simalp
The below can be used to bcp in the logins and roles: bcp master..syslogins in syslogins.out -c -Usa –P****** -Simaldr -b bcp master..sysroles in sysroles.out -c -Usa –P****** -Simaldr -b bcp master..sysloginroles in sysloginroles.out -c -Usa –P****** -Simaldr -b bcp master..syssrvroles in syssrvroles.out -c -Usa –P****** -Simaldr -b PS: allow updates to system tables must be enabled on the destination server for the bcp in to work, it can be disabled after that: To enable: use master go sp_configure "allow updates to system tables", go To disable: use master go sp_configure "allow updates to system tables", OP17F08 – Setup Details Issue Date: 09-04- Version 1.0 Last Revision Date: 09-04-
ICT Professional Services
ICT Professional Services admin quiesce_check The output should be: Server Message: Number 14043, Severity 0 Server 'REP', Line 0: Replication Server REP is Quiesced