Results 1 to 11 of 11

Thread: How to restore a database with minimal log?

  1. #1
    Join Date
    Aug 2004
    Location
    USA
    Posts
    80

    How to restore a database with minimal log?

    My production db has 20 GB log space which it needs. When I want to restore its copy on to Dev in different versions as required by the business needs each time I have trouble with log space on the disk. Is there a way to restore prod backup copy on the Dev with minimal log as Dev doesn't need so much log.

    I know, we can shrink prod and take a backup after shrinking the log and then restore on the Dev. But this work-around is not always possible. Any ideas are greatly appreciated!

    Thanks,

  2. #2
    Join Date
    Sep 2002
    Posts
    5,938
    Not as I aware of other ways without shrinking log file on source server.

  3. #3
    Join Date
    Aug 2004
    Location
    USA
    Posts
    80
    Any one to help??

  4. #4
    Join Date
    Nov 2002
    Location
    New Jersey, USA
    Posts
    3,932
    If you can detach the production database, then detach it, copy the .MDF file to your dev environment, attach the production db.

    Then in dev attach it using

    EXEC sp_detach_db @dbname = 'pubs'
    EXEC sp_attach_single_file_db @dbname = 'pubs',
    @physname = 'c:\Program Files\Microsoft SQL Server\MSSQL\Data\pubs.mdf'

  5. #5
    Join Date
    Aug 2004
    Location
    USA
    Posts
    80
    Nope, we can't detach the production db. Client will lose millions in minutes!

  6. #6
    Join Date
    Sep 2002
    Location
    Fantasy
    Posts
    4,254

  7. #7
    Join Date
    Aug 2004
    Location
    USA
    Posts
    80
    Thanks MAK,

    Is there a work-around to achieve the same thing in SQL Server 2000 as we can't move to 2005 any time soon.?

    thanks,

  8. #8
    Join Date
    Sep 2002
    Posts
    5,938
    Not sure if any third party backup tools can do that.

  9. #9
    Join Date
    Oct 2002
    Posts
    21
    Quote Originally Posted by DBFan
    My production db has 20 GB log space which it needs. When I want to restore its copy on to Dev in different versions as required by ....(snip)
    Why do you need a 20 G log ?? I always like a small log. We have full recovery, backup logs avery 10 minutes, and copy the logs to another server.

  10. #10
    Join Date
    Aug 2004
    Location
    USA
    Posts
    80
    It's a Peoplesoft application which has SQL Server backend and runs payroll for 40,000 employees. We have no control on code. Single big transactions take place which need so much log, so truncation or backing up of log doesn't help here.

    Thanks,

  11. #11
    Join Date
    Sep 2002
    Posts
    5,938
    But you can't put db snapshot on remote server in sql2k5.
    Last edited by rmiao; 09-03-2005 at 04:29 PM.

Posting Permissions

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