Translate into your own language

Monday, August 1, 2016

Steps to create ASM DISK and adding it to ASM DISKGROUP

Step 1:

Login to the server host01 switch yourself to the root execute below commands.

/etc/init.d/oracleasm createdisk ASMDISK_VD046p1 '/dev/mapper/host1_VD046p1'
/etc/init.d/oracleasm createdisk ASMDISK_VD047p1 '/dev/mapper/host1_VD047p1'
/etc/init.d/oracleasm createdisk ASMDISK_VD048p1 '/dev/mapper/host1_VD048p1'


Step 2:

Login as grid

/etc/init.d/oracleasm listdisks


Step 3:

run scan as root
/etc/init.d/oracleasm scandisks

run as grid
/etc/init.d/oracleasm listdisks

Step 4:
Login to grid user setup ASM environment and login as “sys as sysasm” execute below command in SQL environment.

Sql> alter diskgroup DATA add disk 'ORCL:ASMDISK_VD046p1','ORCL:ASMDISK_VD046p1','ORCL:ASMDISK_VD046p1' rebalance power 10;

Step 5:

Sql>select *From v$asm_operation;

Note: Keep running until you see no rows.

Steps to create ASM DISK and adding it to ASM DISKGROUP

Step 1:

Login to the server host01 switch yourself to the root execute below commands.

/etc/init.d/oracleasm createdisk ASMDISK_VD046p1 '/dev/mapper/host1_VD046p1'
/etc/init.d/oracleasm createdisk ASMDISK_VD047p1 '/dev/mapper/host1_VD047p1'
/etc/init.d/oracleasm createdisk ASMDISK_VD048p1 '/dev/mapper/host1_VD048p1'

Login to grid user setup ASM environment and login as “sys as sysasm” execute below command in SQL environment.

Sql> alter diskgroup DATA add disk 'ORCL:ASMDISK_VD046p1','ORCL:ASMDISK_VD046p1','ORCL:ASMDISK_VD046p1' rebalance power 10;

Step 2:

Login to the server host2 switch yourself to the root execute below commands.

host2:

/etc/init.d/oracleasm createdisk ASMDISK_VD047p1 '/dev/mapper/host2_VD047p1'
/etc/init.d/oracleasm createdisk ASMDISK_VD048p1 '/dev/mapper/host2_VD048p1'
/etc/init.d/oracleasm createdisk ASMDISK_VD049p1 '/dev/mapper/host2_VD049p1'

Login to grid user setup ASM environment and login as “sys as sysasm” execute below command in SQL environment.

Sql> alter diskgroup DATA add disk 'ORCL:ASMDISK_VD047p1','ORCL:ASMDISK_VD048p1','ORCL:ASMDISK_VD049p1' rebalance power 10;

CRSCTL commands in Oracle 11g Release 2

How to shutdown CRS on all nodes and Disable CRS as ROOT user:
-------------------------------------------------------------
#crsctl stop crs
#crsctl disable crs

How to Enable CRS and restart CRS on all nodes as ROOT user:
-----------------------------------------------------------
#crsctl enable crs
#crsctl start crs

How to check VIP status is ONLINE / OFFLINE:
----------------------------------------
$crs_stat or
$crsctl stat res -t ------> 11gr2

How to Check current Version of Clusterware:
-------------------------------------------
$crsctl query crs activeversion

$crsctl query crs softwareversion [node_name]

How to Start & Stop CRS and CSS:
-------------------------------
$crsctl start crs
$crsctl stop crs

#/etc/init.d/init.crs start
#/etc/init.d/init.crs stop

#/etc/init.d/init.cssd stop
#/etc/init.d/init.cssd start

How to Enable & Disable CRS:
---------------------------
$crsctl enable crs
$crsctl disable crs

#/etc/init.d/init.crs enable
#/etc/init.d/init.crs disable

How to Check current status of CRS:
----------------------------------
$crsctl check crs

$crsctl check cluster [-node node_name]

How to Check CSS, CRS and EVMD:
------------------------------
$crsctl check cssd

$crsctl check crsd

$crsctl check evmd

How to List the Voting disks currently used by CSS:
--------------------------------------------------
$crsctl check css votedisk

$crsctl query css votedisk

How to Add and Delete any voting disk:
-------------------------------------
$crsctl add css votedisk <PATH>

$crsctl delete css votedisk <PATH>

How to start clusterware resources:
----------------------------------
$crsctl start resources

$crsctl stop resources

Oracle RAC Load balancing and Failover

Oracle RAC Load balancing and Failover
LOAD BALANCING in RAC:-
The Oracle RAC system can distribute the load over many nodes this feature called as load balancing.

There are two methods of load balancing
1.Client load balancing
2.Server load balancing

1.Client Load Balancing
Client Load Balancing distributes new connections among Oracle RAC nodes so that no one server is overloaded with connection requests and it is configured at net service name level by providing multiple descriptions in a description list or multiple addresses in an address list. For example, if connection fails over to another node in case of failure, the client load balancing ensures that the redirected connections are distributed among the other nodes in the RAC.

Configure Client-side connect-time load balancing by setting LOAD_BALANCE=ON in the corresponding client side TNS entry.

TESTRAC =
(DESCRIPTION =
(ADDRESS_LIST=
(LOAD_BALANCE = ON)
(ADDRESS = (PROTOCOL = TCP)(HOST = TESTRAC1-VIP)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = TESTRAC2-VIP)(PORT = 1521))
)
(CONNECT_DATA = (SERVICE_NAME = testdb.selectstarfrom.com))
)

2.Server Load Balancing
Server Load Balancing distributes processing workload among Oracle RAC nodes. It divides the connection load evenly between all available listeners and distributes new user session connection requests to the least loaded listener(s) based on the total number of sessions which are already connected. Each listener communicates with the other listener(s) via each database instance’s PMON process.

Configure Server-side connect-time load balancing feature by setting REMOTE_LISTENERS initialization parameter of each instance to a TNS name that describes list of all available listeners.

TESTRAC_LISTENERS =
(DESCRIPTION =
(ADDRESS_LIST =(ADDRESS = (PROTOCOL = TCP)(HOST = TESTRAC1)(PORT = 1521)))
(ADDRESS_LIST =(ADDRESS = (PROTOCOL = TCP)(HOST = TESTRAC2)(PORT = 1521))))
)

Set *.remote_listener= TESTRAC_LISTENERS’ initialization parameter in the database’s shared SPFILE and add TESTRAC_LISTENERS’ entry to the TNSNAMES.ORA file in the Oracle Home of each node in the cluster.

Once you configure Server-side connect-time load balancing, each database’s PMON process will automatically register the database with the database’s local listener as well as cross-register the database with the listeners on all other nodes in the cluster. Now the nodes themselves decide which node is least busy, and then will connect the client to that node.

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

FAILOVER in RAC:-
The Oracle RAC system can protect against failures caused by O/S or server crashes or hardware failures. When a node failure occurs in RAC system, the connection attempts can fail over to other surviving nodes in the cluster this feature called as Failover.

There are two methods of failover
1. Connection Failover
2. Transparent Application Failover (TAF)

1. Connection Failover
If a connection failure occurs at connect time, the application failover the connection to another active node in the cluster. This feature enables client to connect to another listener if the initial connection to the first listener fails.

Enable client-side connect-time Failover by setting FAILOVER=ON in the corresponding client side TNS entry.

TESTRAC =
(DESCRIPTION =
(ADDRESS_LIST=
(LOAD_BALANCE = ON)
(FAILOVER = ON)
(ADDRESS = (PROTOCOL = TCP)(HOST = TESTRAC1-VIP)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = TESTRAC2-VIP)(PORT = 1521))
)
(CONNECT_DATA = (SERVICE_NAME = testdb.selectstarfrom.com))
)

If LOAD_BALANCE is set to on then clients randomly attempt connections to any nodes. If client made connection attempt to a down node, the client needs to wait until it receives the information that the node is not accessible before trying alternate address in ADDRESS_LIST.

2. Transparent Application Failover (TAF)
If connection failure occurs after a connection is established, the connection fails over to other surviving nodes. Any uncommitted transactions are rolled back and server side program variables and session properties will be lost. In some case the select statements automatically re-executed on the new connection with the cursor positioned on the row on which it was positioned prior to the failover.

TESTRAC =
(DESCRIPTION =
(LOAD_BALANCE = ON)
(FAILOVER = ON)
(ADDRESS = (PROTOCOL = TCP)(HOST = TESTRAC1-VIP)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = TESTRAC1-VIP)(PORT = 1521))
(CONNECT_DATA =
(SERVICE_NAME = testdb.selectstarfrom.com)
(FAILOVER_MODE = (TYPE = SELECT)(METHOD = BASIC)(RETRIES = 180)(DELAY = 5))
)
)