Monday, July 7, 2014

Which ASM disk is mapped to which linux device


How to find which asm disk maps to which linux partition

[orcl@lnx01 ~]$ /etc/init.d/oracleasm querydisk -d `/etc/init.d/oracleasm listdisks -d`

Disk "ASM001" is a valid ASM disk on device /dev/dm-51[252,51]
Disk "ASM002" is a valid ASM disk on device /dev/dm-49[252,49]
Disk "ASM003" is a valid ASM disk on device /dev/dm-47[252,47]
Disk "ASM004" is a valid ASM disk on device /dev/dm-45[252,45]
Disk "ASM005" is a valid ASM disk on device /dev/dm-41[252,41]
Disk "ASM006" is a valid ASM disk on device /dev/dm-37[252,37]
Disk "ASM007" is a valid ASM disk on device /dev/dm-56[252,56]
Disk "ASM008" is a valid ASM disk on device /dev/dm-55[252,55]
Disk "ASM009" is a valid ASM disk on device /dev/dm-54[252,54]
Disk "ASM010" is a valid ASM disk on device /dev/dm-44[252,44]
Disk "ASM011" is a valid ASM disk on device /dev/dm-40[252,40]
Disk "ASM012" is a valid ASM disk on device /dev/dm-38[252,38]
Disk "ASM013" is a valid ASM disk on device /dev/dm-39[252,39]
Disk "ASM014" is a valid ASM disk on device /dev/dm-42[252,42]
Disk "ASM015" is a valid ASM disk on device /dev/dm-53[252,53]



Wednesday, May 14, 2014

Difference between crsctl start/stop crs and crsctl start/stop cluster


crsctl start/stop crs - This command starts/stops the OHASD process along with the complete Clusterware stack on the local node we are logged in.

crsctl start/stop cluster - This command starts/stops the Clusterware stack on a server except the OHASD process.

The following processes will still be running if we stop the cluster using crsctl stop cluster.

Process Owner Processes
------------- -------------------------------------------------
root     $GRID_HOME/bin/ohasd.bin reboot
root     $GRID_HOME/bin/orarootagent.bin
root   $GRID_HOME/bin/osysmond.bin
root    $GRID_HOME/bin/ologgerd -m linux02 -r -d $GRID_HOME/crf/db/linux01
oracle  $GRID_HOME/bin/gipcd.bin
oracle  $GRID_HOME/bin/oraagent.bin
oracle  $GRID_HOME/bin/mdnsd.bin
oracle   $GRID_HOME/bin/gpnpd.bin

Note: The advantage of crsctl stop cluster compared to stop crs command is that it prevent the relocation of 'certain' resources to other servers in the cluster before the Clusterware is stopped on that server.

Wednesday, May 7, 2014

How to find Cluster name on Oracle RAC

How to find Cluster name on Oracle RAC

Environment Details:
OS: Linux 5.8
User: oracle
Two Node RAC: linux01, linux02
Database Version: 11.2.0.4.0
Oracle Home: /u01/app/oracle/product/11.2.0/dbhome_1
Grid Home: /u01/app/11.2.0/grid

There are various method through which we can find out the cluster name. Few of them listed below

Set the GRID HOME & PATH Variable
[oracle@linux01 ~]export ORACLE_HOME=/u01/app/11.2.0/grid
[oracle@linux01 ~]$ export PATH=$ORACLE_HOME/bin:$PATH

Method 1: Execute the below command
[oracle@linux01 ~]$ cemutlo -n
racclu01

Method 2: Execute the below command
[oracle@linux01 ~]$ olsnodes -c
racclu01

Method 3: In Grid Home, there is a cdata directory, inside there will be a directory having the same name as cluster name
[oracle@linux01 ~]$ cd $ORACLE_HOME/cdata
[oracle@linux01 /u01/app/11.2.0/grid/cdata]$ ls
linux01  linux01.olr  localhost racclu01

Method 4: Do a ocrdump and open the dumpfile. Search for SYSTEM.css.clustername in the file.
[oracle@linux01 ~]$ ocrdump
[oracle@linux01 ~]$ vi OCRDUMPFILE

[SYSTEM.css.clustername]
ORATEXT : racclu01
SECURITY : {USER_PERMISSION : PROCR_ALL_ACCESS, GROUP_PERMISSION : PROCR_READ, OTHER_PERMISSION : PROCR_READ, USER_NAME : root, GROUP_NAME : root}


Monday, April 7, 2014

Password less ftp setup in linux

Environment Details:
Source Server Name: linux_src
Destination Server Name: linux_dest
Operating System: Red Hat Enterprise Linux Server 
Version: Release 6.4

When we connect to a server using ftp, we need to provide the username and password of the destination server.
We are going to setup a password less ftp connection authentication to the destination server

Please follow the below steps

Steps(Destination Server):
1. Verify whether vsftpd package is installed or not on the server, if not then install it.
[root@linux_dest bin]# rpm -qa|grep vsftpd
vsftpd-2.2.2-11.el6.x86_64

2. Take a backup of /etc/vsftpd/vsftpd.conf file and edit the value of anonymous_enable to YES
[root@linux_dest ~]# cp /etc/vsftpd/vsftpd.conf /etc/vsftpd/vsftpd.conf.bak
[root@linux_dest ~]# vi /etc/vsftpd/vsftpd.conf

3. Check whether ftp services are running or not, if not then start it
[root@linux_dest bin]# service vsftpd status
vsftpd is stopped
[root@linux_dest bin]# service vsftpd start
Starting vsftpd for vsftpd:                          [  OK  ]
[root@linux_dest bin]# service vsftpd status
vsftpd (pid 10652) is running...

Configuration on the destination server complete

Verify whether we are able to connect to the destination server using ftp or not(since we have not done any configuration on source server yet, it will ask for a username and password

[oracle@linux_src ~]$ ftp linux_dest
Connected to linux_dest (10.11.11.180).
220 (vsFTPd 2.2.2)
Name (linux_dest:testuser): oracle
331 Please specify the password.
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.

We are good, please follow the below steps on source server

Steps(Source Server from where we are planning to connect to the destination server):
1. In our home directory create a file .netrc and change its permission to 400
[oracle@linux_src ~]$ pwd
/home/oracle
[oracle@linux_src ~]$ touch .netrc
[oracle@linux_src ~]$ chmod 400 .netrc

2. Edit the file .netrc and put the value in the following format
machine <dest_server_name> login <username> password <password>
e.g. machine linux_dest login oracle password oracle

[oracle@linux_src ~]$ vi .netrc

3. cat .netrc
machine linux_dest login oracle password oracle

4. Now issue the ftp command from the source to connect to destination server

[oracle@linux_src ~]$ ftp linux_dest
Connected to linux_dest (10.11.11.180).
220 (vsFTPd 2.2.2)
331 Please specify the password.
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.

We are successfully connected to the destination server without supplying the username and password.

Saturday, March 29, 2014

Starting a Pluggable database in 12c

In Oracle 12c when we open a CDB (Container database), the PDBs(Pluggable Databases in the CDB) are by default in mount mode.

Solution: We either need to open the pluggable databases manually or we can create a trigger which can bring up the pluggable databases once the CDB is started.

If we want the PDBs to be opened manually issue the below command in the CDB:
alter pluggable database <pdb_name> open;

If we want the PDBs to be opened automatically, we can create a database event trigger that opens all the PDBs after STARTUP.

Create the below trigger in the CDB, which will bring up all the pluggable database when the CDB instance starts 

CREATE TRIGGER OPEN_ALL_PDBs
after startup on database
begin
execute immediate 'alter pluggable database all open';
end Open_ALL_PDBs;
/