SQL> @?/rdbms/admin/awrrpt.sql
Current Instance
~~~~~~~~~~~~~~~~
DB Id DB Name Inst Num Instance
----------- ------------ -------- ------------
1491479622 ORCL 1 orcl
Specify the Report Type
~~~~~~~~~~~~~~~~~~~~~~~
Would you like an HTML report, or a plain text report?
Enter 'html' for an HTML report, or 'text' for plain text
Defaults to 'html'
Enter value for report_type:
Type Specified: html
Instances in this Workload Repository schema
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
DB Id Inst Num DB Name Instance Host
------------ -------- ------------ ------------ ------------
1491479622 1 ORCL orcl1 hisdb1
1491479622 2 ORCL orcl2 hisdb2
Using 1491479622 for database Id
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
Snap
Instance DB Name Snap Id Snap Started Level
------------ ------------ --------- ------------------ -----
orcl1 ORCL 20185 15 Apr 2020 00:00 1
20186 15 Apr 2020 01:00 1
20187 15 Apr 2020 02:00 1
20188 15 Apr 2020 03:00 1
20189 15 Apr 2020 04:00 1
20190 15 Apr 2020 05:00 1
20191 15 Apr 2020 06:00 1
20192 15 Apr 2020 07:00 1
20193 15 Apr 2020 08:00 1
20194 15 Apr 2020 09:00 1
20195 15 Apr 2020 10:00 1
20196 15 Apr 2020 11:00 1
20197 15 Apr 2020 12:00 1
20198 15 Apr 2020 13:00 1
20199 15 Apr 2020 14:00 1
Specify the Begin and End Snapshot Ids
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Enter value for begin_snap: 20194
Begin Snapshot Id specified: 20194
Enter value for end_snap: 20195
End Snapshot Id specified: 20195
Specify the Report Name
~~~~~~~~~~~~~~~~~~~~~~~
The default report file name is awrrpt_1_20194_20195.html. To use this name,
press <return> to continue, otherwise enter an alternative.
Enter value for report_name:
Using the report name awrrpt_1_20194_20195.html
select output from table(dbms_workload_repository.awr_report_html( :dbid,
ERROR at line 1:
ORA-01157: cannot identify/lock data file 201 - see DBWR trace file
ORA-01110: data file 201: '+DATADG'
ORA-06512: at "SYS.DBMS_AWR_REPORT_LAYOUT", line 2458
ORA-06512: at "SYS.DBMS_SWRF_REPORT_INTERNAL", line 1278
ORA-06512: at "SYS.DBMS_WORKLOAD_REPOSITORY", line 915
ORA-06512: at line 1
这个报错,提示是找不到文件号为201 的数据文件,但在v$datafile视图中,并没有查到有201的文件,找了半天,才想起,忽略了临时文件,备库当时并没有建立临时文件,那要解决这个问题,建立一个临时文件,即可。
查看一下备库中的临时文件
select ts#,name from V$tempfile;
select ts.name as ts,tf.name as fn from v$tempfile tf,v$tablespace ts where tf.ts#=ts.ts#;
处理步骤:
1.增加一个临时文件
alter tablespace temp add tempfile '+data' size 100m autoextend on;
2.删除原来的文件
alter tablespace temp drop tempfile 1;
|