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
2) 在主库上
SYS$UMF 用户是默认具有访问系统级远程管理框架(RMF)视图和表的所有权限的数据库用户。RMF 中的所有 AWR 相关操作只能由 SYS$UMF 用户执行。
SYS$UMF 用户默认处于锁定状态,在部署RMF拓扑之前必须将其解锁:
SQL> alter user sys$umf identified by sysumf account unlock;
3) 在主库和备库之间分别创建database link:
在主库上
create database link db_pridb_to_stbdb CONNECT TO sys$umf IDENTIFIED BY sysumf using 'orcldg';
create database link db_stbdb_to_pridb CONNECT TO sys$umf IDENTIFIED BY sysumf using 'orcl';
验证
SQL> select dbid,open_mode,database_role,db_unique_name from v$database@db_pridb_to_stbdb union all select dbid,open_mode,database_role,db_unique_name from v$database@db_stbdb_to_pridb;
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:
Type Specified: html
Instances in this Workload Repository schema
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
DB Id Inst Num DB Name Instance Host
------------ ---------- --------- ---------- ------
3013062590 1 ORCL orcl orcldg
* 1691191647 1 ORCL orcl orcl
Enter value for dbid: 3013062590
Using 3013062590 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 <return> without
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
------------ ------------ ---------- ------------------ ----------
orcl ORCL 1 05 Nov 2024 11:02 1
2 05 Nov 2024 11:06 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 <return> to continue, otherwise enter an alternative.