这篇文章主要为大家展示了“oracle 11g rac中出现ORA-01157问题怎么办”,内容简而易懂,条理清晰,希望能够帮助大家解决疑惑,下面让小编带领大家一起研究并学习一下“oracle 11g rac中出现ORA-01157问题怎么办”这篇文章吧。
一、环境
11g rac
rhel 6.8
二、报错信息
SQL> select file_name from dba_data_files;
ERROR:
ORA-01157: cannot identify/lock data file 6 - see DBWR trace file
ORA-01110: data file 6:
'/u01/app/oracle/product/11.2.0/dbhome_1/dbs/DATAfsczracdatafilefinance.DBF'
三、处理过程
花了几分钟,清理了一下思路,写好脚本就开始整。
1、默认归档已打开
SQL> archive log list;
Database log mode Archive Mode
Automatic archival Enabled
Archive destination +DATA/arch
Oldest online log sequence 20
Next log sequence to archive 22
Current log sequence 22
SQL>
SQL>
2、offline 表空间
SQL> alter tablespace FINANCE offline;
Tablespace altered.
3、cp 数据文件
ASMCMD [+data/FSCZRAC/datafile] > cp /u01/app/oracle/product/11.2.0/dbhome_1/dbs/DATAfsczracdatafilefinance.DBF +data/fsczrac/datafile/DATAfsczracdatafilefinance.DBF
copying /u01/app/oracle/product/11.2.0/dbhome_1/dbs/DATAfsczracdatafilefinance.DBF -> +data/fsczrac/datafile/DATAfsczracdatafilefinance.DBF
ASMCMD [+data/FSCZRAC/datafile] >
4、修改控制文件中的数据文件路径
SQL> alter database rename file '/u01/app/oracle/product/11.2.0/dbhome_1/dbs/DATAfsczracdatafilefinance.DBF' to '+data/fsczrac/datafile/DATAfsczracdatafilefinance.DBF';
Database altered.
5、恢复表空间
SQL> recover tablespace finance;
Media recovery complete.
6、表空间online
SQL> alter tablespace finance online;
Tablespace altered.
7、验证
SQL> col file_name for a60
SQL> select file_name, file_id, online_status from dba_data_files;
FILE_NAME FILE_ID ONLINE_
------------------------------------------------------------ ---------- -------
+DATA/fsczrac/datafile/users.259.967475641 4 ONLINE
+DATA/fsczrac/datafile/undotbs1.258.967475641 3 ONLINE
+DATA/fsczrac/datafile/sysaux.257.967475641 2 ONLINE
+DATA/fsczrac/datafile/system.256.967475641 1 SYSTEM
+DATA/fsczrac/datafile/undotbs2.269.967475831 5 ONLINE
+DATA/fsczrac/datafile/datafsczracdatafilefinance.dbf 6 ONLINE
6 rows selected.
SQL>
以上是“oracle 11g rac中出现ORA-01157问题怎么办”这篇文章的所有内容,感谢各位的阅读!相信大家都有了一定的了解,希望分享的内容对大家有所帮助,如果还想学习更多知识,欢迎关注亿速云行业资讯频道!