Showing posts with label RAC. Show all posts
Showing posts with label RAC. Show all posts

Friday, 12 February 2021

𝐎𝐫𝐚𝐜𝐥𝐞 𝐑𝐀𝐂 𝐏𝐥𝐚𝐧𝐧𝐞𝐝 𝐌𝐚𝐢𝐧𝐭𝐞𝐧𝐚𝐧𝐜𝐞 𝐀𝐜𝐭𝐢𝐯𝐢𝐭𝐲 𝐒𝐭𝐞𝐩𝐬 (𝐇𝐢𝐠𝐡-𝐀𝐯𝐚𝐢𝐥𝐚𝐛𝐢𝐥𝐢𝐭𝐲 𝐁𝐞𝐬𝐭 𝐏𝐫𝐚𝐜𝐭𝐢𝐜𝐞𝐬)

                                                      [̲̅O][̲̅R][̲̅A][̲̅C][̲̅L][̲̅E] [̲̅R][̲̅A][̲̅C]

Ø  First take “RMAN FULL Backup” of PRODUCTION RAC database.

 

Shutdown NODE-2 of ORACLE RAC Cluster

 

Step 1) IN NODE-2, Disable auto start of CRS in order to be able to perform server-OS Patching. So that CRS is not restarted after a reboot of the server.

 

Ø   crsctl disable crs

 

Step 2) Shutdown the instance running on NODE-2.

 

Ø   srvctl stop instance -d RACDB -i RACDB2 -o immediate

 

Step 3) Shutdown oracle cluster ware.

 

Ø  crsctl stop crs

 

Step 4) Check cluster ware and database instance status.

 

Ø   crsctl check crs

Ø  srvctl status database –d RACDB

 


 Handover NODE-2 to IT team for OS patching.  

                                         


After OS Patching:

Startup NODE-2 of ORACLE RAC Cluster

 

Step 1) IN NODE-2, enable auto start of CRS.

 

Ø   crsctl enable crs

 

Step 2) Start oracle cluster ware.

 

Ø  crsctl start crs

 

Step 3) Startup the RACDB2 instance on NODE-2.

 

Ø  srvctl start instance -d RACDB -i RACDB2

 

Step 4) Check cluster ware and database instance status.

 

Ø  crsctl check crs

Ø  srvctl status database –d RACDB

 


 Handover NODE-2 to  Apps team to check it functionality.

 


Note:- 

After confirmation from Apps team that everything running smoothly then only we will go for NODE-1.

 

Otherwise IT team will have to Rollback OS Patch in NODE-2 !!

 

 


 

Again we will follow the same steps as all mentioned above for Node 1  


Shutdown NODE-1 of ORACLE RAC Cluster

 

Step 1) IN NODE-1, Disable auto start of CRS in order to be able to perform server-OS Patching. So that CRS is not restarted after a reboot of the server.

 

Ø  crsctl disable crs

 

Step 2) Shutdown the instance running on NODE-1.

 

Ø  srvctl stop instance -d RACDB -i RACDB1 -o immediate

 

Step 3) Shutdown oracle cluster ware.

 

Ø  crsctl stop crs

 

Step 4) Check cluster ware and database instance status.

 

Ø  crsctl check crs

Ø  srvctl status database –d RACDB

 


Handover NODE-1 to IT team for OS patching.



After OS Patching:

Startup NODE-1 of ORACLE RAC Cluster

 

Step 1) IN NODE-1, enable auto start of CRS.

 

Ø  crsctl enable crs

 

Step 2) Start oracle cluster ware.

 

Ø crsctl start crs

 

Step 3) Startup the RACDB1 instance on NODE-1.

 

Ø  srvctl start instance -d RACDB -i RACDB1

 

Step 4) Check cluster ware and database instance status.

 

Ø  crsctl check crs

Ø  srvctl status database –d RACDB

 

 Handover NODE-1 to  Apps team to check it functionality.

 


Apps team will need to confirm that everything running smoothly from their end..!!


 ROLLBACK: If anything goes wrong then IT team will have to rollback OS patch in Node- 1 & Node- 2 accordingly. 

Else even after rollback of OS patch if it doesn't work then we can restore RAC database from latest backup which we have taken just before the activity.




Friday, 29 January 2021

𝐎𝐑𝐀𝐂𝐋𝐄 𝟏𝟐𝐂 𝐑𝟏 𝟐𝐍𝐎𝐃𝐄 𝐑𝐀𝐂 𝐃𝐀𝐓𝐀𝐁𝐀𝐒𝐄 𝐑𝐄𝐒𝐓𝐎𝐑𝐀𝐓𝐈𝐎𝐍 𝐏𝐋𝐀𝐍

                                                            [̲̅O][̲̅R][̲̅A][̲̅C][̲̅L][̲̅E] [̲̅R][̲̅A][̲̅C]

  Ø WE have 2 Node RAC – Oracle1 & Oracle2

 

Steps 1) Pre-configuration for WIN-RAC Installation on Both Node.

☑   Create ASM DISK using SAN disks through multipath in    Oracle DB Servers.

      ·         External – DATA, DATA1, DBDATA

 

☑ Install Oracle Grid Services and configure cluster.

 

☑ Install Oracle database software only.

 

 

Step 2) Take RMAN backup from source Server and transfer to target Server. (make sure controlfile autobackup is on)

 

☑ Create required directory structures in ASM for C.R.D. files.

 

☑ Change required parameters in pfile( audit_file_dest,db_name,diagnostic_dest, controlfiles, etc,)

 

 

Step 3) CREATE SID FOR SINGLE INSTANCE ON NODE 1

 

C: oradim -new -sid RACDB

C :> Set ORACLE_SID=RACDB

 

Step 4) RESTORE AND RECOVER DATABASE.

 

C: > rman target /

 

RMAN> set DBID=1896487842

 

RMAN>startup nomount;

 

 

Restore Spfile from full backup

RMAN>restore spfile to 'C:\Oracle\Product\12.1.0\dbhome_1\database\init<<Old sid>>/ora'  from 'f:\fast_recovery_area\<<oldsid>>\BackupSet\2021_01_17\O1_MF_NNSNF_SPFILE_LEVEL_0_DOSTOJT8_.BKP';

 

 

 

 

Create Pfile from spfile

RMAN>create pfile='c:\oracle\product\12.1.0\dbhome_1\Database\pfile<<old sid>>.ora' from spfile='c:\oracle\product\12.1.0\dbhome_1\Database\Init<<old sid>>.ora';

 

 

  Ø  shutdown immediate;

 

 

CREATE PFILE FOR SINGLE INSTANCE

*.audit_file_dest='D:\app\Administrator\admin\RACDB\adump'

*.audit_trail='db'

*.compatible='12.1.0.2.0'

*.control_files='+DBDATA/RACDB/CONTROLFILE/control01.ctl'

*.db_block_size=8192

*.db_create_file_dest='+DBDATA'

*.db_domain=''

*.db_name='RACDB'

*.diagnostic_dest='D:\app\Administrator'

*.dispatchers='(PROTOCOL=TCP) (SERVICE=RACDBXDB)'

*.log_archive_dest_1='LOCATION=+DATA/ARC'

*.memory_target=1600m

*.open_cursors=300

*.processes=300

*.remote_login_passwordfile='exclusive'

*.resource_manager_plan=''

*.undo_tablespace='UNDOTBS1'

 

Go back to your RMAN session and restore the control files. Again, fix paths as needed.

RMAN>startup nomount pfile = 'c:\oracle\product\12.1.0\dbhome_1\Database\pfile<<new_sid>>.ora’;

 

RMAN>restore controlfile to '+dbdata/homedb/controlfile/control01.ctl' from

'D:\rmanbackup\ctl\CF_homedb.C-1547250382-20130527-05';

 

Verify using asmcmd:

ASMCMD> pwd

+dbdata/homedb/controlfile

ASMCMD> ls

control01.ctl

current.305.816437125

 

RMAN>Alter Database Mount;

 

RMAN> catalog start with ‘backup location’;

 

RMAN> run {

ALLOCATE CHANNEL ch01 device TYPE DISK;

ALLOCATE CHANNEL ch02 device TYPE DISK;

ALLOCATE CHANNEL ch03 device TYPE DISK;

set newname for datafile 1 to '+DBDATA';

set newname for datafile 2 to '+DBDATA';

set newname for datafile 3 to '+DBDATA';

set newname for datafile 4 to '+DBDATA';

set newname for datafile 5 to '+DBDATA';

set newname for datafile 6 to '+DBDATA';

set newname for datafile 7 to '+DBDATA';

set newname for datafile 8 to '+DBDATA';

set newname for datafile 9 to '+DBDATA';

set newname for datafile 10 to '+DBDATA';

set newname for datafile 11 to '+DBDATA';

set newname for datafile 12 to '+DBDATA';

set newname for datafile 13 to '+DBDATA';

set newname for datafile 14 to '+DBDATA';

set newname for datafile 15 to '+DBDATA';

restore database;

switch datafile all;

RELEASE CHANNEL ch01;

RELEASE CHANNEL ch02;

RELEASE CHANNEL ch03;

}

 

Step 5) Now Recover the Database

 

 RMAN> recover database;

 

  Ø  Open database with resetlogs option

 

 RMAN> alter database open resetlogs;

database opened

Step 6) ADD RAC PARAMETERS TO PARAMETER FILE

 

racdb.__data_transfer_cache_size=0

racdb1..__data_transfer_cache_size=0

racdb2.__data_transfer_cache_size=0

racdb.__db_cache_size=704643072

racdb2.__db_cache_size=637534208

racdb1..__db_cache_size=620756992

racdb.__java_pool_size=16777216

racdb1..__java_pool_size=16777216

racdb2.__java_pool_size=16777216

racdb.__large_pool_size=33554432

racdb1..__large_pool_size=33554432

racdb2.__large_pool_size=33554432

racdb.__oracle_base='D:\app\Administrator'#ORACLE_BASE set from environment

racdb1..__oracle_base='D:\app\Administrator'#ORACLE_BASE set from environment

racdb2.__oracle_base='D:\app\Administrator'#ORACLE_BASE set from environment

racdb.__pga_aggregate_target=671088640

racdb1..__pga_aggregate_target=671088640

racdb2.__pga_aggregate_target=671088640

racdb.__sga_target=1006632960

racdb1..__sga_target=1006632960

racdb2.__sga_target=1006632960

racdb.__shared_io_pool_size=0

racdb1..__shared_io_pool_size=0

racdb2.__shared_io_pool_size=0

racdb.__shared_pool_size=234881024

racdb2.__shared_pool_size=301989888

racdb1..__shared_pool_size=318767104

racdb.__streams_pool_size=0

racdb1..__streams_pool_size=0

racdb2.__streams_pool_size=0

*.audit_file_dest='D:\app\Administrator\admin\RACDB\adump'

*.audit_trail='db'

*.cluster_database=true

*.cluster_database_instances=2

*.compatible='12.1.0.2.0'

*.control_files='+DBDATA/RACDB/CONTROLFILE/control01.ctl'

*.db_block_size=8192

*.db_create_file_dest='+DBDATA'

*.db_domain=''

*.db_name='RACDB'

*.diagnostic_dest='D:\app\Administrator'

*.dispatchers='(PROTOCOL=TCP) (SERVICE=RACDBXDB)'

RACDB1..instance_number=1

RACDB2.instance_number=2

*.log_archive_dest_1='LOCATION=+DATA1/ARC'

*.memory_target=1600m

*.open_cursors=300

*.processes=300

*.remote_login_passwordfile='exclusive'

*.resource_manager_plan=''

RACDB2.thread=2

RACDB1..thread=1

*.undo_tablespace='UNDOTBS1'

RACDB2.undo_tablespace='UNDOTBS2'

RACDB1..undo_tablespace='UNDOTBS1'

 

Step 7) CREATE SPFILE ON ASM FROM PFILE

 

SQL> create spfile=’+DBDATA’ from pfile=’D:\rmanbackup\initRACDB.ora’;

File created.

 

VERIFY THAT FILE IS CREATED ON ASM

ASMCMD [+dbdata] > cd +dbdata/RCTEST/parameterfile

ASMCMD [+dbdata/RCTEST/parameterfile] > ls

spfile.267.817161073

 

Step 8) CREATE PFILE ON BOTH NODES

 

create parameter files in ORACLE_HOME/database folder for both instances on both servers

(initRACDB1..ora on Node1 and initRACDB2.ora on node 2)

 

Add only one line in both files.

SPFILE=+DBDATA/RACDB/parameterfile/spfile.267.817161073

 

Step 9) SHUTDOWN DATABASE

 

SQL> shutdown immediate;

Step 10) ADD DATABASE TO CLUSTER

 

Go to Grid home

cd D:/app/11.2.0.3/grid/BIN

 

Add database to cluster

D:/app/11.2.0.3/grid/BIN> srvctl add database -d RACDB -oraclehome D:\app\Administrator\product\12.1.0\dbhome_1

 

CHECK DATABASE IS ADDED TO CLUSTER OR NOT

 

D:/app/11.2.0.3/grid/BIN> srvctl config database -d RACDB

 

Step 11) ADD RAC INSTANCES

 

D:/app/11.2.0.3/grid/BIN> srvctl add instance -d RACDB -i RACDB1. -n Oracle1

D:/app/11.2.0.3/grid/BINsrvctl add instance -d RACDB -i RACDB2 -n Oracle2

 

VERIFY THAT INTANCES ARE ADDED TO CLUSTER

D:/app/11.2.0.3/grid/BINsrvctl config database -d RACDB

 

Step 12) START DATABASE and VERIFY THAT DATABASE AND INSTANCES

                 ARE UP

D:/app/11.2.0.3/grid/BINsrvctl start database -d RACDB

D:/app/11.2.0.3/grid/BIN> srvctl config database -d RACDB

 

Database unique name: RACDB

Database name:

Oracle home: D:\app\oracle\product\12.1.0.2\dbhome_1

Oracle user: nt authority\system

Spfile:

Domain:

Start options: open

Stop options: immediate

Database role: PRIMARY

Management policy: AUTOMATIC

Server pools: RACDB

Database instances: RACDB1.,RACDB2

Disk Groups: DBDATA

Mount point paths:

Services:

Type: RAC

Database is administrator managed