时间:2021-07-01 10:21:17 帮助过:31人阅读
修改了控制文件的路径
*.control_files=‘/u01/app/oracle/oradata/test/controlfile/control01.ctl‘
重建控制文件
startup mount
alter database backup controlfile to trace as ‘/tmp/crontol_trace‘;
cat /tmp/crontol_trace | grep -v ^- | grep -v ^$ > /tmp/ctl.sql
修改控制文件里的路径,因为我们有onlinelog所以选择noresetlog模式
vi /tmp/ctl.sql
STARTUP NOMOUNT
CREATE CONTROLFILE REUSE DATABASE "TEST" NORESETLOGS ARCHIVELOG
MAXLOGFILES 16
MAXLOGMEMBERS 3
MAXDATAFILES 100
MAXINSTANCES 8
MAXLOGHISTORY 292
LOGFILE
GROUP 1 ‘/u01/app/oracle/oradata/test/onlinelog/redo01.log‘ SIZE 50M BLOCKSIZE 512,
GROUP 2 ‘/u01/app/oracle/oradata/test/onlinelog/redo02.log‘ SIZE 50M BLOCKSIZE 512,
GROUP 3 ‘/u01/app/oracle/oradata/test/onlinelog/redo03.log‘ SIZE 50M BLOCKSIZE 512
DATAFILE
‘/u01/app/oracle/oradata/test/datafile/system01.dbf‘,
‘/u01/app/oracle/oradata/test/datafile/sysaux01.dbf‘,
‘/u01/app/oracle/oradata/test/datafile/undotbs01.dbf‘,
‘/u01/app/oracle/oradata/test/datafile/users01.dbf‘,
‘/u01/app/oracle/oradata/test/datafile/qwerty.dbf‘,
‘/u01/app/oracle/oradata/test/datafile/testbig.dbf‘,
‘/u01/app/oracle/oradata/test/datafile/data_01.dbf‘
CHARACTER SET AL32UTF8
;
RECOVER DATABASE
ALTER SYSTEM ARCHIVE LOG ALL;
ALTER DATABASE OPEN;
ALTER TABLESPACE TEMP ADD TEMPFILE ‘/u01/app/oracle/oradata/test/datafile/temp01.dbf‘ REUSE;
ALTER TABLESPACE TEMP ADD TEMPFILE ‘/u01/app/oracle/oradata/test/datafile/temp02.dbf‘ REUSE;
ALTER TABLESPACE TEMP_ASYNC ADD TEMPFILE ‘/u01/app/oracle/oradata/test/datafile/temp_async_01.dbf‘ REUSE;
修改完毕后,将数据库启动到nomount状态
shutdown immediate
startup nomout;
运行重建控制文件的sql语句
@/tmp/ctl.sql
SQL> select status from v$instance;
STATUS
------------
OPEN
至此,已经完成数据库的迁移。
本文出自 “Sysdba” 博客,请务必保留此出处http://sysdba.blog.51cto.com/10492366/1702149
ORACLE 12C 冷备份方式的数据迁移
标签:冷备份 oracle数据库迁移 12c