签到成功

知道了

CNDBA社区CNDBA社区

Oracle Data Guard 备库重建TEMP 表空间

2025-06-19 12:09 1985 0 原创 Oracle 19c
作者: dave

1 问题现象

Oracle DG 备库查询TEMP 报错如下:https://www.cndba.cn/dave/article/131639https://www.cndba.cn/dave/article/131639

SQL> select file_id,file_name,bytes/1024/1024 MB,status,tablespace_name from dba_temp_files;
select file_id,file_name,bytes/1024/1024 MB,status,tablespace_name from dba_temp_files
                                                                        *
ERROR at line 1:
ORA-01157: cannot identify/lock data file 1001 - see DBWR trace file
ORA-01110: data file 1001: '/u01/app/oracle/oradata/hisdb/tempfile/temp.342.1110205751'

因为从库是RAC 恢复过来的,所以temp 文件并不存在。 https://www.cndba.cn/dave/article/131639

https://www.cndba.cn/dave/article/131639
https://www.cndba.cn/dave/article/131639

2 解决方法

先取消MRP:https://www.cndba.cn/dave/article/131639

SQL> alter database recover managed standby database cancel;

Database altered.

SQL> alter system set standby_file_management='MANUAL' scope=both;

System altered.

添加新的temp 数据文件:https://www.cndba.cn/dave/article/131639https://www.cndba.cn/dave/article/131639

SQL> alter tablespace TEMP add tempfile '/u01/app/oracle/oradata/hisdb/temp01.dbf' size 30G;

Tablespace altered.

删除旧的不存在的文件:https://www.cndba.cn/dave/article/131639

SQL> alter tablespace TEMP drop tempfile '/u01/app/oracle/oradata/hisdb/tempfile/temp.342.1110205751'; 

Tablespace altered.

SQL> select file_id,file_name,bytes/1024/1024 MB,status,tablespace_name from dba_temp_files;

   FILE_ID FILE_NAME                                MB STATUS  TABLESPACE_NAME
---------- ------------------------------------------------------------ ---------- ------- ------------------------------
     2 /u01/app/oracle/oradata/hisdb/temp01.dbf                 30720 ONLINE  TEMP

启动MRP:

https://www.cndba.cn/dave/article/131639

SQL> alter system set standby_file_management='AUTO' scope=both;

System altered.

SQL> alter database recover managed standby database using current logfile disconnect from session;

Database altered.

版权声明:本文为博主原创文章,未经博主允许不得转载。

用户评论
* 以下用户言论只代表其个人观点,不代表CNDBA社区的观点或立场
dave

dave

关注

人的一生应该是这样度过的:当他回首往事的时候,他不会因为虚度年华而悔恨,也不会因为碌碌无为而羞耻;这样,在临死的时候,他就能够说:“我的整个生命和全部精力,都已经献给世界上最壮丽的事业....."

  • 2297
    原创
  • 3
    翻译
  • 703
    转载
  • 201
    评论
  • 访问:10272286次
  • 积分:4601
  • 等级:核心会员
  • 排名:第1名
精华文章
    热门文章
      Copyright © 2016 All Rights Reserved. Powered by CNDBA · 皖ICP备2022006297号-1·

      QQ交流群

      注册联系QQ