3.5 备份数据库
mkdir -p /public/hotback/jyzhao/standby rman target / run { allocate channel ch1 type disk; backup database format '/public/hotback/jyzhao/standby/dbbackup_for_stndby_%U'; backup current controlfile for standby format '/public/hotback/jyzhao/standby/control_for_standby.ctl'; release channel ch1; }3.6 创建备库参数文件
create pfile='pfile_for_standby.txt' from spfile;3.7 更新tnsnames.ora文件
JYZHAO = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.51)(PORT = 1521)) (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.53)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = jyzhao) ) ) JYZHAO1 = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.51)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = jyzhao) (SID = jyzhao1) ) ) JYZHAO2 = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.53)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = jyzhao) (SID = jyzhao2) ) ) LISTENER_JYZHAO1=(DESCRIPTION =(ADDRESS = (PROTOCOL = TCP)(HOST = jyrac1-vip)(PORT = 1521))) LISTENER_JYZHAO2=(DESCRIPTION =(ADDRESS = (PROTOCOL = TCP)(HOST = jyrac2-vip)(PORT = 1521))) MYNAS = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.62)(PORT = 1521)) (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.64)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = mynas) ) ) MYNAS1 = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.62)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = mynas) (SID = jyzhao1) ) ) MYNAS2 = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.64)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = mynas) (SID = jyzhao2) ) ) 4.备库配置备库配置操作主要有:
拷贝主库RMAN备份和参数文件
拷贝密码文件
创建备库需要的目录
修改备库参数文件
拷贝tnsnames.ora文件
创建ASM相关目录
4.1 拷贝主库RMAN备份和参数文件
我这里备份所在的空间可以直接nfs挂载到备库,不需要拷贝。
4.2 拷贝密码文件
scp $ORACLE_HOME/dbs/orapwjyzhao1 192.168.1.61:$ORACLE_HOME/dbs/orapwjyzhao1 scp $ORACLE_HOME/dbs/orapwjyzhao1 192.168.1.63:$ORACLE_HOME/dbs/orapwjyzhao24.3 创建备库需要的目录
On jystdrac1: