Total Pageviews

Showing posts with label GRID. Show all posts
Showing posts with label GRID. Show all posts

Wednesday, 29 July 2015

Compare scan on all nodes


mybox.linux.com:/app/grid/product/12.1.0/grid/bin>cluvfy comp scan

Verifying SCAN

Checking Single Client Access Name (SCAN)...

Checking TCP connectivity to SCAN listeners...
TCP connectivity to SCAN listeners exists on all cluster nodes

Checking name resolution setup for "mybox-scan01.linux.com"...

Checking integrity of name service switch configuration file "/etc/nsswitch.conf" ...
All nodes have same "hosts" entry defined in file "/etc/nsswitch.conf"
Check for integrity of name service switch configuration file "/etc/nsswitch.conf" passed


Checking SCAN IP addresses...
Check of SCAN IP addresses passed

Verification of SCAN VIP and listener setup passed

Verification of SCAN was successful. 

Wednesday, 20 May 2015

How to Check Clusterware Version and Name

To check name of cluster and version :

/app/grid/product/11.2.0.4/grid/bin/cemutlo -n

node-cluster01

/app/grid_base>crsctl query crs softwareversion

Oracle Clusterware version on node [node1] is [12.1.0.2.0]

/app/grid_base>crsctl query crs activeversion

Oracle Clusterware active version on the cluster is [12.1.0.2.0]

Thursday, 16 April 2015

How to Deconfigure and Deinstall Grid Infrastructure

[grid@rac12cn1 ~]$ crsctl status res -t
--------------------------------------------------------------------------------
Name           Target  State        Server                   State details    
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.DATA.dg
               ONLINE  ONLINE       rac12cn1                 STABLE
               ONLINE  ONLINE       rac12cn2                 STABLE
ora.FRA.dg
               ONLINE  ONLINE       rac12cn1                 STABLE
               ONLINE  ONLINE       rac12cn2                 STABLE
ora.LISTENER.lsnr
               ONLINE  ONLINE       rac12cn1                 STABLE
               ONLINE  ONLINE       rac12cn2                 STABLE
ora.OCR_VOTE.dg
               ONLINE  ONLINE       rac12cn1                 STABLE
               ONLINE  ONLINE       rac12cn2                 STABLE
ora.asm
               ONLINE  ONLINE       rac12cn1                 Started,STABLE
               ONLINE  ONLINE       rac12cn2                 Started,STABLE
ora.net1.network
               ONLINE  ONLINE       rac12cn1                 STABLE
               ONLINE  ONLINE       rac12cn2                 STABLE
ora.ons
               ONLINE  ONLINE       rac12cn1                 STABLE
               ONLINE  ONLINE       rac12cn2                 STABLE
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.LISTENER_SCAN1.lsnr
      1        ONLINE  ONLINE       rac12cn1                 STABLE
ora.LISTENER_SCAN2.lsnr
      1        ONLINE  ONLINE       rac12cn1                 STABLE
ora.LISTENER_SCAN3.lsnr
      1        ONLINE  ONLINE       rac12cn1                 STABLE
ora.cvu
      1        ONLINE  ONLINE       rac12cn2                 STABLE
ora.oc4j
      1        OFFLINE OFFLINE                               STABLE
ora.rac12cn1.vip
      1        ONLINE  ONLINE       rac12cn1                 STABLE
ora.rac12cn2.vip
      1        ONLINE  ONLINE       rac12cn2                 STABLE
ora.scan1.vip
      1        ONLINE  ONLINE       rac12cn1                 STABLE
ora.scan2.vip
      1        ONLINE  ONLINE       rac12cn1                 STABLE
ora.scan3.vip
      1        ONLINE  ONLINE       rac12cn1                 STABLE
--------------------------------------------------------------------------------
[grid@rac12cn1 ~]$

Before deconfiguring a node, ensure it's not pinned, i.e.:

[grid@rac12cn1 ~]$ olsnodes -s -t
rac12cn1 Active Unpinned
rac12cn2 Active Unpinned
[grid@rac12cn1 ~]$
If a node is pinned, unpin it first, i.e. as root user:
<GI_HOME>/bin/crsctl unpin css -n <racnode1>

If OCR or Voting Disks are on ASM and there is user data in OCR/Voting Disk ASM diskgroup:
If GI version is 11.2.0.3 AND fix for bug 13058611 and bug 13001955 has been applied, or GI version is 11.2.0.3.2 GI PSU (includes both fixes) or higher:
On all remote nodes, as root execute:
# <$GRID_HOME>/crs/install/rootcrs.pl -deconfig -force -verbose



[root@rac12cn1 ~]# /data01/app/12.1.0.1.0/grid_121010/crs/install/rootcrs.pl -deconfig -force -verbose
Using configuration parameter file: /data01/app/12.1.0.1.0/grid_121010/crs/install/crsconfig_params
Network 1 exists
Subnet IPv4: 192.168.56.0/255.255.255.0/eth0, static
Subnet IPv6:
VIP exists: network number 1, hosting node rac12cn1
VIP Name: rac12cn1-vip.localdomain
VIP IPv4 Address: 192.168.56.81
VIP IPv6 Address:
VIP exists: network number 1, hosting node rac12cn2
VIP Name: rac12cn2-vip.localdomain
VIP IPv4 Address: 192.168.56.82
VIP IPv6 Address:
ONS exists: Local port 6100, remote port 6200, EM port 2016
CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on 'rac12cn1'
CRS-2673: Attempting to stop 'ora.crsd' on 'rac12cn1'
CRS-2790: Starting shutdown of Cluster Ready Services-managed resources on 'rac12cn1'
CRS-2673: Attempting to stop 'ora.FRA.dg' on 'rac12cn1'
CRS-2673: Attempting to stop 'ora.DATA.dg' on 'rac12cn1'
CRS-2677: Stop of 'ora.DATA.dg' on 'rac12cn1' succeeded
CRS-2677: Stop of 'ora.FRA.dg' on 'rac12cn1' succeeded
CRS-2673: Attempting to stop 'ora.OCR_VOTE.dg' on 'rac12cn1'
CRS-2677: Stop of 'ora.OCR_VOTE.dg' on 'rac12cn1' succeeded
CRS-2673: Attempting to stop 'ora.asm' on 'rac12cn1'
CRS-2677: Stop of 'ora.asm' on 'rac12cn1' succeeded
CRS-2673: Attempting to stop 'ora.net1.network' on 'rac12cn1'
CRS-2677: Stop of 'ora.net1.network' on 'rac12cn1' succeeded
CRS-2792: Shutdown of Cluster Ready Services-managed resources on 'rac12cn1' has completed
CRS-2677: Stop of 'ora.crsd' on 'rac12cn1' succeeded
CRS-2673: Attempting to stop 'ora.evmd' on 'rac12cn1'
CRS-2673: Attempting to stop 'ora.ctssd' on 'rac12cn1'
CRS-2673: Attempting to stop 'ora.mdnsd' on 'rac12cn1'
CRS-2673: Attempting to stop 'ora.drivers.acfs' on 'rac12cn1'
CRS-2673: Attempting to stop 'ora.gpnpd' on 'rac12cn1'
CRS-2677: Stop of 'ora.drivers.acfs' on 'rac12cn1' succeeded
CRS-2677: Stop of 'ora.gpnpd' on 'rac12cn1' succeeded
CRS-2677: Stop of 'ora.mdnsd' on 'rac12cn1' succeeded
CRS-2677: Stop of 'ora.evmd' on 'rac12cn1' succeeded
CRS-2677: Stop of 'ora.ctssd' on 'rac12cn1' succeeded
CRS-2673: Attempting to stop 'ora.storage' on 'rac12cn1'
CRS-2677: Stop of 'ora.storage' on 'rac12cn1' succeeded
CRS-2673: Attempting to stop 'ora.asm' on 'rac12cn1'
CRS-2677: Stop of 'ora.asm' on 'rac12cn1' succeeded
CRS-2673: Attempting to stop 'ora.cluster_interconnect.haip' on 'rac12cn1'
CRS-2677: Stop of 'ora.cluster_interconnect.haip' on 'rac12cn1' succeeded
CRS-2673: Attempting to stop 'ora.cssd' on 'rac12cn1'
CRS-2677: Stop of 'ora.cssd' on 'rac12cn1' succeeded
CRS-2673: Attempting to stop 'ora.gipcd' on 'rac12cn1'
CRS-2677: Stop of 'ora.gipcd' on 'rac12cn1' succeeded
CRS-2793: Shutdown of Oracle High Availability Services-managed resources on 'rac12cn1' has completed
CRS-4133: Oracle High Availability Services has been stopped.
2015/04/16 11:43:20 CLSRSC-336: Successfully deconfigured Oracle clusterware stack on this node


[root@rac12cn1 ~]# /data01/app/12.1.0.1.0/grid_121010/bin/crsctl status res -t
CRS-4047: No Oracle Clusterware components configured.
CRS-4000: Command Status failed, or completed with errors.
[root@rac12cn1 ~]#
[root@rac12cn1 ~]#
[root@rac12cn1 ~]# ssh rac12cn2
root@rac12cn2's password:
Last login: Thu Dec 25 08:21:03 2014 from rac12cn1.localdomain
[root@rac12cn2 ~]#
[root@rac12cn2 ~]#
[root@rac12cn2 ~]#
[root@rac12cn2 ~]# /data01/app/12.1.0.1.0/grid_121010/bin/crsctl status res -t
--------------------------------------------------------------------------------
Name           Target  State        Server                   State details    
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.DATA.dg
               ONLINE  ONLINE       rac12cn2                 STABLE
ora.FRA.dg
               ONLINE  ONLINE       rac12cn2                 STABLE
ora.LISTENER.lsnr
               ONLINE  ONLINE       rac12cn2                 STABLE
ora.OCR_VOTE.dg
               ONLINE  ONLINE       rac12cn2                 STABLE
ora.asm
               ONLINE  ONLINE       rac12cn2                 Started,STABLE
ora.net1.network
               ONLINE  ONLINE       rac12cn2                 STABLE
ora.ons
               ONLINE  ONLINE       rac12cn2                 STABLE
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.LISTENER_SCAN1.lsnr
      1        ONLINE  ONLINE       rac12cn2                 STABLE
ora.LISTENER_SCAN2.lsnr
      1        ONLINE  ONLINE       rac12cn2                 STABLE
ora.LISTENER_SCAN3.lsnr
      1        ONLINE  ONLINE       rac12cn2                 STABLE
ora.cvu
      1        ONLINE  ONLINE       rac12cn2                 STABLE
ora.oc4j
      1        OFFLINE OFFLINE                               STABLE
ora.rac12cn2.vip
      1        ONLINE  ONLINE       rac12cn2                 STABLE
ora.scan1.vip
      1        ONLINE  ONLINE       rac12cn2                 STABLE
ora.scan2.vip
      1        ONLINE  ONLINE       rac12cn2                 STABLE
ora.scan3.vip
      1        ONLINE  ONLINE       rac12cn2                 STABLE
--------------------------------------------------------------------------------
[root@rac12cn2 ~]#


Once the above command finishes on all remote nodes, on local node, as root execute:
/data01/app/12.1.0.1.0/grid_121010/crs/install/rootcrs.pl -deconfig -force -verbose -keepdg -lastnode
[root@rac12cn2 ~]# /data01/app/12.1.0.1.0/grid_121010/crs/install/rootcrs.pl -deconfig -force -verbose -keepdg -lastnode
Using configuration parameter file: /data01/app/12.1.0.1.0/grid_121010/crs/install/crsconfig_params
2015/04/16 11:46:01 CLSRSC-332: CRS resources for listeners are still configured

OC4J failed to stop
PRCC-1016 : oc4j was already stopped
PRCR-1005 : Resource ora.oc4j is already stopped
Network 1 exists
Subnet IPv4: 192.168.56.0/255.255.255.0/eth0, static
Subnet IPv6:
VIP exists: network number 1, hosting node rac12cn2
VIP Name: rac12cn2-vip.localdomain
VIP IPv4 Address: 192.168.56.82
VIP IPv6 Address:
ONS exists: Local port 6100, remote port 6200, EM port 2016
CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on 'rac12cn2'
CRS-2673: Attempting to stop 'ora.crsd' on 'rac12cn2'
CRS-2790: Starting shutdown of Cluster Ready Services-managed resources on 'rac12cn2'
CRS-2673: Attempting to stop 'ora.FRA.dg' on 'rac12cn2'
CRS-2677: Stop of 'ora.FRA.dg' on 'rac12cn2' succeeded
CRS-2673: Attempting to stop 'ora.DATA.dg' on 'rac12cn2'
CRS-2673: Attempting to stop 'ora.OCR_VOTE.dg' on 'rac12cn2'
CRS-2677: Stop of 'ora.DATA.dg' on 'rac12cn2' succeeded
CRS-2677: Stop of 'ora.OCR_VOTE.dg' on 'rac12cn2' succeeded
CRS-2673: Attempting to stop 'ora.asm' on 'rac12cn2'
CRS-2677: Stop of 'ora.asm' on 'rac12cn2' succeeded
CRS-2792: Shutdown of Cluster Ready Services-managed resources on 'rac12cn2' has completed
CRS-2677: Stop of 'ora.crsd' on 'rac12cn2' succeeded
CRS-2673: Attempting to stop 'ora.storage' on 'rac12cn2'
CRS-2673: Attempting to stop 'ora.gpnpd' on 'rac12cn2'
CRS-2673: Attempting to stop 'ora.mdnsd' on 'rac12cn2'
CRS-2673: Attempting to stop 'ora.drivers.acfs' on 'rac12cn2'
CRS-2677: Stop of 'ora.storage' on 'rac12cn2' succeeded
CRS-2677: Stop of 'ora.drivers.acfs' on 'rac12cn2' succeeded
CRS-2673: Attempting to stop 'ora.ctssd' on 'rac12cn2'
CRS-2673: Attempting to stop 'ora.evmd' on 'rac12cn2'
CRS-2673: Attempting to stop 'ora.asm' on 'rac12cn2'
CRS-2677: Stop of 'ora.mdnsd' on 'rac12cn2' succeeded
CRS-2677: Stop of 'ora.gpnpd' on 'rac12cn2' succeeded
CRS-2677: Stop of 'ora.evmd' on 'rac12cn2' succeeded
CRS-2677: Stop of 'ora.asm' on 'rac12cn2' succeeded
CRS-2673: Attempting to stop 'ora.cluster_interconnect.haip' on 'rac12cn2'
CRS-2677: Stop of 'ora.cluster_interconnect.haip' on 'rac12cn2' succeeded
CRS-2677: Stop of 'ora.ctssd' on 'rac12cn2' succeeded
CRS-2673: Attempting to stop 'ora.cssd' on 'rac12cn2'
CRS-2677: Stop of 'ora.cssd' on 'rac12cn2' succeeded
CRS-2673: Attempting to stop 'ora.gipcd' on 'rac12cn2'
CRS-2677: Stop of 'ora.gipcd' on 'rac12cn2' succeeded
CRS-2793: Shutdown of Oracle High Availability Services-managed resources on 'rac12cn2' has completed
CRS-4133: Oracle High Availability Services has been stopped.
CRS-4123: Oracle High Availability Services has been started.
CRS-2673: Attempting to stop 'ora.drivers.acfs' on 'rac12cn2'
CRS-2677: Stop of 'ora.drivers.acfs' on 'rac12cn2' succeeded
CRS-2672: Attempting to start 'ora.evmd' on 'rac12cn2'
CRS-2672: Attempting to start 'ora.mdnsd' on 'rac12cn2'
CRS-2676: Start of 'ora.evmd' on 'rac12cn2' succeeded
CRS-2676: Start of 'ora.mdnsd' on 'rac12cn2' succeeded
CRS-2672: Attempting to start 'ora.gpnpd' on 'rac12cn2'
CRS-2676: Start of 'ora.gpnpd' on 'rac12cn2' succeeded
CRS-2672: Attempting to start 'ora.cssdmonitor' on 'rac12cn2'
CRS-2672: Attempting to start 'ora.gipcd' on 'rac12cn2'
CRS-2676: Start of 'ora.cssdmonitor' on 'rac12cn2' succeeded
CRS-2676: Start of 'ora.gipcd' on 'rac12cn2' succeeded
CRS-2672: Attempting to start 'ora.cssd' on 'rac12cn2'
CRS-2672: Attempting to start 'ora.diskmon' on 'rac12cn2'
CRS-2676: Start of 'ora.diskmon' on 'rac12cn2' succeeded
CRS-2676: Start of 'ora.cssd' on 'rac12cn2' succeeded
CRS-4611: Successful deletion of voting disk +OCR_VOTE.
ASM de-configuration trace file location: /tmp/asmcadc_clean2015-04-16_11-54-32-AM.log
ASM Clean Configuration START
ASM Clean Configuration END

ASM with SID +ASM1 deleted successfully. Check /tmp/asmcadc_clean2015-04-16_11-54-32-AM.log for details.

2015/04/16 11:59:19 CLSRSC-170: Failed to deconfigure Oracle ASM (error code 0) -- Can be ignored

CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on 'rac12cn2'
CRS-2673: Attempting to stop 'ora.mdnsd' on 'rac12cn2'
CRS-2673: Attempting to stop 'ora.evmd' on 'rac12cn2'
CRS-2673: Attempting to stop 'ora.gpnpd' on 'rac12cn2'
CRS-2673: Attempting to stop 'ora.drivers.acfs' on 'rac12cn2'
CRS-2677: Stop of 'ora.drivers.acfs' on 'rac12cn2' succeeded
CRS-2677: Stop of 'ora.mdnsd' on 'rac12cn2' succeeded
CRS-2677: Stop of 'ora.gpnpd' on 'rac12cn2' succeeded
CRS-2677: Stop of 'ora.evmd' on 'rac12cn2' succeeded
CRS-2673: Attempting to stop 'ora.ctssd' on 'rac12cn2'
CRS-2673: Attempting to stop 'ora.asm' on 'rac12cn2'
CRS-2677: Stop of 'ora.ctssd' on 'rac12cn2' succeeded
CRS-2677: Stop of 'ora.asm' on 'rac12cn2' succeeded
CRS-2673: Attempting to stop 'ora.cluster_interconnect.haip' on 'rac12cn2'
CRS-2677: Stop of 'ora.cluster_interconnect.haip' on 'rac12cn2' succeeded
CRS-2673: Attempting to stop 'ora.cssd' on 'rac12cn2'
CRS-2677: Stop of 'ora.cssd' on 'rac12cn2' succeeded
CRS-2673: Attempting to stop 'ora.gipcd' on 'rac12cn2'
CRS-2677: Stop of 'ora.gipcd' on 'rac12cn2' succeeded
CRS-2793: Shutdown of Oracle High Availability Services-managed resources on 'rac12cn2' has completed
CRS-4133: Oracle High Availability Services has been stopped.
2015/04/16 12:00:16 CLSRSC-336: Successfully deconfigured Oracle clusterware stack on this node


 Grid Infrastructure Deinstall

 As grid user, execute:

$ <$GRID_HOME>/deinstall/deinstall

If there's any error, deconfigure the failed GI with steps in Section A - C, and deinstall manually with note 1364419.1

export ORACLE_HOME=<clusterware-home>

## detach ORACLE_HOME
$ORACLE_HOME/oui/bin/runInstaller -detachHome -silent ORACLE_HOME=$ORACLE_HOME

## confirm $ORACLE_HOME is removed from central inventory:
$ORACLE_HOME/OPatch/opatch lsinventory -all

## remove files in ORACLE_HOME manually on all nodes
/bin/rm -rf $ORACLE_HOME               ##>> if grid user fails to remove all files, switch to root user

unset ORACLE_HOME
If it fails for any reason, as clusterware user execute the following on all nodes:

export ORACLE_HOME=<clusterware-home>

## detach ORACLE_HOME
$ORACLE_HOME/oui/bin/runInstaller -detachHome -silent -local ORACLE_HOME=$ORACLE_HOME

## confirm $ORACLE_HOME is removed from central inventory:
$ORACLE_HOME/OPatch/opatch lsinventory -all

## remove files in ORACLE_HOME manually
/bin/rm -rf $ORACLE_HOME               ##>> if grid user fails to remove all files, switch to root user

unset ORACLE_HOME

Reference: How to Deconfigure/Reconfigure(Rebuild OCR) or Deinstall Grid Infrastructure (Doc ID 1377349.1)

How to Deinstall Old Clusterware Home Once Upgrade to Newer Version is Complete

To remove old home, as clusterware user execute the following on any node:


## please replace $OLD_HOME with the path of pre-upgrade clusterware home
export ORACLE_HOME=$OLD_HOME

## detach OLD_HOME
$OLD_HOME/oui/bin/runInstaller -detachHome -silent ORACLE_HOME=$OLD_HOME

## confirm $OLD_HOME is removed from central inventory:
$OLD_HOME/OPatch/opatch lsinventory -all   

## remove files in OLD_HOME manually:
/bin/rm -rf $OLD_HOME

unset ORACLE_HOME

If it fails for any reason, as clusterware user execute the following on all nodes:

export ORACLE_HOME=$OLD_HOME

## detach OLD_HOME
$OLD_HOME/oui/bin/runInstaller -detachHome -silent -local ORACLE_HOME=$OLD_HOME

## confirm $OLD_HOME is removed from central inventory:
$OLD_HOME/OPatch/opatch lsinventory -all   

## remove files in OLD_HOME manually:
/bin/rm -rf $OLD_HOME


unset ORACLE_HOME

Monday, 30 March 2015

Completing an Oracle Clusterware Upgrade when Nodes Become Unreachable

If some nodes become unreachable in the middle of an upgrade, then you cannot complete the upgrade, because the upgrade script (rootupgrade.sh) did not run on the unreachable nodes. Because the upgrade is incomplete, Oracle Clusterware remains in the previous release. You can confirm that the upgrade is incomplete by entering the command crsctl query crs activeversion.

To resolve this problem, run the rootupgrade command with the -force flag on any of the nodes where the rootupgrade.sh script has already completed as follows:

Grid_home/rootupgrade.sh -force

For example:

# /u01/app/12.1.0/grid/rootupgrade.sh -force
This command forces the upgrade to complete. Verify that the upgrade has completed by using the command crsctl query crs activeversion. The active release should be the upgrade release.

The force cluster upgrade has the following limitations:

All active nodes must be upgraded to the newer release.

All inactive nodes (accessible or inaccessible) may be either upgraded or not upgraded.

For inaccessible nodes, after patch set upgrades, you can delete the node from the cluster. If the node becomes accessible later, and the patch version upgrade path is supported, then you can upgrade it to the new patch version.

If the cluster was previously forcibly upgraded, then ensure that all inaccessible nodes have been deleted from the cluster or joined to the cluster before starting the upgrade.

 Upgrading Inaccessible Nodes After Forcing an Upgrade


Starting with Oracle Grid Infrastructure 12c, after you complete a force cluster upgrade, you can join inaccessible nodes to the cluster as an alternative to deleting the nodes, which was required in earlier releases. To use this option, Oracle Grid Infrastructure 12c Release 1 (12.1) software must already be installed on the nodes.

To complete the upgrade of nodes that were inaccessible or unreachable:

Log in as the Grid user on the node that is to be joined to the cluster.

Change directory to the /crs/install directory in the Oracle Grid Infrastructure 12c Release 1 (12.1) Grid home. For example:

$ cd /u01/12.1.0/grid/crs/install
Run the following PERL command, where existingnode is the name of the option and upgraded_node is any node that was successfully upgraded and is currently part of the cluster:

$ rootupgrade.sh -join -existingnode upgraded_node

B.8.4 Changing the First Node for Install and Upgrade
If the first node becomes inaccessible, you can force another node to be the first node for installation or upgrade. During installation, if root.sh fails to complete on the first node, run the following command on another node using the -force option:

Note:
The -join operation is not supported for Oracle Clusterware releases earlier than 11.2.0.1.0. In such cases, delete the node and add it to the clusterware using the addNode command.


Thursday, 26 March 2015

Root.sh Fails with Inappropriate ioctl for device

Root.sh Fails with "Adding Clusterware entries to upstart Failed to start oracleohasd,
error: Inappropriate ioctl for device"

Error: During a Grid Infrastructure 11.2.0.4 installation on a Linux x8664 EL6 (or OL6) cluster, root.sh fails with error:

...
Adding Clusterware entries to upstart
Failed to start oracleohasd,
error: Inappropriate ioctl for device
INT at /data/app/11.2.0/grid/crs/install/crsconfig_lib.pm line 1446.

$GRID_HOME/cfgtoollogs/crsconfig/rootcrs_<node name>.log shows:

20131203
12:42:46: Glob file list =
20131203
12:42:51: Executing cmd: /sbin/restorecon iF
/etc/init/oracleohasd.
conf
20131203
12:42:51: Executing cmd: /sbin/initctl start oracleohasd
20131203
12:42:51: Command output:
> initctl: Unknown job: oracleohasd
>End Command output
20131203
12:42:51: Failed to start oracleohasd,
error: Inappropriate ioctl for device
20131203
12:42:51: Failed to start service 'ohasd'

Cause :

OS upstart fails to reload the oracleohasd entry automatically. Upstart (a feature from EL6) is an eventbased replacement for the /sbin/init daemon which handles starting of tasks and services.
"initctl list" command shows that no entry exists for "oracleohasd".

Solution :

1. Force init to reload its configuration via initctl reloadconfiguration command:

# initctl reload-configuration
# initctl start oracle-ohasd
# initctl list |grep oracle
oracle-ohasd

start/running, process 6855

2. Deconfigure the clusterware:

# $GRID_HOME/crs/install/rootcrs.pl -deconfig -force -verbose

(for Oracle Restart use roothas.pl instead)

3. Rerun root script:

# $GRID_HOME/root.sh


Now root.sh finishes successfully.

Monday, 9 February 2015

The GPnP profile

The GPnP profile is a small XML file located in GRID_HOME/gpnp/<hostname>/profiles/peer under the name profile.xml. It is used to establish the correct global personality of a node. Each node maintains a local copy of the GPnP Profile and is maintanied by the GPnP Deamon (GPnPD) .

/data01/app/11.2.0/grid_11204/gpnp/node1/profiles/peer/profile.xml

[grid@node1 peer]$ /data01/app/11.2.0/grid_11204/bin/gpnptool get
Warning: some command line parameters were defaulted. Resulting command line: 
         /data01/app/11.2.0/grid_11204/bin/gpnptool.bin get -o-

<?xml version="1.0" encoding="UTF-8"?>
<gpnp:GPnP-Profile Version="1.0" xmlns="http://www.grid-pnp.org/2005/11/gpnp-profile" xmlns:gpnp="http://www.grid-pnp.org/2005/11/gpnp-profile" xmlns:orcl="http://www.oracle.com/gpnp/2005/11/gpnp-profile" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.grid-pnp.org/2005/11/gpnp-profile gpnp-profile.xsd" ProfileSequence="4" ClusterUId="3ae91d6243b0df45ff7af75dc0ef0fa3" ClusterName="node-cluster" PALocation="">
<gpnp:Network-Profile><gpnp:HostNetwork id="gen" HostName="*">
<gpnp:Network id="net1" IP="192.168.56.0" Adapter="eth0" Use="public"/>
<gpnp:Network id="net2" IP="192.168.10.0" Adapter="eth1" Use="cluster_interconnect"/>
</gpnp:HostNetwork>
</gpnp:Network-Profile>
<orcl:CSS-Profile id="css" DiscoveryString="+asm" LeaseDuration="400"/>
<orcl:ASM-Profile id="asm" DiscoveryString="/dev/oracleasm/disks*" SPFile="+DATA/node-cluster/asmparameterfile/registry.253.866681801"/>

<ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
 <ds:SignedInfo><ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/><ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/>
 <ds:Reference URI="">
 <ds:Transforms>
  <ds:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/>
  <ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"> <InclusiveNamespaces xmlns="http://www.w3.org/2001/10/xml-exc-c14n#" PrefixList="gpnp orcl xsi"/>
 </ds:Transform>
 </ds:Transforms>
 <ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
 <ds:DigestValue>Qo8cEYWiMWje2ivla0Y3iaY85WY=</ds:DigestValue>
 </ds:Reference>
 </ds:SignedInfo>
 <ds:SignatureValue>ZPkyemS5LEm5kDgoYTl8wPdaJzKk3S06nLvfywuRTMlivF75af1GYicSOfYpRdZ675tUU4W2UkdUzKVB2OKkHPIlfVXndxcfMaiyTNBO88hHeXINC3RL0GvabPjtWlVJ9SyAAH3hahInJn7F8ScFedtxtdMGg+IEyQ6gqn6lJiI=</ds:SignatureValue>
</ds:Signature>
</gpnp:GPnP-Profile>

Success.


[grid@node1 peer]$ /data01/app/11.2.0/grid_11204/bin/gpnptool lfind
Success. Local gpnpd found.
[grid@node1 peer]$ /data01/app/11.2.0/grid_11204/bin/gpnptool find

Found 2 instances of service 'gpnp'.
 mdns:service:gpnp._tcp.local.://node1:61702/agent=gpnpd,cname=node-cluster,host=node1,pid=3034/gpnpd h:node1 c:node-cluster
 mdns:service:gpnp._tcp.local.://node2:55239/agent=gpnpd,cname=node-cluster,host=node2,pid=3133/gpnpd h:node2 c:node-cluster
[grid@node1 peer]$ 
[grid@node1 peer]$ /data01/app/11.2.0/grid_11204/bin/gpnptool getpval -asm_spf
Warning: some command line parameters were defaulted. Resulting command line: 
         /data01/app/11.2.0/grid_11204/bin/gpnptool.bin getpval -asm_spf -p=profile.xml -o-

+DATA/node-cluster/asmparameterfile/registry.253.866681801
[grid@node1 peer]$ /data01/app/11.2.0/grid_11204/bin/gpnptool.bin getpval -asm_spf -p=profile.xml -o-
+DATA/node-cluster/asmparameterfile/registry.253.866681801

[FATAL] [INS-41321] Invalid Oracle Cluster Registry (OCR) location

SEVERE: [FATAL] [INS-41321] Invalid Oracle Cluster Registry (OCR) location.




Check the installation log file . From the installation log we found :

CAUSE: The installer detects that the storage type of the location (/fst01/storage/ocr) is not supported for Oracle Cluster Registry.
ACTION: Provide a supported storage location for the Oracle Cluster Registry.
*ADDITIONAL INFORMATION:*
 - node2:Mount options did not meet the requirements for this platform
 [Expected ="rw|!ro,hard|!soft,suid|!nosuid,rsize>=32768,wsize>=32768,tcp|proto=tcp,v3|nfsv3|vers=3|nfsvers=3,timeo>=600,acregmin=0&acregmax=0&acdirmin=0&acdirmax=0|actimeo=0" ;
 Found = "rw,nosuid,relatime,vers=3,rsize=32768,wsize=32768,namlen=255,hard,noacl,proto=tcp,timeo=600,retrans=2,sec=sys,mountaddr=10.11.15.10,mountvers=3,mountport=4046,mountproto=tcp,local_lock=none,addr=10.11.15.10"]
 The problem occurred on nodes: node1,node2
 - Cause: Cause Of Problem Not Available
 - Action: User Action Not Available
 - node2:PRVG-0361 : Incorrect NFS mount options "nosuid" used for "netapp1.nfs.linuxbox.com":"/vol/nodehome" mounted on: "/fst01/storage" The problem occurred on nodes: node1,node2
 - Cause: Cause Of Problem Not Available
 - Action: User Action Not Available
Summary of the failed nodes
node2
node1


Solution : Issue is clearly mentioned in the installation log and recommendation is also included .
So just mount the shared storage with recommended options .

Before   : 
================== 
netapp1.nfs.linuxbox.com:/vol/nodehome /fs01 nfs vers=3,tcp,timeo=600,retrans=2,rsize=32768,wsize=32768,bg,hard,intr,nosuid,noacl 0 0 

Mount with below options to resolve the issue  : 
================== ========= ========= =========  

filer2.nfs.linuxbox.com:/vol/nodehome /fs01 nfs rw,rsize=32768,wsize=32768,hard,bg,nointr,vers=3,tcp,timeo=600,actimeo=0 


Friday, 23 January 2015

Upgrade Oracle 11.2.0.3 RAC to 11.2.0.4 - ( Out-of-Place Manual Upgrade )

The different upgrade methods you can use to upgrade your database to the new Oracle Database release or higher are:

1) Database Upgrade Assistant (DBUA)
2) Manual Upgrade
3) Export/Import
4) Data Copying
5) Golden Gate

1) DBUA (Database Upgrade Assistant) 

The Database Upgrade Assistant (DBUA) interactively steps you through the upgrade process and configures the database for the new Oracle Database  release. The DBUA automates the upgrade process by performing all of the tasks normally performed manually. The DBUA makes appropriate recommendations for configuration options such as tablespaces and redo logs. You can then act on these recommendations. This method is very easy and user friendly. But if any error occurs it will take time to diagnose the error as the upgrade process is done automatically by the upgrade assistant.
For more information, refer to the following link:

10.2=> http://docs.oracle.com/cd/B19306_01/server.102/b14238/upgrade.htm#i1011482

11.1=> http://download.oracle.com/docs/cd/B28359_01/server.111/b28300/upgrade.htm#i1011482

11.2 => http://docs.oracle.com/cd/E11882_01/server.112/e23633.pdf

Refer to the following oracle support notes for DBUA upgrade:
================================================
NOTE 556477.1 Complete Checklist for Upgrades to 11gR1 using DBUA
NOTE 870814.1 Complete checklist to upgrade the database to 11g R2 using DBUA
NOTE 1516557.1 Complete Checklist for Upgrading to Oracle Database 12c Release 1 (12.1) using DBUA
Upgrade Advisor: Database from 10.2 to 11.2 (Doc ID 251.1)
How to Download and Run Oracle's Database Pre-Upgrade Utility (Doc ID 884522.1)

2) Manual upgrade

A manual upgrade consists of running SQL scripts and utilities from a command line to upgrade a database to the new Oracle Database release. A manual upgrade gives you finer control over the upgrade process as it is done step by step manually. So if any error occurs, it is easier to diagnose the error. While a manual upgrade gives you finer control over the upgrade process, it is more susceptible to error if any of the upgrade or pre-upgrade steps are either not followed or are performed out of order.
When manually upgrading a database, perform the following pre-upgrade steps:

Analyze the database using the Pre-Upgrade Information Tool. The Upgrade Information Tool is a SQL script that ships with the new Oracle Database release, and must be run in the environment of the database being upgraded.
The Upgrade Information Tool displays warnings about possible upgrade issues with the database. It also displays information about required initialization parameters for the new Oracle Database release.
Prepare the new Oracle Home.
Perform a backup of the database.
Depending on the release of the database being upgraded, you may need to perform additional pre-upgrade steps (adjust the parameter file for the upgrade, remove obsolete initialization parameters and adjust initialization parameters that might cause upgrade problems).

Refer to the following oracle support notes for manual upgrade:
================================================
NOTE 1503653.1 Complete Checklist for Manual Upgrades to Oracle Database 12c Release 1 (12.1)
NOTE 837570.1 Complete Checklist for Manual Upgrades to 11gR2
NOTE 429825.1 Complete Checklist for Manual Upgrades to 11gR1
NOTE 263809.1 Complete checklist for manual upgrades to 10gR1 (10.1.0.x).
NOTE 316889.1 Complete checklist for manual upgrades to 10gR2.
NOTE 466181.1 10g Upgrade Companion
NOTE 601807.1 Oracle 11gR1 Upgrade Companion


Note: DBUA can be used only if the source & target Oracle homes are on the same Server.
But manual upgrade will work even if the source and target Home are on different servers provided that the Hardware architecture and operating system on source and target Home are the same.

Example :
- You cannot manually upgrade a database from an AIX Operating System to Solaris Operating System.
- You cannot manually upgrade a database from a Solaris X86-64 Machine to Solaris SPARC 64-bit.

3) Export/Import

The Export/Import upgrade method does not change the current database, which enables the database to remain available throughout the upgrade process. However, if a consistent snapshot of the database is required (for data integrity or other purposes), then the database must run in restricted mode or must otherwise be protected from changes during the export procedure. Because the current database can remain available, you can, for example, keep an existing production database running while the new Oracle Database is being built at the same time by Export/Import. During the upgrade, to maintain complete database consistency, changes to the data in the database cannot be permitted without the same changes to the data in the new Oracle Database.

Most importantly, the Export/Import operation results in a completely new database. Although the current database ultimately contains a copy of the specified data, the upgraded database may perform differently from the original database. For example, although Export/Import creates an identical copy of the database, other factors, such as disk placement of data and unset tuning parameters, may cause unexpected performance problems.

Upgrading an entire database by using Export/Import can take a long time, especially compared to using the DBUA or performing a manual upgrade. Therefore, you may need to schedule the upgrade during non-peak hours or make provisions for propagating to the new database any changes that are made to the current database during the upgrade.

For more information, refer to the following link:
http://docs.oracle.com/cd/B19306_01/server.102/b14238/expimp.htm#i262247

NOTE:  Export/Import works for all versions.  But for 10g and above, DataPump or Transportable Table Spaces methods are better.

NOTE 351598.1 Export/Import DataPump: The Minimum Requirements to Use Export DataPump and Import DataPump (System Privileges)

4) Data Copying

You can copy data from one Oracle Database to another using database links. For example, you can create new tables and fill the tables with data by using the INSERT INTO statement and the CREATE TABLE ... AS statement. Copying data and Export/Import offer the same advantages for upgrading. Using either method, you can defragment data files and restructure the database by creating new tablespaces or modifying existing tables or tablespaces. In addition, you can copy only specified database objects or users.
Copying data, however, unlike Export/Import, enables the selection of specific rows of tables to be placed into the new database. Copying data is a good method for copying only part of a database table. In contrast, using Export/Import, you can copy only entire tables

Oracle Database Upgrade Guide
10g Release 2 (10.2)
Part Number B14238-02
http://docs.oracle.com/cd/B19306_01/server.102/b14238/upgrade.htm

5) Golden Gate

Check on the OTN site with the following url for how to upgrade with zero downtime using Golden Gate:

http://www.oracle.com/technetwork/middleware/goldengate/overview/index.html

In this article we will do , out-of-Place Manual Upgrade from Previous 11.2.0.N Version to the Latest 11.2.0.N Patchset:

The 11.2.0.2 and later patchsets are a full release. The 11.2 Patchset Installer does not update existing 11.2 installations.The install process performs a new installation whether you are doing out-of-place upgrade or in-place upgrade.

Starting with 11.2.0.2, you have two ways to apply a patchset:
  1. Out-of-place upgrade (Recommended)
  2. In-place upgrade

In the below example we are going to upgrade 11.2.0.3 DB to 11.2.0.4 using out-of-place manual upgrade method : 


Current  GRID Version : 11.2.0.3  ---> Upgrade to 11.2.0.4
Current GRID_HOME : /data01/app/11.2.0/grid_11203
Upgrade to GRID_HOME : /data01/app/11.2.0/grid_11204

Current RDBMS Version : 11.2.0.3 ---> Upgrade to 11.2.0.4
Current ORACLE_HOME : /data01/app/oracle/product/11.2.0.3/db_1
Upgrade to ORACLE_HOME : /data01/app/oracle/product/11.2.0.4/db_1

Step- 1; Upgrade the Grid Infra

 http://ora10gadmin.blogspot.in/2015/01/upgrading-grid-infrastructure-from.html

Step 2: Upgrade RDBMS

1. Install 11.2.0.4 binaries in new  ORACLE_HOME /data01/app/oracle/product/11.2.0.4/db_1

Download the binaries from oracle support website and unzip in a directory as below:

unzip p13390677_112040_Linux-x86-64_1of7 -d /home/oracle/software
unzip p13390677_112040_Linux-x86-64_2of7 -d /home/oracle/software

STEP 2
======

Install the latest 11.2 RDBMS Software into a new ORACLE_HOME.

Please note that with the 11.2 installation forward, all base RDBMS components are installed.  The only options are if a component is linked on or off (active and able to be used).  Custom installations are not possible.

You can run "opatch lsinventory -detail" against previous and new ORACLE_HOME to compare installed products.

Also please note:

rootupgrade.sh will fail if you are using /opt/oracle as the ORACLE_BASE.   For further information please see: 

Note: 1281913.1 Root Script Fails if ORACLE_BASE is set to /opt/oracle

Start the runInstaller :

[oracle@node1 database]$ ls -lrth
total 60K
drwxrwxr-x  2 oracle oinstall 4.0K Aug 27  2013 sshsetup
-rwxrwxr-x  1 oracle oinstall 3.2K Aug 27  2013 runInstaller
drwxrwxr-x  2 oracle oinstall 4.0K Aug 27  2013 rpm
drwxrwxr-x  2 oracle oinstall 4.0K Aug 27  2013 response
-rwxrwxr-x  1 oracle oinstall  30K Aug 27  2013 readme.html
drwxrwxr-x 14 oracle oinstall 4.0K Aug 27  2013 stage
-rwxrwxr-x  1 oracle oinstall  500 Aug 27  2013 welcome.html
drwxrwxr-x  4 oracle oinstall 4.0K Aug 27  2013 install

[oracle@node1 database]$ ./runInstaller
Starting Oracle Universal Installer...

Checking Temp space: must be greater than 120 MB.   Actual 4702 MB    Passed
Checking swap space: must be greater than 150 MB.   Actual 1285 MB    Passed
Checking monitor: must be configured to display at least 256 colors.    Actual 16777216    Passed
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2015-01-16_10-11-15AM. Please wait ...
[oracle@node1 database]$ You can find the log of this install session at:
 /data01/app/oraInventory/logs/installActions2015-01-16_10-11-15AM.log















When you click next it will promt you to run root.sh of node1 & node2 . So execute the root.sh using root on both nodes :

 [root@node1 ~]# sh /data01/app/oracle/product/11.2.0.4/db_1/root.sh
Performing root user operation for Oracle 11g

The following environment variables are set as:
    ORACLE_OWNER= oracle
    ORACLE_HOME=  /data01/app/oracle/product/11.2.0.4/db_1

Enter the full pathname of the local bin directory: [/usr/local/bin]:
The contents of "dbhome" have not changed. No need to overwrite.
The contents of "oraenv" have not changed. No need to overwrite.
The contents of "coraenv" have not changed. No need to overwrite.

Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root script.
Now product-specific root actions will be performed.
Finished product-specific root actions.




Check the current version of the 11.2.0.1 Oracle RDBMS time zone definitions -
If this reports version 14 then there is no action to take for the Oracle time zone definitions, you can upgrade from 10.1.0.5 / 10.2.0.x or 11.1.0.x to 11.2.0.2 without any action on TSLTZ or TSTZ data.

If it is not 14 follow the doc : Actions For DST Updates When Upgrading To Or Applying The 11.2.0.2 Patchset (Doc ID 1201253.1) 

SQL>SELECT version FROM v$timezone_file;

VERSION
----------
14

Now run the Pre-upgrade Utility tool and follow the recommendations:

[oracle@node1 ~]$ cp /data01/app/oracle/product/11.2.0.4/db_1/rdbms/admin/utlu112i.sql /home/oracle/upgrade/
[oracle@node1 ~]$ echo $ORACLE_HOME
/data01/app/oracle/product/11.2.0.3/db_1
[oracle@node1 ~]$
[oracle@node1 ~]$ /data01/app/oracle/product/11.2.0.3/db_1/bin/sqlplus / as sysdba

SQL*Plus: Release 11.2.0.3.0 Production on Fri Jan 16 12:19:13 2015

Copyright (c) 1982, 2011, Oracle.  All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options

SQL> spool pre_upgrade_utlu112i_log.log
SQL> @/home/oracle/upgrade/utlu112i.sql 
Oracle Database 11.2 Pre-Upgrade Information Tool 01-16-2015 12:21:01
Script Version: 11.2.0.4.0 Build: 001
.
**********************************************************************
Database:
**********************************************************************
--> name:   RACDB
--> version:   11.2.0.3.0
--> compatible:    11.2.0.0.0
--> blocksize:   8192
--> platform:   Linux x86 64-bit
--> timezone file: V14
.
**********************************************************************
Tablespaces: [make adjustments in the current environment]
**********************************************************************
--> SYSTEM tablespace is adequate for the upgrade.
.... minimum required size: 932 MB
--> SYSAUX tablespace is adequate for the upgrade.
.... minimum required size: 724 MB
--> UNDOTBS1 tablespace is adequate for the upgrade.
.... minimum required size: 400 MB
--> TEMP tablespace is adequate for the upgrade.
.... minimum required size: 60 MB
.
**********************************************************************
Flashback: OFF
**********************************************************************
**********************************************************************
Update Parameters: [Update Oracle Database 11.2 init.ora or spfile]
Note: Pre-upgrade tool was run on a lower version 64-bit database.
**********************************************************************
--> If Target Oracle is 32-Bit, refer here for Update Parameters:
-- No update parameter changes are required.
.

--> If Target Oracle is 64-Bit, refer here for Update Parameters:
-- No update parameter changes are required.
.
**********************************************************************
Renamed Parameters: [Update Oracle Database 11.2 init.ora or spfile]
**********************************************************************
-- No renamed parameters found. No changes are required.
.
**********************************************************************
Obsolete/Deprecated Parameters: [Update Oracle Database 11.2 init.ora or spfile]
**********************************************************************
-- No obsolete parameters found. No changes are required
.

**********************************************************************
Components: [The following database components will be upgraded or installed]
**********************************************************************
--> Oracle Catalog Views [upgrade]  VALID
--> Oracle Packages and Types [upgrade]  VALID
--> JServer JAVA Virtual Machine [upgrade]  VALID
--> Oracle XDK for Java [upgrade]  VALID
--> Real Application Clusters [upgrade]  VALID
--> Oracle Workspace Manager [upgrade]  VALID
--> OLAP Analytic Workspace [upgrade]  VALID
--> OLAP Catalog [upgrade]  VALID
--> EM Repository [upgrade]  VALID
--> Oracle Text [upgrade]  VALID
--> Oracle XML Database [upgrade]  VALID
--> Oracle Java Packages [upgrade]  VALID
--> Oracle interMedia [upgrade]  VALID
--> Spatial [upgrade]  VALID
--> Expression Filter [upgrade]  VALID
--> Rule Manager [upgrade]  VALID
--> Oracle Application Express [upgrade]  VALID
... APEX will only be upgraded if the version of APEX in
... the target Oracle home is higher than the current one.
--> Oracle OLAP API [upgrade]  VALID
.
**********************************************************************
Miscellaneous Warnings
**********************************************************************
WARNING: --> The "cluster_database" parameter is currently "TRUE"
.... and must be set to "FALSE" prior to running a manual upgrade.
WARNING: --> Your recycle bin contains 2 object(s).
.... It is REQUIRED that the recycle bin is empty prior to upgrading
.... your database.  The command:
PURGE DBA_RECYCLEBIN
.... must be executed immediately prior to executing your upgrade.
WARNING: --> Database contains schemas with objects dependent on DBMS_LDAP package.
.... Refer to the 11g Upgrade Guide for instructions to configure Network ACLs.
.... USER APEX_030200 has dependent objects.
.
**********************************************************************
Recommendations
**********************************************************************
Oracle recommends gathering dictionary statistics prior to
upgrading the database.
To gather dictionary statistics execute the following command
while connected as SYSDBA:

    EXECUTE dbms_stats.gather_dictionary_stats;

**********************************************************************
Oracle recommends reviewing any defined events prior to upgrading.

To view existing non-default events execute the following commands
while connected AS SYSDBA:
  Events:
    SELECT (translate(value,chr(13)||chr(10),' ')) FROM sys.v$parameter2
      WHERE  UPPER(name) ='EVENT' AND  isdefault='FALSE'

  Trace Events:
    SELECT (translate(value,chr(13)||chr(10),' ')) from sys.v$parameter2
      WHERE UPPER(name) = '_TRACE_EVENTS' AND isdefault='FALSE'

Changes will need to be made in the init.ora or spfile.

**********************************************************************


Backup database for a Manual Upgrade:

run {
Backup database format 'someformatdirectory%U' TAG BEFORE_UPGRADE ;
Backup current controlfile format '/location/control_backup_name' ;
}

Prepare the New Oracle Home for the Upgrade:


1. Copy configuration files from 11.2.0.3 home to 11.2.0.4 home $ORACLE_HOME/dbs ( pfile , spfile) 
2. Take backup of spfile also by creating a pfile at some  non-default location 
3. copy the password file from old home to new home 
4. If you are doing a cluster database upgrade perform above steps on all nodes 
5. In the pfile make necessary changes like : 
                    --- Remove obsolete parameters 
--- Make sure compatibility parameter is 11.2 
-- Adjust other parameters as suggested by pre-upgrade utility
-- Make sure all paths are fully specified in the pfile 
-- If you are upgrading a cluster database , make sure you make cluster_database=FALSE and after upgrade 
you must set this back to TRUE

Manually  Upgrade the database :

1. Shutdown the database 
2. change the PATH and bash profiles to point to new $ORACLE_HOME
3. If there us a different user and group for GRID and Oracle RDBMS then run the setasmgidwrap script which is located in $GRID_HOME/bin 
against the new $ORACLE_HOME/bin/oracle directory with the -o option as shown below:

Run on all nodes :
[root@node1 ~]# ls -lrth /data01/app/oracle/product/11.2.0.3/db_1/bin/oracle*
-rwxr-x--- 1 oracle oinstall    0 Sep 17  2011 /data01/app/oracle/product/11.2.0.3/db_1/bin/oracleO
-rwsr-s--x 1 oracle asmdba   222M Dec 21 11:57 /data01/app/oracle/product/11.2.0.3/db_1/bin/oracle
[root@node1 ~]# ls -lrth /data01/app/oracle/product/11.2.0.4/db_1/bin/oracle*
-rwxr-x--- 1 oracle oinstall    0 Aug 24  2013 /data01/app/oracle/product/11.2.0.4/db_1/bin/oracleO
-rwsr-s--x 1 oracle oinstall 229M Jan 16 11:10 /data01/app/oracle/product/11.2.0.4/db_1/bin/oracle

[grid@node1 ~]$ $GI_HOME/bin/setasmgidwrap o=/data01/app/oracle/product/11.2.0.4/db_1/bin/oracle


4. From the new $ORACLE_HOME/rdbms/admin

$ORACLE_HOME/bin/sqlplus / as sysdba
SQL>spool startup_upgrade.log
SQL> Startup upgrade pfile='/location of pfile for new home with cluster_databse=false' ;
sql>spool off;

5. Once the DB is open in upgrade mode:

SQL> SPool catupgrade.log
SQL> @$ORACLE_HOME/rdbms/admin/catupgrd.sql ;
SQL> spool off ;

The catupgrd.sql script determines which upgrade scripts must be run , runs them and then shut down the database.

if this script fails for some reason , then you can run the script again after you correct the issue.

6. Now start the database . 

7.Run SQL> @$ORACLE_HOME/rdbms/admin/utlu112s.sql  "The Post Upgrade status tool" which provides the summary of the upgrade at the end of spool log.

SQL> @$ORACLE_HOME/rdbms/admin/utlu112s.sql ;
.
Oracle Database 11.2 Post-Upgrade Status Tool 01-23-2015 22:05:02
.
Component Current      Version Elapsed Time
Name Status     Number HH:MM:SS
.
Oracle Server
.  VALID      11.2.0.4.0  02:30:04
JServer JAVA Virtual Machine
.  VALID      11.2.0.4.0  01:41:39
Oracle Real Application Clusters
.  VALID      11.2.0.4.0  00:00:10
Oracle Workspace Manager
.  VALID      11.2.0.4.0  00:01:57
OLAP Analytic Workspace
.  VALID      11.2.0.4.0  00:04:28
OLAP Catalog
.  VALID      11.2.0.4.0  00:04:53
Oracle OLAP API
.  VALID      11.2.0.4.0  00:02:59
Oracle Enterprise Manager
.  VALID      11.2.0.4.0  00:08:52
Oracle XDK
.  VALID      11.2.0.4.0  00:02:50
Oracle Text
.  VALID      11.2.0.4.0  00:02:12
Oracle XML Database
.  VALID      11.2.0.4.0  00:10:46
Oracle Database Java Packages
.  VALID      11.2.0.4.0  00:02:01
Oracle Multimedia
.  VALID      11.2.0.4.0  03:59:06
Spatial
.  VALID      11.2.0.4.0  00:10:10
Oracle Expression Filter
.  VALID      11.2.0.4.0  00:01:53
Oracle Rules Manager
.  VALID      11.2.0.4.0  00:01:05
Oracle Application Express
.  VALID     3.2.1.00.12
Final Actions
. 00:00:01
Total Upgrade Time: 09:05:24

PL/SQL procedure successfully completed.


8. Run @CATuppst.sql to perform upgrade actions that do not require the database to be in upgrade mode.

9. To reccompile any remaining stored procedure or java code 

SQl> @$ORACLE_HOME/rdbms/admin/utlrp.sql ;

Verify the invalid objects count :

select count(*) from dba_invalid_objects ; 

If the pre-upgrade information tool detected INVALID objects and populated teh registry$sys_inv_objs and registry$nonsys_inv_objs tables 
then execute $ORACLE_HOME/rdbms/admin/utluiobj.sql to display only those objects which are newly invalid because of the upgrade process;

10. If you are upgrading a cluster database , then upgrade the database configuration in clusterware

srvctl upgrade database -d db-unique-name -o /new_oracle_home

11.For cluster database change the CLUSTER_DATABASE=TRUE and stop DB and start the database using the srvctl utility

SQL> select * from v$version ;

BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
PL/SQL Release 11.2.0.4.0 - Production
CORE 11.2.0.4.0 Production
TNS for Linux: Version 11.2.0.4.0 - Production
NLSRTL Version 11.2.0.4.0 - Production


Sunday, 28 December 2014

Automatic Storage Management : ASMCMD



ASMCMD is a command-line utility that you can use to easily view and manipulate files and directories within Automatic Storage Management (ASM) disk groups. It can list the contents of disk groups, perform searches, create and remove directories and aliases, display space utilization, and more.
You can specify the -p option with the asmcmd command to include the current directory in the ASMCMD prompt, as shown in the following example:

% asmcmd -p
ASMCMD [+] > cd dgroup1/mydir
ASMCMD [+DGROUP1/MYDIR] >
ASMCMD Command Reference:

ASM generates filenames according to the following scheme:
+diskGroupName/databaseName/fileType/fileTypeTag.file.incarnation

ASMCMD command attributes:
========================
cd  ---> Changes the current directory to the specified directory.
du  ---> Displays the total disk space occupied by ASM files in the specified ASM directory and all its subdirectories, recursively.
exit  ---> Exits ASMCMD.
find  ---> Lists the paths of all occurrences of the specified name (with wildcards) under the specified directory.
help  ---> Displays the syntax and description of ASMCMD commands.
ls  ---> Lists the contents of an ASM directory, the attributes of the specified file, or the names and attributes of all disk groups.
lsct  ---> Lists information about current ASM clients.
lsdg  ---> Lists all disk groups and their attributes.
mkalias  ---> Creates an alias for a system-generated filename.
mkdir  ---> Creates ASM directories.
pwd  ---> Displays the path of the current ASM directory.
rm  ---> Deletes the specified ASM files or directories.
rmalias  ---> Deletes the specified alias, retaining the file that the alias points to.
When you start ASMCMD, the current directory is set to root (+). For an ASM instance with two disk groups, dgroup1 and dgroup2, entering an lscommand with the root directory as the current directory produces the following output:
ASMCMD> ls
DGROUP1/
DGROUP2/

DU command:
============
This command is similar to the du -s command in UNIX. If you do not specify dir, information about the current directory is displayed. dir can contain wildcard characters.

The following two values are displayed, both in units of MB.

Used_MB—This value does not take the mirroring into account. Mirror_used_MB—This value takes mirroring into account.
For example, if a normal redundancy disk group contains 100 MB of data, then assuming that each file in the disk group is 2-way mirrored, Used_MB is 100 MB and Mirror_used_MB is roughly 200 MB.
The -H flag suppresses column headings from the output.
The following example shows disk space used in the SAMPLE directory in DGROUP1, including all directories below SAMPLE.
ASMCMD [+DGROUP1/SAMPLE] > du
Used_MB      Mirror_used_MB
   1251                2507

Find command:
==============
Displays the absolute paths of all occurrences of the specified name (with wildcards) in a specified directory and its subdirectories.
Syntax and Description
find [-t type] dir name
This command searches the specified directory and all subdirectories below it in the directory tree for the supplied name. name can be a directory name or a filename, and can include wildcard characters. dir may also include wildcards. In the output of the command, directory names are suffixed with the slash character (/) to distinguish them from filenames.
You use the -t flag to find all the files of a particular type (specified as type). For example, you can search for control files by specifying type as CONTROLFILE. Valid values for type are the following:
CONTROLFILE
DATAFILE
ONLINELOG
ARCHIVELOG
TEMPFILE
BACKUPSET
DATAFILE
PARAMETERFILE
DATAGUARDCONFIG
FLASHBACK
CHANGETRACKING
DUMPSET
AUTOBACKUP
XTRANSPORT
Examples
The following example searches the dgroup1 disk group for files that begin with 'undo':
ASMCMD> find +dgroup1 undo*
+dgroup1/SAMPLE/DATAFILE/UNDOTBS1.258.555341963
+dgroup1/SAMPLE/DATAFILE/UNDOTBS1.272.557429239
The following example returns the absolute path of all the control files in the +dgroup1/sample directory.
ASMCMD> find -t CONTROLFILE +dgroup1/sample *
+dgroup1/sample/CONTROLFILE/Current.260.555342185
+dgroup1/sample/CONTROLFILE/Current.261.555342183
ls command:
===========
Lists the contents of an ASM directory, the attributes of the specified file, or the names and attributes of all disk groups.
Syntax and Description
ls [-lsdrtLaH] [name]
name can be a filename or directory name, including wildcard characters.
If name is a directory name, ASMCMD lists the contents of the directory, and, depending on flag settings, information about each directory member. Directories are listed with a trailing slash (/) to distinguish them from files.
If name is a filename, ASMCMD lists the file, and, depending on flag settings, information about the file. The file must be located in the current directory if the filename is specified with a relative path.
Command flags enable you to modify and customize the output of the command. The following table lists the flags and their descriptions.
Flag Description
(none)  Displays only filenames and directory names.
-l    ------> Displays extended file information, including striping and redundancy attributes and whether the file was system-generated (indicated by Y under the SYS column) or user-created (as in the case of an alias, indicated by N under the SYS column). When used in the "ls -l +" command, displays extended disk group information. Note that not all possible file attributes or disk group attributes are included. To view the complete set of attributes for a file or a disk group, query the V$ASM_FILE and V$ASM_DISKGROUP views.
-s  ---------> Displays file space information.
-d If the name argument is a directory, displays information about that directory, rather than the directory contents. Typically used with another flag, such as the -l flag.
-r -------->  Reverses the sort order of the listing.
-t  ---------> Sorts the listing by timestamp (latest first) instead of by name.
-L If ------> the name argument is an alias, displays information on the file that it references. Typically used with another flag, such as the -l flag.
-a  ---------> For each listed file, displays the absolute path of the alias that references it, if any.
-H  -------> Suppresses column headings.
If you specify all flags, then the command shows a union of their attributes, with duplicates removed. If you enter ls +, then the command returns information on all disk groups, including whether or not they are mounted.
Examples
ASMCMD [+DGROUP1/SAMPLE/DATAFILE] > ls
EXAMPLE.269.555342243
SYSAUX.257.555341961
SYSTEM.256.555341961
UNDOTBS1.258.555341963
UNDOTBS1.272.557429239
USERS.259.555341963
ASMCMD [+DGROUP1/SAMPLE/DATAFILE] > ls -l
Type      Redund  Striped  Time             Sys  Name
DATAFILE  MIRROR  COARSE   APR 18 19:16:07  Y    EXAMPLE.269.555342243
DATAFILE  MIRROR  COARSE   MAY 09 22:01:28  Y    SYSAUX.257.555341961
DATAFILE  MIRROR  COARSE   APR 19 19:16:24  Y    SYSTEM.256.555341961
DATAFILE  MIRROR  COARSE   MAY 05 12:28:42  Y    UNDOTBS1.258.555341963
DATAFILE  MIRROR  COARSE   MAY 04 17:27:34  Y    UNDOTBS1.272.557429239
DATAFILE  MIRROR  COARSE   APR 18 19:16:07  Y    USERS.259.555341963
ASMCMD [+DGROUP1/SAMPLE/DATAFILE] > ls -lt
Type      Redund  Striped  Time             Sys  Name
DATAFILE  MIRROR  COARSE   MAY 09 22:01:28  Y    SYSAUX.257.555341961
DATAFILE  MIRROR  COARSE   MAY 05 12:28:42  Y    UNDOTBS1.258.555341963
DATAFILE  MIRROR  COARSE   MAY 04 17:27:34  Y    UNDOTBS1.272.557429239
DATAFILE  MIRROR  COARSE   APR 19 19:16:24  Y    SYSTEM.256.555341961
DATAFILE  MIRROR  COARSE   APR 18 19:16:07  Y    USERS.259.555341963
DATAFILE  MIRROR  COARSE   APR 18 19:16:07  Y    EXAMPLE.269.555342243

ASMCMD [+DGROUP1/SAMPLE/DATAFILE] > ls -l undo*
Type      Redund  Striped  Time             Sys  Name
DATAFILE  MIRROR  COARSE   MAY 05 12:28:42  Y    UNDOTBS1.258.555341963
DATAFILE  MIRROR  COARSE   MAY 04 17:27:34  Y    UNDOTBS1.272.557429239

ASMCMD [+DGROUP1/SAMPLE/DATAFILE] > ls -s
Block_Size  Blocks      Bytes       Space  Name
      8192   12801  104865792   214958080  EXAMPLE.269.555342243
      8192   48641  398467072   802160640  SYSAUX.257.555341961
      8192   61441  503324672  1011875840  SYSTEM.256.555341961
      8192    6401   52436992   110100480  UNDOTBS1.258.555341963
      8192   12801  104865792   214958080  UNDOTBS1.272.557429239
      8192     641    5251072    12582912  USERS.259.555341963
ASMCMD [+DGROUP1] > ls +DGROUP1/SAMPLE
CONTROLFILE/
DATAFILE/
ONLINELOG/
PARAMETERFILE/
TEMPFILE/
spfilesample.ora
ASMCMD [+DGROUP1] > ls -l +DGROUP1/SAMPLE
Type  Redund  Striped  Time  Sys Name
                             Y   CONTROLFILE/
                             Y   DATAFILE/
                             Y   ONLINELOG/
                             Y   PARAMETERFILE/
                             Y   TEMPFILE/
                             N   spfilesample.ora=>
                              +DGROUP1/SAMPLE/PARAMETERFILE/spfile.270.555342443
ASMCMD [+DGROUP1] > ls -r +DGROUP1/SAMPLE
spfilesample.ora
TEMPFILE/
PARAMETERFILE/
ONLINELOG/
DATAFILE/
CONTROLFILE/
ASMCMD [+DGROUP1] > ls -lL example_df2.f
Type      Redund  Striped  Time          Sys  Name
DATAFILE  MIRROR  COARSE   APR 27 11:04  N    example_df2.f => +DGROUP1/SAMPLE/DATAFILE/EXAMPLE.271.556715087
ASMCMD [+DGROUP1] > ls -a +DGROUP1/SAMPLE/DATAFILE/EXAMPLE.271.556715087
+DGROUP1/example_df2.f => EXAMPLE.271.556715087
ASMCMD [+DGROUP1] > ls -lH +DGROUP1/SAMPLE/PARAMETERFILE
PARAMETERFILE  MIRROR  COARSE   MAY 04 21:48  Y    spfile.270.555342443
ASMCMD [+DGROUP1] > ls -l +
State    Type    Rebal  Unbal  Name
MOUNTED  NORMAL  N      N      DGROUP1/
MOUNTED  NORMAL  N      N      DGROUP2/
MOUNTED  EXTERN  N      N      DGROUP3/
lsct command:
=============
Lists information about current ASM clients. A client is a database that uses disk groups managed by the ASM instance that ASMCMD is currently connected to.
Syntax and Description
lsct [-H] [group]
If group is specified, information about only that disk group is displayed. The -H flag suppresses column headings.
Example
This example displays information about the client accessing the dgroup1 disk group.
ASMCMD [+] > lsct dgroup1
DB_Name   Status        Software_Version  Compatible_version  Instance_Name
sample    CONNECTED           10.2.0.0.0          10.2.0.0.0  sample
lsdg command:
==============
Purpose
Lists all disk groups and their attributes.
Syntax and Description
lsdg [-H] [group]
Attribute Name Description
State Mounted/connected state of the disk group
Type Disk group redundancy (NORMAL, HIGH, EXTERNAL)
Rebal Y if a rebalance operation is in progress
Unbal Y if the disk group is in need of rebalancing
Sector Sector size in bytes
Block Block size in bytes
AU Allocation Unit size in bytes
Total_MB Size of the disk group in MB
Free_MB Free space in the disk group in MB, without regard to redundancy. From the V$ASM_DISKGROUP view.
Req_mir_free_MB Amount of space that must be available in the disk group to restore full redundancy after the worst failure that can be tolerated by the disk group. This is the REQUIRED_MIRROR_FREE_MB column from the V$ASM_DISKGROUP view.
Usable_file_MB Amount of free space, adjusted for mirroring, that is available for new files. From the V$ASM_DISKGROUP view.
Offline_disks Number of offline disks in the disk group. Offline disks are eventually dropped.
If group is specified, information about only that disk group is listed. The -H flag suppresses column headings.
Example
The following example lists the attributes of the dgroup2 disk group.
ASMCMD [+] > lsdg dgroup2
State    Type    Rebal  Unbal  Sector  Block       AU  Total_MB  Free_MB
Req_mir_free_MB  Usable_file_MB  Offline_disks  Name
MOUNTED  NORMAL  N      N         512   4096  1048576      4096     1208
           1024              92              0  DGROUP2/
mkalias command:
================
Purpose
Creates an alias for the specified system-generated filename.
mkalias file alias
alias must be in the same disk group as the system-generated file. Only one alias is permitted for each ASM file.
The SQL*Plus equivalent of the mkalias command is:
ALTER DISKGROUP dg_name ADD ALIAS user_alias FOR file
Example
The following example creates the sysaux.f alias for the fully qualified filename +DGROUP1/SAMPLE/DATAFILE/SYSAUX.257.555341961.
ASMCMD [+DGROUP1/SAMPLE/DATAFILE] > mkalias SYSAUX.257.555341961 sysaux.f
ASMCMD [+DGROUP1/SAMPLE/DATAFILE] > ls -a
none => EXAMPLE.269.555342243
+DGROUP1/SAMPLE/DATAFILE/sysaux.f => SYSAUX.257.555341961
none => SYSTEM.256.555341961
none => UNDOTBS1.258.555341963
none => UNDOTBS1.272.557429239
none => USERS.259.555341963
sysaux.f
mkdir command:
==============
Creates ASM directories under the current directory.
mkdir dir [dir] . . .
The current directory can be a system-created or user-created directory. You cannot create a directory at the root (+) level.
The SQL*PLUS equivalent of the mkdir command is ALTER DISKGROUP dg_name ADD DIRECTORY dir, dir . . .
Example
The following example creates the directories subdir1 and subdir2 at the disk group level in the disk group dgroup1.
ASMCMD [+DGROUP1] > mkdir subdir1 subdir2
ASMCMD [+DGROUP1] > ls
SAMPLE/
example_df2.f
subdir1/
subdir2/
pwd command:
=============
Displays the absolute path of the current directory.
ASMCMD> pwd
+dgroup1/sample/controlfile

rm command
===========
Purpose
Deletes the specified ASM files and directories.
Syntax and Description
rm [-rf] name [name] . . .
If name is a file or alias, rm can delete it only if it is not currently in use by a client database. If name is a directory, rm can delete it only if it is empty (unless the -r flag is used) and it is not a system-generated directory. If name is an alias, rm deletes both the alias and the file that the alias references. (To delete just an alias and retain the file that the alias references, use the rmalias command.)
Note:
The SQL*Plus equivalents of the rm command are:
ALTER DISKGROUP ... DROP FILE
ALTER DISKGROUP ... DROP DIRECTORY
If you use a wildcard, rm deletes all matches except non-empty directories (unless the -r flag is used).
To recursively delete, use the -r flag. This enables you to delete a non-empty directory, including all files and directories in it and in the entire directory tree underneath it.
If you use the -r flag or a wildcard character, rm prompts you to confirm deletion before proceeding, unless you specify the -f flag.If a wildcard character matches an alias or a system-generated file that has an alias, both the alias and the system-generated file that it references are deleted. When using the -r flag, either the system-generated file or the alias needs to be present in the directory in which you run the rm command.
For example, if you have a user alias, +dg1/dir1/file.alias that points to +dg/ORCL/DATAFILE/System.256.146589651, then running the rm -r +dg1/dir1 command will remove +dg1/dir1/file.alias as well as +dg/ORCL/DATAFILE/System.256.146589651.
The following example deletes the alias alias293.f.
ASMCMD [+DGROUP1/SAMPLE/DATAFILE] > rm alias293.f
rmalias command
=============
Purpose
Deletes the specified aliases, retaining the files that the aliases reference.
rmalias [-r] alias [alias] . . .
The SQL*Plus equivalent of the rmalias command is:
ALTER DISKGROUP dg_name DROP ALIAS user_alias
To recursively delete, use the -r flag. This enables you to delete all aliases in the current directory and in the entire directory tree beneath the current directory. If any user-created directories become empty as a result of deleting aliases, they are deleted also. System-created files and directories are not deleted.
The following example deletes the alias sysaux.f, retaining the datafile that it references.
ASMCMD [+DGROUP1/SAMPLE/DATAFILE] > rmalias sysaux.f
lsdsk Command
================
Purpose
List the disks that are visible to ASM, using the V$ASM_DISK_STAT and V$ASM_DISK views. The V$ASM_DISK_STAT view is used by default.
lsdsk [-ksptagcHI] [-d diskg_roup_name] [pattern]
pattern restricts the output to only disks that matches the pattern specified. Wild-card characters and slashes (/ or \) can be part of the pattern. See "Wildcard Characters".
The k, s, p, and t flags modify how much information is displayed for each disk. If any combination of the flags are specified, then the output shows the union of the attributes associated with each flag. The flags are described in Table 7-7.
This command can run in connected or non-connected mode. The connected mode is always attempted first. The -I option forces the non-connected mode.
In connected mode, ASMCMD uses dynamic views to retrieve disk information.

In non-connected mode, ASMCMD scans disk headers to retrieve disk information, using an ASM disk string to restrict the discovery set.
(none)
Displays the PATH column of the V$ASM_DISK view.
-k
Displays the TOTAL_MB, FREE_MB, OS_MB,NAME, FAILGROUP, LIBRARY, LABEL, UDID, PRODUCT, REDUNDANCY, and PATH columns of the V$ASM_DISK view.
-s
Displays the READS, WRITES, READ_ERRS, WRITE_ERRS, READ_TIME, WRITE_TIME, BYTES_READ, BYTES_WRITTEN, and the PATH columns of the V$ASM_DISK view.
-p
Displays the GROUP_NUMBER, DISK_NUMBER, INCARNATION, MOUNT_STATUS, HEADER_STATUS, MODE_STATUS, STATE, and the PATH columns of the V$ASM_DISK view.
-t
Displays the CREATE_DATE, MOUNT_DATE, REPAIR_TIMER, and the PATH columns of the V$ASM_DISK view.
-g
Selects from GV$ASM_DISK_STAT, or from GV$ASM_DISK if the -c flag is also specified. GV$ASM_DISK.INST_ID is included in the output.
-c
Selects from V$ASM_DISK, or from GV$ASM_DISK if the -g flag is also specified. This option is ignored if the ASM instance is version 10.1 or earlier.
-H
Suppresses column headings.
-I
Scans disk headers for information rather than extracting the information from an ASM instance. This option forces the non-connected mode.
-d
Restricts results to only those disks that belong to the group specified by disk_group_name.
ASMCMD> lsdsk -k -d DATA *_0001
ASMCMD> lsdsk -s -d DATA *_0001
ASMCMD> lsdsk -t -d DATA *_0001
ASMCMD> lsdsk -C -t -d DATA *_0001
ASMCMD> lsdsk -g -t -d DATA *_0001