================================
### Overview
# The convertion steps will be from Single DB -> RAC and from RAC -> RAC One.
# The database environment consists of three nodes configured as follows:
# Node1 - RAC One Node 1
# Node2 - RAC One Node 2
# Node3 - Standby Server configured with Data Guard Broker
## Description
# Convertion from RAC -> RAC One node can easilly be done with srvctl convert, but you need to manually stop and remove all rac instances exept one, since RAC One Node only permits one instance running. Before this can be done you need to convert your stand alone DB to RAC. An easy way to do this is with rconfig. Your database will stop and start several times and since RAC adds a prefix number on your instance, the instance name will change in the process.
# We will also add a service for use by the applications in this process. This service will only run when the primary databases is running on the RAC One Nodes. When the primary is on the standby server (node3), these srvices will be down and the connections from the applications will sucessfully failover.
# Summary of the steps involved
1. Switchover from node3 to node1
2. Convertion from Standalone DB -> RAC (rconfig)
3. Convertion from RAC -> RAC One (srvctl)
4. Relocate the databases between node1 and node2 (this will ensure that you get the right instance names)
5. Test of data guard switchover (recommended)
### An Example
## 1. Switchover from node3 to node1
# Switchover from node3 to node1
# - a) First take a switch logfile (check alertlog for applied)
# - b) Switchover with broker (dgmgrl>switchover to
## 2. Convertion from Standalone DB -> RAC (rconfig)
# Prepare for rconfig
bash-3.2$ cd $ORACLE_HOME/bin
bash-3.2$ pwd
/u01/app/oracle/product/11.2.0.3/db_1/bin
bash-3.2$ env |grep ORA
ORACLE_SID=bm2test
ORACLE_BASE=/u01/app/oracle
ORACLE_HOME=/u01/app/oracle/product/11.2.0.3/db_1
# Important!
# Edit xml file, make sure dbfiles and flashback files is blank! We will not convert any files!
./rconfig /u01/app/oracle/product/11.2.0.3/db_1/assistants/rconfig/sampleXMLs/ConvertToRAC_AdminManaged_bm2test.xml
# Expected Output:
Converting Database "bm2test" to Cluster Database. Target Oracle Home: /u01/app/oracle/product/11.2.0.3/db_1. Database Role: PRIMARY.
Setting Data Files and Control Files
Adding Database Instances
Adding Redo Logs
Enabling threads for all Database Instances
Setting TEMP tablespace
Adding UNDO tablespaces
Adding Trace files
Setting Fast Recovery Area
Updating Oratab
Creating Password file(s)
Configuring Listeners
Configuring related CRS resources
Starting Cluster Database
# Check of data guard on node3
# Expected output:
DGMGRL> show configuration
Configuration - dataguard_bm2test
Protection Mode: MaxPerformance
Databases:
bm2test - Primary database
DGbm2test - Physical standby database
Fast-Start Failover: DISABLED
Configuration Status:
SUCCESS
# Add a service for applications
bash-3.2$ srvctl add service -d bm2test -s bm2test_srv -r bm2test1 -a bm2test2
bash-3.2$ srvctl start service -d bm2test -s bm2test_srv
## 3. Convertion from RAC -> RAC One (srvctl)
# Stop instance2 to be able to remove it
bash-3.2$ srvctl stop instance -d bm2test -i bm2test2
# Remove instance from cluster
bash-3.2$ srvctl remove instance -d bm2test -i bm2test2
Remove instance from the database bm2test? (y/[n]) y
# Convert DB
srvctl convert database -d bm2test -c RACONENODE -i bm2test
## 4. Relocate the databases between node1 and node2 (this will ensure that you get the right instance names)
# Get the correct instance names by relocating to node2 and back to node1
srvctl relocate database -d bm2test -n dap-bm2-ora02
# Check the instance on node2, notice the instance name has changed!
oracle@dap-bm2-ora02 /home/oracle > bash
bash-3.2$ ps -ef |grep pmon
oracle 7536688 1 0 18 jan - 0:58 asm_pmon_+ASM2
oracle 11599938 1 0 13:22:22 - 0:00 ora_pmon_bm2test_2
# Relocate back to node1
srvctl relocate database -d bm2test -n dap-bm2-ora01
# Check the instance on node1, notice the instance name has changed!
bash-3.2$ ps -ef |grep pmon
oracle 8716330 1 0 18 jan - 1:03 asm_pmon_+ASM1
oracle 21954792 1 0 13:24:43 - 0:00 ora_pmon_bm2test_1
## Check the data guard
# Check the listener setup on node1, check that the new instance is registered under dbname, dbname_DGMGRL and dbname_DGB
. .profile_grid
lsnrctl status
# Expected output
...
Services Summary...
Service "+ASM" has 1 instance(s).
Instance "+ASM1", status READY, has 1 handler(s) for this service...
Service "bm2test" has 2 instance(s).
Instance "bm2test", status UNKNOWN, has 1 handler(s) for this service...
Instance "bm2test_1", status READY, has 1 handler(s) for this service...
Service "bm2testXDB" has 1 instance(s).
Instance "bm2test_1", status READY, has 1 handler(s) for this service...
Service "bm2test_DGB" has 2 instance(s).
Instance "bm2test", status UNKNOWN, has 1 handler(s) for this service...
Instance "bm2test_1", status READY, has 1 handler(s) for this service...
Service "bm2test_DGMGRL" has 1 instance(s).
Instance "bm2test", status UNKNOWN, has 1 handler(s) for this service...
Service "bm2test_srv" has 1 instance(s).
Instance "bm2test_1", status READY, has 1 handler(s) for this service...
# Check data guard config on node1
DGMGRL> show configuration
Configuration - dataguard_bm2test
Protection Mode: MaxPerformance
Databases:
bm2test - Primary database
DGbm2test - Physical standby database
Fast-Start Failover: DISABLED
Configuration Status:
SUCCESS
# Check for transport lag, should be 0
show database verbose 'DGbm2test'
# Expected output
Database - DGbm2test
Role: PHYSICAL STANDBY
Intended State: APPLY-ON
Transport Lag: 0 seconds
Apply Lag: 0 seconds
Real Time Query: OFF
Instance(s):
DGbm2test
# Check data guard configuration on node 3 (this was done after a switchover test)
# Notice that all 4 instances is registered.
DGMGRL> show database verbose bm2test
Database - bm2test
Role: PHYSICAL STANDBY
Intended State: APPLY-ON
Transport Lag: 0 seconds
Apply Lag: 0 seconds
Real Time Query: OFF
Instance(s):
bm2test1
bm2test2
bm2test_1 (apply instance)
bm2test_2
# Consider recreating the broker configuration!
# Check the static connection identifier (port 1521 should be changed)
## 5. Test of data guard switchover (recommended)
# Recommended post steps to check that everything is 100% working and that you are protected!
# Performe switchover to node3
# Performe switchover to node1
!NB remember to have the right instance in the LISTENER.ORA for Data Guard... (not a problem?)
No comments:
Post a Comment