SQL Server Disaster Recovery

You are here: Home » Exercises » SQL Server 2000 » Backup and Recovery Scripts

SQL Server 2000 Backup and Recovery Scripts

SQL Sever 2000 Backup and Recovery Scripts

SQL Server 2000 Scripts That Can Help With Backup and Recovery

  • Description
  • Requirements
  • Description:

    This web page contains a few stored procedures that may be of assistance to you with backup and recovery planning.

    (back to top)

    Requirements:

    As with all of the exercises on this site, do not perform this exercise on a production server.  Perform this exercise in a closed development environment

    1) sp_spaceused - This procedure can be used to determine how large your backups will be so you can adequately plan disk space. You can use this figure as a baseline then estimate growth based on the transactions that are expected to occur in the database. There are 21 MB allocated for the database (from the database_size column) - but the backup only backs up data and indexes. The "reserved" column can be used as a good estimate for how much disk space your backup will require.

    Query Analzyer screen shot - using the EXEC sp_spaceused to determine approximate space required for a backup

     

    2) sp_renamedb - This procedure allows you to rename a database. This is how you rename a database, but you probably don't ever want to be using the procedure because you may break external references to the database in other applications. You can see through the use of the sp_helpdb stored procedure that the pubs database has been renamed to 'renamedpubs'.

    Query Analyzer screen shot using sp_renamedb to rename a database

    (back to top)