Avoiding Disaster through Good DBA Practices

This section provides a number of recommendations for keeping your Adaptive Server installation working at peak effectiveness. By maintaining these good practices, you can maximize server uptime, correct problems proactively, and be as prepared as possible to handle emergencies.

  1. Keep Up-to-Date Backups

    Maintaining current backups of your data is vital for any recovery plan. Keep multiple generations of backups, and keep some offsite as an extra precaution.

    Make regular database dumps of:

  2. Maintain copies of System Tables and DDL

    Keep the latest offline copies of the following tables:

    Use the bcp utility to copy out these tables. In addition, maintain a hardcopy by printing the output of the following queries:

    select * from sysusages order by vstart
    select * from sysusages order by dbid, lstart
    select * from syslogins
    select * from sysloginroles
    select * from sysdatabases
    select * from sysdevices
    select * from syscharsets
    select * from sysconfigures
    select * from sysservers
    select * from sysremotelogins
    select * from sysresourcelimits 
    select * from systimeranges 
    

    Also maintain:

    NoteImplement all changes to schema in the same way that the installmaster script is implemented.

  3. Verify Database Consistency

    Run dbcc checks on a regular basis to monitor the health of your databases. Database-wide checks are available with dbcc checkdb, dbcc checkalloc, and dbcc checkstorage. dbcc checkcatalog is also a useful tool. For a brief overview of dbcc commands, see “Useful dbcc Commands”. Detailed information appears in the System Administration Guide.

    Since dbcc checks can be resource intensive, consider adopting a strategy to take advantage of object level dbcc's. On a given day run a certain number of checktable and tablealloc commands for a portion of the database. On subsequent days, run different tables. Over a period of days you can accomplish a complete check of your databases for integrity. For example if your database has 200 tables in addition to the system tables, run dbcc's on the system tables on night one, run dbcc's on each of the first 50 of the user tables on night two, the next 50 the next night and so on, until at the end of five nights you have checked every table in the database. On the sixth night you can begin the cycle again.

    NoteRunning table-level dbcc's misses the GAM page checks.

    Alternative strategies include:

    Building dbcc checks into your regular backup/maintenance schedule can ensure that you have consistent, accurate backups available at all times.

  4. Implement Mirroring

    Mirroring, either at the Adaptive Server level or at the operating system level, can provide nonstop recovery in the event of media failure.

    The factors you need to consider, and instructions on implementing Adaptive Server mirroring, are detailed in the section titled "Mirroring Database Devices" in the System Administration Guide.

  5. Perform Ongoing Maintenance

    As part of a routine program of server maintenance, you should:

  6. Avoid Risky Practices

  7. Recovery Tips, Or What to do When Things Go Wrong

  8. Additional Tips

    After an operating system upgrade, check permissions on your sybase devices.