This example includes the switchover process, which is described before and after switchover. Before switchover, RAC is primarydatabase. (1) Each RAC instance has
This example includes the switchover process, which is described before and after switchover. Before switchover, RAC is the primary database. (1) Each RAC instance has
An experiment that was made a long time ago is archived today:
Note:
RAC primaryAndSingle standbyConfiguration
2NodeRACAnd1ItemsSingle instanceComposedData guardEnvironment.
1.Environment Introduction
Primary databaseIs a two-nodeRAC, Storage adoptsRawAndASMThe following describes how to mix
RAC Primary
Inode1
Inode2
Public IP
172.28.22.246
172.28.22.247
Private IP
172.28.7.70
172.28.7.244
Virtual IP
172.28.22.248
172.28.22.249
Instance
Orcl1
Orcl2
DB_NAME
Orcl
Data, Controle file, Redo file
Raw, ASM
Standby databaseData files are stored locally.RawAndAmsMethod:
Single instance standby
Description(Inode2)
IP
172.28.7.244
Oracle
Non-InstalledRACVersion
Instance
Orcl
Data, Controle file, Redo file
/Home/orastd/oradata/orcl
Note: Due to restrictionsStandby databaseAlso installed inInode2The single-instance engine is only installed under different system users.
2.Configuration points
In this exampleSwitchoverThe procedure is as follows:SwitchoverBefore and after the introduction.
SwitchoverBefore, thenRACYesPrimary database.
(1) RACLog sending must be configured for each instance.Standby
(2)Confirm the log sending method. In this example, the default synchronization method is used,ARCHProcess
(3) standbyConfigure the log receiving method. This example usesStandby redo log
(4)StartMRP
SwitchoverThenRACYesStandby database.
IfStandbyYesRAC,Then the log receiving and recovery are not the sameInstance,In terms of terms, the two instances are calledReceive instanceAndRecover instance.
In this example, both of them are unified into oneInstance.
(1) single instanceLogs are only sentRACAn instance
(2)ConfirmRACIn this exampleStandby redo log
(3)InRACStarted on an instanceMRP
3.Procedure
(1)ConfigureTnsnames. oraAndListener. ora
RAC (rac1, rac2)AndStandby (orcl)OnTnsnames. oraSame, as follows:
ORCL_SINGLE =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP) (HOST = 172.28.7.244) (PORT = 1522 ))
)
(CONNECT_DATA =
(SID = orcl)
)
)
ORCL2 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP) (HOST = inode2-vip) (PORT = 1521 ))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl)
(INSTANCE_NAME = orcl2)
)
)
ORCL1 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP) (HOST = inode1-vip) (PORT = 1521 ))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl)
(INSTANCE_NAME = orcl1)
)
)
StandbyOnListener. ora
Inode2: orastd: orcl:/home/orastd/product/10.2.0/db_1/network/admin> more listener. ora
LISTENER =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP) (Host = 172.28.7.244) (Port = 1522 ))
)
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = orcl)
(ORACLE_HOME =/home/orastd/product/10.2.0/db_1)
(SID_NAME = orcl)
)
)
(2)Prepare the parameter file
OriginalRACThe parameter file is as follows:
Orcl2. _ db_cache_size = 142606336
Orcl2. _ java_pool_size = 4194304
Orcl1. _ Java _pool_size = 4194304
Orcl2. _ large_pool_size = 4194304
Orcl1. _ large_pool_size = 4194304
Orcl1. _ shared_pool_size = 117440512
Orcl2. _ shared_pool_size = 138412032
Orcl2. _ streams_pool_size = 0
Orcl1. _ streams_pool_size = 0
*. Audit_file_dest = '/db/oracle/admin/orcl/adump'
*. Background_dump_dest = '/db/oracle/admin/orcl/bdump'
*. Cluster_database_instances = 2
*. Cluster_database = TRUE
*. Compatible = '10. 2.0.1.0'
*. Control_files = '/dev/rcontrol1_raw', '/dev/rcontrol2_raw', '/dev/rcontrol3_raw'
*. Core_dump_dest = '/db/oracle/admin/orcl/cdump'
*. Db_block_size = 8192
*. Db_domain =''
*. Db_file_multiblock_read_count = 16
*. Db_name = 'orcl'
*. Db_recovery_file_dest_size = 2147483648
*. Db_recovery_file_dest = '+ DG1'
*. Dispatchers = '(PROTOCOL = TCP) (SERVICE = orclXDB )'
Orcl2.instance _ number = 2
Orcl1.instance _ number = 1
*. Job_queue_processes = 10
*. Log_archive_config =''
*. Log_archive_dest_1 = 'location =/db/oracle'
Orcl1.log _ archive_dest_1 = 'location =/db/arch1'
Orcl2.log _ archive_dest_1 = 'location =/db/arch2'
Orcl2.log _ archive_dest_2 = 'service = orcl1'
Orcl1.log _ archive_dest_2 = 'service = orcl2'
*. Open_cursors = 300
*. Pga_aggregate_target = 96468992
*. Processses = 150
*. Remote_listener = 'listeners _ ORCL'
*. Remote_login_passwordfile = 'clusive'
*. Sga_target = 290455552
Orcl2.standby _ archive_dest = '/db/arch1'
Orcl1.standby _ archive_dest = '/db/arch2'
*. Standby_file_management = 'auto'
Orcl2.thread = 2
Orcl1.thread = 1
*. Undo_management = 'auto'
Orcl2.undo _ tablespace = 'undotbs2'
Orcl1.undo _ tablespace = 'undotbs1'
RACThe original parameters remain unchanged. Add the following parameters:
*. Log_archive_config = 'dg _ CONFIG = (orcl, orcl_single )'
*. Log_archive_dest_3 = 'service = orcl_single VALID_FOR = (ONLINE_LOGFILES, PRIMARY_ROLE) DB_UNIQUE_NAME = orcl_single'
*. Db_file_name_convert = '/home/orastd/oradata/orcl/', '+ DG3/orcl/datafile/', '/home/orastd/oradata/orcl /', '/dev /'
*. Log_file_name_convert = '/home/orastd/oradata/orcl/', '+ DG3/orcl/onlinelog /'
*. Standby_file_management = AUTO
*. FAL_SERVER = 'orcl _ sing'
Orcl1.FAL _ CLIENT = 'orcl1'
Orcl2.FAL _ CLIENT = 'orcl2'
Note:
Db_file_name_convert,Log_file_name_convertIt is used for master-slave switchover. If the master-slave switchover is not enabled, other parameters can be modified dynamically without restarting. These two parameters take effect only after being restarted.
For the file storage format, the values of these two parameters appear in pairs.
InASMOfRACDo not changeDb_unique_nameBecauseASMThe file storage method is based on some values.
Single standbyParameters onInitorcl. oraConfiguration:
*. _ Db_cache_size = 150994944
*. _ Java_pool_size = 4194304
*. _ Large_pool_size = 4194304
*. _ Shared_pool_size = 130023424
*. _ Streams_pool_size = 0
*. Compatible = '10. 2.0.1.0'
*. Db_block_size = 8192
*. Db_domain =''
*. Db_file_multiblock_read_count = 16
*. Db_name = 'orcl'
*. Db_recovery_file_dest_size = 2147483648
*. Dispatchers = '(PROTOCOL = TCP) (SERVICE = orclXDB )'
*. Job_queue_processes = 10
*. Open_cursors = 300
*. Pga_aggregate_target = 96468992
*. Processses = 150
*. Remote_login_passwordfile = 'clusive'
*. Sga_target = 290455552
*. Undo_management = 'auto'
#Parameters to be modified
*. Control_files = '/home/orastd/oradata/orcl/stdcrl. ctl'
*. Log_archive_config = 'dg _ CONFIG = (orcl, orcl_single )'
*. Standby_archive_dest = '/home/orastd/arch'
*. Log_archive_dest_1 = 'location =/home/orastd/arch'
*. Log_archive_dest_2 = 'service = orcl1 VALID_FOR = (ONLINE_LOGFILES, PRIMARY_ROLE) DB_UNIQUE_NAME = orcl'
*. Db_file_name_convert = '/dev/', '/home/orastd/oradata/orcl/', '+ DG3/orcl/datafile /', '/home/orastd/oradata/orcl /'
*. Log_file_name_convert = '/dev/', '/home/orastd/oradata/orcl /'
*. Standby_file_management = 'auto'
Fal_server = 'orcl1', 'orcl1'
Fal_client = 'orcl _ sing'
Thread = 1
Undo_tablespace = 'undotbs1'
*. Core_dump_dest = '/home/orastd/admin/orcl/cdump'
*. Audit_file_dest = '/home/orastd/admin/orcl/adump'
*. Background_dump_dest = '/home/orastd/admin/orcl/bdump'
*. User_dump_dest = '/home/orastd/admin/orcl/udump'
##Parameters to be added
Db_unique_name = 'orcl _ sing'
Service_name = 'orcl _ sing'
##Parameters to be deleted. The following parameters are:RACAnd can be deleted.
*. Cluster_database_instances = 2
*. Cluster_database = TRUE
Orcl2.instance _ number = 2
Orcl1.instance _ number = 1
*. Remote_listener = 'listeners _ ORCL'
*. Db_recovery_file_dest = '+ DG1'
(3)InRACBack up
Inode2: oracle: orcl2:/db/oracle> rman target/
Inode2: oracle: orcl2:/db/oracle/product/10.2.0/db_1/dbs> rman target/
Recovery Manager: Release 10.2.0.1.0-Production on Wed Feb 23 15:26:01 2011
Copyright (c) 1982,200 5, Oracle. All rights reserved.
Connected to target database: ORCL (DBID = 1268210488)
RMAN> backup database format'/db/dbback/% U ';
....
(4)CreateStandbyControl File
InRACArchive several times on two instances
SQL> alter system switch logfile;
SQL> alter database create standby controlfile as '/db/dbback/stdcrl. ctl ';
(5)Copy the backupStandbyUnder the same directory of the server
BecauseStandbyLibrary andRac2On the same serverInode2, So this step can be omitted.
You only needStdcrl. ctlCopy to the specified directory and grant the following permissions:
Inode2: root:/db/dbback> ls
4bm5ajul_1_1 4cm5ajul_1_1 stdcrl. ctl
Inode2: root:/db/dbback> chown orastd: dba/db/dbback /*
Inode2: root:/db/dbback> ls-l
Total 2057968
-Rw-r ----- 1 orastd dba 487129088 Feb 22 4bm5ajul_1_1
-Rw-r ----- 1 orastd dba 554999808 Feb 22 4cm5ajul_1_1
-Rw-r ----- 1 orastd dba 11550720 Feb 22 stdcrl. ctl
Inode2: root:/db/dbback> cp stdcrl. ctl/home/orastd/oradata/orcl/
(6)StartStandbyToNomountStatus
Create a password file:
Inode2: orastd: orcl:/home/orastd/> orapwd password = oracle file = orapworcl entries = 30
Start the database and createSpfileFile:
Use the following two methods to start the instanceNmountStatus:
Inode2: orastd: orcl:/home/orastd/product/10.2.0/db_1/network/admin> sqlplus "/as sysdba"
SQL * Plus: Release 10.2.0.1.0-Production on Wed Feb 23 10:03:40 2011
Copyright (c) 1982,200 5, Oracle. All rights reserved.
Connected to an idle instance.
SQL> startup nomount
ORACLE instance started.
Total System Global Area 293601280 bytes
Fixed Size 2020392 bytes
Variable Size 138415064 bytes
Database Buffers 150994944 bytes
Redo Buffers 2170880 bytes
SQL> exit
Inode2: orastd: orcl:/home/orastd/product/10.2.0/db_1/network/admin> sqlplus sys/oracle @ ORCL_SINGLE as sysdba
SQL * Plus: Release 10.2.0.1.0-Production on Wed Feb 23 10:04:12 2011
Copyright (c) 1982,200 5, Oracle. All rights reserved.
Connected to an idle instance.
SQL> startup nomount
ORACLE instance started.
Total System Global Area 293601280 bytes
Fixed Size 2020392 bytes
Variable Size 138415064 bytes
Database Buffers 150994944 bytes
Redo Buffers 2170880 bytes
SQL> create spfile from pfile;
File created.
(7)UseRmanCreateStandbyDatabase
InRAC orcl2Restore and restore an instance:
Inode2: oracle: orcl2:/db/oracle/product/10.2.0/db_1/network/admin> rman target/auxiliary sys/oracle @ ORCL_SINGLE
Recovery Manager: Release 10.2.0.1.0-Production on Wed Feb 23 10:19:52 2011
Copyright (c) 1982,200 5, Oracle. All rights reserved.
Connected to target database: ORCL (DBID = 1268210488)
Connected to auxiliary database: ORCL (not mounted)
RMAN> duplicate target database for standby;
Starting Duplicate Db at 23-FEB-11
Using target database control file instead of recovery catalog
Allocated channel: ORA_AUX_DISK_1
Channel ORA_AUX_DISK_1: sid = 156 devtype = DISK
Allocated channel: ORA_AUX_DISK_2
Channel ORA_AUX_DISK_2: sid = 155 devtype = DISK
Contents of Memory Script:
{
Restore clone standby controlfile;
SQL clone 'alter database mount standby database ';
}
Executing Memory Script
Starting restore at 23-FEB-1
.............
Datafile 5 switched to datafile copy
Input datafile copy recid = 29 stamp = 743855043 filename =/home/orastd/oradata/orcl/rundotbs2_raw
Datafile 6 switched to datafile copy
Input datafile copy recid = 30 stamp = 743855044 filename =/home/orastd/oradata/orcl/lcz.256.743266487
Datafile 7 switched to datafile copy
Input datafile copy recid = 31 stamp = 743855044 filename =/home/orastd/oradata/orcl/lcz.257.743186313
Datafile 8 switched to datafile copy
Input datafile copy recid = 32 stamp = 743855044 filename =/home/orastd/oradata/orcl/ts.258.743273077
Finished Duplicate Db at 23-FEB-11
RMAN> exit
Recovery Manager complete