SQL Server timing job setting method

xiaoxiao2021-03-06  40

If you need timing in SQL Server, you can perform a SQL statement within a stored procedure or 3200 characters every other period of time, you can use the Administration -> SQL Server Agent -> Job. 1. Management -> SQL Server Agent -> Job (Right-click) -> New Job -> 2, New Job Properties (General) -> Name [Customize the name of this job] -> In the box, Tcloth -> Category Also available can also be used by default [Local)] -> owner defaults to SQL Server users [or choose other login] -> Description [Fill in this work Detailed description]; [Create a job classification step: SQL Server Agent -> Job -> Right click All Tasks -> Add, Modify, Remove] 3, New Job Properties (Step) -> New -> Steps Name [Custom First Step Name] -> Type [Transact-SQL (TSQL) script] -> Database [To operate the database] -> command [If it is a simple SQL to write directly, you can also use the open button to enter a written * .sql file If you want to perform a stored procedure, fill in EXEC P_PROCE_NAME V_PARAMETER1, [V_Parameter2 ... V_Parametern]] -> OK (if there are multiple steps, you can call the new button below again; you can also insert, edit, delete the existing steps. 4, build the job property (scheduling) -> New Scheduling -> Name [Custom Scheduling Name] -> Input box is the - -> Schedule -> Repeated appearance -> Change [Scheduling Timetable] -> OK (If you want to save this job, don't schedule you can remove the enabled boxes); 5, build job properties (notifications) -> Use the default notification method to be fine [When the job fails, write Windows applications Program System Log] -> OK. Some SQL Server knowledge related to the job: SQL ServerAgent service must run normally, starting its NT login user to match the NT login user of the SQL Server database. Point job Right click to view the history of job execution, or immediately start the job and stop job. Recently, when I saw a history history, I found a history of the history record. There were fewer history records for the records of job records. How can some jobs reserve some time according to their needs, such as retaining a month history Record. Look at the online help documentation of SQL Server, introduce: in Administration -> SQL Server Agent -> Right-click Properties -> Job System -> Limit Job History Log Size -> Job History Logs The maximum size of the log log ( Number of lines) The default is 1000 If a machine has a lot of jobs, it must improve it, for example, the maximum number of lines of 100,000 per job history log is that 100 If the job is executed twice a day, it is necessary to keep a month log. It can be set to 60 to have a mutual restrictive relationship, we can change according to your needs. If the SQL Server server changes the machine name, management is the job created when the old name is established, it may encounter an error 14274: Unable to add, Update or delete a job initiated from the MSX server (or its step or scheduling) to see Microsoft's document: http://support.microsoft.com/default.aspx? ScID = Kb; EN-US; 281642 Search SQL Server 2000 In the system msdb..sysjobs, the originating_server field is stored in the name of the original server. 24X7 is definitely cautioned by the system that cannot be said to change the name and change the name in the above Microsoft document.

转载请注明原文地址:https://www.9cbs.com/read-68146.html

New Post(0)