Method: “Manually”
Task 1 (Create First Virtual Machine)
Task 2 (Create Shared Storage and Configure)
Task 3 (Create and Configure the Second Virtual Machine)
Task 4 (Add Ether Net Adapter for Private Network in Both Machine)
Task 5 (Prepare Disk for OCR, Voting and ASM Storage)
Task 6 (Install Oracle Clusterware)
Task 7 (Install Oracle 10gR12 Software/binary)
Task 8 (Configure Oracle Listener)
Task 9 (Create and Configure ASM Instance and ASM DISK Groups)
Task 10 (Mount and open database with new Oracle Home)
Step 1 copy init parameter (initPROD1.ora) file fromto
Step 2 Set environment path.
$ export ORACLE_HOME=/export/home/oracle
$export PATH=$ORACLE_HOME/bin:$PATH
$export ORACLE_SID=PROD1
#sqlplus /nolog
SQL> conn / as sysdba
SQL> startup
Task 11 (Migrate Database to RAC)
We must use RMAN to migrate the data files to ASM disk groups. All data files will be migrated to the newly created disk group, DATA. The redo logs and control files are created in DATA.
Step 1 Migrate Datafile & controle file to ASM.
SQL> connect sys/sys@prod1 as sysdba
Connected.
SQL> alter system set db_create_file_dest=’+DB_DATA’;
System altered.
SQL> alter system set control_files='+DB_DATA/cf1.dbf' scope=spfile;
System altered.
SQL> shutdown immediate;
$ rman target /
RMAN> startup nomount;
Oracle instance started
Total System Global Area 419430400 bytes
Fixed Size 779416 bytes
Variable Size 128981864 bytes
Database Buffers 289406976 bytes
Redo Buffers 262144 bytes
RMAN> restore controlfile from '/export/home/oracle/PROD/control01.ctl';
RMAN> alter database mount;
database mounted
released channel: ORA_DISK_1
RMAN> backup as copy database format '+DB_DATA';
RMAN> switch database to copy;
datafile 1 switched to datafile copy "+DATA/prod1/datafile/system.257.1"
datafile 2 switched to datafile copy "+DATA/prod1/datafile/undotbs1.259.1"
datafile 3 switched to datafile copy "+DATA/prod1/datafile/sysaux.258.1"
datafile 4 switched to datafile copy "+DATA/prod1/datafile/users.260.1"
RMAN> alter database open;
database opened
RMAN> exit
SQL> connect sys/sys@prod1 as sysdba
Connected.
SQL> select tablespace_name, file_name from dba_data_files;
TABLESPACE FILE_NAME
--------------------- -----------------------------------------
USERS +DATA/prod1/datafile/users.260.1
SYSAUX +DATA/prod1/datafile/sysaux.258.1
UNDOTBS1 +DATA/prod1/datafile/undotbs1.259.1
SYSTEM +DATA/prod1/datafile/system.257.1
Step 2 Migrate temp tablespace to ASM.
SQL> alter tablespace temp add tempfile size 100M;
Tablespace altered.
SQL> select file_name from dba_temp_files;
FILE_NAME
-------------------------------------
+DATA/prod1/tempfile/temp.264.3
Step 3 Migrate redo logs to ASM.
Drop existing redo logs and recreate them in ASM disk groups, DATA.
SQL> alter system set db_create_online_log_dest_1='+DB_DATA';
System altered.
SQL> alter system set db_create_online_log_dest_2='+DB_DATA';
System altered.
SQL> select group#, member from v$logfile;
GROUP# MEMBER
--------------- ----------------------------------
1 /oracle/oradata/prod1/redo01.log
2 /oracle/oradata/prod1/redo02.log
SQL> alter database add logfile group 3 size 10M;
Database altered.
SQL> alter system switch logfile;
System altered.
SQL> alter database drop logfile group 1;
Database altered.
SQL> alter database add logfile group 1 size 100M;
Database altered.
SQL> alter database drop logfile group 2;
Database altered.
SQL> alter database add logfile group 2 size 100M;
Database altered.
SQL> alter system switch logfile;
System altered.
SQL> alter database drop logfile group 3;
Database altered.
SQL> select group#, member from v$logfile;
GROUP# MEMBER
--------------- ----------------------------------------
1 +DATA/prod1/onlinelog/group_1.265.3
1 +DATA/prod1/onlinelog/group_1.257.1
2 +DATA/prod1/onlinelog/group_2.266.3
2 +DATA/prod1/onlinelog/group_2.258.1
Step 4 Add additional control file.
If an additional control file is required for redundancy, you can create it in ASM as you would on any other filesystem.
SQL> connect sys/sys@prod1 as sysdba
Connected to an idle instance.
SQL> startup mount
ORACLE instance started.
Total System Global Area 419430400 bytes
Fixed Size 779416 bytes
Variable Size 128981864 bytes
Database Buffers 289406976 bytes
Redo Buffers 262144 bytes
Database mounted.
SQL> alter database backup controlfile to '+RECOVERY/cf2.dbf';
Database altered.
SQL> alter system set control_files='+DATA/cf1.dbf ','+RECOVERY/cf2.dbf' scope=spfile;
System altered.
SQL> shutdown immediate;
ORA-01109: database not open
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.
Total System Global Area 419430400 bytes
Fixed Size 779416 bytes
Variable Size 128981864 bytes
Database Buffers 289406976 bytes
Redo Buffers 262144 bytes
Database mounted.
Database opened.
SQL> select name from v$controlfile;
NAME
---------------------------------------
+DATA/cf1.dbf
+RECOVERY/cf2.dbf
After successfully migrating all the data files over to ASM, the old data files are no longer needed and can be removed. Your single-instance database is now running on ASM!
Task 12 (Add RAC specific parameters in pfile on node 1 (RAC1)
Modify the initPROD1.ora file on node 1 (RAC1) and copy this file to default location of node 2 (RAC2). Add and modify the following parameters:
*.cluster_database_instances=2
*.cluster_database=true
*.remote_listener='LISTENERS_PROD’
PROD1.thread=1
PROD1.instance_number=1
PROD1.undo_tablespace='UNDOTBS1'
PROD2.thread=2
PROD2.instance_number=2
PROD2.undo_tablespace='UNDOTBS2'
Task 12 (Create RAC Data Dictionary Views)
Create the RAC data dictionary views on the first RAC instance.
SQL> !echo $ORACLE_SID
PROD1
SQL> spool /tmp/catclust.log
SQL> @$ORACLE_HOME/rdbms/admin/catclust
...
...
...
SQL> spool off
SQL> shutdown immediate;
Task 13 (Register the RAC instances with CRS)
On node 1 (RAC1):
$ srvctl add database -d PROD -o $ORACLE_HOME
$ srvctl add instance -d PROD -i PROD1 -n rac1
$ srvctl add instance -d PROD -i PROD2 -n rac2
$ srvctl start instance -d PROD -i PROD1
Task 14 (Create redo logs for the second RAC instance)
SQL> connect sys/sys@prod1a as sysdba
Connected.
SQL> alter database add logfile thread 2 group 3 size 100M;
SQL> alter database add logfile thread 2 group 4 size 100M;
SQL> select group#, member from v$logfile;
GROUP# MEMBER
--------------- ----------------------------------------
1 +DATA/prod/onlinelog/group_1.265.3
1 +DATA/prod/onlinelog/group_1.257.1
2 +DATA/prod/onlinelog/group_2.266.3
2 +DATA/prod/onlinelog/group_2.258.1
3 +DATA/prod/onlinelog/group_3.268.1
3 +DATA/prod/onlinelog/group_3.259.1
4 +DATA/prod/onlinelog/group_4.269.1
4 +DATA/prod/onlinelog/group_4.260.1
8 rows selected.
SQL> alter database enable thread 2;
Database altered.
Task 15 (Create undo tablespace for the second RAC instance)
SQL> create undo tablespace UNDOTBS2 datafile size 200M;
SQL> select tablespace_name, file_name from dba_data_files
where tablespace_name=’UNDOTBS2’;
TABLESPACE FILE_NAME
--------------------- --------------------------------------
UNDOTBS2 +DATA/prod/datafile/undotbs2.270.1
Task 16 (Start up the second RAC instance)
$ srvctl start instance -d prod -i prod1b
$ crs_stat -t
$ srvctl status database -d prod
Instance prod1a is running on node rac1
Instance prod1b is running on node rac2
$ srvctl stop database -d prod
$ srvctl start database -d prod
$ sqlplus system/system@prod1
SQL> select instance_number instance#, instance_name, host_name,
status from gv$instance;
INSTANCE# INSTANCE_NAME HOST_NAME STATUS
1 prod1 rac1 OPEN
2 prod2 rac2 OPEN
Task 1 (Create First Virtual Machine)
Task 2 (Create Shared Storage and Configure)
Task 3 (Create and Configure the Second Virtual Machine)
Task 4 (Add Ether Net Adapter for Private Network in Both Machine)
Task 5 (Prepare Disk for OCR, Voting and ASM Storage)
Task 6 (Install Oracle Clusterware)
Task 7 (Install Oracle 10gR12 Software/binary)
Task 8 (Configure Oracle Listener)
Task 9 (Create and Configure ASM Instance and ASM DISK Groups)
Task 10 (Mount and open database with new Oracle Home)
Step 1 copy init parameter (initPROD1.ora) file from
Step 2 Set environment path.
$ export ORACLE_HOME=/export/home/oracle
$export PATH=$ORACLE_HOME/bin:$PATH
$export ORACLE_SID=PROD1
#sqlplus /nolog
SQL> conn / as sysdba
SQL> startup
Task 11 (Migrate Database to RAC)
We must use RMAN to migrate the data files to ASM disk groups. All data files will be migrated to the newly created disk group, DATA. The redo logs and control files are created in DATA.
Step 1 Migrate Datafile & controle file to ASM.
SQL> connect sys/sys@prod1 as sysdba
Connected.
SQL> alter system set db_create_file_dest=’+DB_DATA’;
System altered.
SQL> alter system set control_files='+DB_DATA/cf1.dbf' scope=spfile;
System altered.
SQL> shutdown immediate;
$ rman target /
RMAN> startup nomount;
Oracle instance started
Total System Global Area 419430400 bytes
Fixed Size 779416 bytes
Variable Size 128981864 bytes
Database Buffers 289406976 bytes
Redo Buffers 262144 bytes
RMAN> restore controlfile from '/export/home/oracle/PROD/control01.ctl';
RMAN> alter database mount;
database mounted
released channel: ORA_DISK_1
RMAN> backup as copy database format '+DB_DATA';
RMAN> switch database to copy;
datafile 1 switched to datafile copy "+DATA/prod1/datafile/system.257.1"
datafile 2 switched to datafile copy "+DATA/prod1/datafile/undotbs1.259.1"
datafile 3 switched to datafile copy "+DATA/prod1/datafile/sysaux.258.1"
datafile 4 switched to datafile copy "+DATA/prod1/datafile/users.260.1"
RMAN> alter database open;
database opened
RMAN> exit
SQL> connect sys/sys@prod1 as sysdba
Connected.
SQL> select tablespace_name, file_name from dba_data_files;
TABLESPACE FILE_NAME
--------------------- -----------------------------------------
USERS +DATA/prod1/datafile/users.260.1
SYSAUX +DATA/prod1/datafile/sysaux.258.1
UNDOTBS1 +DATA/prod1/datafile/undotbs1.259.1
SYSTEM +DATA/prod1/datafile/system.257.1
Step 2 Migrate temp tablespace to ASM.
SQL> alter tablespace temp add tempfile size 100M;
Tablespace altered.
SQL> select file_name from dba_temp_files;
FILE_NAME
-------------------------------------
+DATA/prod1/tempfile/temp.264.3
Step 3 Migrate redo logs to ASM.
Drop existing redo logs and recreate them in ASM disk groups, DATA.
SQL> alter system set db_create_online_log_dest_1='+DB_DATA';
System altered.
SQL> alter system set db_create_online_log_dest_2='+DB_DATA';
System altered.
SQL> select group#, member from v$logfile;
GROUP# MEMBER
--------------- ----------------------------------
1 /oracle/oradata/prod1/redo01.log
2 /oracle/oradata/prod1/redo02.log
SQL> alter database add logfile group 3 size 10M;
Database altered.
SQL> alter system switch logfile;
System altered.
SQL> alter database drop logfile group 1;
Database altered.
SQL> alter database add logfile group 1 size 100M;
Database altered.
SQL> alter database drop logfile group 2;
Database altered.
SQL> alter database add logfile group 2 size 100M;
Database altered.
SQL> alter system switch logfile;
System altered.
SQL> alter database drop logfile group 3;
Database altered.
SQL> select group#, member from v$logfile;
GROUP# MEMBER
--------------- ----------------------------------------
1 +DATA/prod1/onlinelog/group_1.265.3
1 +DATA/prod1/onlinelog/group_1.257.1
2 +DATA/prod1/onlinelog/group_2.266.3
2 +DATA/prod1/onlinelog/group_2.258.1
Step 4 Add additional control file.
If an additional control file is required for redundancy, you can create it in ASM as you would on any other filesystem.
SQL> connect sys/sys@prod1 as sysdba
Connected to an idle instance.
SQL> startup mount
ORACLE instance started.
Total System Global Area 419430400 bytes
Fixed Size 779416 bytes
Variable Size 128981864 bytes
Database Buffers 289406976 bytes
Redo Buffers 262144 bytes
Database mounted.
SQL> alter database backup controlfile to '+RECOVERY/cf2.dbf';
Database altered.
SQL> alter system set control_files='+DATA/cf1.dbf ','+RECOVERY/cf2.dbf' scope=spfile;
System altered.
SQL> shutdown immediate;
ORA-01109: database not open
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.
Total System Global Area 419430400 bytes
Fixed Size 779416 bytes
Variable Size 128981864 bytes
Database Buffers 289406976 bytes
Redo Buffers 262144 bytes
Database mounted.
Database opened.
SQL> select name from v$controlfile;
NAME
---------------------------------------
+DATA/cf1.dbf
+RECOVERY/cf2.dbf
After successfully migrating all the data files over to ASM, the old data files are no longer needed and can be removed. Your single-instance database is now running on ASM!
Task 12 (Add RAC specific parameters in pfile on node 1 (RAC1)
Modify the initPROD1.ora file on node 1 (RAC1) and copy this file to default location of node 2 (RAC2). Add and modify the following parameters:
*.cluster_database_instances=2
*.cluster_database=true
*.remote_listener='LISTENERS_PROD’
PROD1.thread=1
PROD1.instance_number=1
PROD1.undo_tablespace='UNDOTBS1'
PROD2.thread=2
PROD2.instance_number=2
PROD2.undo_tablespace='UNDOTBS2'
Task 12 (Create RAC Data Dictionary Views)
Create the RAC data dictionary views on the first RAC instance.
SQL> !echo $ORACLE_SID
PROD1
SQL> spool /tmp/catclust.log
SQL> @$ORACLE_HOME/rdbms/admin/catclust
...
...
...
SQL> spool off
SQL> shutdown immediate;
Task 13 (Register the RAC instances with CRS)
On node 1 (RAC1):
$ srvctl add database -d PROD -o $ORACLE_HOME
$ srvctl add instance -d PROD -i PROD1 -n rac1
$ srvctl add instance -d PROD -i PROD2 -n rac2
$ srvctl start instance -d PROD -i PROD1
Task 14 (Create redo logs for the second RAC instance)
SQL> connect sys/sys@prod1a as sysdba
Connected.
SQL> alter database add logfile thread 2 group 3 size 100M;
SQL> alter database add logfile thread 2 group 4 size 100M;
SQL> select group#, member from v$logfile;
GROUP# MEMBER
--------------- ----------------------------------------
1 +DATA/prod/onlinelog/group_1.265.3
1 +DATA/prod/onlinelog/group_1.257.1
2 +DATA/prod/onlinelog/group_2.266.3
2 +DATA/prod/onlinelog/group_2.258.1
3 +DATA/prod/onlinelog/group_3.268.1
3 +DATA/prod/onlinelog/group_3.259.1
4 +DATA/prod/onlinelog/group_4.269.1
4 +DATA/prod/onlinelog/group_4.260.1
8 rows selected.
SQL> alter database enable thread 2;
Database altered.
Task 15 (Create undo tablespace for the second RAC instance)
SQL> create undo tablespace UNDOTBS2 datafile size 200M;
SQL> select tablespace_name, file_name from dba_data_files
where tablespace_name=’UNDOTBS2’;
TABLESPACE FILE_NAME
--------------------- --------------------------------------
UNDOTBS2 +DATA/prod/datafile/undotbs2.270.1
Task 16 (Start up the second RAC instance)
$ srvctl start instance -d prod -i prod1b
$ crs_stat -t
$ srvctl status database -d prod
Instance prod1a is running on node rac1
Instance prod1b is running on node rac2
$ srvctl stop database -d prod
$ srvctl start database -d prod
$ sqlplus system/system@prod1
SQL> select instance_number instance#, instance_name, host_name,
status from gv$instance;
INSTANCE# INSTANCE_NAME HOST_NAME STATUS
1 prod1 rac1 OPEN
2 prod2 rac2 OPEN
Post a Comment