oracle10g自動分析任務
dbms_scheduler
select owner,job_name,program_name from dba_scheduler_jobs;
停止啟動分析:
exec dbms_scheduler.disable('SYS.GATHER_STATS_JOB');
exec dbms_scheduler.enable('SYS.GATHER_STATS_JOB');
查詢建立好的PROGRAM:
SQL> SELECT PROGRAM_NAME,PROGRAM_ACTION FROM DBA_SCHEDULER_PROGRAMS
2 WHERE PROGRAM_NAME='GATHER_STATS_PROG'
3 ;
PROGRAM_NAME PROGRAM_ACTION
------------------------------ --------------------------------------------------------------------------------
GATHER_STATS_PROG dbms_stats.gather_database_stats_job_proc
SQL>
建立PROGRAM的過程:
BEGIN
-- PL/SQL Block.
DBMS_SCHEDULER.create_program (
program_name => 'test_plsql_block_prog',
program_type => 'PLSQL_BLOCK',
program_action => 'BEGIN DBMS_STATS.gather_schema_stats(''SCOTT''); END;',
enabled => TRUE,
comments => 'Program to gather SCOTT''s statistics using a PL/SQL block.');
-- Shell Script.
DBMS_SCHEDULER.create_program (
program_name => 'test_executable_prog',
program_type => 'EXECUTABLE',
program_action => '/u01/app/oracle/dba/gather_scott_stats.sh',
number_of_arguments => 0,
enabled => TRUE,
comments => 'Program to gather SCOTT''s statistics us a shell script.');
-- Stored Procedure with Arguments.
DBMS_SCHEDULER.create_program (
program_name => 'test_stored_procedure_prog',
program_type => 'STORED_PROCEDURE',
program_action => 'DBMS_STATS.gather_schema_stats',
number_of_arguments => 1,
enabled => FALSE,
comments => 'Program to gather SCOTT''s statistics using a stored procedure.');
DBMS_SCHEDULER.define_program_argument (
program_name => 'test_stored_procedure_prog',
argument_name => 'ownname',
argument_position => 1,
argument_type => 'VARCHAR2',
default_value => 'SCOTT');
DBMS_SCHEDULER.enable (name => 'test_stored_procedure_prog');
END;
/[@more@]
select owner,job_name,program_name from dba_scheduler_jobs;
停止啟動分析:
exec dbms_scheduler.disable('SYS.GATHER_STATS_JOB');
exec dbms_scheduler.enable('SYS.GATHER_STATS_JOB');
查詢建立好的PROGRAM:
SQL> SELECT PROGRAM_NAME,PROGRAM_ACTION FROM DBA_SCHEDULER_PROGRAMS
2 WHERE PROGRAM_NAME='GATHER_STATS_PROG'
3 ;
PROGRAM_NAME PROGRAM_ACTION
------------------------------ --------------------------------------------------------------------------------
GATHER_STATS_PROG dbms_stats.gather_database_stats_job_proc
SQL>
建立PROGRAM的過程:
BEGIN
-- PL/SQL Block.
DBMS_SCHEDULER.create_program (
program_name => 'test_plsql_block_prog',
program_type => 'PLSQL_BLOCK',
program_action => 'BEGIN DBMS_STATS.gather_schema_stats(''SCOTT''); END;',
enabled => TRUE,
comments => 'Program to gather SCOTT''s statistics using a PL/SQL block.');
-- Shell Script.
DBMS_SCHEDULER.create_program (
program_name => 'test_executable_prog',
program_type => 'EXECUTABLE',
program_action => '/u01/app/oracle/dba/gather_scott_stats.sh',
number_of_arguments => 0,
enabled => TRUE,
comments => 'Program to gather SCOTT''s statistics us a shell script.');
-- Stored Procedure with Arguments.
DBMS_SCHEDULER.create_program (
program_name => 'test_stored_procedure_prog',
program_type => 'STORED_PROCEDURE',
program_action => 'DBMS_STATS.gather_schema_stats',
number_of_arguments => 1,
enabled => FALSE,
comments => 'Program to gather SCOTT''s statistics using a stored procedure.');
DBMS_SCHEDULER.define_program_argument (
program_name => 'test_stored_procedure_prog',
argument_name => 'ownname',
argument_position => 1,
argument_type => 'VARCHAR2',
default_value => 'SCOTT');
DBMS_SCHEDULER.enable (name => 'test_stored_procedure_prog');
END;
/[@more@]
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/18921899/viewspace-1017717/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 自動備份任務
- Oracle自動維護任務Oracle
- 自動執行任務crontab
- windows自動任務問題Windows
- Linux 自動任務crontabLinux
- 任務異常自動告警
- ORA-07445處理分析 關閉自動化任務
- RMAN自動備份任務新增
- 快速部署crontab自動排程任務
- Statspack之五-規劃自動任務
- windows 下建立自動執行任務Windows
- 定時自動啟動任務crontab命令用法
- 什麼是任務自動化與流程自動化? - infoworld
- 如何使用 cron 任務在 Linux 中計劃和自動化任務Linux
- 轉:Grunt:任務自動管理工具
- ORACLE 11G 自動維護任務Oracle
- [Linux]crontab定時任務自動化Linux
- 使用 Bash 自動執行復雜任務
- [zt]Oracle10g自動優化統計-檢查GATHER_STATS_JOB任務的執行情況Oracle優化
- 如何使用ChatGPT來自動化Python任務ChatGPTPython
- OCP課程58:管理II之自動任務
- 自動化任務執行器 Grunt 迅速上手
- 資料庫自動維護任務的管理資料庫
- 微商城系統之商家平臺任務自動分析處理系統_OctShop
- 需求分析的任務
- 任務拆解,悠然自得,自動版本的ChatGPT,AutoGPT自動人工智慧AI任務實踐(Python3.10)ChatGPT人工智慧AIPython
- Oracle10g自動生成AWR分析報告的指令碼Oracle指令碼
- xtrabackup備份mysql以及建立自動定時任務MySql
- 使用gulp編寫常用自動化構建任務
- 寶塔兩種方式編寫 crontab 自動任務
- dotnet使用Selenium執行自動化任務
- ORACLE11G自動維護任務簡析Oracle
- EM自動任務導致資料庫緩慢資料庫
- Oracle10g自動當機Oracle
- 專案管理軟體設定任務流程自動化專案管理
- 解決網路自動化風險和任務的方法
- 以WBS模板和PBS自動生成WBS計劃任務
- LiteOS-任務篇-原始碼分析-任務排程函式原始碼函式