12.07.2015 Views

Solution Guide for Migrating Oracle on UNIX to SQL Server - Willy .Net

Solution Guide for Migrating Oracle on UNIX to SQL Server - Willy .Net

Solution Guide for Migrating Oracle on UNIX to SQL Server - Willy .Net

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

216 Developing: Applicati<strong>on</strong>s — <str<strong>on</strong>g>Migrating</str<strong>on</strong>g> <str<strong>on</strong>g>Oracle</str<strong>on</strong>g> <strong>SQL</strong> and PL/<strong>SQL</strong>●●●This is the e-mail address of the pers<strong>on</strong> <strong>to</strong> send e-mail <strong>to</strong> when EMAIL_LEVEL isreached.[ @NOTIFY_NETSEND_OPERATOR_NAME = ] 'NETSEND_NAME'Name of the opera<strong>to</strong>r <strong>to</strong> whom the network message is sent up<strong>on</strong> completi<strong>on</strong> ofthis job.[ @NOTIFY_PAGE_OPERATOR_NAME = ] 'PAGE_NAME'Name of the pers<strong>on</strong> <strong>to</strong> page up<strong>on</strong> completi<strong>on</strong> of this job.[ @DELETE_LEVEL = ] DELETE_LEVELThis value indicates when <strong>to</strong> delete the job. This uses the same values as listed inTable 11.18.The following example shows how <strong>to</strong> create a job from the s<strong>to</strong>red procedure. This createsa job named FILE2. The job is enabled with the notificati<strong>on</strong> level of zero. No notificati<strong>on</strong>swill be created up<strong>on</strong> success or failure. Opera<strong>to</strong>r DBO is assigned as owner <str<strong>on</strong>g>for</str<strong>on</strong>g> this job.USE MSDBEXEC SP_ADD_JOB @JOB_NAME = 'FILE2',@ENABLED = 1,@DESCRIPTION = 'FILE DUMP JOB',@OWNER_LOGIN_NAME = 'DBO',@NOTIFY_LEVEL_EVENTLOG = 0,@NOTIFY_LEVEL_EMAIL = 0,@NOTIFY_LEVEL_NETSEND = 0,@NOTIFY_LEVEL_PAGE = 0,@DELETE_LEVEL = 0After the job is created, it must have some steps <strong>to</strong> execute. The steps define thefuncti<strong>on</strong> of the job. The following example runs a Data Trans<str<strong>on</strong>g>for</str<strong>on</strong>g>mati<strong>on</strong> package by usingthe DTSRUN utility. SUBSYSTEM should be CMDEXEC <strong>to</strong> run any utility from a job.USE MSDBEXEC SP_ADD_JOBSTEP @JOB_NAME = 'FILE2',@STEP_NAME = 'STEP1 IN FILE2',@SUBSYSTEM = 'CMDEXEC',@COMMAND = 'DTSRUN /S "(LOCAL)" /N "FILETRANSFER" /U "SA" /P "SA" ',@RETRY_ATTEMPTS = 5,@RETRY_INTERVAL = 5@SUBSYSTEM is used by the <strong>SQL</strong> <strong>Server</strong> agent service. The available values aredescribed in Table 11.19.Table 11.19: Values <str<strong>on</strong>g>for</str<strong>on</strong>g> @SUBSYSTEM <str<strong>on</strong>g>for</str<strong>on</strong>g> SP_ADD_JOBSubsystem TypeACTIVESCRIPTINGCMDEXECDISTRIBUTIONSNAPSHOTLOGREADERMERGE'T<strong>SQL</strong>' (default)Descripti<strong>on</strong>Active ScriptOperating-system command or executable programReplicati<strong>on</strong> Distributi<strong>on</strong> Agent jobReplicati<strong>on</strong> Snapshot Agent jobReplicati<strong>on</strong> Log Reader Agent jobReplicati<strong>on</strong> Merge Agent jobTransact-<strong>SQL</strong> statement@COMMANDis the actual command <strong>to</strong> execute. In the following example, the DTSRUNutility is used. Any executable can be called using @COMMAND.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!