community.borland.com

Article #25258: Shutting Down a Database and Backing it Up using NT

Problem:
Shutting Down a Database and Backing it Up using NT

Solution:
1) Open a dos session and attach to the database as a non-SYSDBA user
   using ISQL.
	  set ISC_USER and ISC_PASSWORD with the NT set command 
	  Make sure that the user has been entered into the security
	  database using GDEF

2) Open another dos session and (as SYSDBA) shut the database down
	  Make sure the ISC_USER and ISC_PASSWORD environment vars are set
	  to cSYSDBAc and	cmasterkeyc respectively.
	  Shut the database down with the command:
		gfix -shut -force 0 dbname

3) Confirm shutdown of database
	  In the window with the non-SYSDBA user, try to show tables.  If
	  the database is shutdown the message will appear:
				database dbname shutdown
	  Try quiting ISQL and starting it up again.  Once again try and
	  connect to the database. You should get the same message as
	  above.

4) As the SYSDBA, backup the database with the following command:
	gbak -backup -garbage_collect dbname backup_name

5) Try restoring the database to a different file to ensure proper
   backup.  Use the following command:
	gbak -create_database backup_name dbname
	
6) Try connecting with ISQL to the restored database.  If connection is
   successful, then backup is not corrupt.  (note: The restored database
   does not have to be put back on-line).

7) If you want to put the original database on-line, use the following
   command:
	gfix -online dbname

8)  Test to ensure that the original database is back on-line.
	  In the dos session with the non-SYSDBA user, try to connect to
	  the database with ISQL.  You should be able to connect to the
	  database without problem.

Last Modified: 02-OCT-00