Every couple of months, I am constantly researching on the latest PSUs. Unfortunately, Doc ID 756671.1 (Oracle Recommended Patches — Oracle Database) does not apply to me as it only provides the latest PSU for the different parts of the Oracle stack.

The standard that I like to follow is N-1 for the PSUs at the customers site. We would like to be on the most current PSU but sometimes find that the new PSUs are problematic and encounter issues when applying the PSUs. For this reason, I promote the N-1 adoption for PSUs for both Grid Infrastructure and Database Homes. So here’s a better Metalink Doc ID: 1454618.1 (Quick Reference to Patch Numbers for Database PSU, SPU(CPU), Bundle Patches and Patchsets), which provides a comprehensive list of all the PSUs for all the major database releases. Here’s a snippet of what the page looks like:
PSU Summary


With Oracle Linux 5, we still perform the oracle-validated RPM installations. After we perform the oracle-validated configuration, there are quite of bit of tasks that still need to be performed to bring the Linux server to an environment that is suitable for an enterprise Grid and Database installation.

The following steps provide detailed steps to configure your Linux server in order to effectively prepare and install the Grid Infrastructure software and creating an ASM instance. More importantly, the steps are all performed with command line options without the need for X-Windows or other GUI requirements.

First, modify oracleasm configuration file and set the Oracle ASM UID and GID to comply with your corporate policies. In this environment, we are still using oracle and dba as our UID and GID for Oracle ASM.
vi /etc/sysconfig/oracleasm
Modify the following two lines in a VM environment. In a virtualized infrastructure, you will not need to modify the SCANBOOT or SCANORDER options to the configuration file:

ORACLEASM_UID=oracle
ORACLEASM_GID=dba

Next issue the commands below to confirm our settings:

# oracleasm configure
ORACLEASM_ENABLED=false
ORACLEASM_UID=oracle
ORACLEASM_GID=dba
ORACLEASM_SCANBOOT=true
ORACLEASM_SCANORDER=""
ORACLEASM_SCANEXCLUDE=""
ORACLEASM_USE_LOGICAL_BLOCK_SIZE="false"

Next, re-initialize oracleasm to pickup the changes. We need the disk ownership in the /dev/oracleasm/disks directory to be owned by oracle; otherwise, all the oracle utilities will not recognize any of the ASM disks:


# oracleasm exit; oracleasm init
Unmounting ASMlib driver filesystem: /dev/oracleasm
Unloading module "oracleasm": oracleasm
Loading module "oracleasm": oracleasm
Configuring "oracleasm" to use device physical block size
Mounting ASMlib driver filesystem: /dev/oracleasm

Scan disks to re-discover the disks:


# oracleasm scandisks
Reloading disk partitions: done
Cleaning any stale ASM disks...
Scanning system for ASM disks...
Instantiating disk "DATA1"
Instantiating disk "DATA2"
Instantiating disk "DATA3"
Instantiating disk "DATA4"
Instantiating disk "FRA1"

You need to manually download, upload and install the oracleasmlib package manually. It does not pull down via “yum install oracleasmlib”. Without this RPM, you will have not have the oracleasm-discover executable. Without this executable, you will have to use /dev/oracleasm/disks instead of ORCL:* disks for your ASM discovery string.

# ls -ltr
total 36
-rw-r--r-- 1 oracle dba 14176 Jun 23 09:00 oracleasmlib-2.0.4-1.el5.x86_64.rpm
-rwx------ 1 oracle dba   241 Jun 24 12:00 asmca.sh

# rpm -ihv oracleasmlib-2.0.4-1.el5.x86_64.rpm
Preparing...                ########################################### [100%]
   1:oracleasmlib           ########################################### [100%]

Create ASM instance in silent mode

$ cat asmca.sh
/u01/app/oracle/product/11.2.0/grid/bin/asmca -silent -configureASM \
  -sysAsmPassword oracle123 \
  -asmsnmpPassword oracle123 \
  -diskstring \'ORCL:*\' \
  -diskGroupName DATA \
  -disk \'ORCL:DATA1\' \
  -au_size 4 \
  -redundancy external;


$ ./asmca.sh

ASM created and started successfully.

DiskGroup DATA created successfully.

Add more disks to the ASM Data Disk Group:

SQL> alter diskgroup data add disk 'ORCL:DATA2', 'ORCL:DATA3', 'ORCL:DATA4' rebalance power 11 wait;

Diskgroup altered.

Create the FRA Disk Group:


  1* create diskgroup fra external redundancy disk 'ORCL:FRA1' attribute 'au_size'='4M'
SQL> /

Diskgroup created.

Posted by Charles Kim, Oracle ACE Director and VMware vExpert

Posted in ASM

With Oracle Database 11g Release 2, Oracle provides an extremely useful script to establish and exchange ssh keys between all the nodes of the cluster called sshUserSetup.sh. This script is available to everyone from the installation media in the grid/sshsetup sub-directory.

This little shell script comes in handy if you are cloning Oracle RAC clusters and do not want to leverage the GUI tools. If you trying to automate Oracle RAC build deployments, it is a must have tool for the DBAs. Without setting up ssh keys, the cluvfy script will fail and spit out the following error:

ERROR: User equivalence unavailable on all the nodes. Verification cannot proceed.

The following example demonstrates the sshUserSetup script executed on a 2-node RAC called rac1 and rac2:

[oracle@rac1 sshsetup]$ pwd
/nfs/software/12c/grid/sshsetup
 
[oracle@rac1 home]$ cd /nfs/software/12c/grid/sshsetup/

[oracle@rac1 sshsetup]$ ./sshUserSetup.sh -user oracle -hosts "rac1 rac2" -noPromptPassphrase -advanced -exverify
The output of this script is also logged into /tmp/sshUserSetup_2013-07-09-16-31-50.log
Hosts are rac1 rac2
user is oracle
Platform:- Linux
Checking if the remote hosts are reachable
PING rac1 (172.16.41.40) 56(84) bytes of data.
64 bytes from rac1 (172.16.41.40): icmp_seq=1 ttl=64 time=0.020 ms
64 bytes from rac1 (172.16.41.40): icmp_seq=2 ttl=64 time=0.032 ms
64 bytes from rac1 (172.16.41.40): icmp_seq=3 ttl=64 time=0.057 ms
64 bytes from rac1 (172.16.41.40): icmp_seq=4 ttl=64 time=0.030 ms
64 bytes from rac1 (172.16.41.40): icmp_seq=5 ttl=64 time=0.030 ms
 
--- rac1 ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4007ms
rtt min/avg/max/mdev = 0.020/0.033/0.057/0.014 ms
PING rac2 (172.16.41.41) 56(84) bytes of data.
64 bytes from rac2 (172.16.41.41): icmp_seq=1 ttl=64 time=0.256 ms
64 bytes from rac2 (172.16.41.41): icmp_seq=2 ttl=64 time=0.303 ms
64 bytes from rac2 (172.16.41.41): icmp_seq=3 ttl=64 time=0.255 ms
64 bytes from rac2 (172.16.41.41): icmp_seq=4 ttl=64 time=0.306 ms
64 bytes from rac2 (172.16.41.41): icmp_seq=5 ttl=64 time=0.350 ms
 
--- rac2 ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4009ms
rtt min/avg/max/mdev = 0.255/0.294/0.350/0.035 ms
Remote host reachability check succeeded.
The following hosts are reachable: rac1 rac2.
The following hosts are not reachable: .
All hosts are reachable. Proceeding further...
firsthost rac1
numhosts 2
The script will setup SSH connectivity from the host rac1 to all
the remote hosts. After the script is executed, the user can use SSH to run
commands on the remote hosts or copy files between this host rac1
and the remote hosts without being prompted for passwords or confirmations.
 
NOTE 1:
As part of the setup procedure, this script will use ssh and scp to copy
files between the local host and the remote hosts. Since the script does not
store passwords, you may be prompted for the passwords during the execution of
the script whenever ssh or scp is invoked.
 
NOTE 2:
AS PER SSH REQUIREMENTS, THIS SCRIPT WILL SECURE THE USER HOME DIRECTORY
AND THE .ssh DIRECTORY BY REVOKING GROUP AND WORLD WRITE PRIVILEDGES TO THESE
directories.
 
Do you want to continue and let the script make the above mentioned changes (yes/no)?
yes
 
The user chose yes
User chose to skip passphrase related questions.
Creating .ssh directory on local host, if not present already
Creating authorized_keys file on local host
Changing permissions on authorized_keys to 644 on local host
Creating known_hosts file on local host
Changing permissions on known_hosts to 644 on local host
Creating config file on local host
If a config file exists already at /home/oracle/.ssh/config, it would be backed up to /home/oracle/.ssh/config.backup.
Removing old private/public keys on local host
Running SSH keygen on local host with empty passphrase
Generating public/private rsa key pair.
Your identification has been saved in /home/oracle/.ssh/id_rsa.
Your public key has been saved in /home/oracle/.ssh/id_rsa.pub.
The key fingerprint is:
0f:b7:d8:17:6d:00:4f:b5:90:29:6a:a9:10:28:37:63 oracle@rac1
The key's randomart image is:
+--[ RSA 1024]----+
|   .      . o+.  |
|. E .     .+o. . |
| + o .   o .o .  |
|    .   +    o   |
|     . oS . . o  |
|      .  * . o   |
|        . + .    |
|           .     |
|                 |
+-----------------+
Creating .ssh directory and setting permissions on remote host rac1
THE SCRIPT WOULD ALSO BE REVOKING WRITE PERMISSIONS FOR group AND others ON THE HOME DIRECTORY FOR oracle. THIS IS AN SSH REQUIREMENT.
The script would create ~oracle/.ssh/config file on remote host rac1. If a config file exists already at ~oracle/.ssh/config, it would be backed up to ~oracle/.ssh/config.backup.
The user may be prompted for a password here since the script would be running SSH on host rac1.
Warning: Permanently added 'rac1,172.16.41.40' (RSA) to the list of known hosts.
oracle@rac1's password:
Done with creating .ssh directory and setting permissions on remote host rac1.
Creating .ssh directory and setting permissions on remote host rac2
THE SCRIPT WOULD ALSO BE REVOKING WRITE PERMISSIONS FOR group AND others ON THE HOME DIRECTORY FOR oracle. THIS IS AN SSH REQUIREMENT.
The script would create ~oracle/.ssh/config file on remote host rac2. If a config file exists already at ~oracle/.ssh/config, it would be backed up to ~oracle/.ssh/config.backup.
The user may be prompted for a password here since the script would be running SSH on host rac2.
Warning: Permanently added 'rac2,172.16.41.41' (RSA) to the list of known hosts.
oracle@rac2's password:
Done with creating .ssh directory and setting permissions on remote host rac2.
Copying local host public key to the remote host rac1
The user may be prompted for a password or passphrase here since the script would be using SCP for host rac1.
oracle@rac1's password:
Done copying local host public key to the remote host rac1
Copying local host public key to the remote host rac2
The user may be prompted for a password or passphrase here since the script would be using SCP for host rac2.
oracle@rac2's password:
Done copying local host public key to the remote host rac2
Creating keys on remote host rac1 if they do not exist already. This is required to setup SSH on host rac1.
 
Creating keys on remote host rac2 if they do not exist already. This is required to setup SSH on host rac2.
Generating public/private rsa key pair.
Your identification has been saved in .ssh/id_rsa.
Your public key has been saved in .ssh/id_rsa.pub.
The key fingerprint is:
f4:1d:b5:7e:a7:f5:ea:97:24:16:23:01:d7:17:47:c4 oracle@rac2
The key's randomart image is:
+--[ RSA 1024]----+
|         .... .==|
|          .. o oE|
|        .   o o  |
|       . . o =   |
|        S . o + +|
|             o =o|
|            . + o|
|               o.|
|             .o. |
+-----------------+
Updating authorized_keys file on remote host rac1
Updating known_hosts file on remote host rac1
Updating authorized_keys file on remote host rac2
Updating known_hosts file on remote host rac2
cat: /home/oracle/.ssh/known_hosts.tmp: No such file or directory
cat: /home/oracle/.ssh/authorized_keys.tmp: No such file or directory
SSH setup is complete.
 
------------------------------------------------------------------------
Verifying SSH setup
===================
The script will now run the date command on the remote nodes using ssh
to verify if ssh is setup correctly. IF THE SETUP IS CORRECTLY SETUP,
THERE SHOULD BE NO OUTPUT OTHER THAN THE DATE AND SSH SHOULD NOT ASK FOR
PASSWORDS. If you see any output other than date or are prompted for the
password, ssh is not setup correctly and you will need to resolve the
issue and set up ssh again.
The possible causes for failure could be:
1. The server settings in /etc/ssh/sshd_config file do not allow ssh
for user oracle.
2. The server may have disabled public key based authentication.
3. The client public key on the server may be outdated.
4. ~oracle or ~oracle/.ssh on the remote host may not be owned by oracle.
5. User may not have passed -shared option for shared remote users or
may be passing the -shared option for non-shared remote users.
6. If there is output in addition to the date, but no password is asked,
it may be a security alert shown as part of company policy. Append the
additional text to the <OMS HOME>/sysman/prov/resources/ignoreMessages.txt file.
------------------------------------------------------------------------
--rac1:--
Running /usr/bin/ssh -x -l oracle rac1 date to verify SSH connectivity has been setup from local host to rac1.
IF YOU SEE ANY OTHER OUTPUT BESIDES THE OUTPUT OF THE DATE COMMAND OR IF YOU ARE PROMPTED FOR A PASSWORD HERE, IT MEANS SSH SETUP HAS NOT BEEN SUCCESSFUL. Please note that being prompted for a passphrase may be OK but being prompted for a password is ERROR.
Tue Jul  9 16:32:24 CDT 2013
------------------------------------------------------------------------
--rac2:--
Running /usr/bin/ssh -x -l oracle rac2 date to verify SSH connectivity has been setup from local host to rac2.
IF YOU SEE ANY OTHER OUTPUT BESIDES THE OUTPUT OF THE DATE COMMAND OR IF YOU ARE PROMPTED FOR A PASSWORD HERE, IT MEANS SSH SETUP HAS NOT BEEN SUCCESSFUL. Please note that being prompted for a passphrase may be OK but being prompted for a password is ERROR.
Tue Jul  9 16:32:25 CDT 2013
------------------------------------------------------------------------
------------------------------------------------------------------------
Verifying SSH connectivity has been setup from rac1 to rac1
------------------------------------------------------------------------
IF YOU SEE ANY OTHER OUTPUT BESIDES THE OUTPUT OF THE DATE COMMAND OR IF YOU ARE PROMPTED FOR A PASSWORD HERE, IT MEANS SSH SETUP HAS NOT BEEN SUCCESSFUL.
Tue Jul  9 16:32:25 CDT 2013
------------------------------------------------------------------------
------------------------------------------------------------------------
Verifying SSH connectivity has been setup from rac1 to rac2
------------------------------------------------------------------------
IF YOU SEE ANY OTHER OUTPUT BESIDES THE OUTPUT OF THE DATE COMMAND OR IF YOU ARE PROMPTED FOR A PASSWORD HERE, IT MEANS SSH SETUP HAS NOT BEEN SUCCESSFUL.
Tue Jul  9 16:32:26 CDT 2013
------------------------------------------------------------------------
-Verification from rac1 complete-
------------------------------------------------------------------------
Verifying SSH connectivity has been setup from rac2 to rac1
------------------------------------------------------------------------
IF YOU SEE ANY OTHER OUTPUT BESIDES THE OUTPUT OF THE DATE COMMAND OR IF YOU ARE PROMPTED FOR A PASSWORD HERE, IT MEANS SSH SETUP HAS NOT BEEN SUCCESSFUL.
Tue Jul  9 16:32:26 CDT 2013
------------------------------------------------------------------------
------------------------------------------------------------------------
Verifying SSH connectivity has been setup from rac2 to rac2
------------------------------------------------------------------------
IF YOU SEE ANY OTHER OUTPUT BESIDES THE OUTPUT OF THE DATE COMMAND OR IF YOU ARE PROMPTED FOR A PASSWORD HERE, IT MEANS SSH SETUP HAS NOT BEEN SUCCESSFUL.
Tue Jul  9 16:32:27 CDT 2013
------------------------------------------------------------------------
-Verification from rac2 complete-
SSH verification complete.

Now user equivalence is setup between rac1 and rac2. Let’s confirm by connecting to each of the nodes as oracle:

[oracle@rac1 sshsetup]$ ssh rac2

[oracle@rac2 ~]$ exit
logout
Connection to rac2 closed.
 
[oracle@rac2 ~]$ ssh rac1

Last login: Tue Jul  9 16:20:13 2013 from 192.168.225.1
[oracle@rac1 ~]$ exit