flush sql
如果Oracle的最佳化器產生了某種錯誤的執行計劃,或者我們希望Oracle對於某個SQL重新進行分析,那麼就需要這個SQL的執行計劃在共享池中過期。
在業務時段不可能使用alter system flush shared_pool的方式
SQL> select sql_id, address, hash_value, executions, loads, parse_calls, invalidations from v$sqlarea where lower(sql_text) like '%test%';
SQL_ID ADDRESS HASH_VALUE EXECUTIONS LOADS PARSE_CALLS
------------- ---------------- ---------- ---------- ---------- -----------
INVALIDATIONS
-------------
bmgz3h5qtng75 000000007866D210 1838824677 1 4 1
3
0kxrz1ugtjpkm 00000000783DD930 2677593683 1 1 1
0
bb926a5dcb8kr 0000000078941CE0 1522901591 21 2 21
0
SQL_ID ADDRESS HASH_VALUE EXECUTIONS LOADS PARSE_CALLS
------------- ---------------- ---------- ---------- ---------- -----------
INVALIDATIONS
-------------
a5ks9fhw2v9s1 0000000079701150 942515961 1 1 1
0
SQL> exec dbms_shared_pool.purge('0000000079701150,942515961','c');
PL/SQL procedure successfully completed.
SQL> select sql_id, address, hash_value, executions, loads, parse_calls, invalidations from v$sqlarea where lower(sql_text) like '%test%';
SQL_ID ADDRESS HASH_VALUE EXECUTIONS LOADS PARSE_CALLS
------------- ---------------- ---------- ---------- ---------- -----------
INVALIDATIONS
-------------
bmgz3h5qtng75 000000007866D210 1838824677 1 4 1
3
0kxrz1ugtjpkm 00000000783DD930 2677593683 2 1 2
0
bb926a5dcb8kr 0000000078941CE0 1522901591 21 2 21
0
在業務時段不可能使用alter system flush shared_pool的方式
SQL> select sql_id, address, hash_value, executions, loads, parse_calls, invalidations from v$sqlarea where lower(sql_text) like '%test%';
SQL_ID ADDRESS HASH_VALUE EXECUTIONS LOADS PARSE_CALLS
------------- ---------------- ---------- ---------- ---------- -----------
INVALIDATIONS
-------------
bmgz3h5qtng75 000000007866D210 1838824677 1 4 1
3
0kxrz1ugtjpkm 00000000783DD930 2677593683 1 1 1
0
bb926a5dcb8kr 0000000078941CE0 1522901591 21 2 21
0
SQL_ID ADDRESS HASH_VALUE EXECUTIONS LOADS PARSE_CALLS
------------- ---------------- ---------- ---------- ---------- -----------
INVALIDATIONS
-------------
a5ks9fhw2v9s1 0000000079701150 942515961 1 1 1
0
SQL> exec dbms_shared_pool.purge('0000000079701150,942515961','c');
PL/SQL procedure successfully completed.
SQL> select sql_id, address, hash_value, executions, loads, parse_calls, invalidations from v$sqlarea where lower(sql_text) like '%test%';
SQL_ID ADDRESS HASH_VALUE EXECUTIONS LOADS PARSE_CALLS
------------- ---------------- ---------- ---------- ---------- -----------
INVALIDATIONS
-------------
bmgz3h5qtng75 000000007866D210 1838824677 1 4 1
3
0kxrz1ugtjpkm 00000000783DD930 2677593683 2 1 2
0
bb926a5dcb8kr 0000000078941CE0 1522901591 21 2 21
0
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/26870952/viewspace-2142218/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 11G can flush one SQL Cursor out of shared poolSQL
- PHP的ob_flush()與flush()區別PHP
- innodb_flush_method和innodb_flush_log_at_trx_commitMIT
- FenceSyne, flush, waitAI
- Hibernate flush理解
- mysql關於FLUSH TABLES和FLUSH TABLES WITH READ LOCK的理解MySql
- mysql flush 命令詳解MySql
- kill flush tables的思考
- mysql下的flush操作MySql
- innodb_flush_log_at_trx_commit和sync_binlog innodb_flush_methodMIT
- 【Mysql】FLUSH TABLES WITH READ LOCKMySql
- innodb_flush_log_at_trx_commitMIT
- MySQL:unblock with 'mysqladmin flush-hosts'MySqlBloC
- flush logs時做的操作
- 關於MYSQL flush table的作用MySql
- gc cr request 'gcs log flush sync'GC
- [20221015]mmon_slave sql_id=c9umxngkc3byq Automatic Report Flush.sqlSQL
- MySQL學習之flush(刷髒頁)MySql
- MySQL5.7 Waiting FOR TABLE FLUSHMySqlAI
- Oracle中flush buffer cache和x$bhOracle
- Active Session History (ASH) performed an emergency flushSessionORM
- MySQL Flush導致的等待問題MySql
- 使用 BufferedWriter 記得輸出文字時 flush()
- session效能的影響,後臺 flush dirtySession
- 討論:關於The REBIND utility and the FLUSH PACKAGE CACHEPackage
- Oracle10g - Private Strand Flush Not CompleteOracle
- exec dbms_stats.FLUSH_DATABASE_MONITORING_INFO;Database
- 非易失性WAL BUFFER解析:flush WAL改造
- PostgreSQL DBA(66) - 配置引數(checkpoint_flush_after)SQL
- MySQL:Analyze table導致'waiting for table flush'MySqlAI
- cache操作:clean、invalidate與flush的含義
- flush 快取對inmemory有什麼影響?快取
- MySQL必須flush privileges的兩種情況MySql
- Hibernate中flush機制的詳細理解
- [20170215]再次理解flush redo.txt
- mysql效能引數innodb_flush_log_at_trx_commitMySqlMIT
- MySQL 5.5 FLUSH TABLES WITH READ LOCK語句介紹MySql
- gc current block pin time gc current block flush time 疑惑GCBloC