复制数据库
目的:将A实例复制为B实例
在A实例中
sqlplus '/as sysdba'
startup;
alter database backup controlfile to trace;
shutdown immediate;
在实例B数据文件的存放目录B中
cp ../A/* . &
将A实例所有数据文件拷贝到B实例
vi A实例中udump中的trace文件,将resetlog段的重建控制文件语句截出,修改相应目录及字段
STARTUP NOMOUNT
CREATE CONTROLFILE REUSE DATABASE $SIDA_NAME RESETLOGS ARCHIVELOG -修改成
CREATE CONTROLFILE set DATABASE $SIDB_NAME RESETLOGS ARCHIVELOG
-- SET STANDBY TO MAXIMIZE PERFORMANCE
MAXLOGFILES 6
MAXLOGMEMBERS 3
MAXDATAFILES 100
MAXINSTANCES 1
MAXLOGHISTORY 226
LOGFILE
GROUP 1 '/oradata/$B/redo01.log' SIZE 100M,
GROUP 2 '/oradata/$B/redo02.log' SIZE 100M,
GROUP 3 '/oradata/$B/redo03.log' SIZE 100M
-- STANDBY LOGFILE
DATAFILE
'/oradata/$B/system01.dbf',
'/oradata/$B/undotbs01.dbf',
'/oradata/$B/lis01.dbf',
'/oradata/$B/lis02.dbf',
'/oradata/$B/lis03.dbf',
'/oradata/$B/lis04.dbf',
'/oradata/$B/perfstat_01.dbf'
CHARACTER SET ZHS16GBK
;
重建控制文件;
RECOVER DATABASE USING BACKUP CONTROLFILE;
恢复数据库,需要必要的归档日志,如果不在归档日志中,就存在联机日志中,在redo log中寻找。
# Database can now be opened zeroing the online logs.
打开数据库
ALTER DATABASE OPEN RESETLOGS;
# Commands to add tempfiles to temporary tablespaces.
# Online tempfiles have complete space information.
# Other tempfiles may require adjustment.
添加临时文件
ALTER TABLESPACE TEMP ADD TEMPFILE '/oradata/$B/temp01.dbf'
SIZE 467664896 REUSE AUTOEXTEND ON NEXT 655360 MAXSIZE 32767M;
shutdown;
startup;
复制结束
阅读(1873) | 评论(0) | 转发(0) |