{"id":165,"date":"2017-08-17T00:06:52","date_gmt":"2017-08-17T00:06:52","guid":{"rendered":"http:\/\/www.mrmarkyoung.com\/oracle\/?p=165"},"modified":"2018-06-04T16:49:22","modified_gmt":"2018-06-04T06:49:22","slug":"how-to-convert-an-instance-to-a-cluster-database","status":"publish","type":"post","link":"http:\/\/www.mrmarkyoung.com\/oracle\/2017\/08\/17\/how-to-convert-an-instance-to-a-cluster-database\/","title":{"rendered":"How to convert an instance to a cluster database"},"content":{"rendered":"<p>I have tried to perform this using Enterprise Manager, however I have never been successful. Here are the manual steps.<\/p>\n<p>Migrating a database from one RAC system to another can be performed by cloning the database, once it&#8217;s cloned it can be converted to a cluster database. The following steps are what is required.<\/p>\n<p>Step 1. On the newly created standby database<\/p>\n<pre class=\"lang:default decode:true \" >create pfile='\/tmp\/SOA02PRD1.ora' from spfile;<\/pre>\n<p>Step 2. Modify the \/tmp\/SOA02PRD1.ora file.<\/p>\n<pre class=\"lang:default decode:true \" >\r\nSOA02PRD1.__db_cache_size=1644167168\r\nSOA02PRD1.__java_pool_size=16777216\r\nSOA02PRD1.__large_pool_size=16777216\r\nSOA02PRD1.__shared_pool_size=452984832\r\nSOA02PRD1.__streams_pool_size=0\r\nSOA02PRD2.__db_cache_size=1644167168\r\nSOA02PRD2.__java_pool_size=16777216\r\nSOA02PRD2.__large_pool_size=16777216\r\nSOA02PRD2.__shared_pool_size=452984832\r\nSOA02PRD2.__streams_pool_size=0\r\nSOA02PRD3.__db_cache_size=1644167168\r\nSOA02PRD3.__java_pool_size=16777216\r\nSOA02PRD3.__large_pool_size=16777216\r\nSOA02PRD3.__shared_pool_size=452984832\r\nSOA02PRD3.__streams_pool_size=0\r\n*._log_deletion_policy='all'\r\n*.archive_lag_target=0\r\n*.background_dump_dest='\/app\/oracle\/admin\/NEWSOA02DOV\/bdump'\r\n*.compatible='10.2.0.5.0'\r\n*.control_file_record_keep_time=42\r\n*.control_files='+DATA1\/newsoa02dov\/controlfile\/current.288.864211119','+FRA1\/newsoa02dov\/controlfile\/current.384.864211121'\r\n*.core_dump_dest='\/app\/oracle\/admin\/NEWSOA02DOV\/cdump'\r\n*.db_block_size=8192\r\n*.db_create_file_dest='+DATA1'\r\n*.db_domain='toll.com.au'\r\n*.db_file_multiblock_read_count=16\r\n*.db_name='SOA02PRD'\r\n*.db_recovery_file_dest='+FRA1'\r\n*.db_recovery_file_dest_size=354921M\r\n*.db_unique_name='NEWSOA02DOV'\r\n*.dg_broker_config_file1='+DATA1\/dr1NEWSOA02DOV.dat'\r\n*.dg_broker_config_file2='+DATA1\/dr2NEWSOA02DOV.dat'\r\n*.dg_broker_start=true\r\n*.fal_client='(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=oradbaup01)(PORT=1529)))(CONNECT_DATA=(SERVICE_NAME=NEWSOA02DOV_XPT.toll.com.au)(INSTANCE_NAME=SOA02PRD)(SERVER=dedicated)))'\r\n*.fal_server='(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=atsdbdop01-vip)(PORT=1529))(ADDRESS=(PROTOCOL=TCP)(HOST=atsdbdop02-vip)(PORT=1529)))(CONNECT_DATA=(SERVICE_NAME=SOA02DOV_XPT.toll.com.au)(SERVER=dedicated)))',\r\n'(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=atsdbsuz01-vip)(PORT=1529)))(CONNECT_DATA=(SERVICE_NAME=SOA02SUN_XPT.toll.com.au)(INSTANCE_NAME=SOA02PRD1)(SERVER=dedicated)))'\r\n*.job_queue_processes=10\r\n*.log_archive_config='dg_config=(SOA02DOV,SOA02SUN)'\r\n*.log_archive_dest_1='LOCATION=use_db_recovery_file_dest','valid_for=(ALL_ROLES,ONLINE_LOGFILE)'\r\n*.log_archive_dest_2='LOCATION=use_db_recovery_file_dest','valid_for=(STANDBY_ROLE,STANDBY_LOGFILE)'\r\n*.log_archive_format='%t_%s_%r.dbf'\r\n*.log_archive_format='%t_%s_%r.dbf'\r\n*.log_archive_max_processes=2\r\n*.log_archive_min_succeed_dest=1\r\n*.log_archive_trace=0\r\n*.log_file_name_convert='null','null'\r\n*.open_cursors=300\r\n*.pga_aggregate_target=2147483648\r\n*.processes=1600\r\n*.remote_login_passwordfile='exclusive'\r\n*.resource_limit=TRUE\r\n*.sessions=1765\r\n*.sga_target=2147483648\r\n*.standby_archive_dest=''\r\n*.standby_file_management='AUTO'\r\n*.undo_management='AUTO'\r\n\r\n--ADD THIS SECTION BELOW AND MODIFY TO YOUR CONFIGURATION\r\n*.cluster_database=TRUE\r\n*.cluster_database_instances=3\r\nSOA02PRD1.undo_tablespace=undotbs1\r\nSOA02PRD2.undo_tablespace=UNDOTBS2\r\nSOA02PRD3.undo_tablespace=UNDOTBS3\r\nSOA02PRD1.instance_number=1\r\nSOA02PRD2.instance_number=2\r\nSOA02PRD3.instance_number=3\r\nSOA02PRD1.instance_name=SOA02PRD1\r\nSOA02PRD2.instance_name=SOA02PRD2\r\nSOA02PRD3.instance_name=SOA02PRD3\r\nSOA02PRD1.thread=1\r\nSOA02PRD2.thread=2\r\nSOA02PRD3.thread=3  \r\nSOA02PRD1.local_listener='(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=oradbaup01-vip.toll.com.au)(PORT=1529))))'\r\nSOA02PRD2.local_listener='(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=oradbaup02-vip.toll.com.au)(PORT=1529))))'\r\nSOA02PRD3.local_listener='(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=oradbaup03-vip.toll.com.au)(PORT=1529))))'<\/pre>\n<p>Step 3. Modify the contents of the \/var\/opt\/oracle\/oratab file and include the following<\/p>\n<pre class=\"lang:default decode:true \" >SOA02PRD1<\/pre>\n<p>4. Before shutting down the database, take a note of the spfile<\/p>\n<pre class=\"lang:default decode:true \" >show parameter spfile;\r\n    +DATA\/newdssoap01\/spfiledssoap01.ora_463\r\n\r\n    Shutdown abort;<\/pre>\n<pre class=\"lang:default decode:true \" >oraenv  SOA02PRD1\r\n    sqlplus \"\/ as sysdba\"\r\n    create spfile='+DATA\/newdssoap01\/spfiledssoap01.ora_463' from pfile='\/tmp\/rob.ora';\r\n    exit<\/pre>\n<p>5.  Copy the files to the other nodes in the cluster<\/p>\n<pre class=\"lang:default decode:true \" >cp \/app\/oracle\/product\/10.2.0\/dbs\/initSOA02PRD.ora \/app\/oracle\/product\/10.2.0\/dbs\/initSOA02PRD1.ora\r\n    sqlplus \/ as sysdba\r\n    startup mount<\/pre>\n<p>6. Copy the password file to each node in the cluster<\/p>\n<pre class=\"lang:default decode:true \" >cp orapwSOA02PRD orapwSOA02PRD1\r\n    scp initSOA02PRD1.ora oradbaup02:\/app\/oracle\/product\/10.2.0\/dbs\/initSOA02PRD2.ora\r\n    scp initSOA02PRD1.ora oradbaup03:\/app\/oracle\/product\/10.2.0\/dbs\/initSOA02PRD3.ora\r\n    scp orapwSOA02PRD oradbaup02:\/app\/oracle\/product\/10.2.0\/dbs\/orapwSOA02PRD2\r\n    scp orapwSOA02PRD oradbaup03:\/app\/oracle\/product\/10.2.0\/dbs\/orapwSOA02PRD3<\/pre>\n<p>7. Add the database to the cluster (<\/p>\n<pre class=\"lang:default decode:true \" >. oraenv\r\n    DSSOAP011\r\n    srvctl add database -d NEWDSSOAP01 -n oradbaup01 -m TOLL.COM.AU -o \/app\/oracle\/product\/10.2.0 -p +DATA\/newdssoap01\/spfiledssoap01.ora_463 -r physical_standby -s mount\r\n    srvctl add instance -d NEWDSSOAP01 -i DSSOAP011 -n oradbaup01\r\n    srvctl add instance -d NEWDSSOAP01 -i DSSOAP012 -n oradbaup02\r\n    srvctl add instance -d NEWDSSOAP01 -i DSSOAP013 -n oradbaup03<\/pre>\n<p>8. Make the following directories on all nodes<\/p>\n<pre class=\"lang:default decode:true \" >mkdir -p \/app\/oracle\/admin\/NEWDSSOAP01\/bdump\r\n    mkdir -p \/app\/oracle\/admin\/NEWDSSOAP01\/cdump\r\n    mkdir -p \/app\/oracle\/admin\/NEWDSSOAP01\/udump<\/pre>\n<p>9. Start the database<\/p>\n<pre class=\"lang:default decode:true \" >srvctl start database -d NEWDSSOAP01\r\n    check with crsstat<\/pre>\n<p>10. Ensure listener is setup correctly<\/p>\n<pre class=\"lang:default decode:true \" >. oraenv\r\n    CRS<\/pre>\n<p>    First check that the port is currently configured with the scan listener<\/p>\n<pre class=\"lang:default decode:true \" >srvctl config listener\r\n\r\n    Name: LISTENER\r\n    Type: Database Listener\r\n    Network: 1, Owner: oracle\r\n    Home: <CRS home>\r\n    End points: TCP:1521,1528\r\n    Listener is enabled.\r\n    Listener is individually enabled on nodes:\r\n    Listener is individually disabled on nodes:<\/pre>\n<p>    It&#8217;s not, so we need to add it and restart the listener. Stop any other listener running from the oracle home<\/p>\n<pre class=\"lang:default decode:true \" >srvctl modify scan_listener -endpoints TCP:1521\/TCP:1528\/TCP:1529\r\n    srvctl modify listener -endpoints TCP:1521\/TCP:1528\/TCP:1529\r\n\r\n     ps -ef |grep lsnr\r\n     oracle  2960     1   0   Nov 21 ?           0:23 \/app\/oracle\/product\/10.2.0\/bin\/tnslsnr LISTENER1 -inherit\r\n     kill -9 2960     (make sure you kill the right one)<\/pre>\n<p>11. Ensure monitoring is setup correctly and all targets discovered<\/p>\n<pre class=\"lang:default decode:true \" >emctl control agent runCollection oradbaup01:host DiscoverTargets\r\n    emctl config agent addinternaltargets<\/pre>\n<p>12. Now Configure dataguard from the primary database run the following;<\/p>\n<pre class=\"lang:default decode:true \" >dgmgrl\r\n    connect \/\r\n    DGMGRL> show configuration verbose;\r\n\r\n    Configuration\r\n      Name:                SOA02PRD.TOLL.COM.AU\r\n      Enabled:             YES\r\n      Protection Mode:     MaxPerformance\r\n      Fast-Start Failover: DISABLED\r\n      Databases:\r\n        SOA02DOV    - Primary database\r\n        SOA02SUN    - Physical standby database\r\n        NEWSOA02DOV - Physical standby database\r\n\r\n    Current status for \"SOA02PRD.TOLL.COM.AU\":\r\n    Warning: ORA-16607: one or more databases have failed<\/pre>\n<p>    Remove the new Physical standby database and add it again from the primary database.<\/p>\n<p>    ****** MAKE SURE THERE IS AN ENTRY IN THE TNSNAMES.ORA for the database you are removing and going to add again **********<\/p>\n<pre class=\"lang:default decode:true \" >DGMGRL>remove database 'NEWSOA02DOV'\r\n    DGMGRL>add database 'NEWSOA02DOV' as connect identifier is 'NEWSOA02DOV' maintained as physical;\r\n    DGMGRL>enable database 'NEWSOA02DOV';\r\n\r\n    Check the database connection from the standby database and ensure you don't get any time-out messages\r\n\r\n    If needed start real time apply\r\n    <pre class=\"lang:default decode:true \" >SQL>alter database recover managed standby database using current logfile disconnect from session;<\/pre>\n<p>TIPS & TRAPS<\/p>\n<p>    Make sure correct entries are in tnsnames.ora. Specially, pay attention to local listener, scan listener, vip-listener, use of the service name instead of SID etc.<br \/>\n    Eg. On EIL DR node 2:<\/p>\n<p>    LISTENER_EILPRD12 =  (DESCRIPTION =    (PROTOCOL = TCP)    (HOST = eildbauz02)    (PORT = 1521))<\/p>\n<p>    EILPRDSUN = (DESCRIPTION = (ADDRESS = (PROTOCOL= TCP)(HOST = eildr-scan)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = EILPRDSUN)))<\/p>\n<p>    EILPRDSUN_EILDBAUZ02 =(DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = eildbauz02-vip)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED)(SERVICE_NAME = EILPRDSUN) (INSTANCE_NAME = EILPRD12) ) )<\/p>\n<p>    EILPRDSUN_EILPRD12_DGMGRL = (DESCRIPTION =(ADDRESS_LIST =(ADDRESS = (PROTOCOL = TCP)(HOST = eildbauz02)(PORT = 1521)))(CONNECT_DATA =(SERVICE_NAME = EILPRDSUN_EILPRD12_DGMGRL)))<br \/>\n    Copy password file from a Primary node to corresponding DR node. Eg on node 2 of Primary to node 2 of DR  orapwEILPRD12. Otherwise you will see \"Fatal NI connect error 12537, connecting to:\" errors on alert log, and\/or \" ORA-12521 \" errors in DG log (eg. drcEILPRD11.log ) and very hard to trouble shoot.<\/p>\n<p>    If the DR RAC database has lesser nodes than the Primary RAC database, make sure no entries exist in the DR spfile that are not related to the valid nodes in DR. For example, EIL primary is a 4 node RAC and DR is 2 node RAC. By default, DR init ora files will have non-existent node entries such as eildbauz04 etc.<\/p>\n<p>    Make sure the SP file of the DR cluster database is located in ASM and local init ora files of each DR node with a 1 line in it (pointing to cluster SP file in ASM) is  sitting in $ORACLE_HOME\/dbs<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I have tried to perform this using Enterprise Manager, however I have never been successful. Here are the manual steps. Migrating a database from one RAC system to another can be performed by cloning the database, once it&#8217;s cloned it can be converted to a cluster database. The following steps are what is required. Step &#8230; <a title=\"How to convert an instance to a cluster database\" class=\"read-more\" href=\"http:\/\/www.mrmarkyoung.com\/oracle\/2017\/08\/17\/how-to-convert-an-instance-to-a-cluster-database\/\" aria-label=\"Read more about How to convert an instance to a cluster database\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-165","post","type-post","status-publish","format-standard","hentry","category-oracle-database"],"_links":{"self":[{"href":"http:\/\/www.mrmarkyoung.com\/oracle\/wp-json\/wp\/v2\/posts\/165","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.mrmarkyoung.com\/oracle\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.mrmarkyoung.com\/oracle\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.mrmarkyoung.com\/oracle\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.mrmarkyoung.com\/oracle\/wp-json\/wp\/v2\/comments?post=165"}],"version-history":[{"count":5,"href":"http:\/\/www.mrmarkyoung.com\/oracle\/wp-json\/wp\/v2\/posts\/165\/revisions"}],"predecessor-version":[{"id":170,"href":"http:\/\/www.mrmarkyoung.com\/oracle\/wp-json\/wp\/v2\/posts\/165\/revisions\/170"}],"wp:attachment":[{"href":"http:\/\/www.mrmarkyoung.com\/oracle\/wp-json\/wp\/v2\/media?parent=165"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.mrmarkyoung.com\/oracle\/wp-json\/wp\/v2\/categories?post=165"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.mrmarkyoung.com\/oracle\/wp-json\/wp\/v2\/tags?post=165"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}