oracle_rac_database_migration_to_rac

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
oracle_rac_database_migration_to_rac [2020/10/18 15:00] – created andonovjoracle_rac_database_migration_to_rac [2020/10/22 12:45] (current) – [Migration] andonovj
Line 7: Line 7:
  
 In our case we will use the RConfig tool. So let's get going In our case we will use the RConfig tool. So let's get going
 +
 +{{ :singleinstance2rac.jpg?600 |}}
  
 =====Prepare the environemnt===== =====Prepare the environemnt=====
-Firstbe sure to take an offline backup of the single instance database, preferably with RMAN:+Firstly we can check how the database is configured: 
 + 
 +<Code:Bash|Check database configuration> 
 +[oracle@enode01 ~]$ srvctl config database -db eastdb 
 +Database unique name: eastdb  
 +Database name: eastdb  
 +Oracle home: /u01/app/oracle/product/12.1.0/dbhome_1  
 +Oracle user: oracle  
 +Spfile: +DATA/EASTDB/PARAMETERFILE/spfile.299.890151031  
 +Password file:  
 +Domain: example.com  
 +Start options: open  
 +Stop options: immediate  
 +Database role: PRIMARY  
 +Management policy: AUTOMATIC  
 +Server pools:  
 +Disk Groups: DATA,FRA  
 +Mount point paths:  
 +Services:  
 +Type: SINGLE                  <- Single instance Database 
 +OSDBA group: dba  
 +OSOPER group: oper  
 +Database instance: eastdb  
 +Configured nodes: enode01  
 +Database is administrator managed  
 +[oracle@enode01 ~]$ 
 +</Code> 
 + 
 + 
 +Be sure to take an offline backup of the single instance database, preferably with RMAN:
  
 <Code:bash|Create offlien backup> <Code:bash|Create offlien backup>
Line 17: Line 48:
 $ backup database; $ backup database;
 $ alter database open; $ alter database open;
-</Code<+</Code>
  
 In case the database has a standby increase archivelog apply gap: In case the database has a standby increase archivelog apply gap:
Line 48: Line 79:
 <!-- Verify does a precheck to ensure all pre-requisites are met, before the  <!-- Verify does a precheck to ensure all pre-requisites are met, before the 
 conversion is attempted. Allowable values are: YES|NO|ONLY -->  conversion is attempted. Allowable values are: YES|NO|ONLY --> 
- **<n:Convert verify="ONLY">** + <n:Convert verify="ONLY">                                                             <- Modify it to ONLY
 <!--Specify current OracleHome of non-rac database for SourceDBHome -->  <!--Specify current OracleHome of non-rac database for SourceDBHome --> 
    
-<n:SourceDBHome>/u01/app/oracle/product/12.1.0/dbhome_1</n:SourceDBHome> +<n:SourceDBHome>/u01/app/oracle/product/12.1.0/dbhome_1</n:SourceDBHome>               <- Modify it to the correct value
 <!--Specify OracleHome where the rac database should be configured. It can be  <!--Specify OracleHome where the rac database should be configured. It can be 
 same as SourceDBHome -->  same as SourceDBHome --> 
    
-<n:TargetDBHome>/u01/app/oracle/product/12.1.0/dbhome_1</n:TargetDBHome> +<n:TargetDBHome>/u01/app/oracle/product/12.1.0/dbhome_1</n:TargetDBHome>               <- Modify it to the correct value
 <!--Specify SID of non-rac database and credential. User with sysdba role is  <!--Specify SID of non-rac database and credential. User with sysdba role is 
 required to perform conversion -->  required to perform conversion --> 
Line 61: Line 92:
  <n:Credentials>   <n:Credentials> 
  <n:User>sys</n:User>   <n:User>sys</n:User> 
- <n:Password>oracle_4U</n:Password> + <n:Password>oracle_4U</n:Password>                                                    <- Modify it to the correct value
  <n:Role>sysdba</n:Role>   <n:Role>sysdba</n:Role> 
  </n:Credentials>   </n:Credentials> 
 <!--Specify Windows Secure Oracle Home Credentials if the Oracle Home was  <!--Specify Windows Secure Oracle Home Credentials if the Oracle Home was 
 installed with Secure User option --> installed with Secure User option -->
 + <n:Credentials> 
 + <n:User>UserDomain\SecureHomeUserName</n:User> 
 + <n:Password>oracle</n:Password> 
 + <n:Role>windows_svc</n:Role> 
 + </n:Credentials> 
 +--> 
 + </n:SourceDBInfo> 
 +<!--Specify the list of nodes that should have rac instances running for the 
 +Admin Managed Cluster Database. LocalNode should be the first node in this 
 +nodelist. --> 
 + <n:NodeList> 
 + <n:Node name="enode01"/>                                                    <- Modify it to the correct value
 + <n:Node name="enode02"/>                                                    <- Modify it to the correct value
 + </n:NodeList> 
 +<!--Specify RacOneNode along with servicename to convert database to RACOne 
 +Node --> 
 + <!--n:RacOneNode servicename="salesrac1service"/--> 
 +<!--Instance Prefix tag is optional starting with 11.2. If left empty, it is 
 +derived from db_unique_name.--> 
 + <n:InstancePrefix>eastdb</n:InstancePrefix>                                  <- Modify it to the correct value
 +<!-- Listener details are no longer needed starting 11.2. Database is 
 +registered with default listener and SCAN listener running from Oracle Grid 
 +Infrastructure home. --> 
 +<!--Specify the type of storage to be used by rac database. Allowable values 
 +are CFS|ASM. The non-rac database should have same storage type. ASM 
 +credentials are no needed for conversion. --> 
 + <n:SharedStorage type="ASM"> 
 +<!--Specify Database Area Location to be configured for rac database.If this 
 +field is left empty, current storage will be used for rac database. For CFS, 
 +this field will have directory path. --> 
 + <n:TargetDatabaseArea></n:TargetDatabaseArea>                                <-<- We don't move files so we don't need that parameter
 +<!--Specify Fast Recovery Area to be configured for rac database. If this field 
 +is left empty, current recovery area of non-rac database will be configured for 
 +rac database. If current database is not using recovery Area, the resulting rac 
 +database will not have a recovery area. --> 
 + 
 + <n:TargetFlashRecoveryArea></n:TargetFlashRecoveryArea>                        <- We don't move files so we don't need that parameter
 + </n:SharedStorage> 
 + </n:Convert> 
 + </n:ConvertToRAC> 
 +</n:RConfig> 
 +:wq! 
 +[oracle@enode01 sampleXMLs]$
 </Code> </Code>
  
 +====Test the conversion====
 +With that, we can test if the conversion will succeed as follows:
 +
 +<Code:bash|Test>
 +[oracle@enode01 sampleXMLs]$ rconfig ConvertToRAC_AdminManaged.xml
 +<?xml version="1.0" ?> 
 +<RConfig version="1.1"
 +<ConvertToRAC> 
 + <Convert> 
 + <Response> 
 + <Result code="0"
 + Operation Succeeded
 + </Result> 
 + </Response> 
 + <ReturnValue type="object"> 
 +There is no return value for this step </ReturnValue> 
 + </Convert>
 +</ConvertToRAC></RConfig> 
 +[oracle@enode01 sampleXMLs]$
 +</Code>
 +
 +After we are sure that the operation will succed we can modify the parameter as follows:
 +
 +<Code:bash|Modiy the parameter>
 +[oracle@enode01 sampleXMLs]$ vi ConvertToRAC_AdminManaged.xml
 +<n:Convert verify="YES">
 +:wq! 
 +[oracle@enode01 sampleXMLs]$
 +</Code>
 +
 +=====Migration=====
 +Finally, run the migration as follows:
 +
 +<Code:bash|Migrate>
 +[oracle@enode01 sampleXMLs]$ rconfig ConvertToRAC_AdminManaged.xml
 +Converting Database "eastdb" to Cluster Database. Target Oracle Home: 
 +/u01/app/oracle/product/12.1.0/dbhome_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 
 +<?xml version="1.0" ?> 
 +<RConfig version="1.1"
 +<ConvertToRAC> 
 + <Convert> 
 + <Response> 
 + <Result code="0"
 + Operation Succeeded 
 + </Result> 
 + </Response> 
 + <ReturnValue type="object"> 
 +<Oracle_Home> 
 + /u01/app/oracle/product/12.1.0/dbhome_1 
 + </Oracle_Home> 
 + <Database type="ADMIN_MANAGED"
 + <InstanceList> 
 + <Instance SID="eastdb1" Node="enode01"
 + </Instance> 
 + <Instance SID="eastdb2" Node="enode02"
 + </Instance>
 +/Database> </ReturnValue> 
 + </Convert> 
 +</ConvertToRAC></RConfig>
 +[oracle@enode01 sampleXMLs]$
 +</Code>
 +
 +Once that is done, we can test the database configuration:
 +
 +<Code:bash|Check the reconfiguration>
 +[oracle@enode01 sampleXMLs]$ srvctl config database -db eastdb
 +Database unique name: eastdb 
 +Database name: eastdb 
 +Oracle home: /u01/app/oracle/product/12.1.0/dbhome_1 
 +Oracle user: oracle 
 +Spfile: +DATA/EASTDB/PARAMETERFILE/spfile.299.890151031 
 +Password file: +DATA/eastdb/orapweastdb 
 +Domain: example.com 
 +Start options: open 
 +Stop options: immediate 
 +Database role: PRIMARY 
 +Management policy: AUTOMATIC 
 +Server pools: 
 +Disk Groups: DATA,FRA 
 +Mount point paths: 
 +Services: 
 +Type: RAC                <- Changed to RAC Database
 +Start concurrency: 
 +Stop concurrency: 
 +OSDBA group: dba 
 +OSOPER group: oper 
 +Database instances: eastdb1,eastdb2 
 +Configured nodes: enode01,enode02 
 +Database is administrator managed 
 +[oracle@enode01 sampleXMLs]$
 +</Code>
  • oracle_rac_database_migration_to_rac.1603033256.txt.gz
  • Last modified: 2020/10/18 15:00
  • by andonovj