Skip to main content

Recovery Of Master In ASE

Recovery Of Master In ASE

Introduction
This document describes the disaster recovery procedure to follow when the master database or the master device in ASE 12.0.x has been lost and the server was upgraded from a pre-12.0 server. Changes in Adaptive Server Enterprise 12.0 make it necessary to use this procedure, instead of the standard procedures described in the System Administration Guide or the Troubleshooting & Error Messages Guide, for a server upgraded from pre-12.0.
Two scenarios are covered in separate sections:
• The master device is lost
• The master database is lost but the master device is intact.
This discussion assumes that you did not alter any databases on the master device. Recovering from that scenario is beyond the scope of this document; contact Sybase Technical Support for assistance.
For ASE 12.5.x servers upgraded from a previous version, see the disaster recovery procedure described in TechNote 1028123, Recovering an Upgraded Master Device and master Database in ASE 12.5.x .
The master device is lost
If only the master database was lost, see The master database is lost but the master device is intact later in this document.
Note:
This procedure assumes that a good backup of the master database exists, and that you know either the database layout on the master device or have a copy of the sysusages table.
1. Rebuild the master device, setting the path and size:
$SYBASE$SYBASE_ASE/bin/11x_bmaster -d-s
2. Start the server in single-user mode by executing startserver with the -m option:
startserver -f -m
You should see a message at the end of the boot sequence, "SQL Server booted against master device for different release." This message is to be expected during an upgrade.
Warning!
If you do not start the server in single-user mode, it will create sybsystemdb upon startup and the original sysusages layout cannot be restored.
3. In order to load in the master database dump, the newly built rows in the sysusages table should match the sysusages rows saved on the dump of master. (A recent copy of your sysusages table, before the master device was lost, is helpful at this step).
The sysusages table of a newly built master device should look similar to the following:
1> select * from sysusages
2> go
dbid segmap lstart size vstart pad unreservedpgs
---- ------ ------ ---- ------ ----- -------------
1 7 0 1536 4 NULL 271
2 7 0 1024 2564 NULL 566
3 7 0 1024 1540 NULL 566
This example shows that the first piece used on the master device is dbid 1 (master database) starting on page 4 (vstart) on the master device, with a size of 1536 2K pages (or 3 MB.) The next piece used on the master device is dbid 3 (model) which starts at page 1540, and consists of 1024 pages (2MB). The last piece is dbid 2 (tempdb), which starts at page 2564, and consists of 1024 pages. When you alter master and model and add a sybsystemdb database, additional rows are added to sysusages.
Log in to the server with isql. Alter master, tempdb, and model and create the sybsystemdb database in the correct order to reflect the exact physical and logical layout of the original master device that was lost. (At a minimum you will need to increase the size of master and add sybsystemdb, but the mapping will differ between sites.)
Note:
You only need to update the layout of the master device. Do not modify sybsystemprocs or any of the user databases.
4. Log in to the server with isql and set the upgrade version of the config block to match the version of ASE you are restoring.
1> select config_admin(1, 122, 12000, 1, NULL, NULL)
2> go
5. Shut down the server and restart it in single-user mode. Upon reboot, you should find that the server upgrades system databases to the version you set in the previous step.
startserver -f -m
6. Log in to the server. Make sure model, sybsystemdb and master are all online before proceeding.
1> select name, status from sysdatabases
2> go
tempdb should have a status of 4, the rest of the databases should have a status of 0.
Update sysservers to set the external name of the Backup Server correctly as follows:
1> update sysservers set srvnetname =
2> where srvnetname = 'SYB_BACKUP'
3> go
where matches the entry in the interfaces file (sql.ini on NT).
7. Load the dump of the master database back in:
Note:
If the server was localized (non-default character set or sort order), turn on trace flag 3100 before loading the master database. Trace flag 3100 allows master to be loaded with a non-standard sort order.
1> dbcc traceon (3100)
2> go
1> load database master from
2> go
The server automatically shuts down after the load.
8. Boot the server in single user mode one more time, looking carefully for any errors in the error log. Check if all information has been restored correctly or if additional changes need to be made.
Restart the server in multi-user mode, and it is ready for use.
The master database is lost but the master device is intact
Use the following procedure to rebuild the master database on an ASE 12.0.x server; the procedure assumes that a good backup of master is available:
1. If the 11x_bmaster binary for buildmaster (bldmastr on NT) is not already available in the SYBASE/$SYBASE_ASE/bin directory, you will need to get a copy of the older buildmaster from your prior release.
Use the -m option to rebuild the master database only and leave the master device intact:
$SYBASE/ASE-12_0/bin/11x_bmaster -d
-s -m
2. Start the server in single-user mode to upgrade the databases during the first boot sequence. If the server is not started in single-user mode, it will create sybsystemdb upon startup and the original sysusages layout cannot be restored.
startserver -f -m
3. Log in to the server. Alter master, tempdb, model and create the sybsystemdb database in the correct order to reflect the exact physical and logical layout of sysusages in the original master database that was replaced.
Note:
You only need to update the layout of the master device. Do not modify sybsystemprocs or any of the user databases.
4. Log in to the server. Update sysservers to set the external name of the Backup Server correctly as follows:
1> update sysservers set srvnetname =
2> where srvnetname = 'SYB_BACKUP'
3> go
where matches the entry in the interfaces file (sql.ini on NT).
5. Load the master database dump back in:
1> load database master from
2> go
The server automatically shuts down after the load.
6. Restart the server in single-user mode one more time to check if all information has been restored correctly or if additional changes need to be made.
Restart the server in multi-user mode and it should be ready to use.

Disclaimer
This technote will NOT apply to all server configurations. As one example, there are additional considerations, depending on how sybsystemdb was setup on your prior version. Please contact technical support for details that may pertain to your specific installation.

Comments

Popular posts from this blog

Replication Server Quick Ref Guide

Replication Server Guide : • Replication Server Commands • ASE commands and system stored procedures • ASE RSSD stored procedures • RSSD tables • Replication Server System Functions • Troubleshooting Tips Abbreviations Some abbreviations which are used in this Quick Reference Guide: ASE Adaptive Server Enterprise DSI DataServer Interface - RS thread for a connection to a replicate database DIST Distributor - RS thread per primary database LTM Log Transfer Manager; synonym for RepAgent RS, RepServer Replication Server RepAgent Replication Agent (in primary dataserver) RepDef Replication Definition RSI Replication Server Interface - RS thread related to a route to another RepServer RSM Replication Server Manager (a DBA tool normally used in combination with Sybase Central) RSSD Replication Server System Database SQM Stable Queue Manager - RS thread managing a queue SQT Stable Queue Manager - RS thread assembling transactions Replication Server Commands The following commands can only be ...

Sybase IQ material - Quick Ref

Contents IQ 12.6 Commands IQ 12.6 Datatypes IQ 12.6 Functions IQ 12.6 System Procedures IQ 12.6 Catalogue Procedures IQ 12.6 Multiplex System Procedures IQ 12.6 ASE Compatibility System Procedures IQ 12.6 ASE Compatibility Catalogue Procedures IQ 12.6 Extended Procedures IQ 12.6 General Database Options IQ 12.6 T-SQL Compatibility Options IQ 12.6 DBISL Options IQ 12.6 Server Properties IQ 12.6 Database Properties IQ 12.6 Commands Two styles of commenting; the same as in ASE :- /* a comment between delimiters on one or more lines */ -- a comment until the end of this line ALLOCATE DESCRIPTOR descriptor-name [ WITH MAX { integer | host-variable } ] ^ALTER DBSPACE dbspace-name { READWRITE | READONLY | RELOCATE | SIZE dbspace-size [ KB | MB | GB | TB | PAGES ] | ADD dbspace-size [ KB | MB | GB | TB | PAGES ] } ALTER EVENT event-name [ DELETE TYPE | TYPE event-type ] { WHERE { trigger-condition | NULL } | { ADD | [ MODIFY ] | DELETE } SCHEDULE schedule-spec } [ ENABLE | DISABLE ] [ [ MODIFY...

Interesting Notes on ASE

Some hidden things about ASE Different States of SLEEP When all processes are shown as SLEEPING by sp_who except the one, which issued the sp_who command, how can a user tell the difference between hangings versus running processes? Definitions In pre-4.9.2 SQL Servers, the output of sp_who could be difficult to interpret. Processes showed only one type of SLEEP status, "sleeping". In System 10, and 4.9.2 Rollup 2115 and above, sp_who shows four types of sleep along with the other possible statuses: Value Meaning Infected The server erred with a stack trace, and the process got an error that would normally kill it. The process is infected instead of killed. Background This process is in the background recv sleep The process is waiting for input from the client Send sleep The process is waiting for a write to the client to complete alarm sleep The process is waiting for an alarm (usually means the process is waiting for a wait for command to complete). Lock sleep The process i...