源头:赛迪网 作者:Bennett
idle> startup mount pfile='/home/oracle/opt/admin/standby/pfile/init_standby.ora';
7、RESTORE STANDBY数据库:
由于节制文件外面记实的备份信息还是在WINDOWS上主库的备份信息,我们需要运用RMAN的catalog饬令来使RMAN认出在STANDBY端从WINDOWS主库COPY已往的备份集:
RMAN> catalog start with '/home/oracle/opt/oradata/standby';
using target database control file instead of recovery catalog
searching for all files that match the pattern /home/oracle/opt/oradata/standby
List of Files Unknown to the Database
=====================================
File Name: /home/oracle/opt/oradata/standby/db_05j3dk6n_1_1.bak
File Name: /home/oracle/opt/oradata/standby/db_04j3dk0q_1_1.bak
Do you really want to catalog the above files (enter YES or NO)? yes
cataloging files...
cataloging done
List of Cataloged Files
=======================
File Name: /home/oracle/opt/oradata/standby/db_05j3dk6n_1_1.bak
File Name: /home/oracle/opt/oradata/standby/db_04j3dk0q_1_1.bak
RMAN> crosscheck backup;
RMAN> delete expired backup;
等到RMAN可以正切认出STANDBY真个备份集后,我们就可以对数据库中断RESTORE了:
RMAN> list backup;
List of Backup Sets
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
3 Full 1.75G DISK 00:03:03 12-DEC-07
BP Key: 6 Status: AVAILABLE Compressed: NO Tag: TAG20071212T104026
Piece Name: /home/oracle/opt/oradata/standby/db_04j3dk0q_1_1.bak
RMAN> restore database;
Starting restore at 12-DEC-07
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00001 to /home/oracle/opt/oradata/standby/SYSTEM01.DBF
channel ORA_DISK_1: restoring datafile 00002 to /home/oracle/opt/oradata/standby/SYSAUX01.DBF
channel ORA_DISK_1: restoring datafile 00003 to /home/oracle/opt/oradata/standby/UNDOTBS01.DBF
channel ORA_DISK_1: restoring datafile 00004 to /home/oracle/opt/oradata/standby/USERS01.DBF
channel ORA_DISK_1: restoring datafile 00005 to /home/oracle/opt/oradata/standby/EXAMPLE01.DBF
channel ORA_DISK_1: reading from backup piece /home/oracle/opt/oradata/standby/db_04j3dk0q_1_1.bak
channel ORA_DISK_1: piece handle=/home/oracle/opt/oradata/standby/db_04j3dk0q_1_1.bak tag=TAG20071212T104026
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:01:05
Finished restore at 12-DEC-07
8、在主库和备用库端拜别更改tnsnames设置,添加主库和备用库的TNS跟尾字,并确保在主库和STANDBY都可以跟尾上对方:
primary =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.200.168)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl)
)
)
standby =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST =192.168.200.169)(PORT = 1522))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = standby)
)
)
9、添加STANDBY LOGFILE,启动STANDBY至光复经管形式:
idle> alter database add standby logfile '/home/oracle/opt/oradata/standby/redo04.log' size 50M;
idle> alter database add standby logfile '/home/oracle/opt/oradata/standby/redo05.log' size 50M;
idle> alter database add standby logfile '/home/oracle/opt/oradata/standby/redo06.log' size 50M;
idle> recover managed standby database disconnect from session;
Media recovery complete.
版权声明:
原创作品,允许转载,转载时请务必以超链接体式格局标明文章 原始原由 、作者信息和本声明。否则将清查法律责任。