Oracle热备恢复system 表空间

参考文档:https://blog.csdn.net/hunhun1122/article/details/78113755

备份表空间文件:
alter tablespace system begin backup;
host cp /u01/app/oracle/oradata/orcl/system01.dbf /home/oracle/
alter tablespace system end backup;

破坏数据库:
shutdown immediate
host rm -rf /u01/app/oracle/oradata/orcl/system01.dbf

启动数据库报错:
startup
ORACLE instance started.
Total System Global Area 1.0066E+10 bytes
Fixed Size     12342064 bytes
Variable Size   2248150224 bytes
Database Buffers  7784628224 bytes
Redo Buffers     21209088 bytes
Database mounted.
ORA-01157: cannot identify/lock data file 1 - see DBWR trace file
ORA-01110: data file 1: '/u01/app/oracle/oradata/orcl/system01.dbf

--在mount模式下,将源文件更改为备份处的文件
alter database rename file '/u01/app/oracle/oradata/orcl/system01.dbf' to '/home/oracle/system01.dbf';

recover database; --进行数据库恢复
Media recovery complete.

扫描二维码关注公众号,回复: 4666633 查看本文章

alter database open; --打开数据库


--查看数据文件位置,发现 system 表空间的位置已经更改
set linesize 200;
col file_id 999
col file_id for 999
col file_name for a70
select file_id,file_name,tablespace_name from dba_data_files;

猜你喜欢

转载自blog.csdn.net/yaoshixian/article/details/85272624