重庆思庄Oracle、Redhat认证学习论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 5144|回复: 0
打印 上一主题 下一主题

[Oracle] DG备库生成AWR报告时提示ORA-01157,ORA-01110的处理方法

[复制链接]
跳转到指定楼层
楼主
发表于 2020-4-19 15:06:01 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
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;


分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 支持支持 反对反对
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|手机版|小黑屋|重庆思庄Oracle、Redhat认证学习论坛 ( 渝ICP备12004239号-4 )

GMT+8, 2024-9-28 02:15 , Processed in 0.093892 second(s), 21 queries .

重庆思庄学习中心论坛-重庆思庄科技有限公司论坛

© 2001-2020

快速回复 返回顶部 返回列表