create subfolder each DB when backup log performed
-
Tuesday, May 08, 2012 7:23 AM
dear all
I'm newbie on SQL Server I want to the folder will be automatically created for each DB's name when Log backup performed..???
anybody has scripts?? please help me..
Thanks for any helps
Regards
All Replies
-
Tuesday, May 08, 2012 7:32 AMAnswerer
Old DOS command
SET @CommandString = 'IF NOT EXIST "' + @LocalBackupPath + '\' + @name + '" MD "' + @LocalBackupPath + '\' + @name + '"'
EXEC xp_cmdshell @CommandStringBest Regards, Uri Dimant SQL Server MVP http://dimantdatabasesolutions.blogspot.com/ http://sqlblog.com/blogs/uri_dimant/
-
Tuesday, May 08, 2012 7:34 AM
Use Maintenance Plan, and you will have that option.SKG: Please Marked as Answered, if it resolves your issue. (b: http://sudeeptaganguly.wordpress.com)
- Proposed As Answer by BalmukundMicrosoft Employee, Moderator Tuesday, May 08, 2012 7:56 AM
-
Tuesday, May 08, 2012 8:00 AMModerator
As Sudeepta mentioned, here is the image.
Balmukund Lakhani | Please mark solved if I've answered your question, vote for it as helpful to help other user's find a solution quicker
--------------------------------------------------------------------------------
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------------------------------------------------------------------
My Blog | Team Blog | @Twitter -
Tuesday, May 08, 2012 8:25 AM
Thanks Balmukund & Sudeepta,
But I'd like run this script(Backup Log) automatically when one of DB's used logspace > 80%....e
is it possible with maintenance plan??
thanks
-
Tuesday, May 08, 2012 8:28 AMModerator
MP don't have that kind of trigger.Thanks Balmukund & Sudeepta,
But I'd like run this script(Backup Log) automatically when one of DB's used logspace > 80%....e
is it possible with maintenance plan??
thanks
Balmukund Lakhani | Please mark solved if I've answered your question, vote for it as helpful to help other user's find a solution quicker
--------------------------------------------------------------------------------
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------------------------------------------------------------------
My Blog | Team Blog | @Twitter -
Tuesday, May 08, 2012 9:04 AMAnswerer
Include in your backup script the code I posted above....Best Regards, Uri Dimant SQL Server MVP http://dimantdatabasesolutions.blogspot.com/ http://sqlblog.com/blogs/uri_dimant/
- Proposed As Answer by BalmukundMicrosoft Employee, Moderator Tuesday, May 08, 2012 9:05 AM
-
Tuesday, May 08, 2012 10:22 AM
Hello Urang,
Please see the screen shots below to get the exact procedure.
Hope it helped you..If yes then please marked it as answer.
All the best :)
For more details go to the following link.
- Edited by Vimarsh Tuesday, May 08, 2012 10:30 AM Extra information
- Proposed As Answer by GodzillaReturnsBanned Tuesday, May 08, 2012 11:45 AM
- Unproposed As Answer by Jonathan KehayiasMVP, Moderator Tuesday, May 08, 2012 1:29 PM
-
Tuesday, May 08, 2012 11:35 AMModerator
dear all
I'm newbie on SQL Server I want to the folder will be automatically created for each DB's name when Log backup performed..???
anybody has scripts?? please help me..
Thanks for any helps
Regards
Yes, Ola Hallengren's scripts do this exact type of functionality:
http://ola.hallengren.com/
This is one of the best set of database backup, integrity check, and maintenance scripts available and it is completely free. It's also been the winner of the SQL Server Magazine Gold Award for best free tool for the last few years. I recommend these scripts to all of my consulting clients.
Jonathan Kehayias | Principal Consultant, SQLSkills.com
SQL Server MVP | Microsoft Certified Master: SQL Server 2008
Author of Troubleshooting SQL Server: A Guide for Accidental DBAs
Feel free to contact me through My Blog or Twitter. Become a SQLskills Insider!
Please click the Mark as Answer button if a post solves your problem!- Proposed As Answer by BalmukundMicrosoft Employee, Moderator Tuesday, May 08, 2012 11:37 AM
- Marked As Answer by amber zhangModerator Tuesday, May 15, 2012 7:52 AM
-
Tuesday, May 08, 2012 11:37 AMModerator
The MP itself doesn't have that trigger, but the Agent Alert for logspace > 80% can execute the Backup Log job step from the MP to do the backup, so it's not impossible with MPs.Jonathan Kehayias | Principal Consultant, SQLSkills.com
SQL Server MVP | Microsoft Certified Master: SQL Server 2008
Author of Troubleshooting SQL Server: A Guide for Accidental DBAs
Feel free to contact me through My Blog or Twitter. Become a SQLskills Insider!
Please click the Mark as Answer button if a post solves your problem!- Proposed As Answer by amber zhangModerator Wednesday, May 09, 2012 2:37 AM
- Marked As Answer by amber zhangModerator Tuesday, May 15, 2012 7:52 AM
-
Tuesday, May 08, 2012 11:38 AMModerator
I agree with Jonathan!Yes, Ola Hallengren's scripts do this exact type of functionality:
Balmukund Lakhani | Please mark solved if I've answered your question, vote for it as helpful to help other user's find a solution quicker
--------------------------------------------------------------------------------
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------------------------------------------------------------------
My Blog | Team Blog | @Twitter

