主库性息:db_unique_name:wsbl host:server
备份性息:db_unique_name:wsblstd host:backup
一、server端操作:
1、主库需要修改的参数:
alter system set fal_server='wsbl';
alter system set fal_client='wsblstd';
alter system set db_unique_name='primary' scope=spfile;
alter system set db_service='primary' scope=spfile;
alter system set log_archive_dest_2='serivce=wsblstd';
其他的:
*.standby_archive_dest='/home/oracle/oradata/archive'
*.standby_file_management='AUTO'
*.local_listener='(ADDRESS_LIST=(Address=(Protocol=TCP)(Host=localhost)(Port=1521)) (Address=(Protocol=IPC)(Key=wsbl)))'
*.log_archive_dest_1='location=/home/oracle/oradata/wsbl/archive'
*.log_archive_dest_state_1='ENABLE'
*.log_archive_dest_state_2='ENABLE'
*.log_archive_format='%S_%T_%R.log'
2、使用create pfile from spfile创建initwsbl.ora,然后scp到backup机器;
3、修改tnsnames.ora
WSBLSTD =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = standby)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = wsbl)
)
)
WSBL =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = server)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = wsbl)
)
)
4、使用rman脚本备份
run{
allocate channel d1 device type disk;
backup as compressed backupset
incremental level=0
format='/rmanback/inc0_%d_%U'
tag='inc0'
channel=d1
database;
sql 'alter system switch logfile';
backup as compressed backupset
format='/rmanback/arch_%d_%U'
tag='arch'
channel=d1
archivelog all delete input;
backup as compressed backupset
format='/rmanback/standby.ctl'
tag='standby'
channel=d1
current controlfile for standby reuse;
}
二、standby端操作
注意:其目录结构和server端需要一样的
tnsnames.ora修改为一样
1、将参数文件、rman备份的所有文件复制到相应位置,不需修改;
2、通过sqlplus启动到nomount状态;
3、rman恢复:
rman nocatalog
connect auxiliary
run{
allocate auxiliary channel d1 device type disk;
duplicate target database for standby nofilenamecheck;
}
4、sqlplus操作:
自动恢复standby
recover managed standby database disconnect from session;
以只读模式打开:
recover managed standby database cancel;
alter database open;
阅读(1208) | 评论(0) | 转发(0) |