AWR需要禁用?这么好的东东。缺省的情况下,AWR是可以使用的,需要耗用一定的sysaux表空间。但涉及到有关AWR相关的调试包(需要li
AWR需要禁用?这么好的东东。缺省的情况下,AWR是可以使用的,需要耗用一定的sysaux表空间。但涉及到有关AWR相关的调试包(需要license)会访问AWR视图或者awr异常又不想更新patch,甚至没有patch可用的情况下,我们可以禁用AWR以及卸载AWR,本文演示了如果禁用AWR功能以及卸载awr相关的数据字典。
1、禁用AWR的目的
If most of the space in the SYSAUX tablespace is consumed by information associated with the Automatic Workload Repository (AWR), the AWR can be disabled or uninstalled, releasing space in the sysaux tablespace. This is specially relevant to customers who do not have a license to use AWR.
2、如何禁用AWR(Oracle 10g and above)
AWR is enabled by default because many database features that are not part of the Diagnostic Pack such as Automatic Segment Advisor and Undo Advisor need information captured in AWR. Use of these features, which implicitly access some AWR views, does not require Diagnostic Pack license.
What is not permitted without the Diagnostic Pack license is direct access by customers of AWR views and reports. Oracle, therefore, recommends that all customers, with or without Diagnostic Pack license, leave AWR enabled so that they can benefit from features that do not require a license but implicitly use AWR. (When running both AWR and Statspack collection on one database, it is advised to schedule the two types of collections at different times. For example, if the AWR takes a snapshot every hour, on the hour, then you could schedule a Statspack snapshot every hour, at the bottom of each hour.)
However, for those users who all the same want to disable AWR, the package DBMS_AWR described below can be instaled and used. The package gives the ability to disable and enable AWR so as not to breaching Diagnostic Pack license terms.
Affected Releases:
All Oracle Database 10g releases and onwards
禁用awr需要下载: dbmsnoawr.plb 文件。
------------------------------------------分割线------------------------------------------
免费下载地址在
用户名与密码都是
具体下载目录在 /2014年资料/9月/12日/禁用与卸载Oracle AWR特性
下载方法见
------------------------------------------分割线------------------------------------------
注意这里的禁用我们指的是完全停用。当然通过设置STATISTICS_LEVEL也可以从一定程度上实现类似的目的。
如果将参数STATISTICS_LEVEL设置为BASIC,下列重要的统计信息将不会被收集。
Automatic Workload Repository (AWR) Snapshots
Automatic Database Diagnostic Monitor (ADDM)
All server-generated alerts
Automatic SGA Memory Management
Automatic optimizer statistics collection
Object level statistics
End to End Application Tracing (V$CLIENT_STATS)
Database time distribution statistics (V$SESS_TIME_MODEL and V$SYS_TIME_MODEL)
Service level statistics
Buffer cache advisory
MTTR advisory
Shared pool sizing advisory
Segment level statistics
PGA Target advisory
Timed statistics
Monitoring of statistics
3、演示禁用AWR
oracle@USDB:~> export ORACLE_SID=HKBO5
oracle@USDB:~> sqlplus / as sysdba
sys@HKBO5> select * from v$version where rownum
BANNER
----------------------------------------------------------------
Oracle Database 10g Release 10.2.0.3.0 - 64bit Production
--查看禁用前awr的使用频率
sys@HKBO5> SELECT name,
2 detected_usages detected,
3 total_samples samples,
4 currently_used used,
5 to_char(last_sample_date,'MMDDYYYY:HH24:MI') last_sample,
6 sample_interval interval
7 FROM dba_feature_usage_statistics
8 WHERE name = 'Automatic Workload Repository';
NAME DETECTED SAMPLES USED LAST_SAMPLE INTERVAL
---------------------------------------------------------------- ---------- ---------- ----- -------------- ----------
Automatic Workload Repository 0 207 FALSE 09112014:00:12 604800
oracle@USDB:~> ll *awr*
-rw-r--r-- 1 oracle oinstall 2369 2014-08-21 17:26 dbmsnoawr.plb
--Author : Leshami
--Blog :
--执行dbmsnoawr.plb,,其实质是添加了一个名为dbms_awr的pkg到当前数据库
sys@HKBO5> @dbmsnoawr.plb
Package created.
Package body created.
sys@HKBO5> exec dbms_awr.disable_awr();
PL/SQL procedure successfully completed.
sys@HKBO5> desc dbms_awr
FUNCTION AWR_ENABLED RETURNS BOOLEAN
FUNCTION AWR_STATUS RETURNS VARCHAR2
PROCEDURE DISABLE_AWR
PROCEDURE ENABLE_AWR
--查看disable后awr的状态,返回值为disable
sys@HKBO5> select dbms_awr.awr_status from dual;
AWR_STATUS
-------------------------------------------------------------
DISABLED
--查询awr的数据字典,发现SNAP_INTERVAL变成了0值
sys@HKBO5> select * from dba_hist_wr_control;

MySQL通過異步、半同步和組複製三種模式處理數據複製。 1)異步複製性能高但可能丟失數據。 2)半同步複製提高數據安全性但增加延遲。 3)組複製支持多主複製和故障轉移,適用於高可用性需求。

EXPLAIN語句可用於分析和提升SQL查詢性能。 1.執行EXPLAIN語句查看查詢計劃。 2.分析輸出結果,關注訪問類型、索引使用情況和JOIN順序。 3.根據分析結果,創建或調整索引,優化JOIN操作,避免全表掃描,以提升查詢效率。

使用mysqldump進行邏輯備份和MySQLEnterpriseBackup進行熱備份是備份MySQL數據庫的有效方法。 1.使用mysqldump備份數據庫:mysqldump-uroot-pmydatabase>mydatabase_backup.sql。 2.使用MySQLEnterpriseBackup進行熱備份:mysqlbackup--user=root--password=password--backup-dir=/path/to/backupbackup。恢復時,使用相應的命

MySQL慢查詢的主要原因包括索引缺失或不當使用、查詢複雜度、數據量過大和硬件資源不足。優化建議包括:1.創建合適的索引;2.優化查詢語句;3.使用分錶分區技術;4.適當升級硬件。

MySQL視圖是基於SQL查詢結果的虛擬表,不存儲數據。 1)視圖簡化複雜查詢,2)增強數據安全性,3)維護數據一致性。視圖是數據庫中的存儲查詢,可像表一樣使用,但數據動態生成。

mysqldiffersfromothersqldialectsinsyntaxforlimit,自動啟動,弦樂範圍,子征服和表面上分析。 1)MySqluessLipslimit,whilesqlserverusestopopandoraclesrontersrontsrontsrontsronnum.2)

MySQL分區能提升性能和簡化維護。 1)通過按特定標準(如日期範圍)將大表分成小塊,2)物理上將數據分成獨立文件,3)查詢時MySQL可專注於相關分區,4)查詢優化器可跳過不相關分區,5)選擇合適的分區策略並定期維護是關鍵。

在MySQL中,如何授予和撤銷權限? 1.使用GRANT語句授予權限,如GRANTALLPRIVILEGESONdatabase_name.TO'username'@'host';2.使用REVOKE語句撤銷權限,如REVOKEALLPRIVILEGESONdatabase_name.FROM'username'@'host',確保及時溝通權限變更。


熱AI工具

Undresser.AI Undress
人工智慧驅動的應用程序,用於創建逼真的裸體照片

AI Clothes Remover
用於從照片中去除衣服的線上人工智慧工具。

Undress AI Tool
免費脫衣圖片

Clothoff.io
AI脫衣器

Video Face Swap
使用我們完全免費的人工智慧換臉工具,輕鬆在任何影片中換臉!

熱門文章

熱工具

PhpStorm Mac 版本
最新(2018.2.1 )專業的PHP整合開發工具

VSCode Windows 64位元 下載
微軟推出的免費、功能強大的一款IDE編輯器

SublimeText3 Mac版
神級程式碼編輯軟體(SublimeText3)

MantisBT
Mantis是一個易於部署的基於Web的缺陷追蹤工具,用於幫助產品缺陷追蹤。它需要PHP、MySQL和一個Web伺服器。請查看我們的演示和託管服務。

Dreamweaver CS6
視覺化網頁開發工具