ASM

11gR2: Steps to Rename ASM Diskgroup with DB files

11gR2 introduced renamedg utility to rename diskgroups. I would discuss renaming a diskgroup on a Standalone Grid Infrastructure installation with Oracle Restart. Before you use the command, ensure that ASM diskgroup is dismounted.
Below is syntax for the command. You can refer to
11gR2 docs for details

renamedg
[phase={ one|two |both } ] dgname=diskgroup
newdgname=newdiskgroup [config=configfile]
[ asm_diskstring=discoverystring, discoverystring ... ]
[ clean={true|false} ] [ check={true|false} ]
[ confirm={true|false}] [ verbose={ true|false} ]
[ keep_voting_files={true|false}]

Basically we have two phases of using renamedg command, phase 1 generates a configuration file to be used by phase 2. In phase 2 actual renaming of diskgroup is done.

Note : – I have tried these steps in a Test environment and tried to cover the most components. But would recommend you  to cross verify the steps in a test environment before implementing in production environment

Lets get Started!!

1) Gather all the information for Oracle restart Configuration and DB parameters

Database Configuration

[oracle@db11g bin]$ srvctl config database -d test11r2
Database unique name: test11r2
Database name: test11r2
Oracle home: /u02/app/oracle/product/11.2.0/dbhome_1
Oracle user: oracle
Spfile: +DATA/test11r2/spfiletest11r2.ora
Domain:
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Disk Groups: DATA
Services:

ASM Information

[oracle@db11g bin]$ srvctl config asm
ASM home: /u02/app/oracle/product/11.2.0/grid
ASM listener: LISTENER
Spfile: +DATA/asm/asmparameterfile/registry.253.696489255
ASM diskgroup discovery string: /dev/oracleasm/disks/VOL*

[oracle@db11g bin]$ srvctl config listener
Name: LISTENER
Home: /u02/app/oracle/product/11.2.0/grid
End points: TCP:1521

Create Database parameter file

sql> create pfile='/tmp/param.txt' from spfile;

Oracle Restart configuration

Disable Oracle Restart so that it does not restart any component. ‘crsctl status resource’ can be used to check status of resources. As you can see I have stopped database but  ASM Diskgroup DATA is still mounted.

[oracle@db11g bin]$ crsctl disable has
[oracle@db11g bin]$ crsctl status resource
NAME=ora.DATA.dg
TYPE=ora.diskgroup.type
TARGET=ONLINE
STATE=ONLINE on db11g

NAME=ora.FLASH_ARC.dg
TYPE=ora.diskgroup.type
TARGET=ONLINE
STATE=ONLINE on db11g

NAME=ora.LISTENER.lsnr
TYPE=ora.listener.type
TARGET=ONLINE
STATE=ONLINE on db11g

NAME=ora.asm
TYPE=ora.asm.type
TARGET=ONLINE
STATE=ONLINE on db11g

NAME=ora.cssd
TYPE=ora.cssd.type
TARGET=ONLINE
STATE=ONLINE on db11g

NAME=ora.diskmon
TYPE=ora.diskmon.type
TARGET=ONLINE
STATE=ONLINE on db11g

NAME=ora.test11r2.db
TYPE=ora.database.type
TARGET=OFFLINE
STATE=OFFLINE

2) We are renaming DATA diskgroup to DG.

[oracle@db11g bin]$ renamedg dgname=data newdgname=dg asm_diskstring='/dev/oracleasm/disks/VOL*' verbose=true
NOTE: No asm libraries found in the system

Parsing parameters..

Parameters in effect:

         Old DG name       : DATA
         New DG name          : DG
         Phases               :
                 Phase 1
                 Phase 2
         Discovery str        : /dev/oracleasm/disks/VOL*
         Clean              : TRUE
         Raw only           : TRUE
renamedg operation: dgname=data newdgname=dg asm_diskstring=/dev/oracleasm/disks/VOL* verbose=true
Executing phase 1
Discovering the group
Performing discovery with string:/dev/oracleasm/disks/VOL*
Identified disk UFS:/dev/oracleasm/disks/VOL11 with disk number:2 and timestamp (32924744 398242816)
Identified disk UFS:/dev/oracleasm/disks/VOL12 with disk number:1 and timestamp (32924741 928525312)
Identified disk UFS:/dev/oracleasm/disks/VOL21 with disk number:0 and timestamp (32924744 362846208)
Identified disk UFS:/dev/oracleasm/disks/VOL22 with disk number:3 and timestamp (32924741 928525312)
Checking for hearbeat...
Re-discovering the group
Performing discovery with string:/dev/oracleasm/disks/VOL*
Identified disk UFS:/dev/oracleasm/disks/VOL11 with disk number:2 and timestamp (32924744 398242816)
Identified disk UFS:/dev/oracleasm/disks/VOL12 with disk number:1 and timestamp (32924741 928525312)
Identified disk UFS:/dev/oracleasm/disks/VOL21 with disk number:0 and timestamp (32924744 362846208)
Identified disk UFS:/dev/oracleasm/disks/VOL22 with disk number:3 and timestamp (32924741 928525312)
Checking if the diskgroup is mounted
Checking disk number:2
Checking disk number:1
Checking disk number:0
Checking disk number:3
Checking if diskgroup is used by CSS
Generating configuration file..
Completed phase 1
Executing phase 2
Looking for /dev/oracleasm/disks/VOL11
Modifying the header
Looking for /dev/oracleasm/disks/VOL12
Modifying the header
Looking for /dev/oracleasm/disks/VOL21
Modifying the header
Looking for /dev/oracleasm/disks/VOL22
Modifying the header
Completed phase 2
Terminating kgfd context 0xb7e7a050

3) Modify ASM configuration to correct the spfile location

$srvctl modify asm -p +DG/asm/asmparameterfile/registry.253.696489255
$srvctl start asm

Connect to ASM instance and mount +DG diskgroup.

sqlplus "/ as sysasm"
sql> alter diskgroup DG mount;

At this moment, you will see additional ASM diskgroup resource ora.DG.dg in crsctl configuration. Remove the old ora.DATA.dg resource

oracle@db11g ~]$ crsctl delete resource ora.DATA.dg
CRS-2730: Resource 'ora.test11r2.db' depends on resource 'ora.DATA.dg'
CRS-4000: Command Delete failed, or completed with errors.

We get above error as the test11r2 database configuration states ora.DATA.dg as dependent resource. Use -f option to drop it by force. Or you can first modify the database configuration and drop the resource later.

[oracle@db11g ~]$ crsctl delete resource ora.DATA.dg -f

4) Startup Database.

To do that we need to modify parameter file as control_files parameter and other *_file_dest needs to be changed. Change all occurence of ‘+DATA’ to ‘+DG’. Open database in mount mode as we would have to rename database files and redo logs before opening databases

SQL> startup nomount pfile='/tmp/param.txt'
ORACLE instance started.

Total System Global Area  343154688 bytes
Fixed Size                  1336428 bytes
Variable Size             218106772 bytes
Database Buffers          117440512 bytes
Redo Buffers                6270976 bytes

SQL>alter database mount;

Use below command to get sql for renaming diskgroup information for datafiles/redo logs

 select 'alter database rename file '''||name||''' to ''<strong>+DG</strong>'||substr(name,instr(name,'/',1,1))||''';' from V$DATAFILE;

select 'alter database rename file '''||member||''' to ''<strong>+DG</strong>'||substr(member,instr(member,'/',1,1))||''';' from V$logfile;

V$RECOVER_FILE view can be used to check for any issues with datafiles not being available.
If everything is fine, you can open the database. You would have noticed that I have not done anything for Temp files. Checking alert log, we see that it is renamed automatically

 Re-creating tempfile +DATA/test11r2/tempfile/temp.268.696494395 as +DG/test11r2/tempfile/temp.272.704195475

Now we need to re-create spfile on ASM Diskgroup. Use following steps

$cd $ORACLE_HOME/dbs
$cat inittest11r2.ora
SPFILE='+DATA/test11r2/spfiletest11r2.ora'
$mv inittest11r2.ora inittest11r2.ora.new
$ cp /tmp/param.txt $ORACLE_HOME/dbs/inittest11r2.ora
$sqlplus "/ as sysdba"
SQL>create spfile='+DG/test11r2/spfiletest11r2.ora' from pfile;
exit
$mv inittest11r2.ora initest11r2.old

--- Modify inittest11r2.ora.new and change diskgroup to +DG---
$cat inittest11r2.ora.new
SPFILE='+DG/test11r2/spfiletest11r2.ora'
$mv inittest11r2.ora.new inittest11r2.ora

Now we need to modify Database configuration for Oracle Restart

[oracle@db11g ~]$ srvctl config database -d test11r2
Database unique name: test11r2
Database name: test11r2
Oracle home: /u02/app/oracle/product/11.2.0/dbhome_1
Oracle user: oracle
Spfile: +DATA/test11r2/spfiletest11r2.ora
Domain:
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
PRCD-1012 : Failed to retrieve disk group list for database test11r2.
PRCR-1035 : Failed to look up CRS resource ora.DATA.dg for test11r2
PRCR-1001 : Resource ora.DATA.dg does not exist

As there is no DATA diskgroup available, it gives a error. If you notice initial output (before renaming diskgroup), there was entry for DATA Diskgroup. We also need to modify the entry for spfile.

[oracle@db11g ~]$ srvctl modify database -d test11r2 -p +DG/test11r2/spfiletest11r2.ora
[oracle@db11g ~]$ srvctl modify database -d test11r2 -a DG
[oracle@db11g dbs]$ srvctl config database -d test11r2
Database unique name: test11r2
Database name: test11r2
Oracle home: /u02/app/oracle/product/11.2.0/dbhome_1
Oracle user: oracle
<strong>Spfile: +DG/test11r2/spfiletest11r2.ora</strong>
Domain:
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
<strong>Disk Groups: DG</strong>
Services:

You can now shutdown database and use srvctl to start If you have not dropped ora.DATA.dg resource earlier (due to errors), you can drop it now without errors

 [oracle@db11g ~]$ crsctl delete resource ora.DATA.dg

You can now enable Oracle Restart

[oracle@db11g dbs]$ crsctl enable has
CRS-4622: Oracle High Availability Services autostart is enabled.

Phew!! This was quite a posting after long time!!

11gR2 – SysAsm vs SysDba

SYSASM role was introduced in 11gR1 and was designed to administer ASM instances. In 11gR1 , if you connected with SYSDBA role , you used to get a warning which was only recorded in alert log (Refer to my earlier post here). But things have changed in 11gR2. While trying to dismount a Diskgroup, I found following errors

SQL> alter diskgroup flash_arc mount;
alter diskgroup flash_arc mount
*
ERROR at line 1:
ORA-15032: not all alterations performed
ORA-15260: permission denied on ASM disk group

Above error indicates that I do not have permission on the ASM Diskgroup.  As per 11gR2 documentation, SYSASM privilege is used for carrying out administration tasks on ASM Diskgroups. SYSDBA privilege can be used only for creating/deleting aliases and querying ASM dictionary views.  Frankly speaking, you should unlearn the habit of connecting as “/ as sysdba” to ASM instance and learn connecting as “/ as sysasm”

Link:11gR2 RAC installation steps on OEL4

If you are looking for steps for 11gR2 RAC installation, you can refer to this article by Rajeev Ramdas at Dbastreet.com. Article lists down steps for installing 11gR2 RAC on 64 bit Oracle Enterprise Linux 4 (OEL4) using ASM for storage. As Raw devices are no longer supported, OCR and Voting Disks are also stored on ASM. Yes, this is one more cool New Feature available in 11gR2.

Get Upgrading: Steps To Upgrade To 11gR2

As 11gR2 is out for Linux, I decided to upgrade one of my existing 10.2.0.3 database to 11.2.0.1 to get the look and feel of 11gR2. Direct upgrade to 11gR2 is supported from 9.2.0.8 or higher, 10.1.0.5 or higher, 10.2.0.2 or higher and 11.1.0.6 or higher. If you have a database 9.2.0.6 then first you need to upgrade to intermediate release i.e 9.2.0.8 then to 11.2.0.1.

9.2.0.6==>9.2.0.8==>11.2.0.1
8.1.7.0==>8.1.7.4==>10.2.0.4==>11.2.0.1

I will discuss how to upgrade an existing Single Instance 10.2.0.3 database with ASM, having same ORACLE_HOME, to 11gR2 with ASM. The upgrade needs to be performed in two phases:

1. Upgrade the ASM instance
2. Upgrade the database

Upgrade ASM Instance:
===============

There are three ways to upgrade already existing ASM instance:

- Using OUI of Grid Infrastructure
- Using ASM Configuration Assistant
- Manual upgrade

The recommended method to upgrade ASM instance is to use OUI of Grid Infrastructure, which I have used .

STEP 1:

Create OSASM group:
If you want, you can create a separate group for ASM instance here it is named as ASMADMIN.

# groupadd asmadmin
# usermod -a -G asmadmin oracle

STEP 2:

Before upgrading an ASM instance to 11gR2 it is mandatory to add a ‘user and password’ combination to the password file which is local to node’s ASM instance. Login to database instance “/ as sysdba”:

SQL> create user sood identified by oracle;
SQL> grant sysdba to sood;
SQL> select * from v$pwfile_users;

USERNAME            SYSDB SYSOP
------------------------------ -----       -----
SYS                        TRUE  TRUE
SOOD                     TRUE  FALSE

STEP 3:

From 11gR2 onwards ASM is part of Grid Infrastructure and we need to download Grid Infrastructure software first. To download the software for 11gR2 Grid Infrastructure click here

Start the RunInstaller:

./runInstaller

Click on the Image to Enlarge.

1. It will automatically defaults to the “Upgrade Mode”

Upgrade Mode

Select “Upgrade Grid Infrastructure” and click Next.

2. On clicking Next, It will detect the already existing ASM instance. Shutdown the Database and ASM instance at this point.

Click “Yes”.

3.  Select the Language

Click “Next”.

4.  Enter a Password for ASMSNMP user. The password can be anything you want, though Oracle will ask you to set a password which adhers to Oracle’s standards otherwise a “Red Cross” will be shown in the tab at left hand side. Do not worry about that cross 🙂

Click “Next”.

5. Provide the Group details

Click “Next”.

Click “Yes”.

6. Provide the Base and Home location for Grid Infrastructure Home

Click “Next”.

7.  It will perform the Prerequisite checks here, For more information on this click Installation Fixup script
I have select “Ignore All”

Click “Next”.

8.  Now you will see “Summary” page, make sure that the Installation Option is shown as “Upgrade Grid Infrastructure” and Migrate ASM as “True”.

Click “Finish”.

9. Now the setup for “Grid Infrastructure’ is started

Run the rootupgrade.sh

# ./rootupgrade.sh

[root@localhost ~]# cd /u01/11g/oracle/product/11.2.0/grid/

[root@localhost grid]# pwd
/u01/11g/oracle/product/11.2.0/grid
[root@localhost grid]# ./rootupgrade.sh
Running Oracle 11g root.sh script...

The following environment variables are set as:
ORACLE_OWNER= oracle
ORACLE_HOME=  /u01/11g/oracle/product/11.2.0/grid

Enter the full pathname of the local bin directory: [/usr/local/bin]:
The file "dbhome" already exists in /usr/local/bin.  Overwrite it? (y/n)
[n]: y
Copying dbhome to /usr/local/bin ...
The file "oraenv" already exists in /usr/local/bin.  Overwrite it? (y/n)
[n]: y
Copying oraenv to /usr/local/bin ...
The file "coraenv" already exists in /usr/local/bin.  Overwrite it? (y/n)
[n]: y
Copying coraenv to /usr/local/bin ...

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.sh script.
Now product-specific root actions will be performed.
2009-09-05 11:46:25: Checking for super user privileges
2009-09-05 11:46:25: User has super user privileges
2009-09-05 11:46:25: Parsing the host name
Using configuration parameter file: /u01/11g/oracle/product/11.2.0/grid/crs/install/crsconfig_params
Creating trace directory
LOCAL ADD MODE
Creating OCR keys for user 'oracle', privgrp 'oinstall'..
Operation successful.
CSS appears healthy
Stopping CSSD.
Shutting down CSS daemon.
Shutdown request successfully issued.
Shutdown has begun. The daemons should exit soon.
CRS-4664: Node localhost successfully pinned.
Adding daemon to inittab
CRS-4123: Oracle High Availability Services has been started.
ohasd is starting

localhost     2009/09/05 11:49:02     /u01/11g/oracle/product/11.2.0/grid/cdata/localhost/backup_20090905_114902.olr
Successfully configured Oracle Grid Infrastructure for a Standalone Server
Updating inventory properties for clusterware
Starting Oracle Universal Installer...

Checking swap space: must be greater than 500 MB.   Actual 885 MB    Passed
The inventory pointer is located at /etc/oraInst.loc
The inventory is located at /u01/10g/oraInventory
'UpdateNodeList' was successful.
[root@localhost grid]#

10. After the upgrade I have checked /etc/oratab file and found the entry of ASM pointing to new home i.e now ASM is a part of “Grid Infrastructure”
“+ASM:/u01/11g/oracle/product/11.2.0/grid:N”

Upgrade Database Instance:
===================

NOTE: DO NOT SHUTDOWN DATABASE BEFORE RUNNING DBUA.

STEP 1: Install The Software:

To download Oracle Database 11gR2 software click Here . Execute runInstaller to install “SOFTWARE ONLY” option, you can follow this link to install the software.  Make sure that you select “software only”  option as shown below rest of the steps are same as described in above link.

STEP 2: Run Pre-Upgrade Information tool

I have installed the software under “/u01/11g/oracle/product/11.2.0/dbhome_1” location. Once the software is installed, then go to location $ORACLE_HOME/rdbms/admin and copy  utlu112i.sql script to /tmp directory. Now login to 10g database “/ as sysdba” and startup the 10g database, then:

SQL> spool /tmp/upgrade.spl
SQL> @/tmp/utlu112i.sql
SQL> spool off</span>

Following is the output of this script from my database:

Oracle Database 11.2 Pre-Upgrade Information Tool    09-04-2009 01:54:32
.
**********************************************************************
Database:
**********************************************************************
--&gt; name:          ORCL10G
--&gt; version:       10.2.0.3.0
--&gt; compatible:    10.2.0.3.0
--&gt; blocksize:     8192
--&gt; platform:      Linux IA (32-bit)
--&gt; timezone file: V3
.
**********************************************************************
Tablespaces: [make adjustments in the current environment]
**********************************************************************
--&gt; SYSTEM tablespace is adequate for the upgrade.
.... minimum required size: 724 MB
.... AUTOEXTEND additional space required: 244 MB
--&gt; UNDOTBS1 tablespace is adequate for the upgrade.
.... minimum required size: 464 MB
.... AUTOEXTEND additional space required: 439 MB
--&gt; SYSAUX tablespace is adequate for the upgrade.
.... minimum required size: 447 MB
.... AUTOEXTEND additional space required: 207 MB
--&gt; TEMP tablespace is adequate for the upgrade.
.... minimum required size: 61 MB
.... AUTOEXTEND additional space required: 41 MB
.
**********************************************************************
Flashback: OFF
**********************************************************************
**********************************************************************
Update Parameters: [Update Oracle Database 11.2 init.ora or spfile]
**********************************************************************
WARNING: --&gt; "sga_target" needs to be increased to at least 336 MB
WARNING: --&gt; "java_pool_size" needs to be increased to at least 64 MB
WARNING: --&gt; "pga_aggregate_target" needs to be increased to at least 24 MB
.
**********************************************************************
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]
**********************************************************************
--&gt; background_dump_dest         11.1       DEPRECATED   replaced by
"diagnostic_dest"
--&gt; user_dump_dest               11.1       DEPRECATED   replaced by
"diagnostic_dest"
--&gt; core_dump_dest               11.1       DEPRECATED   replaced by
"diagnostic_dest"
.
**********************************************************************
Components: [The following database components will be upgraded or installed]
**********************************************************************
--&gt; Oracle Catalog Views         [upgrade]  VALID
--&gt; Oracle Packages and Types    [upgrade]  VALID
--&gt; JServer JAVA Virtual Machine [upgrade]  VALID
--&gt; Oracle XDK for Java          [upgrade]  VALID
--&gt; Oracle Workspace Manager     [upgrade]  VALID
--&gt; OLAP Analytic Workspace      [upgrade]  VALID
--&gt; OLAP Catalog                 [upgrade]  VALID
--&gt; EM Repository                [upgrade]  VALID
--&gt; Oracle Text                  [upgrade]  VALID
--&gt; Oracle XML Database          [upgrade]  VALID
--&gt; Oracle Java Packages         [upgrade]  VALID
--&gt; Oracle interMedia            [upgrade]  VALID
--&gt; Spatial                      [upgrade]  VALID
--&gt; Data Mining                  [upgrade]  VALID
--&gt; Expression Filter            [upgrade]  VALID
--&gt; Rule Manager                 [upgrade]  VALID
--&gt; Oracle OLAP API              [upgrade]  VALID
.
**********************************************************************
Miscellaneous Warnings
**********************************************************************
WARNING: --&gt; Database is using a timezone file older than version 11.
.... After the release migration, it is recommended that DBMS_DST package
.... be used to upgrade the 10.2.0.3.0 database timezone version
.... to the latest version which comes with the new release.
WARNING: --&gt; Database contains schemas with stale optimizer statistics.
.... Refer to the Upgrade Guide for instructions to update
.... schema statistics prior to upgrading the database.
.... Component Schemas with stale statistics:
....   SYS
....   XDB
WARNING: --&gt; Database contains schemas with objects dependent on network
packages.
.... Refer to the Upgrade Guide for instructions to configure Network ACLs.
WARNING: --&gt; EM Database Control Repository exists in the database.
.... Direct downgrade of EM Database Control is not supported. Refer to the
.... Upgrade Guide for instructions to save the EM data prior to upgrade.
WARNING:--&gt; recycle bin in use.
.... Your recycle bin turned on.
.... 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.
PL/SQL procedure successfully completed.
SQL&gt; spool off

Adjust the warnings shown by Pre-Upgrade Information tool.

STEP 3 : Upgrade using DBUA

Execute the DBUA from 11gR2 software home as

$ cd $ORACLE_HOME/bin
$./dbua

1.

Click “Next”

2.  Select the database that you want to upgrade

Click “Next”

3.  Here DBUA will show warnings that were not solved after running Pre-Upgrade Information tool

Click “Yes”

4. Turn OFF archiving while upgrading

Click “Next”

5. Check whether you want to move the datafiles while upgrade, though the “move datafile” check-box was not highlighted when I upgraded

Click “Next”.

6. Specify “FRA” and “Diagnostic Destination”

Click “Next”.

7. Check configuration for EM

Click “Next”.

8.  Check “Summary” page

Click “Finish”

Upgrade Process is started

Check the Results

12Congratulations!!!!!!!!!! Upgrade is Successful !!!!!!!!!!!!!!!

Now you are ready to use Most Powerful Database!! 🙂

11gR2 Database Installation with ASM on OEL5

I will be listing down steps for 11g Release 2 installation on Linux x86. There has been few changes incorporated in 11gR2 which must be given due consideration before starting installation. ASM instance now runs from new Oracle Home called Grid Infrastructure.

If you wish to use ASM for storing database files, then you should install first Oracle grid infrastructure for a standalone server. It is also required if you wish to use Oracle Restart feature (Provides for automatic restart of DB and other components after a hardware or software failure or whenever your database host computer restarts) for single instance.

Environment used for this setup
Operating System – Oracle Enterprise Linux Release 5(OEL5) on Vmware
Physical Ram – 1Gb

Asmlib for labeling ASM Disks.Refer to following OTN article for configuring asmlib and creating disks.

Software can be downloaded from OTN at following link

Oracle Database 11g Release 2 Grid Infrastructure (11.2.0.1.0) for Linux x86

Oracle Database 11g Release 2 (11.2.0.1.0) for Linux x86

All the pre-requisites for installation can be found here
http://download.oracle.com/docs/cd/E11882_01/install.112/e10840/pre_install.htm

I have tried to shorten it by keeping things which are relevant to our setup.

Check Packages

binutils-2.17.50.0.6
compat-libstdc++-33-3.2.3
elfutils-libelf-0.125
elfutils-libelf-devel-0.125
elfutils-libelf-devel-static-0.125
gcc-4.1.2
gcc-c++-4.1.2
glibc-2.5-24
glibc-common-2.5
glibc-devel-2.5
glibc-headers-2.5
kernel-headers-2.6.18
ksh-20060214
libaio-0.3.106
libaio-devel-0.3.106
libgcc-4.1.2
libgomp-4.1.2
libstdc++-4.1.2
libstdc++-devel-4.1.2
make-3.81
sysstat-7.0.2
unixODBC-2.2.11
unixODBC-devel-2.2.11

If you have yum installed on your machine, then it is very easy to install the packages. You can copy the list of packages in a text file and insert ‘yum install ‘ in beginning and execute it as root. This will install any missing packages. To know more about setting up yum, refer to my previous post

If Kernel parameters are not setup correctly, Oracle 11g OUI provides you  a fixup script and also ability to resume the installation process without need to re-run the earlier steps. Please refer to article here

Users,Roles and Groups for Installation

osdba group for ASM – Membership in the OSDBA group allows access to the files managed by Automatic Storage Management. It can be same as database osdba group. We will be using group dba in our setup.
OSASM group – Members of the OSASM group can use SQL to connect to an Automatic Storage Management instance as SYSASM using operating system authentication. The SYSASM privileges permit mounting and dismounting disk groups, and other storage administration tasks. SYSASM privileges provide no access privileges on an RDBMS instance. We will use asmadmin

OSOPER group – Similar to SYSOPER privilege in RDBMS, this is used for limited privileges like starting up and stopping the Oracle ASM instance. We will not be using separate group for it, will be selecting dba in our setup

oinstall – This is similar to previous releases, and used for Oracle Inventory group

I am using oracle user for installing Grid Infrastructure and Oracle Database Software. You can have a separate user say oragrid with oinstall membership and permission on oracle inventory directory.

Create Base directory where software will be installed. I used /u02/app/oracle

Add users and groups

/usr/sbin/groupadd -g 501 dba
/usr/sbin/groupadd -g 504 asmadmin
/usr/sbin/groupadd oinstall

/usr/sbin/useradd -u 502 -g oinstall -G dba,asmadmin oracle

Add following entries to /etc/security/limits.conf

oracle              soft    nproc   2047
oracle              hard    nproc   16384
oracle              soft    nofile  1024
oracle              hard    nofile  65536

Add or edit the following line in the /etc/pam.d/login file, if it does not already exist:

session    required     pam_limits.so

Add/replace following entries in /etc/sysctl.conf

fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 536870912
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048586

Execute following command as root to change the current kernel parameters:

/sbin/sysctl -p

Copy following in your login profile.

if [ $USER = "oracle" ]; then
        if [ $SHELL = "/bin/ksh" ]; then
              ulimit -p 16384
              ulimit -n 65536
        else
              ulimit -u 16384 -n 65536
        fi
umask 022
fi

We need to start with Grid Infrastructure installation. Unzip the contents and execute  runInstaller . This would require 2.8Gb of disk space.

$./runInstaller

Please click on image below for  displaying screenshots for 11gR2 Grid Infrastructure installation

Grid_infra_install

Execute root.sh from Grid ORACLE_HOME as root user

The following environment variables are set as:
    ORACLE_OWNER= oracle
    ORACLE_HOME=  /u02/app/oracle/product/11.2.0/grid

Enter the full pathname of the local bin directory: [/usr/local/bin]:
The file "dbhome" already exists in /usr/local/bin.  Overwrite it? (y/n)
[n]: y
   Copying dbhome to /usr/local/bin ...
The file "oraenv" already exists in /usr/local/bin.  Overwrite it? (y/n)
[n]: y
   Copying oraenv to /usr/local/bin ...
The file "coraenv" already exists in /usr/local/bin.  Overwrite it? (y/n)
[n]: y
   Copying coraenv to /usr/local/bin ...

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.sh script.
Now product-specific root actions will be performed.
2009-09-02 05:07:26: Checking for super user privileges
2009-09-02 05:07:26: User has super user privileges
2009-09-02 05:07:26: Parsing the host name
Using configuration parameter file: /u02/app/oracle/product/11.2.0/grid/crs/install/crsconfig_params
Creating trace directory
LOCAL ADD MODE
Creating OCR keys for user 'oracle', privgrp 'oinstall'..
Operation successful.
CRS-4664: Node db11g successfully pinned.
Adding daemon to inittab
CRS-4123: Oracle High Availability Services has been started.
ohasd is starting

db11g     2009/09/02 05:09:24     /u02/app/oracle/product/11.2.0/grid/cdata/db11g/backup_20090902_050924.olr
Successfully configured Oracle Grid Infrastructure for a Standalone Server
Updating inventory properties for clusterware
Starting Oracle Universal Installer...

Checking swap space: must be greater than 500 MB.   Actual 2399 MB    Passed
The inventory pointer is located at /etc/oraInst.loc
The inventory is located at /u01/app/oraInventory
'UpdateNodeList' was successful.

To install Database software, Unzip the contents of both the zip files and execute runInstaller . Ensure you have 3.95Gb of free disk space

$./runInstaller

Please click on image for  displaying screenshots for 11gR2 Database installation .

11g_db_install

You are done 🙂

Component

Value /Commands to Check

Physical RAM >1 Gb

1Gb
grep MemTotal /proc/meminfo

Swap should be 1.5 times the RAM.

In our case it will be 1.5G
grep SwapTotal /proc/meminfo

/dev/shm to be configured to use MEMORY_TARGET

# df -h /dev/shm/

1Gb of /tmp space

df -h /tmp

Disk space Requirement for Grid Infrastructure Software (Enterprise edition)

2.95 Gb

Disk space Requirement for Database Software (Enterprise edition)

3.95 Gb

Packages for OEL5

binutils-2.17.50.0.6
compat-libstdc++-33-3.2.3
elfutils-libelf-0.125
elfutils-libelf-devel-0.125
elfutils-libelf-devel-static-0.125
gcc-4.1.2
gcc-c++-4.1.2
glibc-2.5-24
glibc-common-2.5
glibc-devel-2.5
glibc-headers-2.5
kernel-headers-2.6.18
ksh-20060214
libaio-0.3.106
libaio-devel-0.3.106
libgcc-4.1.2
libgomp-4.1.2
libstdc++-4.1.2
libstdc++-devel-4.1.2
make-3.81
sysstat-7.0.2
unixODBC-2.2.11
unixODBC-devel-2.2.11

ORA-1078 ORA-1565 Errors while starting database with SPFILE on ASM

I was getting following error’s while starting a database using spfile on ASM. Actually this was a cloned RAC environment.

SQL> create SPFILE='+ASM_GROUP/PORTALDB/spfileportaldb.ora' from pfile;
File created.
SQL> shut immediate;
ORA-01109: database not open
Database dismounted.
ORACLE instance shut down.
SQL> exit
SQL> startup mount
ORA-01078: failure in processing system parameters
ORA-01565: error in identifying file '+ASM_GROUP/PORTALDB/spfileportaldb.ora'
ORA-17503: ksfdopn:2 Failed to open file +ASM_GROUP/PORTALDB/spfileportaldb.ora
ORA-01000: maximum open cursors exceeded

Error first states that it has failed to process the parameter. Second states that it has failed to identify the spfile and is unable to open. But I was able to open the database normally with pfile. Also the spfile was present in ASM diskgroup which I confirmed by listing DG contets on asmcmd prompt.

Problem here was that I had started the database with pfile from non-default location and pfile located in $ORACLE_HOME/dbs had following entries

SPFILE='+ASM_GROUP/PORTALDB/spfileportaldb.ora'

In this case spfile too was created with same contents. Correct method is to specify the non-default pfile location in ‘create spfile’ syntax.

SQL> CREATE SPFILE='+ASM_GROUP/PORTALDB/spfileportaldb.ora' from pfile=\'/home/oracle/portaldb.ora\';

File created.

SQL> shut immediate;
ORA-01109: database not open

Database dismounted.
ORACLE instance shut down.
SQL> exit
SQL> sqlplus \"/ as sysdba\"
Connected to an idle instance.

SQL> startup mount
ORACLE instance started.

Total System Global Area 3674210304 bytes
Fixed Size                  2088384 bytes
Variable Size            2197815872 bytes
Database Buffers         1459617792 bytes
Redo Buffers               14688256 bytes
Database mounted.
SQL> alter database open;

Cheers
Amit