Oracle Job學習與測試
Oracle Job學習與測試
<
<
目錄
1 JOB相關的程式
2 Jobs and Import/Export
3 How Jobs Execute
4 Job Queue Locks
5 常用的Interval
6 Notes
1 JOB相關的程式
1.1 Job queue(Jnnn) processes execute jobs in the job queue. For each instance, these job queue processes are dynamically spawned by a coordinator job queue(CJQ0) background process. The coordinator periodically selects jobs that are ready to run from the jobs shown in the DBA_JOBS view. It orders them by time, and then spawns Jnnn processes to run the selected jobs. Each Jnnn process executes one of the selected jobs.(後臺程式CJQ0動態地產生Jnnn程式,並從DBA_JOBS中選擇一個Job給產生的Jnnn.由Jnnn程式來執行JOB).
1.2 The JOB_QUEUE_PROCESS initialization parameter controls whether a coordinator job queue process is started by an instance.. If this parameter is set to 0, no coordinator job queue process is started at database startup, and consequently no job queue jobs are executed. The JOB_QUEUE_PROCESSES initialization parameter also specifies the maximum number of Jnnn processes that can concurrently run on an instance. The maximum number of processes that can be specified is 1000. (由引數JOB_QUEUE_PROCESS來決定在系統啟動的時候是否啟動CJQ0程式,同時也決定了在系統執行時最多可以產生多少個Jnnn程式)
2 Jobs and Import/Export
Jobs can be exported and imported. Thus, if you define a job in one database, you can transfer it to another database. When exporting and importing jobs, the job’s number, environment, and definition remain unchanged. If the job number of a job you want to import matches the number of a job already existing in the database, you will not be allowed to import that job. Submit the job as a new job in the database. (Job在Export, Import過程中,Job的屬性不會發生變化,如果JobID已被用,則不能匯入相同JOBID的作業,只有重建)
3 How Jobs Execute
When a Jnnn process runs a job, the job is run in the same environment in which it was submitted and with the owner’s default privileges. The owner must be explicitly granted the necessary object privileges for all objects referenced within the job definition. (Job Owner 必須擁有JOB所涉及到的物件的相應許可權)
Jnnn processes execute jobs. To execute a job, the process creates a session to run the job. When you force a job to run using the procedure DBMS_JOB.RUN, the job is run by your user process and with your default privileges only. Privileges granted to you through roles are unavailable. You must be explicitly granted the necessary object privileges for all objects referenced within the job definition. (對於DBMS_JOB.RUN所需的許可權,必須是顯式授予的,而不能是透過Role傳遞得到的. )
4 Job Queue Locks
Oracle uses job queue locks to ensure that a job is executed in only one session at a time. When a job is being run, its session acquires a job queue (JQ) lock for that job. You can use the locking views in the data dictionary to examine information about locks currently held by sessions. (Oracle用鎖來保證每一個Session只有一個Job在執行)
可用以下語句查詢相應的鎖資訊
Select SID, TYPE, ID1, ID2 FROM V$LOCK WHERE TYPE = ‘JQ’;
當JOB執行錯誤時,Oracle會以一定的間隔來重試執行,間隔的時間也逐步增加,但在嘗試16次後,Oracle將Broken JOB.
5 常用的Interval
1 Exactly seven days from the last execution:
SYSDATE + 7
2 EVERY HALF HOUR
SYSDATE + 1/48
3 Every Monday at 3PM
NEXT_DAY(TRUNC(SYSDATE),’’MONDAY’’) + 15/24
4 First Thursday of each quarter
NEXT_DAY(ADD_MONTHS(TRUNC(SYSDATE,’’Q’’),3),’’THURSDAY’’)
對於Interval是從上一次成功執行後開始計算的.假定一個JOB定在每隔7天執行,但某天,沒有執行,則下次執行的時間要在成功執行時間的後7天.
6 Notes
Job不能正常執行的原因檢查
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/10248702/viewspace-623797/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Oracle privilege學習與測試Oracle
- Oracle Roles學習與測試Oracle
- Oracle Audit 學習與測試Oracle
- Oracle DB Links學習與測試Oracle
- Oracle約束的學習與測試Oracle
- Oracle Audit學習與測試 參考文件Oracle
- Oracle SCN相關問題學習與測試Oracle
- 【JOB】Oracle JOB全面學習(DBMS_JOB和DBMS_SCHEDULER)Oracle
- RMAN Catalog 學習與測試
- oracle外部表的測試學習 (轉)Oracle
- Oracle Null 學習與測試_20091209OracleNull
- ResetLogs 選項學習與測試
- Elastic Job學習AST
- 全面學習ORACLE Scheduler特性(11)使用Job ClassesOracle
- 並行執行的學習與測試並行
- Oracle之Triggers學習與測試_20091229Oracle
- Oracle user and resource學習與測試_20100110Oracle
- 安全測試學習
- 效能測試學習(1)-效能測試分類與常見術語
- Oracle 11g 測試停庫對job的影響Oracle
- Quartz job scheduler 學習quartz
- redo log file 物理結構學習與測試
- oracle10g_expdp工具測試學習_之一Oracle
- oracle10g_impdp工具測試學習_之一Oracle
- javascript的學習測試JavaScript
- 測試學習SQL篇SQL
- 學習測試框架Mocha框架
- 單元測試學習
- Flutter 學習之路 - 測試(單元測試,Widget 測試,整合測試)Flutter
- 軟體測試學習教程—迴歸測試
- nologging選項的學習與測試
- Bitmap Indexes 學習與測試_20091213Index
- 學習筆記之測試筆記
- MySQL學習 - 基準測試MySql
- 學習旅途(軟體測試)
- 軟體測試整理學習
- js型別測試學習JS型別
- 【實驗】關於HWM(高水位)的學習與測試