Part I - Move your single instance database over to a RAC environment
1. Take a backup directory of your ORACLE_HOME for the ORCL database under the oradata directory
[oracle@testserver01 12.2.0]$ cd /oradata
[oracle@testserver01 12.2.0]$ mkdir backup
[oracle@testserver01 12.2.0]$ cd $ORACLE_HOME
[oracle@testserver01 12.2.0]$ cd ../
[oracle@testserver01 12.2.0]$tar -cvf /oradata/backup/DB12c_HOME.tar db_1
2. zip up the backup file to make it more light weight
[oracle@testserver01 12.2.0]$ cd /oradata/backup
[oracle@testserver01 backup]$ ll
total 5403744
-rw-r--r-- 1 oracle oinstall 5528023040 Jan 30 09:58 DB12c_HOME.tar
[oracle@testserver01 backup]$ gzip DB12c_HOME.tar
3. Make the appropriate ORACLE_HOME directory in the RAC server
[oracle@testRAC1 ~]$ echo $ORACLE_HOME
/u01/app/oracle/product/11.2.0/db_1
[oracle@testRAC1 ~]$
[oracle@testRAC1 ~]$ cd $ORACLE_HOME
[oracle@testRAC1 db_1]$ pwd
/u01/app/oracle/product/11.2.0/db_1
[oracle@testRAC1 db_1]$ cd ../../
[oracle@testRAC1 product]$ pwd
/u01/app/oracle/product
[oracle@testRAC1 product]$ mkdir 12.0.1
[oracle@testRAC1 product]$ cd 12.0.1
[oracle@testRAC1 db_1]$ pwd
/u01/app/oracle/product/12.0.1
[oracle@testRAC1 db_1]$
4. Move the zipped file to the RAC server
[oracle@testserver01 backup]$ ll
total 2727320
-rw-r--r-- 1 oracle oinstall 2790039829 Jan 30 09:58 DB12c_HOME.tar.gz
[oracle@testserver01 backup]$ pwd
/oradata/backup
[oracle@testserver01 backup]$ scp DB12c_HOME.tar.gz oracle@testRAC1:/u01/app/oracle/product/12.0.1
The authenticity of host 'testRAC1 (192.168.x.x)' can't be established.
RSA key fingerprint is xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'testRAC1,192.168.x.x' (RSA) to the list of known hosts.
oracle@testRAC1's password:
DB12c_HOME.tar.gz 100% 2661MB 8.6MB/s 05:11
[oracle@testserver01 backup]$
5. unzip & untar the 12c HOME under the appropriate location in the RAC server
[oracle@testRAC1 12.0.1]$ pwd
/u01/app/oracle/product/12.0.1
[oracle@testRAC1 12.0.1]$ ll
total 2727320
-rw-r--r-- 1 oracle oinstall 2790039829 Jan 30 10:36 DB12c_HOME.tar.gz
[oracle@testRAC1 12.0.1]$ gunzip DB12c_HOME.tar.gz
[oracle@testRAC1 12.0.1]$ ll
total 5403744
-rw-r--r-- 1 oracle oinstall 5528023040 Jan 30 10:36 DB12c_HOME.tar
[oracle@testRAC1 12.0.1]$ tar -xvf DB12c_HOME.tar
db_1/
db_1/lib/
db_1/lib/sscoreed.o
db_1/lib/libsql12.a
db_1/lib/libclntsh.so.11.1
db_1/lib/libons.so
db_1/lib/libsrvmhas12.so
db_1/lib/libclsce12.so
You now have your db_1 directory created for the 12c ORACLE_HOME
6. Remove the large tar file from your system
[oracle@testRAC1 12.0.1]$ ll
total 5403748
drwxr-xr-x 70 oracle oinstall 4096 Jan 30 09:30 db_1
-rw-r--r-- 1 oracle oinstall 5528023040 Jan 30 10:36 DB12c_HOME.tar
[oracle@testRAC1 12.0.1]$ rm -f DB12c_HOME.tar
[oracle@testRAC1 12.0.1]$ ll
total 4
drwxr-xr-x 70 oracle oinstall 4096 Jan 30 09:30 db_1
[oracle@testRAC1 12.0.1]$
7. Go to the 12c ORACLE_HOME/bin directory as and link the Oracle 12c Software binaries to your new OS (This simulates the process of a clean Oracle Software install).
Tail the logfile generated on a separate terminal & see the linking that's being done (just so you know how to tail log files when running processes)
[oracle@testRAC1 12.0.1]$ pwd
/u01/app/oracle/product/12.0.1
[oracle@testRAC1 12.0.1]$ ll
total 4
drwxrwxr-x 70 oracle oinstall 4096 Jan 30 09:30 db_1
[oracle@testRAC1 12.0.1]$ cd db_1
[oracle@testRAC1 db_1]$ pwd
/u01/app/oracle/product/12.0.1/db_1
[oracle@testRAC1 db_1]$ export ORACLE_HOME=/u01/app/oracle/product/12.0.1/db_1
[oracle@testRAC1 db_1]$ cd $ORACLE_HOME/bin
[oracle@testRAC1 bin]$ pwd
/u01/app/oracle/product/12.0.1/db_1/bin
[oracle@testRAC1 bin]$ ./relink all
writing relink log to: /u01/app/oracle/product/12.0.1/db_1/install/relink.log
[oracle@testRAC1 bin]$
[oracle@testRAC1 bin]$ tail -f /u01/app/oracle/product/12.0.1/db_1/install/relink.log
When the command prompt returns, your relinking is done.
STOP!! Go back to your single instance environment !!
8. Take an inventory of all your controlfiles, datafiles any archived redo log files from your single instance env't to the RAC server
- First, take an inventory of all the files in your single instance environment
SQL> select name from v$controlfile;
NAME
--------------------------------------------------------------------------------
/oradata/ORCL/controlfile/o1_mf_c985pl01_.ctl
/u01/app/oracle/fast_recovery_area/ORCL/controlfile/o1_mf_c985ploz_.ctl
SQL> select member from v$logfile;
MEMBER
--------------------------------------------------------------------------------
/oradata/ORCL/onlinelog/o1_mf_3_c985q5oy_.log
/u01/app/oracle/fast_recovery_area/ORCL/onlinelog/o1_mf_3_c985q5t1_.log
/oradata/ORCL/onlinelog/o1_mf_2_c985pxxc_.log
/u01/app/oracle/fast_recovery_area/ORCL/onlinelog/o1_mf_2_c985pzj6_.log
/oradata/ORCL/onlinelog/o1_mf_1_c985pq3w_.log
/u01/app/oracle/fast_recovery_area/ORCL/onlinelog/o1_mf_1_c985pqfh_.log
SQL> select name from v$datafile;
NAME
--------------------------------------------------------------------------------
/oradata/ORCL/datafile/o1_mf_system_c985kcf0_.dbf
/oradata/ORCL/datafile/o1_mf_sysaux_c985g9fz_.dbf
/oradata/ORCL/datafile/o1_mf_undotbs1_c985o01b_.dbf
/oradata/ORCL/datafile/o1_mf_users_c985nyqx_.dbf
SQL> select name from v$tempfile;
NAME
--------------------------------------------------------------------------------
/oradata/ORCL/datafile/o1_mf_temp_c985rt8m_.tmp
STOP!! Go back to your RAC environment & create the appropriate parent directories for all the DB files above
[oracle@testRAC1 ~]$ cd /u01
[oracle@testRAC1 u01]$ ll
total 4
drwxrwxr-x 8 oracle oinstall 4096 Jan 28 18:23 app
[oracle@testRAC1 u01]$ mkdir -p oradata/ORCL
[oracle@testRAC1 u01]$ cd /u01/app/oracle
[oracle@testRAC1 oracle]$ mkdir -p fast_recovery_area/ORCL
STOP!! Go back to your single instance environment and move the files over !! Will take a while to transfer all directories and files depending on how large your database is
[oracle@testserver01 ORCL]$ scp -r /oradata/ORCL/* oracle@testRAC1:/u01/oradata/ORCL/
oracle@testRAC1's password:
o1_mf_c985pl01_.ctl 100% 9808KB 9.6MB/s 00:01
o1_mf_users_c985nyqx_.dbf 100% 5128KB 1.0MB/s 00:05
o1_mf_temp_c985rt8m_.tmp 100% 60MB 12.0MB/s 00:05
o1_mf_sysaux_c985g9fz_.dbf 100% 1010MB 7.5MB/s 02:15
o1_mf_system_c985kcf0_.dbf 100% 810MB 6.5MB/s 02:05
o1_mf_undotbs1_c985o01b_.dbf 100% 75MB 10.7MB/s 00:07
o1_mf_1_c985pq3w_.log 100% 50MB 12.5MB/s 00:04
o1_mf_2_c985pxxc_.log 100% 50MB 4.6MB/s 00:11
o1_mf_3_c985q5oy_.log 100% 50MB 6.3MB/s 00:08
[oracle@testserver01 ORCL]$
[oracle@testserver01 ORCL]$ scp -r /u01/app/oracle/fast_recovery_area/ORCL/* oracle@testRAC1:/u01/app/oracle/fast_recovery_area/ORCL
oracle@testRAC1's password:
o1_mf_c985ploz_.ctl 100% 9808KB 576.9KB/s 00:17
o1_mf_3_c985q5t1_.log 100% 50MB 1.0MB/s 00:50
o1_mf_1_c985pqfh_.log 100% 50MB 3.3MB/s 00:15
o1_mf_2_c985pzj6_.log 100% 50MB 4.2MB/s 00:12
[oracle@testserver01 ORCL]$
[oracle@testserver01 ORCL]$
STOP!! Go back to your RAC environment & bring up the single instance database
9. create a pfile from the spfile, then modify the controlfile and db_create_file_dest to point to their new locations
Also create the adump directory
[oracle@testRAC1 ~]$ cd $ORACLE_HOME/dbs
[oracle@testRAC1 dbs]$ ll
total 44
-rwxrwxr-x 1 oracle oinstall 1544 Jan 30 11:33 hc_ORCL.dat
-rwxrwxr-x 1 oracle oinstall 1544 Jan 13 21:50 hc_ZFPRD1.dat
-rwxrwxr-x 1 oracle oinstall 2992 Feb 3 2012 init.ora
-rwxrwxr-x 1 oracle oinstall 24 Jan 11 15:50 lkORCL
-rwxrwxr-x 1 oracle oinstall 24 Jan 13 20:39 lkZFPRD1
-rwxrwxr-x 1 oracle oinstall 7680 Jan 11 15:58 orapwORCL
-rwxrwxr-x 1 oracle oinstall 7680 Jan 13 21:33 orapwZFPRD1
-rwxrwxr-x 1 oracle oinstall 3584 Jan 30 09:30 spfileORCL.ora
-rwxrwxr-x 1 oracle oinstall 3584 Jan 13 23:52 spfileZFPRD1.ora
[oracle@testRAC1 dbs]$ sqlplus / as sysdba
SQL*Plus: Release 12.1.0.2.0 Production on Sat Jan 30 12:58:06 2016
Copyright (c) 1982, 2014, Oracle. All rights reserved.
Connected to an idle instance.
SQL> create pfile from spfile;
File created.
SQL> !
[oracle@testRAC1 dbs]$ ls -ltr
total 48
-rwxrwxr-x 1 oracle oinstall 2992 Feb 3 2012 init.ora
-rwxrwxr-x 1 oracle oinstall 24 Jan 11 15:50 lkORCL
-rwxrwxr-x 1 oracle oinstall 7680 Jan 11 15:58 orapwORCL
-rwxrwxr-x 1 oracle oinstall 24 Jan 13 20:39 lkZFPRD1
-rwxrwxr-x 1 oracle oinstall 7680 Jan 13 21:33 orapwZFPRD1
-rwxrwxr-x 1 oracle oinstall 1544 Jan 13 21:50 hc_ZFPRD1.dat
-rwxrwxr-x 1 oracle oinstall 3584 Jan 13 23:52 spfileZFPRD1.ora
-rwxrwxr-x 1 oracle oinstall 3584 Jan 30 09:30 spfileORCL.ora
-rwxrwxr-x 1 oracle oinstall 1544 Jan 30 12:58 hc_ORCL.dat
-rw-r--r-- 1 oracle oinstall 989 Jan 30 12:58 initORCL.ora
[oracle@testRAC1 dbs]$
[oracle@testRAC1 dbs]$ vi initORCL.ora
*control_files='/u01/oradata/ORCL/controlfile/o1_mf_c985pl01_.ctl','/u01/app/oracle/fast_recovery_area/ORCL/controlfile/o1_mf_c985ploz_.ctl'
*.db_create_file_dest='/u01/oradata'
[oracle@testRAC1 ~]$ cd $ORACLE_BASE/admin/ORCL
[oracle@testRAC1 ORCL]$ mkdir adump
[oracle@testRAC1 ORCL]$ ll
total 8
drwxr-xr-x 2 oracle oinstall 4096 Jan 30 13:11 adump
drwxr-xr-x 2 oracle oinstall 4096 Jan 30 13:09 xdb_wallet
[oracle@testRAC1 ORCL]$
10. create a new controlfile for your database with your basic redo & datafile information using a script similar to the following
[oracle@testRAC1 dbs]$ vi create_controlfile.sql
[oracle@testRAC1 dbs]$ sqlplus / as sysdba
SQL*Plus: Release 12.1.0.2.0 Production on Sat Jan 30 14:41:33 2016
Copyright (c) 1982, 2014, Oracle. All rights reserved.
Connected to an idle instance.
SQL> @create_controlfile.sql
SQL> spool create_controlfile.log
SQL>
SQL> STARTUP NOMOUNT
ORACLE instance started.
Total System Global Area 834666496 bytes
Fixed Size 2929888 bytes
Variable Size 557845280 bytes
Database Buffers 268435456 bytes
Redo Buffers 5455872 bytes
SQL>
SQL> CREATE CONTROLFILE REUSE DATABASE "ORCL" NORESETLOGS NOARCHIVELOG
2 MAXLOGFILES 32
3 MAXLOGMEMBERS 2
4 MAXDATAFILES 32
5 MAXINSTANCES 1
6 MAXLOGHISTORY 449
7 LOGFILE
8 GROUP 1 '/u01/oradata/ORCL/onlinelog/o1_mf_1_c985pq3w_.log',
9 GROUP 2 '/u01/oradata/ORCL/onlinelog/o1_mf_2_c985pxxc_.log',
10 GROUP 3 '/u01/oradata/ORCL/onlinelog/o1_mf_3_c985q5oy_.log'
11 DATAFILE
12 '/u01/oradata/ORCL/datafile/o1_mf_system_c985kcf0_.dbf',
13 '/u01/oradata/ORCL/datafile/o1_mf_sysaux_c985g9fz_.dbf',
14 '/u01/oradata/ORCL/datafile/o1_mf_undotbs1_c985o01b_.dbf',
15 '/u01/oradata/ORCL/datafile/o1_mf_users_c985nyqx_.dbf'
16 CHARACTER SET WE8MSWIN1252
17 ;
Control file created.
SQL>
SQL> recover database;
Media recovery complete.
SQL>
SQL> alter database open;
Database altered.
SQL>
SQL> select instance_name,status from v$instance;
INSTANCE_NAME STATUS
---------------- ------------
ORCL OPEN
SQL>
11. Take a backup of your spfile
SQL> create pfile from spfile;
File created.
SQL>
11. Take an inventory of all your datafiles, compare with the one you took earlier and add those that are missing. Also multiplex as needed
SQL> select name from v$controlfile;
NAME
--------------------------------------------------------------------------------
/u01/oradata/ORCL/controlfile/o1_mf_c985pl01_.ctl
/u01/app/oracle/fast_recovery_area/ORCL/controlfile/o1_mf_c985ploz_.ctl
SQL> select name from v$datafile;
NAME
--------------------------------------------------------------------------------
/oradata/ORCL/datafile/o1_mf_system_c985kcf0_.dbf
/oradata/ORCL/datafile/o1_mf_sysaux_c985g9fz_.dbf
/oradata/ORCL/datafile/o1_mf_undotbs1_c985o01b_.dbf
/oradata/ORCL/datafile/o1_mf_users_c985nyqx_.dbf
SQL> alter database add logfile member '/u01/app/oracle/fast_recovery_area/ORCL/onlinelog/redo01.log' to group 1;
Database altered.
SQL> alter database add logfile member '/u01/app/oracle/fast_recovery_area/ORCL/onlinelog/redo02.log ' to group 2;
Database altered.
SQL> alter database add logfile member '/u01/app/oracle/fast_recovery_area/ORCL/onlinelog/redo03.log' to group 3;
Database altered.
SQL> select member from v$logfile;
MEMBER
--------------------------------------------------------------------------------
/u01/oradata/ORCL/onlinelog/o1_mf_3_c985q5oy_.log
/u01/oradata/ORCL/onlinelog/o1_mf_2_c985pxxc_.log
/u01/oradata/ORCL/onlinelog/o1_mf_1_c985pq3w_.log
/u01/app/oracle/fast_recovery_area/ORCL/onlinelog/redo01.log
/u01/app/oracle/fast_recovery_area/ORCL/onlinelog/redo02.log
/u01/app/oracle/fast_recovery_area/ORCL/onlinelog/redo03.log
6 rows selected.
12. Add a tempfile to the TEMP tablespace
SQL> select name from v$tempfile;
no rows selected
SQL> alter tablespace TEMP add tempfile '/u01/oradata/ORCL/datafile/temp01.dbf' size 128M reuse;
Tablespace altered.
SQL>
SQL> select name from v$tempfile;
NAME
--------------------------------------------------------------------------------
/u01/oradata/ORCL/datafile/temp01.dbf
SQL>
13. Bounce the database to ensure a "clean" startup
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL>
SQL>
SQL> startup
ORACLE instance started.
Total System Global Area 834666496 bytes
Fixed Size 2929888 bytes
Variable Size 557845280 bytes
Database Buffers 268435456 bytes
Redo Buffers 5455872 bytes
Database mounted.
Database opened.
SQL>
SQL>
SQL> select instance_name,status from v$instance;
INSTANCE_NAME STATUS
---------------- ------------
ORCL OPEN
SQL> select name,log_mode,open_mode,database_role from v$database;
NAME LOG_MODE OPEN_MODE DATABASE_ROLE
--------- ------------ -------------------- ----------------
ORCL NOARCHIVELOG READ WRITE PRIMARY
SQL>
Your ORCL database is now up and running in the RAC enironment. Part II of this article will be to convert this single instance
that uses filesystem storage to an Oracle RAC database using ASM.
Thanks for reading. Your feedback is very welcome
1. Take a backup directory of your ORACLE_HOME for the ORCL database under the oradata directory
[oracle@testserver01 12.2.0]$ cd /oradata
[oracle@testserver01 12.2.0]$ mkdir backup
[oracle@testserver01 12.2.0]$ cd $ORACLE_HOME
[oracle@testserver01 12.2.0]$ cd ../
[oracle@testserver01 12.2.0]$tar -cvf /oradata/backup/DB12c_HOME.tar db_1
2. zip up the backup file to make it more light weight
[oracle@testserver01 12.2.0]$ cd /oradata/backup
[oracle@testserver01 backup]$ ll
total 5403744
-rw-r--r-- 1 oracle oinstall 5528023040 Jan 30 09:58 DB12c_HOME.tar
[oracle@testserver01 backup]$ gzip DB12c_HOME.tar
3. Make the appropriate ORACLE_HOME directory in the RAC server
[oracle@testRAC1 ~]$ echo $ORACLE_HOME
/u01/app/oracle/product/11.2.0/db_1
[oracle@testRAC1 ~]$
[oracle@testRAC1 ~]$ cd $ORACLE_HOME
[oracle@testRAC1 db_1]$ pwd
/u01/app/oracle/product/11.2.0/db_1
[oracle@testRAC1 db_1]$ cd ../../
[oracle@testRAC1 product]$ pwd
/u01/app/oracle/product
[oracle@testRAC1 product]$ mkdir 12.0.1
[oracle@testRAC1 product]$ cd 12.0.1
[oracle@testRAC1 db_1]$ pwd
/u01/app/oracle/product/12.0.1
[oracle@testRAC1 db_1]$
4. Move the zipped file to the RAC server
[oracle@testserver01 backup]$ ll
total 2727320
-rw-r--r-- 1 oracle oinstall 2790039829 Jan 30 09:58 DB12c_HOME.tar.gz
[oracle@testserver01 backup]$ pwd
/oradata/backup
[oracle@testserver01 backup]$ scp DB12c_HOME.tar.gz oracle@testRAC1:/u01/app/oracle/product/12.0.1
The authenticity of host 'testRAC1 (192.168.x.x)' can't be established.
RSA key fingerprint is xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'testRAC1,192.168.x.x' (RSA) to the list of known hosts.
oracle@testRAC1's password:
DB12c_HOME.tar.gz 100% 2661MB 8.6MB/s 05:11
[oracle@testserver01 backup]$
5. unzip & untar the 12c HOME under the appropriate location in the RAC server
[oracle@testRAC1 12.0.1]$ pwd
/u01/app/oracle/product/12.0.1
[oracle@testRAC1 12.0.1]$ ll
total 2727320
-rw-r--r-- 1 oracle oinstall 2790039829 Jan 30 10:36 DB12c_HOME.tar.gz
[oracle@testRAC1 12.0.1]$ gunzip DB12c_HOME.tar.gz
[oracle@testRAC1 12.0.1]$ ll
total 5403744
-rw-r--r-- 1 oracle oinstall 5528023040 Jan 30 10:36 DB12c_HOME.tar
[oracle@testRAC1 12.0.1]$ tar -xvf DB12c_HOME.tar
db_1/
db_1/lib/
db_1/lib/sscoreed.o
db_1/lib/libsql12.a
db_1/lib/libclntsh.so.11.1
db_1/lib/libons.so
db_1/lib/libsrvmhas12.so
db_1/lib/libclsce12.so
You now have your db_1 directory created for the 12c ORACLE_HOME
6. Remove the large tar file from your system
[oracle@testRAC1 12.0.1]$ ll
total 5403748
drwxr-xr-x 70 oracle oinstall 4096 Jan 30 09:30 db_1
-rw-r--r-- 1 oracle oinstall 5528023040 Jan 30 10:36 DB12c_HOME.tar
[oracle@testRAC1 12.0.1]$ rm -f DB12c_HOME.tar
[oracle@testRAC1 12.0.1]$ ll
total 4
drwxr-xr-x 70 oracle oinstall 4096 Jan 30 09:30 db_1
[oracle@testRAC1 12.0.1]$
7. Go to the 12c ORACLE_HOME/bin directory as and link the Oracle 12c Software binaries to your new OS (This simulates the process of a clean Oracle Software install).
Tail the logfile generated on a separate terminal & see the linking that's being done (just so you know how to tail log files when running processes)
[oracle@testRAC1 12.0.1]$ pwd
/u01/app/oracle/product/12.0.1
[oracle@testRAC1 12.0.1]$ ll
total 4
drwxrwxr-x 70 oracle oinstall 4096 Jan 30 09:30 db_1
[oracle@testRAC1 12.0.1]$ cd db_1
[oracle@testRAC1 db_1]$ pwd
/u01/app/oracle/product/12.0.1/db_1
[oracle@testRAC1 db_1]$ export ORACLE_HOME=/u01/app/oracle/product/12.0.1/db_1
[oracle@testRAC1 db_1]$ cd $ORACLE_HOME/bin
[oracle@testRAC1 bin]$ pwd
/u01/app/oracle/product/12.0.1/db_1/bin
[oracle@testRAC1 bin]$ ./relink all
writing relink log to: /u01/app/oracle/product/12.0.1/db_1/install/relink.log
[oracle@testRAC1 bin]$
[oracle@testRAC1 bin]$ tail -f /u01/app/oracle/product/12.0.1/db_1/install/relink.log
When the command prompt returns, your relinking is done.
STOP!! Go back to your single instance environment !!
8. Take an inventory of all your controlfiles, datafiles any archived redo log files from your single instance env't to the RAC server
- First, take an inventory of all the files in your single instance environment
SQL> select name from v$controlfile;
NAME
--------------------------------------------------------------------------------
/oradata/ORCL/controlfile/o1_mf_c985pl01_.ctl
/u01/app/oracle/fast_recovery_area/ORCL/controlfile/o1_mf_c985ploz_.ctl
SQL> select member from v$logfile;
MEMBER
--------------------------------------------------------------------------------
/oradata/ORCL/onlinelog/o1_mf_3_c985q5oy_.log
/u01/app/oracle/fast_recovery_area/ORCL/onlinelog/o1_mf_3_c985q5t1_.log
/oradata/ORCL/onlinelog/o1_mf_2_c985pxxc_.log
/u01/app/oracle/fast_recovery_area/ORCL/onlinelog/o1_mf_2_c985pzj6_.log
/oradata/ORCL/onlinelog/o1_mf_1_c985pq3w_.log
/u01/app/oracle/fast_recovery_area/ORCL/onlinelog/o1_mf_1_c985pqfh_.log
SQL> select name from v$datafile;
NAME
--------------------------------------------------------------------------------
/oradata/ORCL/datafile/o1_mf_system_c985kcf0_.dbf
/oradata/ORCL/datafile/o1_mf_sysaux_c985g9fz_.dbf
/oradata/ORCL/datafile/o1_mf_undotbs1_c985o01b_.dbf
/oradata/ORCL/datafile/o1_mf_users_c985nyqx_.dbf
SQL> select name from v$tempfile;
NAME
--------------------------------------------------------------------------------
/oradata/ORCL/datafile/o1_mf_temp_c985rt8m_.tmp
STOP!! Go back to your RAC environment & create the appropriate parent directories for all the DB files above
[oracle@testRAC1 ~]$ cd /u01
[oracle@testRAC1 u01]$ ll
total 4
drwxrwxr-x 8 oracle oinstall 4096 Jan 28 18:23 app
[oracle@testRAC1 u01]$ mkdir -p oradata/ORCL
[oracle@testRAC1 u01]$ cd /u01/app/oracle
[oracle@testRAC1 oracle]$ mkdir -p fast_recovery_area/ORCL
STOP!! Go back to your single instance environment and move the files over !! Will take a while to transfer all directories and files depending on how large your database is
[oracle@testserver01 ORCL]$ scp -r /oradata/ORCL/* oracle@testRAC1:/u01/oradata/ORCL/
oracle@testRAC1's password:
o1_mf_c985pl01_.ctl 100% 9808KB 9.6MB/s 00:01
o1_mf_users_c985nyqx_.dbf 100% 5128KB 1.0MB/s 00:05
o1_mf_temp_c985rt8m_.tmp 100% 60MB 12.0MB/s 00:05
o1_mf_sysaux_c985g9fz_.dbf 100% 1010MB 7.5MB/s 02:15
o1_mf_system_c985kcf0_.dbf 100% 810MB 6.5MB/s 02:05
o1_mf_undotbs1_c985o01b_.dbf 100% 75MB 10.7MB/s 00:07
o1_mf_1_c985pq3w_.log 100% 50MB 12.5MB/s 00:04
o1_mf_2_c985pxxc_.log 100% 50MB 4.6MB/s 00:11
o1_mf_3_c985q5oy_.log 100% 50MB 6.3MB/s 00:08
[oracle@testserver01 ORCL]$
[oracle@testserver01 ORCL]$ scp -r /u01/app/oracle/fast_recovery_area/ORCL/* oracle@testRAC1:/u01/app/oracle/fast_recovery_area/ORCL
oracle@testRAC1's password:
o1_mf_c985ploz_.ctl 100% 9808KB 576.9KB/s 00:17
o1_mf_3_c985q5t1_.log 100% 50MB 1.0MB/s 00:50
o1_mf_1_c985pqfh_.log 100% 50MB 3.3MB/s 00:15
o1_mf_2_c985pzj6_.log 100% 50MB 4.2MB/s 00:12
[oracle@testserver01 ORCL]$
[oracle@testserver01 ORCL]$
STOP!! Go back to your RAC environment & bring up the single instance database
9. create a pfile from the spfile, then modify the controlfile and db_create_file_dest to point to their new locations
Also create the adump directory
[oracle@testRAC1 ~]$ cd $ORACLE_HOME/dbs
[oracle@testRAC1 dbs]$ ll
total 44
-rwxrwxr-x 1 oracle oinstall 1544 Jan 30 11:33 hc_ORCL.dat
-rwxrwxr-x 1 oracle oinstall 1544 Jan 13 21:50 hc_ZFPRD1.dat
-rwxrwxr-x 1 oracle oinstall 2992 Feb 3 2012 init.ora
-rwxrwxr-x 1 oracle oinstall 24 Jan 11 15:50 lkORCL
-rwxrwxr-x 1 oracle oinstall 24 Jan 13 20:39 lkZFPRD1
-rwxrwxr-x 1 oracle oinstall 7680 Jan 11 15:58 orapwORCL
-rwxrwxr-x 1 oracle oinstall 7680 Jan 13 21:33 orapwZFPRD1
-rwxrwxr-x 1 oracle oinstall 3584 Jan 30 09:30 spfileORCL.ora
-rwxrwxr-x 1 oracle oinstall 3584 Jan 13 23:52 spfileZFPRD1.ora
[oracle@testRAC1 dbs]$ sqlplus / as sysdba
SQL*Plus: Release 12.1.0.2.0 Production on Sat Jan 30 12:58:06 2016
Copyright (c) 1982, 2014, Oracle. All rights reserved.
Connected to an idle instance.
SQL> create pfile from spfile;
File created.
SQL> !
[oracle@testRAC1 dbs]$ ls -ltr
total 48
-rwxrwxr-x 1 oracle oinstall 2992 Feb 3 2012 init.ora
-rwxrwxr-x 1 oracle oinstall 24 Jan 11 15:50 lkORCL
-rwxrwxr-x 1 oracle oinstall 7680 Jan 11 15:58 orapwORCL
-rwxrwxr-x 1 oracle oinstall 24 Jan 13 20:39 lkZFPRD1
-rwxrwxr-x 1 oracle oinstall 7680 Jan 13 21:33 orapwZFPRD1
-rwxrwxr-x 1 oracle oinstall 1544 Jan 13 21:50 hc_ZFPRD1.dat
-rwxrwxr-x 1 oracle oinstall 3584 Jan 13 23:52 spfileZFPRD1.ora
-rwxrwxr-x 1 oracle oinstall 3584 Jan 30 09:30 spfileORCL.ora
-rwxrwxr-x 1 oracle oinstall 1544 Jan 30 12:58 hc_ORCL.dat
-rw-r--r-- 1 oracle oinstall 989 Jan 30 12:58 initORCL.ora
[oracle@testRAC1 dbs]$
[oracle@testRAC1 dbs]$ vi initORCL.ora
*control_files='/u01/oradata/ORCL/controlfile/o1_mf_c985pl01_.ctl','/u01/app/oracle/fast_recovery_area/ORCL/controlfile/o1_mf_c985ploz_.ctl'
*.db_create_file_dest='/u01/oradata'
[oracle@testRAC1 ~]$ cd $ORACLE_BASE/admin/ORCL
[oracle@testRAC1 ORCL]$ mkdir adump
[oracle@testRAC1 ORCL]$ ll
total 8
drwxr-xr-x 2 oracle oinstall 4096 Jan 30 13:11 adump
drwxr-xr-x 2 oracle oinstall 4096 Jan 30 13:09 xdb_wallet
[oracle@testRAC1 ORCL]$
10. create a new controlfile for your database with your basic redo & datafile information using a script similar to the following
[oracle@testRAC1 dbs]$ vi create_controlfile.sql
[oracle@testRAC1 dbs]$ sqlplus / as sysdba
SQL*Plus: Release 12.1.0.2.0 Production on Sat Jan 30 14:41:33 2016
Copyright (c) 1982, 2014, Oracle. All rights reserved.
Connected to an idle instance.
SQL> @create_controlfile.sql
SQL> spool create_controlfile.log
SQL>
SQL> STARTUP NOMOUNT
ORACLE instance started.
Total System Global Area 834666496 bytes
Fixed Size 2929888 bytes
Variable Size 557845280 bytes
Database Buffers 268435456 bytes
Redo Buffers 5455872 bytes
SQL>
SQL> CREATE CONTROLFILE REUSE DATABASE "ORCL" NORESETLOGS NOARCHIVELOG
2 MAXLOGFILES 32
3 MAXLOGMEMBERS 2
4 MAXDATAFILES 32
5 MAXINSTANCES 1
6 MAXLOGHISTORY 449
7 LOGFILE
8 GROUP 1 '/u01/oradata/ORCL/onlinelog/o1_mf_1_c985pq3w_.log',
9 GROUP 2 '/u01/oradata/ORCL/onlinelog/o1_mf_2_c985pxxc_.log',
10 GROUP 3 '/u01/oradata/ORCL/onlinelog/o1_mf_3_c985q5oy_.log'
11 DATAFILE
12 '/u01/oradata/ORCL/datafile/o1_mf_system_c985kcf0_.dbf',
13 '/u01/oradata/ORCL/datafile/o1_mf_sysaux_c985g9fz_.dbf',
14 '/u01/oradata/ORCL/datafile/o1_mf_undotbs1_c985o01b_.dbf',
15 '/u01/oradata/ORCL/datafile/o1_mf_users_c985nyqx_.dbf'
16 CHARACTER SET WE8MSWIN1252
17 ;
Control file created.
SQL>
SQL> recover database;
Media recovery complete.
SQL>
SQL> alter database open;
Database altered.
SQL>
SQL> select instance_name,status from v$instance;
INSTANCE_NAME STATUS
---------------- ------------
ORCL OPEN
SQL>
11. Take a backup of your spfile
SQL> create pfile from spfile;
File created.
SQL>
11. Take an inventory of all your datafiles, compare with the one you took earlier and add those that are missing. Also multiplex as needed
SQL> select name from v$controlfile;
NAME
--------------------------------------------------------------------------------
/u01/oradata/ORCL/controlfile/o1_mf_c985pl01_.ctl
/u01/app/oracle/fast_recovery_area/ORCL/controlfile/o1_mf_c985ploz_.ctl
SQL> select name from v$datafile;
NAME
--------------------------------------------------------------------------------
/oradata/ORCL/datafile/o1_mf_system_c985kcf0_.dbf
/oradata/ORCL/datafile/o1_mf_sysaux_c985g9fz_.dbf
/oradata/ORCL/datafile/o1_mf_undotbs1_c985o01b_.dbf
/oradata/ORCL/datafile/o1_mf_users_c985nyqx_.dbf
SQL> alter database add logfile member '/u01/app/oracle/fast_recovery_area/ORCL/onlinelog/redo01.log' to group 1;
Database altered.
SQL> alter database add logfile member '/u01/app/oracle/fast_recovery_area/ORCL/onlinelog/redo02.log ' to group 2;
Database altered.
SQL> alter database add logfile member '/u01/app/oracle/fast_recovery_area/ORCL/onlinelog/redo03.log' to group 3;
Database altered.
SQL> select member from v$logfile;
MEMBER
--------------------------------------------------------------------------------
/u01/oradata/ORCL/onlinelog/o1_mf_3_c985q5oy_.log
/u01/oradata/ORCL/onlinelog/o1_mf_2_c985pxxc_.log
/u01/oradata/ORCL/onlinelog/o1_mf_1_c985pq3w_.log
/u01/app/oracle/fast_recovery_area/ORCL/onlinelog/redo01.log
/u01/app/oracle/fast_recovery_area/ORCL/onlinelog/redo02.log
/u01/app/oracle/fast_recovery_area/ORCL/onlinelog/redo03.log
6 rows selected.
12. Add a tempfile to the TEMP tablespace
SQL> select name from v$tempfile;
no rows selected
SQL> alter tablespace TEMP add tempfile '/u01/oradata/ORCL/datafile/temp01.dbf' size 128M reuse;
Tablespace altered.
SQL>
SQL> select name from v$tempfile;
NAME
--------------------------------------------------------------------------------
/u01/oradata/ORCL/datafile/temp01.dbf
SQL>
13. Bounce the database to ensure a "clean" startup
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL>
SQL>
SQL> startup
ORACLE instance started.
Total System Global Area 834666496 bytes
Fixed Size 2929888 bytes
Variable Size 557845280 bytes
Database Buffers 268435456 bytes
Redo Buffers 5455872 bytes
Database mounted.
Database opened.
SQL>
SQL>
SQL> select instance_name,status from v$instance;
INSTANCE_NAME STATUS
---------------- ------------
ORCL OPEN
SQL> select name,log_mode,open_mode,database_role from v$database;
NAME LOG_MODE OPEN_MODE DATABASE_ROLE
--------- ------------ -------------------- ----------------
ORCL NOARCHIVELOG READ WRITE PRIMARY
SQL>
Your ORCL database is now up and running in the RAC enironment. Part II of this article will be to convert this single instance
that uses filesystem storage to an Oracle RAC database using ASM.
Thanks for reading. Your feedback is very welcome
No comments:
Post a Comment