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


Tuesday, 26 January 2021

𝗥𝗔𝗖 𝟮 𝗡𝗼𝗱𝗲 𝗦𝗲𝘁𝘂𝗽 𝗮𝗻𝗱 𝗖𝗼𝗻𝗳𝗶𝗴𝘂𝗿𝗮𝘁𝗶𝗼𝗻 𝗼𝗻 𝘄𝗶𝗻𝗱𝗼𝘄𝘀 𝟮𝟬𝟭𝟮 𝘀𝘁𝗲𝗽 𝗯𝘆 𝘀𝘁𝗲𝗽

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

Steps1) Node WIN-RAC1 installation and configuration

 

OS changes

1. Modify hosts file

Do modifications in file “C:\windows\system32\drivers\etc\hosts”.

 

#public

172.22.155.10WIN-RAC1

172.22.155.11 WIN-RAC2

 

#private

10.0.0.11 WIN-RAC1-priv

10.0.0.12 WIN-RAC2-priv

 

#virtual

172.22.155.15  WIN-RAC1-vip

172.22.155.16  WIN-RAC2-vip

 

#SCAN

172.22.155.20  WIN-RAC12-scan

2. Change network settings

Click “Start” -> “Control Panel” -> “Network and Sharing Center” ->

“Manage network connections”.

Rename network interfaces to following names

Unidentified network (public)

“Local Area Connection” to “public”

“Local Area Connection 2” to “private”

Network (public)

 






 Configure IP address on each network card

NOTE – IPv6 is not supported for Oracle Grid Infrastructure or Oracle RAC

on Windows in the first release of

Oracle RAC 12C so disable it on each network card.

We start in the same window “Network Connections”

public

IP Address: 172.22.155.10

Subnet: 255.255.255.0

Right click on “public” network to display menu and select “Properties”.

Uncheck checkbox “Internet Protocol

Version 6(TCP/IPv6)” then select “Internet Protocol Version 4(TCP/IPv4)”

And click “Properties” button.

 

3. Disable Windows Media Sensing for TCP/IP:

Backup the Windows registry.

Use Registry Editor to view the following key in the registry:

HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Tcpip\Parameters

Add a new key type DWORD:

Value Name: DisableDHCPMediaSense

Value: 1

Exit the Registry Editor. It requires reboot of machine.

 


 

4. Set Manage auditing and security log

Run

C:\Users\Administrator>secpol.msc

to start “Local Security Policy”. Then select “Security Settings”->”Local Policies”-

>”User Rights Assignment”

and verify policy “Manage auditing and security log” to ensure “Administrators”

group is assigned.

 


 

5. Turn off firewall

During installation of grid and database software firewall must be disabled. 

Just run following commands on each node.

C:\Users\Administrator>netsh firewall set opmode disable

Ok.

C:\Users\Administrator>netsh advfirewall set allprofiles state off

Ok.

 

6.Disable SNP features

 

C:\Users\Administrator>netsh int tcp set global chimney=disabled

Ok.

C:\Users\Administrator>netsh tcp set global rss=disabled

The following command was not found: tcp set global rss=disabled.

C:\Users\Administrator>netsh interface tcp show global

Querying active state...

TCP Global Parameters

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

Receive-Side Scaling State : enabled

Chimney Offload State : disabled

Receive Window Auto-Tuning Level : normal

Add-On Congestion Control Provider : ctcp

ECN Capability : disabled

RFC 1323 Timestamps : disabled

 

 

Steps 2) Node WIN-RAC2 installation and configuration

 

NOTE : Please follow all the above step to create NODE2 in this

Post here I have showed only one node step.

 

Steps 3) Create ASM DISK using SAN disks through multipath in       Oracle DB Servers.

External – VDATA, DATA1 and FRA.

 

Steps 4) Grid software installation

Unzip grid software then run setup.exe to start grid software installation.

unzip winx64_12c_grid_1of2.zip

unzip winx64_12c_grid_2of2.zip

 

Install Oracle Grid Services and configure cluster.

 

1. Select “Install and Configure Oracle Grid Infrastructure for a Cluster”

And click “Next” button.

 



















2. Select  “Advanced installation” and click “Next” button

 

3. Enter SCAN Name “WIN-RAC12-scan” then click “Add” button to add second

node WIN-RAC2

 

4. Enter public and virtual host name for second node and click “OK”

Button

 

 

Validations are started for memory, network interfaces etc. Ensure

172.22.155.0 subnet is public and 10.0.0.0 subnet is private and click

“OK” button. You should be

back on main screen so click “Next” button.

 

5. select "use Standard ASM for storage"

 


















 

6. Enter disk group name as showed below and press stamp disk option

 

7. Select Add or change label and next.

 






















8. Select the disk label and finish.

 


 

 



















9. Enter the disk group name ( VDATA) for creating OCR and voting disk, DATA1 for data & FRA.

Select external radio button.


















10. Enter the asm user password and next.

11. Select second radio button and next

















12. Select buit-in account(Administrator) and then continue next



















13. Enter ORACLE_BASE and software location for grid software.

 

















14. click " ignore all" and next

 
















 

15. Install

 


 

 

Step 5) Install Oracle RAC database software only (12cR1).

 

1.


















2. Install database software only

 


 

 














3. Oracle Real Application Clusters database Installation

 






















4. Select the available node in the cluster: 2 hosts - WIN-RAC1, WIN-RAC2.

 

5. Select Database Edition – Enterprise Edition.

6. Specify installation location

 


 















 

7. Privileged operating system groups.

 




















8. Prerequisite Checks.

 

9. Select ignore all

 

10. Install the Software


 

 


 











Step 6) Create a RAC database (12cR1).

 

1. DBCA to create a database

 

















2. Select Advanced mode

3. Configuration Type : Admin-Managed

 



4. Database name - RACDB

 

5. Select 2 hosts - WIN-RAC1, WIN-RAC2.

 

6. Storage Locations : Data files in +DATA and Recovery Area in +FRA

 


 











7. Set  Memory Size (SGA & PGA)

 

8. Select create database.

 

9.  Finish creation.

 

 

Next, Verify the RAC installation.

 $ crsctl stat res –t

$ crsctl check crs