溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊(cè)×
其他方式登錄
點(diǎn)擊 登錄注冊(cè) 即表示同意《億速云用戶服務(wù)條款》

怎么在Oracle12.2或更高版本上為PDB級(jí)別創(chuàng)建AWR

發(fā)布時(shí)間:2021-08-27 14:26:35 來(lái)源:億速云 閱讀:159 作者:chen 欄目:關(guān)系型數(shù)據(jù)庫(kù)

這篇文章主要介紹“怎么在Oracle12.2或更高版本上為PDB級(jí)別創(chuàng)建AWR”,在日常操作中,相信很多人在怎么在Oracle12.2或更高版本上為PDB級(jí)別創(chuàng)建AWR問(wèn)題上存在疑惑,小編查閱了各式資料,整理出簡(jiǎn)單好用的操作方法,希望對(duì)大家解答”怎么在Oracle12.2或更高版本上為PDB級(jí)別創(chuàng)建AWR”的疑惑有所幫助!接下來(lái),請(qǐng)跟著小編一起來(lái)學(xué)習(xí)吧!

這是12.2或更高版本的新功能。

Oracle Database Performance Tuning Guide
12c Release 2 (12.1)
6.2.7 Managing Automatic Workload Repository in a Multitenant Environment

http://docs.oracle.com/database/122/TGDBA/gathering-database-statistics.htm#TGDBA-GUID-D64AEB01-18FF-47EF-BB5C-A0611117D180


可以按照以下詳細(xì)步驟在PDB級(jí)別啟用和創(chuàng)建AWR報(bào)告。


1) 在PDB級(jí)別設(shè)置awr_pdb_autoflush_enabled=true:

alter session set container=PDB1;
alter system set awr_pdb_autoflush_enabled=true;


2) 正確設(shè)置AWR快照

select * from cdb_hist_wr_control;
DBID SNAP_INTERVAL RETENTION TOPNSQL CON_ID
2580889417 +40150 00:01:00.0 +00008 00:00:00.0 DEFAULT 3
execute dbms_workload_repository.modify_snapshot_settings(interval => 60);
select * from cdb_hist_wr_control;
DBID SNAP_INTERVAL RETENTION TOPNSQL CON_ID
2580889417 +00000 01:00:00.0 +00008 00:00:00.0 DEFAULT 3


3) 另請(qǐng)將AWR_SNAPSHOT_TIME_OFFSET設(shè)置為1000000,以避免多個(gè)PDB同時(shí)創(chuàng)建快照時(shí)出現(xiàn)性能問(wèn)題。

Oracle Database 12c Release 2
Database Reference 
1.26 AWR_SNAPSHOT_TIME_OFFSET
http://docs.oracle.com/database/122/REFRN/AWR_SNAPSHOT_TIME_OFFSET.htm#REFRN10325
alter system set AWR_SNAPSHOT_TIME_OFFSET=1000000 scope=both;

AWR_SNAPSHOT_TIME_OFFSET

AWR_SNAPSHOT_TIME_OFFSET specifies an offset for the Automatic Workload Repository (AWR) snapshot start time.

PropertyDescription

Parameter type

Integer

Default value

There is no offset by default.

Modifiable

ALTER SYSTEM

Modifiable in a PDB

No

Range of values

0 - 3599, or the special value 1000000

Basic

No

Oracle RAC

Multiple instances should use the same value

AWR snapshots normally start at the top of the hour (12:00, 1:00, 2:00, and so on). This parameter allows DBAs to specify an offset for the AWR snapshot start time.

This is a useful parameter to avoid CPU spikes from multiple instances all starting their AWR snapshots at the same time. If you have a large system with many instances on it (like many Exadata installations), and you are experiencing such CPU spikes, this parameter can be very useful.

The parameter is specified in seconds. Normally, you set it to a value less than 3600. If you set the special value 1000000 (1,000,000), you get an automatic mode, in which the offset is based on the database name.

The automatic mode is an effective way of getting a reasonable distribution of offset times when you have a very large number of instances running on the same node.

4) 等待1-2小時(shí)以自動(dòng)生成快照:

select * from awr_pdb_snapshot;
或者您可以手動(dòng)創(chuàng)建快照:
SQL> connect / as sysdba
SQL> alter session set container=PDB1;
SQL> exec dbms_workload_repository.create_snapshot();
創(chuàng)建AWR報(bào)告:
@?/rdbms/admin/awrrpt
Specify the location of AWR Data
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
AWR_ROOT - Use AWR data from root (default)
AWR_PDB - Use AWR data from PDB    ** Use the location AWR_PDB for a PDB level report

5)參考文檔

如何在12.2或更高版本的PDB級(jí)別創(chuàng)建AWR報(bào)告 (文檔 ID 2469637.1).docx

到此,關(guān)于“怎么在Oracle12.2或更高版本上為PDB級(jí)別創(chuàng)建AWR”的學(xué)習(xí)就結(jié)束了,希望能夠解決大家的疑惑。理論與實(shí)踐的搭配能更好的幫助大家學(xué)習(xí),快去試試吧!若想繼續(xù)學(xué)習(xí)更多相關(guān)知識(shí),請(qǐng)繼續(xù)關(guān)注億速云網(wǎng)站,小編會(huì)繼續(xù)努力為大家?guī)?lái)更多實(shí)用的文章!

向AI問(wèn)一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI