Вы находитесь на странице: 1из 4

-------------------------------------- Convert Single instance to RAC

------------------------------------------------------------------------------------------------------ 1) Create redo for second instance


----------------------------------------------------------------SQL> select member from v$logfile;
alter database add logfile thread 2 group 21 ('+DATA') size 100M;
alter database add logfile thread 2 group 22 ('+DATA') size 100M;
alter database add logfile thread 2 group 23 ('+DATA') size 100M;
SQL> alter database enable public thread 2;
----------------------------------------------------------------select GROUP# , THREAD# from v$log;
---------------------------------------------------------------------------------------------------------------------------------- 2) Create undo tablespace for second instance
----------------------------------------------------------------SQL> create undo tablespace PSAPUNDO1 datafile '+DATA' size 30M;
SQL> create undo tablespace PSAPUNDO2 datafile '+DATA' size 30M;
-----------------------------------------------------------------

------------------------------------------------------------------ 3) Adding RAC Parameters


----------------------------------------------------------------SQL> create pfile from spfile;
----------------------------------------------------------------$ vi $ORACLE_HOME/dbs/initQAS.ora
-- Remove *.undo_tablespace parameter
-- Add cluster related DB parameters
----------------------------------------------------------------*.cluster_database_instances=2
*.cluster_database=true
QAS1.instance_number=1
QAS2.instance_number=2
QAS1.instance_name=QAS1
QAS2.instance_name=QAS2
QAS1.thread=1
QAS2.thread=2
QAS1.undo_tablespace='PSAPUNDO1'
QAS2.undo_tablespace='PSAPUNDO2'
------------------------------------------------------------------ Copy pfile & password file to oraQAS02 and rename it
----------------------------------------------------------------[oracle@oraprd01 dbs]$ cp initQAS.ora initQAS1.ora
[oracle@oraprd01 dbs]$ scp initQAS.ora oraprd02:$ORACLE_HOME/dbs/initQAS2.ora
[oracle@oraprd01 dbs]$ cp orapwQAS orapwQAS1
[oracle@oraprd01 dbs]$ scp orapwQAS oraprd02:$ORACLE_HOME/dbs/orapwQAS2
----------------------------------------------------------------SQL> shutdown immediate
-----------------------------------------------------------------

------------------------------------------------------------------ 4) Starting as RAC Instances


----------------------------------------------------------------export ORACLE_SID=QAS1
----------------------------------------------------------------srvctl config database -d QAS
------------------------------------------------------------------ Database instance: QAS
-- Type: SINGLE
----------------------------------------------------------------SQL> create spfile from pfile;
----------------------------------------------------------------SQL> startup
ORACLE instance started.
Total System Global Area 541065216 bytes
Fixed Size
2085288 bytes
Variable Size
289410648 bytes
Database Buffers
239075328 bytes
Redo Buffers
10493952 bytes
Database mounted.
Database opened.
SQL> select instance_name from v$instance;
INSTANCE_NAME
---------------QAS1
SQL> show parameter cluster
NAME
-----------------------------------cluster_database
cluster_database_instances

TYPE
----------boolean
integer

VALUE
-----------------------------TRUE
2

-- Create Cluster Data Dictionary


----------------------------------------------------------------SQL> @?/rdbms/admin/catclust.sql
---------------------------------------------------------------------------------------------------------------------------------- In Node 02
----------------------------------------------------------------orahome
export ORACLE_SID=QAS2
----------------------------------------------------------------SQL> create spfile from pfile;
----------------------------------------------------------------SQL> startup
ORACLE instance started.
Total System Global Area 541065216 bytes
Fixed Size
2085288 bytes
Variable Size
289410648 bytes
Database Buffers
239075328 bytes
Redo Buffers
10493952 bytes

Database mounted.
Database opened.
SQL> select instance_name from v$instance;
INSTANCE_NAME
---------------QAS2
-----------------------------------------------------------------

------------------------------------------------------------------ 5) Register the RAC instances with CRS in Node 1


----------------------------------------------------------------crs_stat -t
srvctl status database -d QAS
srvctl stop database -d QAS
srvctl remove database -d QAS
crs_stat -t
----------------------------------------------------------------srvctl add database -d QAS -o /oracle/product/12cR1
srvctl status database -d QAS
srvctl add instance -d QAS -i QAS1 -n oraprd01
srvctl add instance -d QAS -i QAS2 -n oraprd02
srvctl status database -d QAS
----------------------------------------------------------------srvctl start database -d QAS
----------------------------------------------------------------srvctl status database -d QAS
srvctl config database -d QAS
------------------------------------------------------------------ Database instances: QAS1,QAS2
-- Type: RAC
----------------------------------------------------------------SQL> select * from v$active_instances;
INST_NUMBER INST_NAME
----------- ----------------1 QAS1
2 QAS2
-----------------------------------------------------------------

------------------------------------------------------------------ 6) Check the status of all resources:


----------------------------------------------------------------crs_stat -t
----------------------------------------------------------------crsctl status resource -t
----------------------------------------------------------------srvctl config database -d QAS
-----------------------------------------------------------------

-----------------------------------------------------------------

-- 7) Create unique spfile in ASM


----------------------------------------------------------------SQL> show parameter spfile
SQL> create spfile='+DATA/QAS/spfileQAS.ora' from pfile;
------------------------------------------------------------------ Modifying pfiles point to spfile +DATA/QAS/spfileQAS.ora
----------------------------------------------------------------[oracle@oraQAS01 dbs]$ cat initQAS1.ora
SPFILE='+DATA/QAS/spfileQAS.ora'
----------------------------------------------------------------[oracle@oraQAS02 dbs]$ cat initQAS2.ora
SPFILE='+DATA/QAS/spfileQAS.ora'
------------------------------------------------------------------ Drop the old spfileQASn.ora &
------------------------------------------------------------------ Restarting the Cluster Database
----------------------------------------------------------------srvctl stop database -d QAS
srvctl start database -d QAS
srvctl status database -d QAS
srvctl config database -d QAS
----------------------------------------------------------------crsctl modify resource ora.qas.db -attr "SPFILE=+DATA/QAS/spfileQAS.ora"
----------------------------------------------------------------srvctl config database -d QAS
----------------------------------------------------------------SQL> show parameter spfile
NAME
TYPE
VALUE
------------------------------------ ----------- -----------------------------spfile
string
+DATA/qas/spfileqas.ora
SQL>
SQL> alter system set db_recovery_file_dest='+DG_FRA' scope=both sid='*';
System altered.
SQL>

Вам также может понравиться