Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
HenkTrumpie
Starting Member
3 Posts |
Posted - 2008-10-14 : 07:29:12
|
Hi there,I am very new in this. I do work with SQL databases a lot, especially in the filed I am working with. I am a BMC Control-M Consultant, and one problem that I have found is to run and submit MSSQL packages/Stored Procedures and backups with Control-M. Here is a command line interface to do this:osql -S SMIN7ND01 -U user -P pass -d msdb -Q "EXEC dbo.sp_start_job N'SystemDB Backups'"The biggest problem with this is, that when it is submitted from BMC COntrol-M the task within Control-M ends, and is successful, for it does not know what the package/Stored Procedure or backup is doing within MSSQL. At the moment we are sending a condition using a utility of Control-M in the backup to send us a failure or success.Does anyone have a script which we can use to do this and submit the backup, and it will wait for the return of the success or failure of the backup before it actually ends?This is urgent for we are busy rolling out a very large orginization which half of the tasks are based within MSSQL.Kind RegardsHenk Trumpie  |
|
|
CDP
Starting Member
2 Posts |
Posted - 2008-10-14 : 15:22:53
|
Hi,Change the -Q to a -q and osql will wait for the backup command to complete.quote: Originally posted by HenkTrumpie Hi there,I am very new in this. I do work with SQL databases a lot, especially in the filed I am working with. I am a BMC Control-M Consultant, and one problem that I have found is to run and submit MSSQL packages/Stored Procedures and backups with Control-M. Here is a command line interface to do this:osql -S SMIN7ND01 -U user -P pass -d msdb -Q "EXEC dbo.sp_start_job N'SystemDB Backups'"The biggest problem with this is, that when it is submitted from BMC COntrol-M the task within Control-M ends, and is successful, for it does not know what the package/Stored Procedure or backup is doing within MSSQL. At the moment we are sending a condition using a utility of Control-M in the backup to send us a failure or success.Does anyone have a script which we can use to do this and submit the backup, and it will wait for the return of the success or failure of the backup before it actually ends?This is urgent for we are busy rolling out a very large orginization which half of the tasks are based within MSSQL.Kind RegardsHenk Trumpie 
Chris.DBA @ The Pythian Groupwww.pythian.com |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
HenkTrumpie
Starting Member
3 Posts |
Posted - 2008-10-15 : 03:45:45
|
| Hi there Chris and Tara,Thank you so much for your input...I will definitly use them and test them...I am sure it will work 100%henk |
 |
|
|
HenkTrumpie
Starting Member
3 Posts |
Posted - 2008-10-15 : 06:39:47
|
| Hi there Tara and Chris,I have tried the -q option instead of the -Q option, which submit the backup, and it stay there...The problem is now that it does not end when the backup ends...Any ideas why t would happen?Henk |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
|
|
|
|
|