Results 1 to 6 of 6

Thread: emergency, please help!

  1. #1
    Join Date
    Jul 2004
    Location
    bay area
    Posts
    61

    emergency, please help!

    Hi all,
    My window xp pro suddenly cannot reboot any more.
    luckily, I can get into safe mode with command prompt.
    So before doing any repair or even reinstallation of the op.
    I need to back up my database using transact-sql in order to restore later on completely if have to reinstall my OP system.
    I have MSDE installed on my computer. so osql.exe is available
    for me to back up the database. I did before with the backup command, but it's a while ago. since this time the backup is so precious to me. I want you guys to back me up.
    I will go to osql dir in C:\program files\microsoft SQL server\...
    then issue:
    backup database CMCTIS to disk='D:\sqlbackup\cmcbackup.dat'

    CMCTIS is the database name and d:\sqlbackup\cmcbackup.dat is the file I want to use later on
    to restore. Since if I will probably do repair or reinstallation, the information on C: will be wiped out or damaged. that's why I will use D: drive for the backup.
    Please confirm.

    So later on I can restore database completely including data and store procedures, database changes, right?
    I have several databases and two server instances. I have to back up database one by one right?

    Please reply at your earliest convenience. Otherwise I will lose all three month database work.

    Betty

  2. #2
    Join Date
    Jul 2004
    Location
    SLC, UT
    Posts
    15

    just a thought..

    Have you considered detaching all the dbs and copying all the files to this safe D:\sqlbackup\ location and later attach them back after you box if fixed... just a thought ..

    Correct me if I'm wrong, can't you can use the sp_detach_db and sp_attach_db system stored procedures to detach database and then attach it again.

    IF you need script
    http://www.mssqlcity.com/Articles/Ad...h_database.htm

    I'm just trying to help, I'm not a SQL genius ..

    let me know what you finally decided to do ..

    thank you

  3. #3
    Join Date
    Sep 2002
    Posts
    5,938
    I prefer backup db since it's safer.

  4. #4
    Join Date
    Jul 2004
    Location
    bay area
    Posts
    61
    I will do backup. I never use the detach command before.
    Yesterday, probably I was vey frustrated and forgot to back up as regular.
    I copied all files from sql server dir and thinking about move back to the dir later on after reinstall my op and sql server. Then it suddenly came to my mind nobody did that way to make the original data, database back.
    Thank you both.
    Betty

  5. #5
    Join Date
    Oct 2005
    Location
    Ireland
    Posts
    92

    backup/restore

    why is backup and restore safer than detach/attach?
    what about if your database never existed on the destination server before?

  6. #6
    Join Date
    Sep 2002
    Posts
    5,938
    1. If the machinse is not in stable status, you may unable to reattach db back. Besides, backup doesn't take db down so you don't have down time.

    2. You can create an empty db on target server then restore from backup.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •