Hungry DBA .com for DBAs who like food

Installing and Configuring Oracle ASM on a Standalone Server

Create ASM Disks

Create the required ASM disks using the oracleasm utility as the root user:

oracleasm createdisk ORA1 /dev/local1/oral1

oracleasm createdisk ORA2 /dev/local1/oral2

oracleasm createdisk ORA3 /dev/local1/oral3

Install Oracle Infrastructure Grid:

From the Oracle Infrastructure Grid Installation directory type:

./runInstaller

 

 

Select Install and Configure Grid Infrastructure for a Standalone Server and then click Next

 

 

Select Required Languages and then press Next

 

 

Select the Disk Group Characteristics and select which disks to add, then click Next

 

 

Setup the relevant passwords and then click Next

 

 

Enter the Operating System Group Details and press Next

 

 

Enter The Home for the Infrastructure Grid and press Next

 

 

Review Checks; as this is just a test we can ignore the Swap Size Warning and press Next

 

 

Review Installation settings and Save a Response File is so required.  Press Finish when ready.

 

 

Run root.sh as the root user as instructed above

 

/u01/app/oracle/product/11.2.0/grid/root.sh

Running Oracle 11g root.sh script...

The following environment variables are set as:

    ORACLE_OWNER= oracle

    ORACLE_HOME=  /u01/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.

2010-09-27 12:30:46: Checking for super user privileges

2010-09-27 12:30:46: User has super user privileges

2010-09-27 12:30:46: Parsing the host name

Using configuration parameter file: /u01/app/oracle/product/11.2.0/grid/crs/inst                             all/crsconfig_params

Creating trace directory

Improper Oracle Clusterware configuration found on this host

Deconfigure the existing cluster configuration before starting

to configure a new Clusterware

run '/u01/app/oracle/product/11.2.0/grid/crs/install/rootcrs.pl -deconfig'

to configure existing failed configuration and then rerun root.sh

In the example above the root.sh script failed as there was an older clusterware configuration found on the host.

Remove the old configuration as instructed but include the additional option ‘-force’:

 

/u01/app/oracle/product/11.2.0/grid/crs/install/rootcrs.pl -deconfig –force

2010-09-27 12:34:36: Parsing the host name

2010-09-27 12:34:36: Checking for super user privileges

2010-09-27 12:34:36: User has super user privileges

Using configuration parameter file: /u01/app/oracle/product/11.2.0/grid/crs/install/crsconfig_params

Failure to execute: No such file or directory for command /u01/app/oracle/product/11.2.0/grid/bin/crsctl check cluster -n wwlapps4111

Failure to execute: No such file or directory for command /u01/app/oracle/product/11.2.0/grid/bin/crsctl check cluster -n wwlapps4111

Usage: srvctl <command> <object> [<options>]

    commands: enable|disable|start|stop|status|add|remove|modify|getenv|setenv|unsetenv|config

    objects: database|service|asm|diskgroup|listener|home|ons|eons

For detailed help on each command and object and its options use:

  srvctl <command> -h or

  srvctl <command> <object> -h

PRKO-2012 : nodeapps object is not supported in Oracle Restart

Can't exec "/u01/app/oracle/product/11.2.0/grid/bin/clsecho": No such file or directory at /u01/app/oracle/product/11.2.0/grid/lib/acfslib.pm line 937.

Failure to execute: No such file or directory for command /u01/app/oracle/product/11.2.0/grid/bin/crsctl stat res ora.registry.acfs

Failure to execute: No such file or directory for command /u01/app/oracle/product/11.2.0/grid/bin/crsctl check cluster -n wwlapps4111

You must kill crs processes or reboot the system to properly

cleanup the processes started by Oracle clusterware

2560+0 records in

2560+0 records out

10485760 bytes (10 MB) copied, 0.036883 seconds, 284 MB/s

error: package cvuqdisk is not installed

Successfully deconfigured Oracle clusterware stack on this node 

Now rerun root.sh:

 

[root@wwlapps4111 oracle]# /u01/app/oracle/product/11.2.0/grid/root.sh

Running Oracle 11g root.sh script...

The following environment variables are set as:

    ORACLE_OWNER= oracle

    ORACLE_HOME=  /u01/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]:

The file "oraenv" already exists in /usr/local/bin.  Overwrite it? (y/n)

[n]:

The file "coraenv" already exists in /usr/local/bin.  Overwrite it? (y/n)

[n]:

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.

2010-09-27 12:36:17: Checking for super user privileges

2010-09-27 12:36:17: User has super user privileges

2010-09-27 12:36:17: Parsing the host name

Using configuration parameter file: /u01/app/oracle/product/11.2.0/grid/crs/install/crsconfig_params

LOCAL ADD MODE

Creating OCR keys for user 'oracle', privgrp 'oinstall'..

Operation successful.

CRS-4664: Node wwlapps4111 successfully pinned.

Adding daemon to inittab

CRS-4123: Oracle High Availability Services has been started.

ohasd is starting

wwlapps4111     2010/09/27 12:36:45     /u01/app/oracle/product/11.2.0/grid/cdata/wwlapps4111/backup_20100927_123645.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 2047 MB    Passed

The inventory pointer is located at /etc/oraInst.loc

The inventory is located at /u01/app/oraInventory

'UpdateNodeList' was successful.

 

 Continue the installation until all required steps have completed successfully and press Next 

 

The installation of the Grid Infrastructure is now complete; thus press Close to end

Administering ASM and adding a disk to a disk group

 

After installing ASM, the +ASM instance should now be started.

ps -ef |grep smon

oracle    7121     1  0 12:39 ?        00:00:00 asm_smon_+ASM

. oraenv

ORACLE_SID = [oracle] ? +ASM

The Oracle base for ORACLE_HOME=/u01/app/oracle/product/11.2.0/grid is /u01/app/oracle

sqlplus /nolog

SQL*Plus: Release 11.2.0.1.0 Production on Mon Sep 27 12:49:52 2010

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

SQL> connect / as sysasm

Connected.

NOTE: connection is done as the SYSASM role

SQL> select group_number, disk_number, mount_status, header_status, name, path from v$asm_disk;

GROUP_NUMBER

DISK_NUMBER

MOUNT_STATUS

HEADER_STATUS

NAME

PATH

1

0

CACHED

MEMBER

ORA1

ORCL:ORA1

1

1

CACHED

MEMBER

ORA2

ORCL:ORA2

1

2

CACHED

MEMBER

ORA3

ORCL:ORA3

Add a new disk to the group:

As the root user add a new disk via the oracleasm utility:

oracleasm createdisk ORA4 /dev/local1/oral4

From the ASM instance check the status of the new disk:

SQL> select group_number, disk_number, mount_status, header_status, name, path from v$asm_disk;

GROUP_NUMBER

DISK_NUMBER

MOUNT_STATUS

HEADER_STATUS

NAME

PATH

0

0

CLOSED

PROVISIONED

 

ORCL:ORA4

1

0

CACHED

MEMBER

ORA1

ORCL:ORA1

1

1

CACHED

MEMBER

ORA2

ORCL:ORA2

1

2

CACHED

MEMBER

ORA3

ORCL:ORA3

Add the new disk to the disk group DATA as follows:

SQL> alter diskgroup DATA add disk 'ORCL:ORA4';

Recheck the status:

SQL> select group_number, disk_number, mount_status, header_status, name, path from v$asm_disk;

GROUP_NUMBER

DISK_NUMBER

MOUNT_STATUS

HEADER_STATUS

NAME

PATH

1

0

CACHED

MEMBER

ORA1

ORCL:ORA1

1

1

CACHED

MEMBER

ORA2

ORCL:ORA2

1

2

CACHED

MEMBER

ORA3

ORCL:ORA3

1

3

CACHED

MEMBER

ORA4

ORCL:ORA4

Manually create a database to use ASM

Use ASMCMD to create the relevant structure for the database files

. oraenv

ORACLE_SID = [DEV3] ? +ASM

The Oracle base for ORACLE_HOME=/u01/app/oracle/product/11.2.0/grid is /u01/app/oracle

asmcmd

ASMCMD> ls

DATA/

ASMCMD> cd DATA

ASMCMD> ls

ASM/

DEV3/

ASMCMD> mkdir DEV1

ASMCMD> cd DEV1

ASMCMD> mkdir CONTROLFILE

ASMCMD> mkdir DATAFILE

ASMCMD> mkdir PARAMETERFILE

ASMCMD> mkdir TEMPFILE

ASMCMD> mkdir RDO

ASMCMD> mkdir UNDO

ASMCMD> exit

Create admin directory structures

cd $ORACLE_BASE\admin

mkdir DEV1

mkdir DEV1/adump

mkdir DEV1/dpdump

mkdir DEV1/pfile

mkdir DEV1/scripts 

Setup INIT.ORA file

-- add entry in /etc/oratab for DEV1

 . oraenv

ORACLE_SID = [+ASM] ? DEV1

The Oracle base for ORACLE_HOME=/u01/app/oracle/product/11.2.0/oracle is /u01/app/oracle

cd $ORACLE_HOME/dbs

cat > initDEV1.ora

*.audit_file_dest='/u01/app/oracle/admin/DEV1/adump'

*.audit_trail='db'

*.compatible='11.2.0.0.0'

*.control_files='+DATA/dev1/controlfile/control1.ctl','+DATA/dev1/controlfile/control2.ctl'

*.db_block_size=16384

*.db_create_file_dest='+DATA'

*.db_domain=''

*.db_name='DEV1'

*.db_recovery_file_dest='+DATA'

*.db_recovery_file_dest_size=5218762752

*.diagnostic_dest='/u01/app/oracle'

*.dispatchers='(PROTOCOL=TCP) (SERVICE=DEV1XDB)'

*.open_cursors=300

*.processes=150

*.remote_login_passwordfile='EXCLUSIVE'

*.undo_tablespace='UNDOTBS1'  

Create Password File

orapwd file=orapwDEV1 password=sys entries=35  

Create Database

sqlplus /nolog 

SQL> connect / as sysdba

SQL> startup nomount 

SQL> create database "DEV1"

logfile group 1 ('+DATA/dev1/rdo/redo1a.log','+DATA/dev1/rdo/redo1b.log') size 100m,

        group 2 ('+DATA/dev1/rdo/redo2a.log','+DATA/dev1/rdo/redo2b.log') size 100m,

        group 3 ('+DATA/dev1/rdo/redo3a.log','+DATA/dev1/rdo/redo3b.log') size 100m

character set "UTF8"

national character set "AL16UTF16"

datafile '+DATA/dev1/datafile/system01.dbf' size 250m autoextend on next 10m maxsize unlimited extent management local

undo tablespace "UNDOTBS1" datafile '+DATA/dev1/undo/undotbs01.dbf' size 200m

sysaux datafile '+DATA/dev1/datafile/sysaux01.dbf' size 200m reuse autoextend on next 10m maxsize unlimited

default temporary tablespace TEMP tempfile '+DATA/dev1/tempfile/temp01.dbf' size 200m autoextend on next 10m maxsize 400m;

Create SPFILE

SQL> create spfile='+DATA/dev1/spfileDEV1.ora' from pfile;

SQL> exit

 

cat > $ORACLE_HOME/dbs/initDEV1.ora

SPFILE='+DATA/DEV1/spfileDEV1.ora'

sqlplus /nolog

SQL> connect / as sysdba

SQL> shutdown immediate

SQL> startup

SQL> show parameter spfile

NAME                                 TYPE        VALUE

------------------------------------ ----------- ------------------------------

spfile                               string      +DATA/dev1/spfiledev1.ora

Create a tablespace using ASM

Within our newly created DEV1 database:

CREATE TABLESPACE USER_DATA

DATAFILE '+DATA/dev1/datafile/user_data_01.dbf' SIZE 200M REUSE

AUTOEXTEND ON NEXT 10M MAXSIZE UNLIMITED

LOGGING

ONLINE

PERMANENT

EXTENT MANAGEMENT LOCAL AUTOALLOCATE

SEGMENT SPACE MANAGEMENT AUTO;