Convert a single oracle instance database to a RAC database

Source: Internet
Author: User

Test Purpose: Single Instance database conversion to RAC database
Test environment: Oracle 11.2.0.4
Test method: Manual Conversion
.
First, install a set of RAC environments and restore single-instance databases to this environment through Rman (typically, in production environments, we build ADG from RAC to single-instance databases to reduce downtime).

Then generate a source library (single-instance database) SPFile:

Startup pfile=/home/oracle/lunar/spfile.lunardb.tmp
08:07:25 sys@lunardb>show parameter SPFile
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
SPFile string
08:08:38 sys@lunardb>
Note that the two configuration entries used for the Local_listener parameter in Tnsnames.ora are correct:
listener_rac1= (address = (PROTOCOL = TCP) (HOST = dm0101-vip.lunar.com) (PORT = 1521))
listener_rac2= (address = (PROTOCOL = TCP) (HOST = dm0102-vip.lunar.com) (PORT = 1521))
Modify the Pfile file (/home/oracle/lunar/spfile.lunardb.tmp) that you just backed up and add the RAC-related configuration:
*.audit_file_dest= '/u01/app/oracle/admin/lunardb/adump '
*.audit_trail= ' NONE '
*.compatible= ' 11.2.0.3.0 '
*.control_files= ' +datadg/lunardb/control01.ctl ', ' +datadg/lunardb/control02.ctl '
*.db_block_size=8192
*.db_domain= '
*.db_files=2000
*.db_name= ' Lunardb '
*.db_recovery_file_dest= ' +RECODG '
*.db_recovery_file_dest_size=336870912000
*.db_unique_name= ' Lunardb '
*.deferred_segment_creation=false
*.diagnostic_dest= '/u01/app/oracle '
*.dispatchers= ' (protocol=tcp) (SERVICE=LUNARDBXDB) '
*.log_archive_dest_1= ' Location=use_db_recovery_file_dest valid_for= (all_logfiles,all_roles) DB_UNIQUE_NAME= Lunardb '
*.log_archive_dest_state_1= ' ENABLE '
*.open_cursors=500
*.pga_aggregate_target=1059552256
*.processes=500
*.remote_login_passwordfile= ' EXCLUSIVE '
*.resource_manager_plan= '
*.session_cached_cursors=2000
*.sga_target=0
*.standby_file_management= ' AUTO '
*.undo_tablespace= ' UNDOTBS1 '
#*.use_large_pages= ' only '
*.db_cache_size=3g
*.shared_pool_size=3g
*.streams_pool_size=28m
*.java_pool_size=200m
*.log_buffer=37108864
*.job_queue_processes=20
*.cluster_database=true
*.cluster_database_instances=2
*.undo_management=auto
*.db_create_file_dest= ' +DATADG '
*.db_create_online_log_dest_1= ' +RECODG '
Lunardb1.undo_tablespace= ' UNDOTBS1 '
Lunardb2.undo_tablespace= ' UNDOTBS2 '
Lunardb1.instance_number=1
lunardb2.instance_number=2
Lunardb1.instance_name=lunardb1
Lunardb2.instance_name=lunardb2
Lunardb1.thread=1
lunardb2.thread=2
Lunardb1.local_listener=listener_rac1
Lunardb2.local_listener=listener_rac2
Use this pfile to start the database:
08:26:59 @>startup pfile=/home/oracle/lunar/spfile.lunardb.tmp
ORACLE instance started.

Total System Global area 6881869824 bytes
Fixed Size 2266064 bytes
Variable Size 3573550128 bytes
Database buffers 3221225472 bytes
Redo buffers 84828160 bytes
Database mounted.
Database opened.
08:27:30 @>
Add Thread2:
08:27:30 @>alter Database Add logfile thread 2
08:28:16 2 Group (' +RECODG ') size 1024m,
08:28:16 3 Group (' +RECODG ') size 1024m,
08:28:16 4 Group (' +RECODG ') size 1024m,
Group (' +RECODG ') size 1024m,
08:28:16 5 08:28:16 6 Group (' +RECODG ') size 1024m,
08:28:16 7 Group (' +RECODG ') size 1024m,
Group (' +RECODG ') size 1024m,
08:28:16 8 08:28:16 9 Group (' +RECODG ') size 1024m,
Group (' +RECODG ') size 1024m,
08:28:16 08:28:16 Group (' +RECODG ') size 1024m,
08:28:16 Group (' +RECODG ') size 1024m,
Group (' +RECODG ') size 1024m,
08:28:16 08:28:16 (' +recodg ') size 1024m,
08:28:16 Group (' +RECODG ') size 1024m,
08:28:16 Group (' +RECODG ') size 1024m,
08:28:16 Group (' +RECODG ') size 1024m
; 08:28:16 18

Database altered.

elapsed:00:00:28.51
08:28:46 @>
Add the Undo table space for instance 2:
08:28:46 @>create UNDO tablespace UNDOTBS2 datafile ' +DATADG ' SIZE 10480m;

Tablespace created.

elapsed:00:00:09.87
08:29:11 @>
Enable Instance 2 (THREAD2):
08:29:11 @>alter database enable public thread 2;

Database altered.

elapsed:00:00:00.59
08:29:29 @>
1<br>
Create spfile:<p></p>
<pre class= "Brush:bash; Title:; Notranslate "title=" ">08:33:58 @>create spfile= ' +DATADG ' from pfile= '/home/oracle/lunar/spfile.lunardb.tmp ';

File created.

elapsed:00:00:00.21
08:35:30 @>
</pre>
<p> view:</p> using grid users
<pre class= "Brush:bash; Title:; Notranslate "title=" ">ASMCMD> ls"
spfile.3296.878718931
asmcmd> pwd
+datadg/lunardb/parameterfile
Asmcmd>
</pre>
<p> Modify Initlunardb1.ora file:</p>
<pre class= "Brush:bash; Title:; Notranslate "title=" ">[oracle@dm01db01 dbs]$ cat Initlunardb1.ora
Spfile= ' +datadg/lunardb/parameterfile/spfile.3296.878718931 '
[Oracle@dm01db01 dbs]$
</pre>
<p> Check Database:</p>
<pre class= "Brush:bash; Title:; Notranslate "title=" ">08:42:07 sys@lunardb>show parameter SPFile

NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
SPFile string +DATADG/LUNARDB/PARAMETERFILE/SPF
ile.3296.878718931
08:42:11 sys@lunardb>show parameter Cluster

NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
Cluster_database Boolean TRUE
Cluster_database_instances Integer 2
Cluster_interconnects string
08:42:14 sys@lunardb>
</pre>

<p> executive @?/rdbms/admin/catclust.sql, this process according to the document can be, nothing to say, the implementation of the check log to see if there is an error. <br>

Then start the database and check to see if all 2 database instances are normal </p>
<pre class= "Brush:bash; Title:; Notranslate "title=" ">sys@lunardb2>startup
ORACLE instance started.

Total System Global area 6881869824 bytes
Fixed Size 2266064 bytes
Variable Size 3573550128 bytes
Database buffers 3221225472 bytes
Redo buffers 84828160 bytes
Database mounted.
Database opened.
Sys@lunardb2>select * from V$active_instances;

Inst_number Inst_name
---------------- ----------------------------------------------------------------------------------------------- -------------------------
1 DM01DB01.LUNAR.COM:LUNARDB1
2 DM01DB02.LUNAR.COM:LUNARDB2

elapsed:00:00:00.00
Sys@lunardb2>
Sys@lunardb2>show parameter SPFile

NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
SPFile string +DATADG/LUNARDB/PARAMETERFILE/SPF
ile.3296.878718931
Sys@lunardb2>
</pre>

<p> Add database instances to CRS:</p>

<pre class= "Brush:bash; Title:; Notranslate "title=" ">[oracle@dm01db01 ~]$ srvctl config database-d lunardb
Prcd-1120:the resource for database Lunardb could is not found.
Prcr-1001:resource ora.lunardb.db does not exist
[Oracle@dm01db01 ~]$
[Oracle@dm01db01 ~]$ srvctl add database-d lunardb-o/u01/app/oracle/product/11.2.0.4/dbhome_1
[Oracle@dm01db01 ~]$ srvctl add instance-d lunardb-n dm01db01-i
[Oracle@dm01db01 ~]$ srvctl add instance-d lunardb-n dm01db02-i
[oracle@dm01db01 ~]$ srvctl config database-d lunardb
Database Unique Name:lunardb
Database Name:
Oracle Home:/u01/app/oracle/product/11.2.0.4/dbhome_1
Oracle user:oracle
Spfile:
Domain:
Start Options:open
Stop options:immediate
Database role:primary
Management policy:automatic
Server Pools:lunardb
Database INSTANCES:LUNARDB1,LUNARDB2
Disk Groups:
Mount Point paths:
Services:
Type:rac
Database is administrator managed
[Oracle@dm01db01 ~]$
[Oracle@dm01db01 ~]$ srvctl Modify database-d lunardb-a
[Oracle@dm01db01 ~]$ srvctl Modify database-d lunardb-p ' +datadg/lunardb/parameterfile/spfile.3296.878718931 '
[oracle@dm01db01 ~]$ srvctl config database-d lunardb
Database Unique Name:lunardb
Database Name:
Oracle Home:/u01/app/oracle/product/11.2.0.4/dbhome_1
Oracle user:oracle
Spfile: +datadg/lunardb/parameterfile/spfile.3296.878718931
Domain:
Start Options:open
Stop options:immediate
Database role:primary
Management policy:automatic
Server Pools:lunardb
Database INSTANCES:LUNARDB1,LUNARDB2
Disk GROUPS:DATADG,RECODG
Mount Point paths:
Services:
Type:rac
Database is administrator managed
[Oracle@dm01db01 ~]$
</pre>

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.