You can run the generated T-SQL command by using the
New Query menu option to check whether the operation succeeds. If the command runs successfully, the scheduled backups will be successful.
If you want to use return codes in the generated T-SQL command, you must modify the command.
Consider the following example raw T-SQL command:
USE [master]
GO
DECLARE @returnCode int
EXEC @returnCode = dbo.emc_run_backup ' -c NMMDB154.nmmdev.com -l full -a "NSR_DFA_SI_DD_HOST=10.31.192.14" -a "NSR_DFA_SI_DD_USER=ddbma" -a "NSR_DFA_SI_DEVICE_PATH=/ddbma-sqlagent2" "MSSQL:Fabrics"'
PRINT @returnCode
GO
Consider the following example T-SQL command with return codes:
DECLARE @returnCode int
EXEC @returnCode = dbo.emc_run_backup ' -c NMMDA224.heroines.local -l full -a "NSR_DFA_SI_DD_HOST=10.31.77.27" -a "NSR_DFA_SI_DD_USER=ost112" -a "NSR_DFA_SI_DEVICE_PATH=/heroines" "MSSQL:CopyOftest_db_1" "MSSQL:db1"'
IF @returnCode <>0
BEGIN
RAISERROR ('Fail!', 16, 1)
END
If the return code is error, the job step fails.
NOTE The last two parameters, 16 and 1 are necessary to raise an error if a job step fails.
On the
Advanced page, specify the following fields:
On success action: Select whether to proceed to the next job step or quit the current job step and report success, after the current job step succeeds.
Specify the other fields according to your requirements.
Click
OK.
On the
Schedules page, click
New to schedule a job.
In the
Job Schedule Properties window, specify appropriate information in the corresponding fields, and then click
OK.
On the
Alerts page, click
Add to create an alert that will perform a job when a certain event occurs.
In the
New Alert window:
On the
General page, specify the following fields.
Name: Type a name for the alert.
Type: Select the type of the event.
Specify the appropriate information in the other fields.
On the
Response page, specify the following fields:
Notify operators: Select this option to send a message to the operators about the job step status.
New Operator: Click this button to add an operator to the
Operator list.
On the
Options page, configure a method, such as E-mail, Pager, or Net Send, to notify operators about the status of the job step.
On the
Notifications page, under
Actions to perform when the job completes, select the appropriate notification methods to notify operators about the status of the job step.
On the
Targets page, select Target local server.
Click
OK.
Next steps
To check the status of a job, either right-click the job and select
View History or review the log files in the
nsr/applogs/ folder.
Data is not available for the Topic
Please provide ratings (1-5 stars).
Please provide ratings (1-5 stars).
Please provide ratings (1-5 stars).
Please select whether the article was helpful or not.
Comments cannot contain these special characters: <>()\