Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MSDE Backup

Status
Not open for further replies.

DroopyA

Programmer
Aug 5, 2003
52
0
0
US
My software runs on MSDE assuming that the majority of my clients will not have Microsoft SQL Server installed on their computers. How do you do a backup and restore without having SQL Server?


I tried executing this code "BACKUP DATABASE [tablename] TO DISK = '[path]'..." but that only worked if I used a database I had in SQL Server itself. It would give me a "Table not found" error if I tried running this using a database relying on MSDE and MSDE only. How do I backup a MSDE database?

Thank you
-N473
 
You should be able to do it using osql. From a command prompt type
Code:
 osql ?
to see your options.

Here's an example (this would all be done from a command prompt):

Code:
osql -S SERVER -d master -U username -P password -q "BACKUP DATABASE [dbName]
   TO disk = N'C:\Backups\MyBackup.bak'
   WITH  INIT ,  NOUNLOAD ,  
   NAME = N'MSDE backup',  NOSKIP ,  STATS = 10,  NOFORMAT"
-dave
 
You can wite a simple batch file to copy the folders and append or verwrite as you see fit. Or you can also use add on tools.
Making an MSDE Backup



You should make regular backups of your MSDE database in case of server failure.

To Backup MSDE:



1. Shut down ListManager. If ListManager is running in a console window, ctrl-c will begin the shutdown process. If it is running as a service, stop the service by clicking on Start -- Settings -- Control Panel -- Administrative Tools.

2. Shut down MSDE using the SQL Server Service Manager. It can be found by clicking Start -- Programs -- MSDE -- Service Manager.

3. Using Windows Explorer (Start – Programs – Accessories – Windows Explorer), navigate to the SQL Server Data Directory: Drive\MSSQL7\data\, where Drive corresponds to the Drive that you installed ListManager SQL on. In most cases Drive will be “c:\”.

4. Copy the entire data directory to your backup location.

5. Restart MSDE using the SQL Server Service Manager.

6. Restart ListManager.

Restoring ListManager MSDE databases

To restore your backup:

1. Stop ListManager.

2. Copy the ListManager_log.ldf and ListManager.mdf files from the backup location to the data directory of your MSDE installation.

3. Restart MSDE.


Here is a Microsoft link if you want to use SQL statements to back up the database:
 
Thank you for your help... now if only my restore would work.

Peace
-N473
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top