Professional Documents
Culture Documents
Database Migration - Upgrade 11g To 12c, Non ASM To ASM, Non RAC To RAC
Database Migration - Upgrade 11g To 12c, Non ASM To ASM, Non RAC To RAC
Consider a Typical Database Migration which contains all of this below (and if down time is not a problem)
Environment Details
Source Target
##################################################################################
Step 1:- In order to upgrade or convert to rac We must install 11g software as non - rac assuming installed in Target side
##################################################################################
###################################################################################
Step 2:- Create Tnsnames.ora and Listener.ora (separate) in 11.2.0.4 home in target side
###################################################################################
tnsnames.ora
dbdup =
(DESCRIPTION =
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = dbname.localdomain)
dbname =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = source.localdomain)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = dbname.localdomain)
listener.ora
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = dbname.localdomain)
(ORACLE_HOME = /ora/app/oracle/product/12.1.0.1/db_1)
(SID_NAME = dbname)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
cd /u01/app/oracle/11.2.0.4/db_1/network/admin
lsnrctl start
###################################################################################
###################################################################################
On source
###################################################################################
###################################################################################
sqlplus / as sysdba
###################################################################################
Step 5:- Modify the parameter file especially the following
###################################################################################
*.control_files='+DATA','+DATA'
*.db_create_file_dest='+DATA'
*.db_recovery_file_dest='+FRADG'
*.log_archive_dest_1='location=+FRADG'
#######################################################
Sample File
#######################################################
dbname.__data_transfer_cache_size=0
dbname.__db_cache_size=536870912
dbname.__java_pool_size=16777216
dbname.__large_pool_size=150994944
dbname.__oracle_base='/ora/app/oracle'
dbname.__pga_aggregate_target=671088640
dbname.__sga_target=989855744
dbname.__shared_io_pool_size=50331648
dbname.__shared_pool_size=218103808
dbname.__streams_pool_size=0
*.compatible='12.1.0.2.0'
*.control_files='+DATA','+DATA'
*.db_block_size=8192
*.db_domain='localdomain'
*.db_name='dbname'
*.db_create_file_dest='+DATA'
*.db_recovery_file_dest='+FRADG'
*.db_recovery_file_dest_size=4560m
*.diagnostic_dest='/ora/app/oracle'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=dbnameXDB)'
*.log_archive_dest_1='location=+FRADG'
*.log_archive_dest_state_1='enable'
*.open_cursors=300
*.processes=300
*.remote_login_passwordfile='EXCLUSIVE'
*.undo_tablespace='UNDOTBS1'
###################################################################################
Step 6:- Start the instance in non mount mode in target machine
###################################################################################
export ORACLE_HOME=/u01/app/oracle/11.2.0.4/db_1
export PATH=$ORACLE_HOME/bin:$PATH
export ORACLE_SID=dbname
sqlplus / as sysdba
###################################################################################
Step 7:- In target machine, Using RMAN , run duplicate command as below
###################################################################################
rman
run {
pfile=$ORACLE_HOME/dbs/initdbname.ora
logfile
The above will create a database in ASM with single instance now you need to make this as RAC instance before upgrading to 12c.
###################################################################################
Step 8:- Convert Database to RAC, In target database run the following`
###################################################################################
alter database add logfile thread 2 group 3 ('+DATA','+FRADG') size 200m reuse;
alter database add logfile thread 2 group 4 ('+DATA','+FRADG') size 200m reuse;
###################################################################################
Step 9:- Add the parameters in init file and copy the parameter files to remote nodes as well
###################################################################################
*.cluster_database_instances=2
*.cluster_database=true
dbname1.instance_number=1
dbname2.instance_number=2
dbname1.thread=1
dbname2.thread=2
dbanme1.undo_tablespace='UNDOTBS1'
dbanme2.undo_tablespace='UNDOTBS2'
cd $ORACLE_HOME/dbs
cp initdbname.ora initdbname1.ora
###################################################################################
Step 10: Shut down and compile the binaries with RAC option, this ensures oracle home is enabled with RAC options
###################################################################################
sqlplus / as sysdba
shut immediate
cd $ORACLE_HOME/rdbms/lib
###################################################################################
###################################################################################
Change the
export ORACLE_HOME=/u01/app/oracle/11.2.0.4/db_1
export PATH=$ORACLE_HOME/bin:$PATH
export ORACLE_SID=dbname1 --> ensure this is instance name you are starting
sqlplus / as sysdba
shut immediate
startup
###################################################################################
###################################################################################
srvctl add database -d dbname -o /u01/app/oracle/11.2.0.4/db_1 -p $ORACLE_HOME/dbs/spfileDBNAME.ora
###################################################################################
Step 13:- With all above, the database is converted to RAC & ASM, now the remaining part is to upgrade the database to
12c.
###################################################################################
$ cp /u01/app/oracle/11.2.0.4/db_1/dbs/spfiledbname.ora /u01/app/oracle/product/12.1.0.2/db_1/dbs
$ cp /u01/app/oracle/11.2.0.4/db_1/dbs/orapwdbname1 /u01/app/oracle/product/12.1.0.2/db_1/dbs
export ORACLE_HOME=/u01/app/oracle/12.1.0.2/db_1
export PATH=$ORACLE_HOME/bin:$PATH
export ORACLE_SID=dbname1
sqlplus / as sysdba
startup upgrade
cd $ORACLE_HOME/rdbms/admin
###################################################################################
###################################################################################
###################################################################################
Step 14:- Change the environemnt variables and /etc/oratab entries to new home
###################################################################################