一、环境
操作系统: Red Hat Enterprise Linux Server release 5 (Tikanga)
Primary数据库(rac):
IP地址:172.168.1.206 172.168.1.208
vip地址:172.168.1.116 172.168.1.118
数据库SID:syk1 syk2
DB_NAME:syk
数据、控制、日志文件放在 ASM
Standby数据库(单机):
IP地址:172.168.1.222
数据库SID:syk
DB_NAME:syk
数据、控制、日志文件使用文件系统 /oradata
二、tnsnames.ora在rac和standby相同
SYK2 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = rac2-vip)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = syk)
(INSTANCE_NAME = syk2)
)
)
SYK1 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = rac1-vip)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = syk)
(INSTANCE_NAME = syk1)
)
)
SYK =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = rac1-vip)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = rac2-vip)(PORT = 1521))
(LOAD_BALANCE = yes)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = syk)
)
)
SYK_SINGLE =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 172.168.1.222)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = syk)
)
)
LISTENERS_SYK =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = rac1-vip)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = rac2-vip)(PORT = 1521))
)
EXTPROC_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
)
(CONNECT_DATA =
(SID = PLSExtProc)
(PRESENTATION = RO)
)
)
standby上的listener.ora
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = syk)
(ORACLE_HOME = /u01/app/oracle/product/10.2.0/db_1)
(SID_NAME = syk)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 172.168.1.222)(PORT = 1521))
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
)
)
三、修改参数(在rac1上如下操作)
SQL> create pfile=''/home/oracle/pfilesyk.ora'' from spfile;
添加如下参数
*.db_unique_name=''SYK''
*.service_names=''syk_rac''
*.log_archive_config=''dg_config=(syk,syk_single)''
*.log_archive_dest_1=''LOCATION=/home/oracle/archive/ VALID_FOR=(ALL_LOGFILES,ALL_ROLES)'' DB_UNIQUE_NAME=''syk''
*.log_archive_dest_2=''service=syk_single LGWR valid_for=(online_logfiles,primary_role) db_unique_name=syk_single''
*.log_archive_dest_state_1=''ENABLE''
*.log_archive_dest_state_2=''ENABLE''
*.db_file_name_convert=''/oradata/syk'','' ASM_DATA/syk/datafile'',''/oradata/syk'','' ASM_DATA/syk/tempfile''
*.log_file_name_convert=''/oradata/syk'','' ASM_DATA/syk/onlinelog'',''/oradata/syk'','' ASM_RECOVER/syk/onlinelog''
syk1.fal_client=''syk1''
syk2.fal_client=''syk2''
*.fal_server=''syk_single''
*.standby_file_management=''auto''
*.STANDBY_ARCHIVE_D