This time i’d like to share about how to backup and restore database while user still online or something that client still active. Usually even client already close his application but in SQL Server 2000 still show that client connected to database. You won’t succeeded while you’re trying to Restore Database.
Here’s some sample script that you can run on Enterprise Manager or you can build your own Backup & Restore Application module.
Backup :
BACKUP DATABASE [dbBillingAMAG]
TO
DISK = ‘C:\Data\Microsoft SQL Server\MSSQL\BACKUP\dbBilling\dbBilling_backup1.BAK’
WITH
NOFORMAT,
NOINIT,
NAME = ‘dbBilling backup’,
NOREWIND,
NOUNLOAD,
SKIP
Restore :
USE MASTER
RESTORE DATABASE [dbBillingAMAG]
FROM
DISK = ‘C:\Data\Microsoft SQL Server\MSSQL\BACKUP\dbBillingAMAG\dbBillingAMAG_backup1.BAK’
WITH
FILE = 1,
NOREWIND,
NOUNLOAD,
REPLACE
*Note :
If you didn’t syntax “USE MASTER” you will get message from SQL server like this message “Error: Failed: Exclusive access could not be obtained because the database is in use“.


Word press advises that you do this every so often so that you don’t lose information on your blog….but I still don’t know how to back up!
If you’re using WordPress you can regularly backup at Tools WordPress Admin.