lter
database archivelog; //归档目的地默认
alter database open;
alter database force logging;
步骤3,racx1,racx2上之前的库关闭,检查ASM diskgroup 状态 和CRS状态
在racy1设置TNS 启动监听 scp 到另外3个节点
点击(此处)折叠或打开
RACDB= (DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = racy1-vip)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = racy2-vip)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME =RACDB)
)
)
SBDB= (DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = racx1-vip)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = racx2-vip)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME =SBDB)
)
)
步骤4,racy1 生成口令文件,PFILE
orapwd file=orapwRACDB1 password=oracle entries=3 force=y
SCP 到racx2 orapwSBDB1
create pfile='/home/oracle/initRACDB.ora' from spfile;
vi initRACDB.ora
点击(此处)折叠或打开
#注释dispatchers
#结尾添加如下内容
DB_UNIQUE_NAME=RACDB LOG_ARCHIVE_CONFIG='DG_CONFIG=(RACDB,SBDB)' LOG_ARCHIVE_DEST_1='LOCATION=+RCV/RACDB/ VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=RACDB' LOG_ARCHIVE_DEST_2='SERVICE=SBDB LGWR ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=SBDB'
FAL_SERVER=SBDB FAL_CLIENT=RACDB
步骤5,
racy1 grid 用户创建目录ASMCMD
cd +RCVmkdir SBDB
cd +DATAmkdir SBDB
racx1 grid用户创建目录ASMCMDcd +INFOmkdir
SBDB RACDBcd +FBA mkdir
SBDB RACDB
racy1 ,racx1 oracle 用户创建目录
mkdir -p /u01/app/oracle/admin/SBDB/adump
chown -R oracle:dba /u01/app/oracle/admin/SBDB/adump
步骤6,改完参数文件后
racy1:startup nomount pfile='/home/oracle/initRACDB.ora';
create spfile='+DATA/racdb/spfileracdb.ora'
from pfile='/home/oracle/initRACDB.ora';
shutdown immediate;
startup mount;
步骤7,
cp
initRACDB.ora initSBDB.ora
vi initSBDB.ora
RACDB 和SBDB 互换 包括PATH名称互换,注释下划线的参数
scp initSBDB.ora racx1:/home/oracle/initSBDB1.ora
步骤8,利用RMAN创建STANDBY 数据库
RMAN TARGET /
CONFIGURE BACKUP OPTIMIZATION ON;
CONFIGURE DEVICE TYPE
DISK PARALLELISM 2 BACKUP TYPE TO COMPRESSED BACKUPSET;
CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT '/u01/backup/%d_%T_%U.bak'
MAXPIECESIZE 2G;run{allocate channel c1 type disk;allocate channelc2 type disk;backup database format '/u01/backup/%d_%s_%p_cold.bak';
}
将备份集SCP传到 racx1:/u01/backup
racy1: RMAN >
backup
current controlfile
for standby format '/home/oracle/RACDB_control.bak';
shutdown immediate;
scp
RACDB_control.bak racx1:/home/oracle
步骤9,racx1export ORACLE_SID=SBDB1sqlplus '/as sysdba'
startup nomount pfile='/home/oracle/initSBDB1.ora';create spfile='+INFO/sbdb/spfilesbdb.ora'
from pfile='/home/oracle/initSBDB1.ora';
cd
$ORACLE_HOME/dbs
vi initSBDB1.ora
添加:
spfile='+INFO/sbdb/spfilesbdb.ora'
scp
initSBDB1.ora racx2:$ORACLE_HOME/dbs/initSBDB2.ora
shutdown immediate; startup nomount;
步骤10,将密码文件从racy1复制到racx1,racx2
scp
orapwRACDB1 racx1:$ORACLE_HOME/dbs/orapwSBDB1
scp orapwRACDB1 racx2:$ORACLE_HOME/dbs/orapwSBDB2
export ORACLE_SID=SBDB1
rman target /
restore standby controlfile from '/home/oracle/RACDB_control.bak';
alter database mount;
run{
allocate channel c11
type
disk; allocate channel c12 type disk; restore database;
}
alter database open;
步骤11,依次启动racy1,racy2,racx2节点,至此差不多结束了
先关闭primary 后关闭standby
standby 在mount 时 使用 alter database recover managed standby database disconnect from session; 应用日志