Tuesday, December 30, 2014

PRCR-1065 Failed to stop resource ora.asm

Error PRCR-1065 and CRS-2529 can be returned while stopping the ASM using srvctl command on Grid Infrastructure 11.2 and above as can be seen in the following

[grid@salman1 ~]$ srvctl stop asm
PRCR-1065 : Failed to stop resource ora.asm
CRS-2529: Unable to act on 'ora.asm' because that would require stopping or relocating 'ora.CRS.dg', but the force option was not specified

Reason of Error
The reason for this error is that starting from 11.2 Grid Infrastructure, ASM diskgroups are registered with CRS as a resource. Since these diskgroup resources are dependent on ASM, hence you can’t stop ASM resource without stopping diskgroup resources first; or alternatively you can use “–f” option with "srvctl stop asm" command to stop ASM regardless of its dependent resources (i.e. diskgroups). In this example, ora.CRS.dg and ora.DATA.dg are my diskgroup resources for the diskgroup CRS and DATA which hindered stopping the ASM using srvctl command. In the following you can see the correct method/sequence of stopping the ASM.


[grid@salman1 ~]$ crsctl status res –t
--------------------------------------------------------------------------------
Name           Target  State        Server                   State details
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.CRS.dg
               ONLINE  ONLINE       salman1                  STABLE
ora.DATA.dg
               ONLINE  ONLINE       salman1                  STABLE
ora.LISTENER.lsnr
               ONLINE  ONLINE       salman1                  STABLE
ora.asm
               ONLINE  ONLINE       salman1                  Started,STABLE
ora.ons
               OFFLINE OFFLINE      salman1                  STABLE
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.cdb.db
      1        OFFLINE OFFLINE                               Instance Shutdown, STABLE
                                                            
ora.cssd
      1        ONLINE  ONLINE       salman1                  STABLE
ora.diskmon
      1        OFFLINE OFFLINE                               STABLE
ora.evmd
      1        ONLINE  ONLINE       salman1                  STABLE
--------------------------------------------------------------------------------

[grid@salman1 ~]$ srvctl stop asm
PRCR-1065 : Failed to stop resource ora.asm
CRS-2529: Unable to act on 'ora.asm' because that would require stopping or relocating 'ora.CRS.dg', but the force option was not specified

Now you will see that if we stop diskgroup resources before stopping the ASM, there will be no error while stopping ASM later.

[grid@salman1 ~]$ srvctl stop diskgroup -g crs
[grid@salman1 ~]$ srvctl stop diskgroup -g data
[grid@salman1 ~]$ srvctl stop asm
[grid@salman1 ~]$ crsctl stat res -t
--------------------------------------------------------------------------------
Name           Target  State        Server                   State details
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.CRS.dg
               OFFLINE OFFLINE      salman1                  STABLE
ora.DATA.dg
               OFFLINE OFFLINE      salman1                  STABLE
ora.LISTENER.lsnr
               ONLINE  ONLINE       salman1                  STABLE
ora.asm
               OFFLINE OFFLINE      salman1                  Instance Shutdown,ST
                                                             ABLE
ora.ons
               OFFLINE OFFLINE      salman1                  STABLE
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.cdb.db
      1        OFFLINE OFFLINE                               Instance Shutdown,ST
                                                             ABLE
ora.cssd
      1        ONLINE  ONLINE       salman1                  STABLE
ora.diskmon
      1        OFFLINE OFFLINE                               STABLE
ora.evmd
      1        ONLINE  ONLINE       salman1                  STABLE
--------------------------------------------------------------------------------
[grid@salman1 ~]$

Monday, December 29, 2014

Oracle Database 12c Patch/Upgrade from 12.1.0.1 to 12.1.0.2 using DBUA

For manual upgrade guide from 12.1.0.1 to 12.1.0.2, click here.
Before going through this upgrade guide, you may be interested to view the guide to patch/upgrade standalone Grid Infrastructure from 12.1.0.1 to 12.1.0.2

In this guide, you will see how we patch/upgrade our existing Oracle RDBMS software form 12.1.0.1 to 12.1.0.2. This would be an out-of-place upgrade and hence we would be installing new software in a new home.
As we know that Oracle now provides full installation binaries for patchset releases so the binaries are required to be downloaded from MOS. You would need to download Patch 17694377 disk 1 and 2. This upgrade was done on Oracle Linux 6 (x86-64) running on Oracle Virtual Box. There is a 12.1.0.1 (cdb) database and an 11.2.0.4 (db11g) database running on this host having files on ASM.

To install RDBMS software, log in as “oracle” (RDBMS software owner) and unset ORACLE_BASE and ORACLE_HOME environment variables. After this initiate the installer.
Unset ORACLE_HOME, ORACLE_SID and ORACLE_BASE environment variables

$unset ORACLE_BASE
$unset ORACLE_HOME
$./runInstaller

Click Next





























Select “Install database software only”, and click Next




























Make sure you have selected first option. Click Next 




























Click Next




























Click Next




























Specify path for Oracle Base and Oracle Software Home directories. Click Next




























Make necessary changes if required. Click Next




























Click Install




























When prompted, execute root.sh by opening a new terminal window and logging in as root
























Installation is complete. Click Close





























Now you should update your .bast_profile for “oracle” user to reflect new ORACLE_BASE and ORACLE_HOME directories.

Now it is time to upgrading existing 12.1.0.1 database to 12.1.0.2. Here I will be using DBUA to upgrade the database which is the recommended way to do an upgrade.
Same method can be used to upgrade any database with version 11.2.0.2 or above (for 11G R2), 11.1.0.7 or 10.2.0.5. Otherwise you would need to use some other method to upgrade your database. Please see this white paper for the details.

Open DBUA by executing command dbua. Select first option to upgrade the Oracle database. Click Next.




























Select your source database for upgrade. Click Next




























If this is a container database, all pluggable databases would also be upgraded automatically. Click Next




























Make sure there is not error or warning on this screen. If you see any error or warning, resolve it before moving further. Click Next




























Select upgrade parallelism carefully. I selected 4 with my single processor Virtual Machine and it took several hours to finish. Your parallelism should never go beyond the number of processors. Click Next




























Specify the port on with OEM is needed to be configured. Click Next

Click Next




























Select the Listener to which this database will be registered. Or if you want to create a new Listener. local_listener entry in the parameter file would be updated to register the database with the specified listener. Click Next




























Select if you either want RMAN to create a new backup before upgrade, or if you want to create or use an existing guaranteed restore point to revert back the database in case of a failed upgrade. Or if you don’t want to take any backup because you already have backed up your database before starting the upgrade. Click Next




























Click Finish




























Monitor the progress




























Click on the Upgrade Results button to see the details. Ignore the Time taken for upgrade, in bellow screen shot because for my case it took quite a long time to finish because of limited resources I had for my virtual machine.


























































Now you many click on Close to DBUA interface.
DBUA would automatically register database in grid infrastructure from new ORACLE_HOME (12.1.0.2), as can be seen bellow

[grid@salman1 ~]$ srvctl config database -d cdb
Database unique name: cdb
Database name: cdb
Oracle home: /u01/app/oracle/product/12.1.0/dbhome_1
Oracle user: oracle
Spfile: +DATA/cdb/spfilecdb.ora_1418278365037
Password file:
Domain:
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Disk Groups: DATA
Services: pdb_srv
OSDBA group:
OSOPER group:
Database instance: cdb