Results 1 to 7 of 7
  1. #1
    Newcomer
    Join Date
    Aug 2009
    Posts
    8
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default Automate daily (newly created database) full backups; script help

    Hello all, thanks for reading this post.

    I have a server which has Microsoft SQl Server and TSM TDPSql installed on it. i have around 50 SQL server databases on it with active usage. I run a full backup every month and differential backups every day.

    But when a new SQL database is created, its backup fails because 'its full backup does not exist'. So I would like to make a little change to my sqldiff schedule script. Right now all it says is

    %sql_dir%\tdpsqlc backup master full /tsmoptfile=%sql_dir%\dsm.opt /logfile=%sql_dir%\sqldiff.log >> %sql_dir%\sqldiffsched.log
    %sql_dir%\tdpsqlc backup * diff

    I would like to add a little script here that would take a full backups of the databases created that particular day along with full backup of master. And then, run the differential.

    Something like select * from sys.databases where create date is 'today'. Can anyone help?

    Thanks,
    Ben

  2. #2
    Moderator moon-buddy's Avatar
    Join Date
    Aug 2005
    Location
    Somewhere in the US
    Posts
    5,857
    Thanks
    4
    Thanked 228 Times in 223 Posts

    Default

    My two cents

    Just run the full backup manually unless you create new databases every hour! If you create new databases once a day, don't bother automating it.

    On the other hand, I question why you have just one FULL backup a month - scary!
    Ed

  3. #3
    Newcomer
    Join Date
    Aug 2009
    Posts
    8
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default

    Thanks for your reply.

    My application creates databases every hour.

    Thanks,
    Ben

  4. #4
    Moderator moon-buddy's Avatar
    Join Date
    Aug 2005
    Location
    Somewhere in the US
    Posts
    5,857
    Thanks
    4
    Thanked 228 Times in 223 Posts

    Default

    When you say create every hour - do you mean a new instance on an existing database?
    Ed

  5. #5
    Newcomer
    Join Date
    Aug 2009
    Posts
    8
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default

    Sorry , I should have been more clear. I have this application that is used by (public) users. Whenever a new user registers on our webpage, Application creates a new mssql database for him/her. We have a recent upsurge in our application usage and more and more users are registering. Hence more database creations, around 20-30 a day.

    So, as I was saying before, I run all the database backups on to tape through TSM. I have no problem with the ones that have full backup, as the differentials run fine. But the ones that are newly created are failing on full backups. Right now, I am running full backups for the newly created ones manually every day. I was wondering if there is a way to automate it.

    Thanks,
    Ben

  6. #6
    Moderator moon-buddy's Avatar
    Join Date
    Aug 2005
    Location
    Somewhere in the US
    Posts
    5,857
    Thanks
    4
    Thanked 228 Times in 223 Posts

    Default

    Look at this post: http://adsm.org/forum/showthread.php...hlight=tdp+sql

    You can use the script I posted - modifying it of course - to run at the end-of-day a full backup of the newly created DB PRIOR to DIFF backup.
    Ed

  7. The Following User Says Thank You to moon-buddy For This Useful Post:

    microosoft (03-29-2012)

  8. #7
    Newcomer
    Join Date
    Aug 2009
    Posts
    8
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default

    Thanks, Ed.

    BTW, I was looking for something similar on the forum. I found this link very useful.

    http://adsm.org/forum/showthread.php...080#post107080

    Solved my purpose.

    Thanks.

Similar Threads

  1. Replies: 2
    Last Post: 11-15-2011, 04:58 PM
  2. Replies: 0
    Last Post: 10-01-2008, 04:58 PM
  3. Replies: 1
    Last Post: 03-04-2008, 10:23 AM
  4. Deleting a newly created export?
    By odyssey in forum Tape / Media Library
    Replies: 1
    Last Post: 07-20-2006, 04:30 AM
  5. Script For Daily Node Backups
    By sujith in forum Scripting
    Replies: 1
    Last Post: 07-09-2006, 02:16 PM

Tags for this Thread

Posting Permissions

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