這篇文章主要講解了“Oracle 12.2提供了什么功能”,文中的講解內(nèi)容簡(jiǎn)單清晰,易于學(xué)習(xí)與理解,下面請(qǐng)大家跟著小編的思路慢慢深入,一起來(lái)研究和學(xué)習(xí)“Oracle 12.2提供了什么功能”吧!
創(chuàng)新互聯(lián)公司專(zhuān)注于中大型企業(yè)的網(wǎng)站建設(shè)、網(wǎng)站設(shè)計(jì)和網(wǎng)站改版、網(wǎng)站營(yíng)銷(xiāo)服務(wù),追求商業(yè)策劃與數(shù)據(jù)分析、創(chuàng)意藝術(shù)與技術(shù)開(kāi)發(fā)的融合,累計(jì)客戶1000+,服務(wù)滿意度達(dá)97%。幫助廣大客戶順利對(duì)接上互聯(lián)網(wǎng)浪潮,準(zhǔn)確優(yōu)選出符合自己需要的互聯(lián)網(wǎng)運(yùn)用,我們將一直專(zhuān)注高端網(wǎng)站設(shè)計(jì)和互聯(lián)網(wǎng)程序開(kāi)發(fā),在前進(jìn)的路上,與客戶一起成長(zhǎng)!
Oracle 12.2提供了收集備庫(kù)AWR的功能。
確定備庫(kù)角色和打開(kāi)狀態(tài)
SQL> select inst_id, open_mode, database_role from gv$database order by 1; INST_ID OPEN_MODE DATABASE_ROLE ---------- ------------------------------ ------------------------------------------------ 1 READ ONLY WITH APPLY PHYSICAL STANDBY |
On Primary (CDB) 執(zhí)行解鎖:
SQL> alter user sys$umf identified by sysumf account unlock; |
SYS$UMF用戶默認(rèn)是locked的;該用戶具有Remote Management Framework (RMF)有關(guān)的所有的視圖和表的權(quán)限。
On Primary (CDB)創(chuàng)建db_link
create database link dblk_EMNBBETA_TO_EMNBBETAPDG01 CONNECT TO sys$umf IDENTIFIED BY sysumf using 'LTACTESTPDG01'; create database link dblk_EMNBBETAPDG01_TO_EMNBBETA CONNECT TO sys$umf IDENTIFIED BY sysumf using 'LTACTEST'; |
RMF拓?fù)浣Y(jié)構(gòu)中的所有節(jié)點(diǎn)必須有一個(gè)獨(dú)一無(wú)二的名字,默認(rèn)選擇db_unique_name
On Primary(CDB 執(zhí)行) ,LTACTEST是主庫(kù)db_unique_name
exec dbms_umf.configure_node ('LTACTEST'); |
On Standby,LTACTESTPDG01是備庫(kù)db_unique_name
exec dbms_umf.configure_node ('LTACTESTPDG01','dblk_EMNBBETAPDG01_TO_EMNBBETA'); |
創(chuàng)建RMF拓?fù)?,On Primary:
exec DBMS_UMF.create_topology ('EMNBBETA_Topology'); |
驗(yàn)證目前為止的操作
set line 132 col topology_name format a15 col node_name format a15 select * from dba_umf_topology; select * from dba_umf_registration; For example SQL> select * from dba_umf_topology; TOPOLOGY_NAME TARGET_ID TOPOLOGY_VERSION TOPOLOGY_STATE -------------------- ---------- ---------------- ------------------------ EMNBBETA_Topology 798157014 1 ACTIVE SQL> select * from dba_umf_registration; TOPOLOGY_NAME NODE_NAME NODE_ID NODE_TYPE AS_SOURCE AS_CANDIDATE_TA STATE -------------------- --------------- ---------- ---------- --------------- --------------- -------------------- EMNBBETA_Topology LTACTEST 798157014 0 FALSE FALSE OK |
注冊(cè)備庫(kù)到RMF拓?fù)渲?/p>
SQL> exec DBMS_UMF.register_node ('EMNBBETA_Topology', 'LTACTESTPDG01', 'dblk_EMNBBETA_TO_EMNBBETAPDG01', 'dblk_EMNBBETAPDG01_TO_EMNBBETA', 'FALSE', 'FALSE'); BEGIN DBMS_UMF.register_node ('EMNBBETA_Topology', 'LTACTESTPDG01', 'dblk_EMNBBETA_TO_EMNBBETAPDG01', 'dblk_EMNBBETAPDG01_TO_EMNBBETA', 'FALSE', 'FALSE'); END; * ERROR at line 1: ORA-15766: already registered in an RMF topology ORA-06512: at "SYS.DBMS_UMF_INTERNAL", line 132 ORA-06512: at "SYS.DBMS_UMF_INTERNAL", line 170 ORA-06512: at "SYS.DBMS_UMF", line 822 ORA-06512: at line 1 ORA-06512: at "SYS.DBMS_UMF", line 794 ORA-06512: at "SYS.DBMS_UMF", line 712 ORA-06512: at line 1 |
解決辦法:
如果遇到了ORA-15766,那么就執(zhí)行下面:
SQL> exec DBMS_UMF.unregister_node ('EMNBBETA_Topology', 'LTACTESTPDG01'); PL/SQL procedure successfully completed. |
如果遇到了ORA-13519: Database id (1730117407) exists in the workload repository,然后重新運(yùn)行DBMS_WORKLOAD_REPOSITORY.register_remote_database
exec DBMS_WORKLOAD_REPOSITORY.unregister_remote_database('LTACTESTPDG01',' EMNBBETA_Topology',TRUE); |
注冊(cè)到AWR
exec DBMS_WORKLOAD_REPOSITORY.register_remote_database(node_name=>'LTACTESTPDG01'); PL/SQL procedure successfully completed. |
驗(yàn)證
set line 132 col topology_name format a20 col node_name format a15 SQL> select * from dba_umf_topology; TOPOLOGY_NAME TARGET_ID TOPOLOGY_VERSION TOPOLOGY_STATE -------------------- ---------- ---------------- ------------------------ EMNBBETA_Topology 798157014 6 ACTIVE SQL> select * from dba_umf_registration; TOPOLOGY_NAME NODE_NAME NODE_ID NODE_TYPE AS_SOURCE AS_CANDIDATE_TA STATE -------------------- --------------- ---------- ---------- --------------- --------------- -------------------- EMNBBETA_Topology LTACTEST 798157014 0 FALSE FALSE OK EMNBBETA_Topology LTACTESTPDG01 524737559 0 FALSE FALSE OK SQL> select * from dba_umf_service; TOPOLOGY_NAME NODE_ID SERVICE_ID -------------------- ---------- --------------------- EMNBBETA_Topology 524737559 AWR |
用RMF創(chuàng)建遠(yuǎn)程snapshot
SQL> exec dbms_workload_repository.create_remote_snapshot('LTACTESTPDG01'); PL/SQL procedure successfully completed. |
如果遇到了ORA-13516: AWR Operation failed: Remote source not registered for AWR,手動(dòng)切2-3個(gè)歸檔
alter system switch logfile; |
收集備庫(kù)AWR報(bào)告
@?/rdbms/admin/awrrpti.sql |
注意是awrrpti.sql,不是awrrpt.sql
輸入dbid就可以了。
SQL> @?/rdbms/admin/awrrpti.sql Specify the Report Type ~~~~~~~~~~~~~~~~~~~~~~~ AWR reports can be generated in the following formats. Please enter the name of the format at the prompt. Default value is 'html'. 'html' HTML format (default) 'text' Text format 'active-html' Includes Performance Hub active report Enter value for report_type: html Type Specified: html Instances in this Workload Repository schema ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DB Id Inst Num DB Name Instance Host ------------ ---------- --------- ---------- ------ 524737559 1 LTACTEST LTACTEST ORADB-53154. * 4166033225 1 LTACTEST LTACTEST ORADB-53163. Enter value for dbid: 524737559 Using 524737559 for database Id Enter value for inst_num: 1 Using 1 for instance number Specify the number of days of snapshots to choose from ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Entering the number of days (n) will result in the most recent (n) days of snapshots being listed. Pressing specifying a number lists all completed snapshots. Enter value for num_days: 1 Listing the last day's Completed Snapshots Instance DB Name Snap Id Snap Started Snap Level ------------ ------------ ---------- ------------------ ---------- LTACTEST LTACTEST 1 04 Sep 2019 15:41 1 2 04 Sep 2019 15:42 1 Specify the Begin and End Snapshot Ids ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Enter value for begin_snap: 1 Begin Snapshot Id specified: 1 Enter value for end_snap: 2 End Snapshot Id specified: 2 Specify the Report Name ~~~~~~~~~~~~~~~~~~~~~~~ The default report file name is awrrpt_1_1_2.html. To use this name, press Enter value for report_name: Using the report name awrrpt_1_1_2.html |
查看AWR報(bào)告:
感謝各位的閱讀,以上就是“Oracle 12.2提供了什么功能”的內(nèi)容了,經(jīng)過(guò)本文的學(xué)習(xí)后,相信大家對(duì)Oracle 12.2提供了什么功能這一問(wèn)題有了更深刻的體會(huì),具體使用情況還需要大家實(shí)踐驗(yàn)證。這里是創(chuàng)新互聯(lián),小編將為大家推送更多相關(guān)知識(shí)點(diǎn)的文章,歡迎關(guān)注!