Oracle Database Experts

By Charles Kim

September 15th, 2009

Public Yum with Oracle

Configure your server for Yum (Yellowdog Updater Modified):

There’s no more need to look for CDs from your pile of CDs or from the clutter of your desk. Earlier in 2009, Oracle launched their public yum server which offers a free and convenient way to install packages from the Enterprise Linux and Oracle VM. Obviously, the Yum server if offered without support.

We will show you how to setup your Red Hat or Oracle Enterprise Linux to use Oracle’s public Yum repository. In this example, we only focus on 64-bit Red Hat 5 Update 3.

[root@rac01 ~]# cd /etc/yum.repos.d/
[root@rac01 yum.repos.d]# ls -ltr
total 0
[root@rac01 yum.repos.d]# wget http://public-yum.oracle.com/public-yum-el5.repo
--11:27:04--  http://public-yum.oracle.com/public-yum-el5.repo
Resolving public-yum.oracle.com... 141.146.44.34
Connecting to public-yum.oracle.com|141.146.44.34|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1402 (1.4K) [text/plain]
Saving to: `public-yum-el5.repo'

100%[=========================================================>] 1,402       --.-K/s   in 0s     

11:27:04 (83.6 MB/s) - `public-yum-el5.repo' saved [1402/1402]

Edit the file public-yum-el5.repo with your choice of editor such as vi. Change enabled=0 to enabled=1 for the following sections since we are on RH5 U3

Portions of your yum.repos.d file should look something like this:

[el5_u3_base]
name=Enterprise Linux $releasever U3 - $basearch - base
baseurl=http://public-yum.oracle.com/repo/EnterpriseLinux/EL5/3/base/$basearch/
gpgkey=http://public-yum.oracle.com/RPM-GPG-KEY-oracle-el5
gpgcheck=1
enabled=1

[el5_addons]
name=Enterprise Linux $releasever - $basearch - addons
baseurl=http://public-yum.oracle.com/repo/EnterpriseLinux/EL5/addons/$basearch/
gpgkey=http://public-yum.oracle.com/RPM-GPG-KEY-oracle-el5
gpgcheck=1
enabled=1

[el5_oracle_addons]
name=Enterprise Linux $releasever - $basearch - oracle_addons
baseurl=http://public-yum.oracle.com/repo/EnterpriseLinux/EL5/oracle_addons/$basearch/
gpgkey=http://public-yum.oracle.com/RPM-GPG-KEY-oracle-el5
gpgcheck=1
enabled=1

Install missing RPM needed to install Oracle

Here’s an example of downloading the compat-db RPM and installing the package

[root@rac01 yum.repos.d]# yum install compat-db
Loaded plugins: security
Setting up Install Process
Parsing package install arguments
Package compat-db-4.2.52-5.1.x86_64 already installed and latest version
Resolving Dependencies
--> Running transaction check
---> Package compat-db.i386 0:4.2.52-5.1 set to be updated
--> Finished Dependency Resolution

Dependencies Resolved

==================================================================================================
 Package                Arch              Version                  Repository                Size
==================================================================================================
Installing:
 compat-db              i386              4.2.52-5.1               el5_u3_base              1.7 M

Transaction Summary
==================================================================================================
Install      1 Package(s)
Update       0 Package(s)
Remove       0 Package(s)         

Total download size: 1.7 M
Is this ok [y/N]: y
Downloading Packages:
compat-db-4.2.52-5.1.i386.rpm                                              | 1.7 MB     00:01
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing     : compat-db                                         [1/1] 

Installed: compat-db.i386 0:4.2.52-5.1
Complete!

Posted by Charles Kim, Oracle ACE

Technorati Tags:

September 13th, 2009

ACFS command-line tools available in Oracle Database 11g Release 2

To support all the greatest ASM cluster file system functionality in Oracle Database 11g Release 2, Oracle provides set of command-line tools available for all Unix and Windows platforms. Here’s a summary of all the available commands:

acfsdbg 			Debugs an Oracle ACFS file system.
acfsutil info 	Displays various Oracle ACFS file system information.
acfsutil registry 	Registers an Oracle ACFS file system with the Oracle ACFS mount registry.
acfsutil rmfs 	Removes an Oracle ACFS file system.
acfsutil size 	Resizes an Oracle ACFS file system.
acfsutil snap create Creates a read-only snapshot of an Oracle ACFS file system.
acfsutil snap delete Deletes a read-only snapshot of an Oracle ACFS file system.
acfsutil tune 	Modifies or displays Oracle ACFS tuneables.
advmutil tune 	Modifies or displays Oracle ADVM parameters.
advmutil volinfo 	Displays information about Oracle ADVM volumes.

Let’s start with the acfsutil command. If you are not logged in as root, acfsutil may not be in your path. acfs is located in the /sbin directory. If you are logged in as oracle, you will have to add /sbin to your environment $PATH variable or fully qualify the path of the executable.

You can get the complete list of all the option by displaying the help page with the -h or -help option as shown here:

[root@jin1 ~]# acfsutil -h

Usage: acfsutil [-h] command ...   # (Version 11.2.0.1.0.0)

             -h - help

 Command Subcmd Arguments
-------- ------ ----------------------------------------------------------------
    help                                 - display this message
 version                                 - display ACFS version information
    info fs                              - Display all ACFS file systems
    info fs     [<path> ...]             - Display specific ACFS file sys
    info fs     -o <item> <path>         - Display specific file sys item:
    info fs     -o                           freespace,    totalspace,
    info fs     -o                           mountpoints,  volumes,
    info fs     -o                           available,    ismountpoint,
    info fs     -o                           isavailable,  iscorrupt,
    info fs     -o                           isadvm,       diskgroup,
    info fs     -o                           redundancy,   resizeincrement,
    info fs     -o                           stripewidth,  stripecolumns,
    info fs     -o                           primaryvolume
    info file   <path> [<path> ...]      - Display specific file info
    info id     <file-identifier> <mountpoint> -
    info id           Display the pathname associated with the given
    info id           ACFS file identifier and mountpoint.
    rmfs        <device>                 - Remove unmounted ACFS file sys
    size        [-|+]nnn[K|M|G|T|P] [-d <device>] <path> - Resize file system
registry        [-l]                     - Display registry contents
registry        -l <mountpoint>          - Display a specific mount point
registry        -l <device>              - Display a specific device
registry        -m <device>              - Display a specific mount point associated with a device
registry        -a [-f] [-o <opts>] [-n <nodes>] <device> <mountpoint> - Add a mount point
registry        -d [<mountpoint> | <device>] - Delete a mount point or a device
    tune        AcfsMaxOpenFiles         - Maximum number of open files
    tune                                   (Windows only)
    snap create <snap_name> <mountpoint> - create a file system snapshot
    snap delete <snap_name> <mountpoint> - delete a file system snapshot
[root@jin1 ~]# acfsutil version
acfsutil version: 11.2.0.1.0.0
[root@jin1 ~]# acfsutil info fs
/apps/oracle/acfsmounts/data_vol_rpts
    ACFS Version: 11.2.0.1.0.0
    flags:        MountPoint,Available
    mount time:   Wed Sep  9 00:45:39 2009
    volumes:      1
    total size:   5368709120
    total free:   5317926912
    primary volume: /dev/asm/vol_rpts-340
        label:
        flags:                 Primary,Available,ADVM
        on-disk version:       39.0
        allocation unit:       4096
        major, minor:          252, 174081
        size:                  5368709120
        free:                  5317926912
        ADVM diskgroup         DATA
        ADVM resize increment: 268435456
        ADVM redundancy:       unprotected
        ADVM stripe columns:   4
        ADVM stripe width:     131072
    number of snapshots:  0
    snapshot space usage: 0
/apps/oracle/acfsmounts/data_vol_logfile
    ACFS Version: 11.2.0.1.0.0
    flags:        MountPoint,Available
    mount time:   Fri Sep 11 07:21:55 2009
    volumes:      1
    total size:   3221225472
    total free:   2990030848
    primary volume: /dev/asm/vol_logfile-340
        label:                 Log Volume
        flags:                 Primary,Available,ADVM
        on-disk version:       39.0
        allocation unit:       4096
        major, minor:          252, 174082
        size:                  3221225472
        free:                  2990030848
        ADVM diskgroup         DATA
        ADVM resize increment: 268435456
        ADVM redundancy:       unprotected
        ADVM stripe columns:   4
        ADVM stripe width:     131072
    number of snapshots:  3
    snapshot space usage: 106496
/apps/oracle/acfsmounts/lobdata
    ACFS Version: 11.2.0.1.0.0
    flags:        MountPoint,Available
    mount time:   Sat Sep 12 13:47:06 2009
    volumes:      1
    total size:   4294967296
    total free:   4248444928
    primary volume: /dev/asm/vol_lob-484
        label:
        flags:                 Primary,Available,ADVM
        on-disk version:       39.0
        allocation unit:       4096
        major, minor:          252, 247809
        size:                  4294967296
        free:                  4248444928
        ADVM diskgroup         LOBDATA
        ADVM resize increment: 268435456
        ADVM redundancy:       unprotected
        ADVM stripe columns:   4
        ADVM stripe width:     131072
    number of snapshots:  0
    snapshot space usage: 0
[root@jin1 ~]# acfsutil info fs /apps/oracle/acfsmounts/data_vol_rpts
/apps/oracle/acfsmounts/data_vol_rpts
    ACFS Version: 11.2.0.1.0.0
    flags:        MountPoint,Available
    mount time:   Wed Sep  9 00:45:39 2009
    volumes:      1
    total size:   5368709120
    total free:   5317926912
    primary volume: /dev/asm/vol_rpts-340
        label:
        flags:                 Primary,Available,ADVM
        on-disk version:       39.0
        allocation unit:       4096
        major, minor:          252, 174081
        size:                  5368709120
        free:                  5317926912
        ADVM diskgroup         DATA
        ADVM resize increment: 268435456
        ADVM redundancy:       unprotected
        ADVM stripe columns:   4
        ADVM stripe width:     131072
    number of snapshots:  0
    snapshot space usage: 0
[oracle@jin1 ~]$ /sbin/acfsutil info fs -o freespace -o totalspace /apps/oracle/acfsmounts/data_vol_rpts
5368709120
[oracle@jin1 ~]$ /sbin/acfsutil info fs -o freespace -o totalspace -o volumes /apps/oracle/acfsmounts/data_vol_rpts
1
[oracle@jin1 ~]$ /sbin/acfsutil info fs -o volumes /apps/oracle/acfsmounts/data_vol_rpts1
[oracle@jin1 ~]$ /sbin/acfsutil info fs -o redundancy  /apps/oracle/acfsmounts/data_vol_rpts
unprotected
[oracle@jin1 ~]$ /sbin/acfsutil info fs -o diskgroup  /apps/oracle/acfsmounts/data_vol_rpts
DATA
[oracle@jin1 ~]$ /sbin/acfsutil info fs -o mountpoints  /apps/oracle/acfsmounts/data_vol_rpts
/apps/oracle/acfsmounts/data_vol_rpts
[oracle@jin1 ~]$ /sbin/acfsutil info fs -o stripewidth  /apps/oracle/acfsmounts/data_vol_rpts
131072
[oracle@jin1 ~]$ /sbin/acfsutil info fs -o stripecolumns  /apps/oracle/acfsmounts/data_vol_rpts
4
[oracle@jin1 ~]$ /sbin/acfsutil info fs -o resizeincrement  /apps/oracle/acfsmounts/data_vol_rpts
268435456
[oracle@jin1 ~]$ /sbin/acfsutil info fs -o freespace  /apps/oracle/acfsmounts/data_vol_rpts
5317926912
[oracle@jin1 ~]$ /sbin/acfsutil info fs -o primaryvolume  /apps/oracle/acfsmounts/data_vol_rpts
/dev/asm/vol_rpts-340
[oracle@jin1 ~]$ /sbin/acfsutil info fs -o totalspace  /apps/oracle/acfsmounts/data_vol_rpts
5368709120

Shrink the file system by 2G

In this example, we will shrink the file system by 2G down to 3G:

[oracle@jin1 ~]$ /sbin/acfsutil size -2G -d /dev/asm/vol_rpts-340 /apps/oracle/acfsmounts/data_vol_rpts
acfsutil size: new file system size: 3221225472 (3072MB)

[oracle@jin1 ~]$ df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
                      122G   11G  106G   9% /
/dev/sda1              99M   12M   82M  13% /boot
tmpfs                 1.1G  154M  874M  15% /dev/shm
.host:/               163G  149G   15G  92% /mnt/hgfs
/dev/asm/vol_rpts-340
                      3.0G   49M  3.0G   2% /apps/oracle/acfsmounts/data_vol_rpts
/dev/asm/vol_logfile-340
                      3.0G  221M  2.8G   8% /apps/oracle/acfsmounts/data_vol_logfile
/dev/asm/vol_lob-484  4.0G   45M  4.0G   2% /apps/oracle/acfsmounts/lobdata

Increase the file system by 2G

In this example, we will increase the file system by 2G and put the file system back to 5G.

[oracle@jin1 ~]$ /sbin/acfsutil size +2G -d /dev/asm/vol_rpts-340 /apps/oracle/acfsmounts/data_vol_rpts
acfsutil size: new file system size: 5368709120 (5120MB)

[oracle@jin1 ~]$ df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
                      122G   11G  106G   9% /
/dev/sda1              99M   12M   82M  13% /boot
tmpfs                 1.1G  154M  874M  15% /dev/shm
.host:/               163G  149G   15G  92% /mnt/hgfs
/dev/asm/vol_rpts-340
                      5.0G   49M  5.0G   1% /apps/oracle/acfsmounts/data_vol_rpts
/dev/asm/vol_logfile-340
                      3.0G  221M  2.8G   8% /apps/oracle/acfsmounts/data_vol_logfile
/dev/asm/vol_lob-484  4.0G   45M  4.0G   2% /apps/oracle/acfsmounts/lobdata
[oracle@jin1 ~]$ /sbin/acfsutil registry -h
Usage: acfsutil [-h] registry [-l]                     - Display registry contents
                -l <mountpoint>          - Display a specific mount point
                -l <device>              - Display a specific device
                -m <device>              - Display a specific mount point associated with a device
                -a [-f] [-o <opts>] [-n <nodes>] <device> <mountpoint> - Add a mount point
                -d [<mountpoint> | <device>] - Delete a mount point or a device

[oracle@jin1 ~]$ /sbin/acfsutil registry -l
Device : /dev/asm/vol_rpts-340 : Mount Point : /apps/oracle/acfsmounts/data_vol_rpts : Options : none : Nodes : all : Disk Group : DATA : Volume : VOL_RPTS
Device : /dev/asm/vol_logfile-340 : Mount Point : /apps/oracle/acfsmounts/data_vol_logfile : Options : none : Nodes : all : Disk Group : DATA : Volume : VOL_LOGFILE

[oracle@jin1 ~]$ /sbin/acfsutil registry -l /apps/oracle/acfsmounts/data_vol_rpts
Device : /dev/asm/vol_rpts-340 : Mount Point : /apps/oracle/acfsmounts/data_vol_rpts : Options : none : Nodes : all : Disk Group : DATA : Volume : VOL_RPTS

[oracle@jin1 ~]$ /sbin/acfsutil registry -m /dev/asm/vol_rpts-340
/apps/oracle/acfsmounts/data_vol_rpts

[oracle@jin1 ~]$ /sbin/acfsutil registry -l /dev/asm/vol_rpts-340
Device : /dev/asm/vol_rpts-340 : Mount Point : /apps/oracle/acfsmounts/data_vol_rpts : Options : none : Nodes : all : Disk Group : DATA : Volume : VOL_RPTS
[oracle@jin1 ~]$ /sbin/acfsutil snap create -h
Usage: acfsutil [-h] snap create <snap_name> <mountpoint> - create a file system snapshot
[oracle@jin1 ~]$ /sbin/acfsutil snap create 13Sep2009_rpts /apps/oracle/acfsmounts/data_vol_rpts
acfsutil snap create: Snapshot operation is complete.
September 13th, 2009

Configure ACFS for auto-startup for non-RAC database servers

[root@rac9 bin]# ./acfsload start -s

[root@rac9 bin]# lsmod |grep -i ora
oracleacfs 781476 0
oracleadvm 212736 0
oracleoks 224864 2 oracleacfs,oracleadvm
oracleasm 46356 1

Create the file: /etc/init.d/acfsload

The file will contain the runlevel configuration, and the acfsload command. Place in the file the following lines

#!/bin/sh

# chkconfig: 2345 30 21
# description: Load Oracle ACFS drivers at system boot
/apps/oracle/product/11.2.0/grid/bin/acfsload start -s

[root@rac9 init.d]# chmod u+x /etc/init.d/acfsload
[root@rac9 init.d]# chkconfig –add acfsload
[root@rac9 init.d]# chkconfig –list acfsload
acfsload 0:off 1:off 2:on 3:on 4:on 5:on 6:off

September 12th, 2009

Volume Management with asmcmd

Creating Volumes with the volcreate command

ASMCMD> volcreate -G lobdata -s 4g vol_lob2

Note:
You can not create a mirror or high redundancy volume on an external redundant disk group.

ASMCMD> volcreate -G lobdata -s 4g --redundancy mirror vol_lob2
ORA-15032: not all alterations performed
ORA-15471: volume redundancy incompatible with diskgroup redundancy (DBD ERROR: OCIStmtExecute)

Displaying volume information with the volinfo command

With the -a option (and do not specify a diskgroup and volume), you will get a detailed information about every volume for every diskgroup

ASMCMD> volinfo -a
Diskgroup Name: DATA

         Volume Name: VOL_LOGFILE
         Volume Device: /dev/asm/vol_logfile-340
         State: ENABLED
         Size (MB): 3072
         Resize Unit (MB): 256
         Redundancy: UNPROT
         Stripe Columns: 4
         Stripe Width (K): 128
         Usage: ACFS
         Mountpath: /apps/oracle/acfsmounts/data_vol_logfile 

         Volume Name: VOL_RPTS
         Volume Device: /dev/asm/vol_rpts-340
         State: ENABLED
         Size (MB): 5120
         Resize Unit (MB): 256
         Redundancy: UNPROT
         Stripe Columns: 4
         Stripe Width (K): 128
         Usage: ACFS
         Mountpath: /apps/oracle/acfsmounts/data_vol_rpts 

Diskgroup Name: LOBDATA

         Volume Name: VOL_LOB
         Volume Device: /dev/asm/vol_lob-484
         State: ENABLED
         Size (MB): 4096
         Resize Unit (MB): 256
         Redundancy: UNPROT
         Stripe Columns: 4
         Stripe Width (K): 128
         Usage: ACFS
         Mountpath: /apps/oracle/acfsmounts/lobdata 

         Volume Name: VOL_LOB2
         Volume Device: /dev/asm/vol_lob2-484
         State: ENABLED
         Size (MB): 4096
         Resize Unit (MB): 256
         Redundancy: UNPROT
         Stripe Columns: 4
         Stripe Width (K): 128
         Usage:
         Mountpath:

To display volume information for a specific diskgroup, use the -G option:

ASMCMD> volinfo -G lobdata -a
Diskgroup Name: LOBDATA

         Volume Name: VOL_LOB
         Volume Device: /dev/asm/vol_lob-484
         State: ENABLED
         Size (MB): 4096
         Resize Unit (MB): 256
         Redundancy: UNPROT
         Stripe Columns: 4
         Stripe Width (K): 128
         Usage: ACFS
         Mountpath: /apps/oracle/acfsmounts/lobdata 

         Volume Name: VOL_LOB2
         Volume Device: /dev/asm/vol_lob2-484
         State: ENABLED
         Size (MB): 4096
         Resize Unit (MB): 256
         Redundancy: UNPROT
         Stripe Columns: 4
         Stripe Width (K): 128
         Usage:
         Mountpath:

To display volume information for a specific volume, use the -G option followed by the volume name of interest:

ASMCMD> volinfo -G DATA VOL_RPTS
Diskgroup Name: DATA

         Volume Name: VOL_RPTS
         Volume Device: /dev/asm/vol_rpts-340
         State: ENABLED
         Size (MB): 5120
         Resize Unit (MB): 256
         Redundancy: UNPROT
         Stripe Columns: 4
         Stripe Width (K): 128
         Usage: ACFS
         Mountpath: /apps/oracle/acfsmounts/data_vol_rpts

You can reverse query based on a volume device and lookup the volume information:

ASMCMD> volinfo --show_volume /dev/asm/vol_lob2-484
vol_lob2

Likewise, you can reverse lookup the disk group information based on the volume device:

ASMCMD> volinfo --show_diskgroup /dev/asm/vol_lob2-484
lobdata

Report volume I/O statistics

ASMCMD> volstat -G data

DISKGROUP NUMBER / NAME:  1 / DATA
---------------------------------------
  VOLUME_NAME
     READS           BYTES_READ      READ_TIME       READ_ERRS
     WRITES          BYTES_WRITTEN   WRITE_TIME      WRITE_ERRS
  -------------------------------------------------------------
  VOL_LOGFILE
     49862           3219816448      37565           0
     3349            167577600       80043           0
  VOL_RPTS
     125             71168           306             0
     10              12288           90              0

If the –show_volume is not specified, I/O statistics for all volumes of the disk group are displayed. To display a specific volume, use the show_volume parameter as shown below:

ASMCMD>  volstat -G data --show_volume vol_logfile

DISKGROUP NUMBER / NAME:  1 / DATA
---------------------------------------
  VOLUME_NAME
     READS           BYTES_READ      READ_TIME       READ_ERRS
     WRITES          BYTES_WRITTEN   WRITE_TIME      WRITE_ERRS
  -------------------------------------------------------------
  VOL_LOGFILE
     49862           3219816448      37565           0
     3349            167577600       80043           0

Enable/Disable a volume

ASMCMD> voldisable -G lobdata vol_lob2
ASMCMD>
ASMCMD> volenable -G lobdata vol_lob2

ASMCMD> voldisable -G lobdata vol_lob2

Use the -a option to enable all the volumes for the disk gruop

ASMCMD> volenable -G lobdata -a

Note:
You cannot disable a volume that is currently being accessed:

ASMCMD> voldisable -G lobdata vol_lob
ORA-15032: not all alterations performed
ORA-15468: volume 'VOL_LOB' in diskgroup 'LOBDATA' is currently being accessed (DBD ERROR: OCIStmtExecute)

Resizing an existing volume
[code language='sql']
ASMCMD> volresize -G LOBDATA -s 5G VOL_LOB2
ASMCMD> volresize -G LOBDATA -s 2G VOL_LOB2
The volume is not ACFS and the requested size is smaller than the current size.
Data corruption may occur.
Are you sure? [y/n]: y

Note:
You cannot volresize a volume that is being accessed. I wish the error message was more accurate.

ASMCMD> volresize -G LOBDATA -s 5G VOL_LOB
ORA-15032: not all alterations performed
ORA-15476: resize of ACFS volume must use ACFS resize command (DBD ERROR: OCIStmtExecute)

Deleting an existing volume from a disk group

You can use the voldelete command followed by the -G option for the diskgroup followed by the volume name to drop a volume from the diskgroup

ASMCMD> voldelete -G lobdata VOL_LOB2

You can set attributes for volumes. The attributes that are available are:
1. --usagestring
2. --mountpath
These attributes are information only and used for informational purposes only by ASM and not used by ASM. Here's couple of examples with volset

[oracle@jin1 ~]$ asmcmd volset -G data --usagestring 'To Store temporary reports' VOL_RPTS
[oracle@jin1 ~]$ asmcmd volset -G data --mountpath 'We should mount this volume as /data/reports' VOL_RPTS

[oracle@jin1 ~]$ asmcmd volinfo -G data VOL_RPTS
Diskgroup Name: DATA

         Volume Name: VOL_RPTS
         Volume Device: /dev/asm/vol_rpts-340
         State: ENABLED
         Size (MB): 5120
         Resize Unit (MB): 256
         Redundancy: UNPROT
         Stripe Columns: 4
         Stripe Width (K): 128
         Usage: To Store temporary reports
         Mountpath: We should mount this volume as /data/reports

Posted by Charles Kim, Oracle ACE

September 12th, 2009

Rename Disk Group

As of Oracle Database 11g Release 2, we can now rename disk groups. Why is this important? There’s two great reason why I think this feature is really beneficial for lot of companies. First, companies who leverage hardware mirroring or triple mirroring technologies such as EMC Business Continuity Volumes (BCV) or Hitachi Shadow Image (SI) can really benefit from this. Companies can now break their BCV or SI and rename their disk group where they have their production database and mount it again as another diskgroup. This way they can stand up another copy of their production database on the same physical server with minimal effort.

Note:
1. As of the initial release of Oracle Database 11g Release 2, the disk group rename feature does not handle the remaining task of standing up another database. You still have to re-catalog all the database files with the renamed disk group name. Additionally, you will have to create a new DB ID (nid).
2. If your company happens to have standardized disk group names with easily identifiable names such as as DATA, FLASH, LOBDATA, or FRA, you may have the same disk group names in Production, Staging, DEV and even disaster recovery site. For example, you can zone your production BCV or SI disks to your staging/Pre-Production/Model servers, rename the disk group called DATA to STAGE_DATA, and stand up the database from your BCV/SI.

Likewise, if you built disk groups with intelligent naming schemes (being a forward thinking architect :-) ), you may now choose to create easily identifiable disk group names such as DATA, FLASH, FRA, LOBDATA, etc.

Let’s look at the process of renaming a disk group. In order to rename a disk group, the disk group must be disounted across all the RAC nodes:

ASMCMD> umount dg_external
ASMCMD> umount fra

You can rename a disk group in one of two ways. The first option (default) renames the disk group in a single command. In our example, we will also specify the verbose mode for additional details in the output. The second option will create a configuration file at the end of phase one and will use the configuration file to complete the rename disk group operation.

Option #1 – Phase=Both:

The default phase is both.

[oracle@jin1 ~]$ renamedg dgname=fra newdgname=flash verbose=true

Parsing parameters..

Parameters in effect:

         Old DG name       : FRA
         New DG name          : FLASH
         Phases               :
                 Phase 1
                 Phase 2
         Discovery str        : (null)
         Clean              : TRUE
         Raw only           : TRUE
renamedg operation: dgname=fra newdgname=flash verbose=true
Executing phase 1
Discovering the group
Performing discovery with string:
Identified disk ASM:/opt/oracle/extapi/32/asm/orcl/1/libasm.so:ORCL:FRA1 with disk number:0 and timestamp (32924850 209876992)
Checking for hearbeat...
Re-discovering the group
Performing discovery with string:
Identified disk ASM:/opt/oracle/extapi/32/asm/orcl/1/libasm.so:ORCL:FRA1 with disk number:0 and timestamp (32924850 209876992)
Checking if the diskgroup is mounted
Checking disk number:0
Checking if diskgroup is used by CSS
Generating configuration file..
Completed phase 1
Executing phase 2
Looking for ORCL:FRA1
Modifying the header
Completed phase 2
Terminating kgfd context 0xb7f2c050

Let’s mount the renamed disk group:

[oracle@jin1 ~]$ asmcmd mount flash
[oracle@jin1 ~]$ asmcmd lsdg
State    Type    Rebal  Sector  Block       AU  Total_MB  Free_MB  Req_mir_free_MB  Usable_file_MB  Offline_disks  Voting_files  Name
MOUNTED  EXTERN  N         512   4096  1048576     23460    13140                0           13140              0             N  DATA/
MOUNTED  EXTERN  N         512   4096  1048576     42068    42016                0           42016              0             N  FLASH/
MOUNTED  EXTERN  N         512   4096  1048576     45792    41631                0           41631              0             N  LOBDATA/

Option #2 – Phase 1 followed by Phase 2:

This option basically involves two steps to renaming a disk group. The first step, referred to as phase one, generates a configuration file. The config file has line item entries for each disk with changes to be made. The second step called phase two uses the generated config file to perform the rename function.

Another important information to note is that the renamedg command is an OS utility (not an asmcmd command). if you type renamedg with the -help option, you can get the complete syntax:

[oracle@jin1 ~]$ renamedg -help

Parsing parameters..
phase                           Phase to execute,
                                (phase=ONE|TWO|BOTH), default BOTH

dgname                          Diskgroup to be renamed

newdgname                       New name for the diskgroup

config                          intermediate config file

check                           just check-do not perform actual operation,
                                (check=TRUE/FALSE), default FALSE

confirm                         confirm before committing changes to disks,
                                (confirm=TRUE/FALSE), default FALSE

clean                           ignore errors,
                                (clean=TRUE/FALSE), default TRUE

asm_diskstring                  ASM Diskstring (asm_diskstring='discoverystring',
                                'discoverystring1' ...)

verbose                         verbose execution,
                                (verbose=TRUE|FALSE), default FALSE

keep_voting_files               Voting file attribute,
                                (keep_voting_files=TRUE|FALSE), default FALSE

Let’s start the process, phase one, by creating our configuration file:

[oracle@jin1 ~]$ renamedg -phase one -dgname dg_external -newdgname lobdata -config rename_dg_external_2.conf

Parsing parameters..
renamedg operation: -phase one -dgname dg_external -newdgname lobdata -config rename_dg_external_2.conf
Executing phase 1
Discovering the group
Checking for hearbeat...
Re-discovering the group
Generating configuration file..
Completed phase 1

The configuration file rename_dg_external_2.conf looks like this:

[oracle@jin1 ~]$ cat rename_dg_external_2.conf
ORCL:HIGH1 DG_EXTERNAL LOBDATA
ORCL:HIGH2 DG_EXTERNAL LOBDATA
ORCL:HIGH3 DG_EXTERNAL LOBDATA

Now, let’s apply the configuration file and rename our diskgroup from DG_EXTERNAL to LOBDATA:

[oracle@jin1 ~]$ renamedg -phase two -dgname dg_external -newdgname lobdata -config rename_dg_external_2.conf

Parsing parameters..
renamedg operation: -phase two -dgname dg_external -newdgname lobdata -config rename_dg_external_2.conf
Executing phase 2
Completed phase 2

We should now be able to mount the renamed LOBDATA disk group with asmcmd:

[oracle@jin1 ~]$ asmcmd
ASMCMD> mount lobdata

With the lsdg asmcmd command, you can verify that the LOBDATA disk group is truly mounted:

ASMCMD> lsdg
State    Type    Rebal  Sector  Block       AU  Total_MB  Free_MB  Req_mir_free_MB  Usable_file_MB  Offline_disks  Voting_files  Name
MOUNTED  EXTERN  N         512   4096  1048576     15640     5332                0            5332              0             N  DATA/
MOUNTED  EXTERN  N         512   4096  1048576     45792    45736                0           45736              0             N  LOBDATA/

Posted by Charles Kim, Oracle ACE

September 12th, 2009

Ways to mount and dismount disk groups in Oracle Database 11g Release 2

Prior to Oracle Database 11g Release 2, you had to issue the following commands in sqlplus to mount and dismount a diskgroup:

SQL> alter diskgroup fra mount;

Diskgroup altered.

SQL> alter diskgroup fra dismount;

Diskgroup altered.

As of Oracle Database 11g Release 2, an easier and more SA friendly approach is provided with asmcmd:

ASMCMD> mount fra

Looking at the disk group information with the lsdg command, we see that the fra disk group is now mounted:

ASMCMD> lsdg
State    Type    Rebal  Sector  Block       AU  Total_MB  Free_MB  Req_mir_free_MB  Usable_file_MB  Offline_disks  Voting_files  Name
MOUNTED  EXTERN  N         512   4096  1048576     15640     5352                0            5352              0             N  DATA/
MOUNTED  EXTERN  N         512   4096  1048576     45792    45736                0           45736              0             N  DG_EXTERNAL/
MOUNTED  EXTERN  N         512   4096  1048576     42068    42016                0           42016              0             N  FRA/

Let’s issue the umount command in asmcmd. Notice that the syntax is umount in asmcmd and dismount in SQL*Plus:

ASMCMD> umount fra

Looking at the disk group information with the lsdg command, we see that the fra disk group is no longer mounted:

ASMCMD> lsdg
State    Type    Rebal  Sector  Block       AU  Total_MB  Free_MB  Req_mir_free_MB  Usable_file_MB  Offline_disks  Voting_files  Name
MOUNTED  EXTERN  N         512   4096  1048576     15640     5352                0            5352              0             N  DATA/
MOUNTED  EXTERN  N         512   4096  1048576     45792    45736                0           45736              0             N  DG_EXTERNAL/

Posted by Charles Kim, Oracle ACE

September 12th, 2009

New ways to create disk groups in Oracle Database 11g Release 2

Guess what? As of Oracle Database 11g Release 2, we can create disk groups using the asmcmd command. Check out one of the new ways we can create a diskgroup using an XML file as a template. The mkdg ASMCMD command can accept an xml file as a parameter to create a disk group:

[oracle@jin1 ~]$ asmcmd mkdg dg_high.xml

[oracle@jin1 ~]$ cat dg_high.xml
<dg name="dg_high" redundancy="high">
  <fg name="fg1">
    <dsk string="ORCL:HIGH1" />
  </fg>
  <fg name="fg2">
    <dsk string="ORCL:HIGH2" />
  </fg>
  <fg name="fg3">
    <dsk string="ORCL:HIGH3" />
  </fg>
  <a name="compatible.asm" value="11.2"/>
  <a name="compatible.rdbms" value="11.2"/>
</dg>

And if we refresh our Automatic Storage Management main screen, we see the new diskgroup as shown here:
Picture 138.png

Let’s drop the dg_high disk group and show you how you can do this same thing with asmca command line interface.

Here’s the super hard syntax to drop the dg_high disk group:

ASMCMD> dropdg dg_high

Now, let’s create the disk group with asmca command line interface:

[oracle@jin1 ~]$ ksh cr_dg_high.txt

DiskGroup dg_high created successfully.

[oracle@jin1 ~]$ cat cr_dg_high.txt
asmca -silent -createDiskGroup \
-diskgroupname dg_high \
-redundancy high \
-disk 'ORCL:HIGH1' -disk 'ORCL:HIGH2' -disk 'ORCL:HIGH3' \
-failuregroup fg1 \
-failuregroup fg2 \
-failuregroup fg3 \
-au_size 64  \
-compatible.asm '11.2.0.0.0'  \
-compatible.rdbms '11.2.0.0.0'  \
-compatible.advm '11.2.0.0.0'

In the example with the asmca command line syntax, we added a little twist by adding the allocation extent to 64 MB and adding the compatible.advm attribute.

Majority of the ASM customers run external redundancy and have the protection provided to us by the storage array vendors. Let’s see our same example and show how to create an external redundant diskgroup. Here’s the XML file for the external redundancy disk group:

[oracle@jin1 ~]$ cat dg_external.xml
<dg name="dg_external" redundancy="external">
    <dsk string="ORCL:HIGH1" />
    <dsk string="ORCL:HIGH2" />
    <dsk string="ORCL:HIGH3" />
  <a name="compatible.asm" value="11.2"/>
  <a name="compatible.rdbms" value="11.2"/>
  <a name="compatible.advm" value="11.2"/>
</dg>

Using asmcmd, we will create the dg_external diskgroup:

[oracle@jin1 ~]$ asmcmd mkdg dg_external.xml

Alternatively, you can create the diskgroup in a single inline command as shown here:

ASMCMD> mkdg '<dg name="dg_external" redundancy="external">  <dsk string="ORCL:HIGH1" /> <dsk string="ORCL:HIGH2" /> <dsk string="ORCL:HIGH3" /> <a name="compatible.asm" value="11.2"/> <a name="compatible.rdbms" value="11.2"/>  <a name="compatible.advm" value="11.2"/> </dg>'

Obviously, nobody in their right mind would create a disk in this format. Wether you use asmca or asmcmd with an XML file or even the dreaded SQL*Plus, figure out what works best for you and stick with it. Depending on if you are a Unix System Administrator or Database Administrator, you may choose a different tool as your standard.

Posted by Charles Kim

September 11th, 2009

ASMCA Command-line Interface

In another post, we learned how to exploit all the ASMCA GUI features. asmca can be invoked with the -silent option and can effectively become a great command line interface.

You can create disk groups with the ASMCA configuration tool (ASMCA) or asmcmd command line interface as shown in this blog entry:
New ways to create disk groups in Oracle Database 11g Release 2

Another useful Oracle Database 11g Release 2 feature is the capability to add disk(s) to an existing disk group using asmca. In our example, we will add ORCL:DATA3 ASMLIB disk to the DATA diskgroup. Before we add the disk group, let’s look at the disks that make up the DATA disk group:

[oracle@jin1 ~]$ asmcmd lsdsk -G data
Path
ORCL:DATA1
ORCL:DATA2

Adding disks to an existing disk group:

Now, using ASM configuration assistant, let’s add a disk to the DATA disk group:

[oracle@jin1 ~]$ asmca -silent -adddisk -diskgroupname DATA -disk 'ORCL:DATA3'

Disks added successfully to diskgroup DATA

Let’s confirm that ORCL:DATA3 disk is added:

[oracle@jin1 ~]$ asmcmd lsdsk -G data
Path
ORCL:DATA1
ORCL:DATA2
ORCL:DATA3

Create ASM Volumes with asmca

You can leverage asmca to create volumes out of existing disk groups. Once you create volumes, you can use them to create ASM cluster file systesm. Let’s go through the process of creating a volume of the DATA disk group and creating an ASM cluster file system and mounting the file system for end users.

[oracle@jin1 tmp]$ ksh cr_asmca_volume.txt 

Volume vol_lob created successfully.

The contents of the file cr_asmca_volume.txt looks like this:

[oracle@jin1 tmp]$ cat cr_asmca_volume.txt
asmca -silent \
      -createVolume \
      -volumeName vol_lob \
      -volumeDiskGroup LOBDATA \
      -volumeSizeGB 4

Listing the /dev/asm directory, you can see that our volume that was create is vol_lob-484:

[oracle@jin1 tmp]$ ls -ltr /dev/asm
total 0
brwxrwx--- 1 root oinstall 252, 174081 Sep  9 00:45 vol_rpts-340
brwxrwx--- 1 root oinstall 252, 174082 Sep 11 06:58 vol_logfile-340
brwxrwx--- 1 root oinstall 252, 247809 Sep 12 13:29 vol_lob-484

Create ASM cluster file system (ACFS) with asmca

Using the vol_lob-484 volume, let’s create an ACFS file system:

[oracle@jin1 tmp]$ asmca -silent -createACFS -acfsVolumeDevice /dev/asm/vol_lob-484

ACFS creation on /dev/asm/vol_lob-484 completed successfully.
The ACFS should be mounted for use.

For the final step, login as root and mount the ASM file system:

[root@jin1 acfsmounts]# pwd
/apps/oracle/acfsmounts
[root@jin1 acfsmounts]# mkdir lobdata
[root@jin1 acfsmounts]# mount -t acfs /dev/asm/vol_lob-484 /apps/oracle/acfsmounts/lobdata

Verify that the newly created file system is mounted:

[root@jin1 acfsmounts]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
                      122G   11G  106G   9% /
/dev/sda1              99M   12M   82M  13% /boot
tmpfs                 1.1G  154M  874M  15% /dev/shm
.host:/               163G  149G   15G  91% /mnt/hgfs
/dev/asm/vol_rpts-340
                      5.0G   49M  5.0G   1% /apps/oracle/acfsmounts/data_vol_rpts
/dev/asm/vol_logfile-340
                      3.0G  221M  2.8G   8% /apps/oracle/acfsmounts/data_vol_logfile
/dev/asm/vol_lob-484  4.0G   45M  4.0G   2% /apps/oracle/acfsmounts/lobdata

Posted by Charles Kim, Oracle ACE

September 11th, 2009

Maintaining ASM Volumes and Cluster File Systems in Oracle Database 11g Release 2

Earlier we created an ASM Volume and created Cluster File System. Let’s continue where we left off and do some maintenance.

From the ASM Cluster File System main screen (Click on the ASM Cluster File System Tab), we will click on the VOL_LOGFILE volume URL to see volume related information:
Picture 132.png

Click on the Edit button to edit the current volume:

Picture 133.png

From the Edit Volume screen, click on the URL next to the Size Field. You will be redirected to the Resize ASM Cluster File System screen:

Picture 135.png

Let’s change the size from 2 GB to 3GB and click on the show command to see what commands EM will submit do to resize the file system:

Show Command

/sbin/acfsutil size 3G /apps/oracle/acfsmounts/data_vol_logfile

The acfsutil above will resize the file system and resize the volume at the same time.

Click on Return to go back to the Resize ASM Cluster File System screen
Click on the OK button
Again, you will be prompted to provide ASM Cluster File System Host Credentials if you have not saved your credentials as a preferred credential yet.
Enter your username credentials and click on Continue
When the task is complete, you will be routed to the ASM Cluster File System: /apps/oracle/acfsmounts/data_vol_logfile screen
(You may see a screen stating that the no monitoring data has been collected for this ASM Cluster File system.)
Click on the ASM Cluster File System breadcrumb URL
In the ASM Cluster File System main screen, you will see the changed size for the /apps/oracle/acfsmounts/data_vol_logfile file system.

From the ASM Cluster File System main screen, you will see buttons to Delete the mount point, to view the contents of the file system, register/deregister a file system, mount all and dismount all file systems. You will also notice that the actions drop list has the functions to resize an existing file system and to check and repair a file system. In order to perform a check and repair function, the file system must be dismounted.

Picture 137.png

Let’s go an dismount a file system:
Click on the radio button of the file system that you want to dismount
Picture 120.png
You will see the Dismount ASM Cluster File System screen. As you can guess, Enterprise Manager only generates the syntax that need to be executed by someone with root privileges (or sudo). Click on the Return button to go back to the ASM Cluster File System main page.

Posted by Charles Kim, Oracle ACE

September 11th, 2009

Creating ASM Volumes and Cluster File Systems with Enterprise Mangers in 11g Release 2

Earlier in another blog post, I wrote on the subtle differences in how to start Enterprise Manager Database Control (dbconsole) in Oracle Database 11g Release 2

Let’s login to the EM Database Control. Your URL to login should be something like this:

https://jin1:1158/em

Scroll to the bottom of the screen to the instances section. You will see the database and ASM instance information as shown here:
Picture 107.png

Click on the +ASM1_[HOSTNAME] instance URL
The Automatic Storage Management Home page now includes sections for ASM Clustered File Systems (ACFS) and Volumes.

Picture 108.png

You will also notice a new tab dedicated to support the new ASM Cluster File System feature. The ASM Cluster File System tab will simplify your ability to create volumes, create cluster file systems and ACFS snapshots. In this blog post, we will only cover creating volumes and ASM cluster file systems.

Oracle ASM Dynamic Volume Manager (Oracle ADVM)

The new Oracle ASM Dynamic Volume Manager (Oracle ADVM) provides volume management services and a standard disk device driver interface. A volume device is constructed from an ASM volume. You can create one or more volumes devices within a disk group. Once you create a volume, you can create a file system using that volume. You can create an ASM cluster file system off of the ASM volume. Likewise, you can create an EXT3 or OCFS2 file system based on the ASM volume. Likewise, as Oracle ports ACFS to other Unix Platforms, you can create the OS native file systems using Oracle ASM disk group volumes. Oracle ACFS is layered on ASM through the ADVM interface.

Note:
Creating an OCFS2 file system on top of ASM Disk Group does not make sense, but it is do-able.

Requirements for ADVM
1. COMPATIBLE.ASM and COMPATIBLE.ADVM attributes must be set to 11.2.
2. Volume name can be a maximum of 11 alphanumeric characters (no dashes and first character must be alphabetic)

Let’s click on the new ASM Cluster File System tab and create ourselves an ASM Cluster File System.

You will see the following screen:
Picture 110.png

Notice that we already created the VOL_RPTS volume that is already mounted as /apps/oracle/acfsmounts/data_vol_rpts mount point. Let’s create a new volume and mount another file system. To start this process, click on the Create button on the right corner. You will be directed to the Create ASM Cluster File System screen. Before we can create an ASM Cluster File System, we must first create a volume. Click on the the Create ASM Volume button. From the Create ASM Volume screen,
Picture 111.png
Enter the values for Volume, Data Group, and Size.

Notice the size can be specified in MB, GB and TB.
If you want to see the SQL, click on the Show Command button
Picture 112.png
Click on the Return button to go back to the Create ASM Cluster File System Screen
You will notice that the Volume Device field is populated with the new Volume that you just created
Specify a label (optional) if you want and specify a Mount Point

Picture 113.png
Again, click on the Show Command button

Picture 115.png
Click on the Return button to back to the Create ASM Cluster File System screen
Click on the OK button to create the ACFS file system
You will be requested to enter OS credentials – This operating system user name and password will be used to perform ASM Cluster File System operations on this host.

You will receive a confirmation status on top of the screen indicating that the file system was successfully created:
Picture 116.png

Next, click on the VOL_LOGFILE Volume radio button and click on the Mount button on the top left portion of the screen. You will be routed to the Mount ASM Cluster File System: [VOLUME_NAME] screen.
Picture 117.png

Unfortunately, you will not be able to mount the file system from Enterprise Manager. Only thing you will be able to do is generate the command and ask your system administrator to mount the file system.
Picture 118.png

As the root user, issue the mount command shown from this screen.

[root@jin1 oracle]# /bin/mount -t acfs /dev/asm/vol_logfile-340 /apps/oracle/acfsmounts/data_vol_logfile

Now from the OS, you can see the output from the df -h command to see the new file system mounted:

[root@jin1 oracle]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
                      122G   11G  106G   9% /
/dev/sda1              99M   12M   82M  13% /boot
tmpfs                 1.1G  154M  874M  15% /dev/shm
.host:/               163G  141G   23G  87% /mnt/hgfs
/dev/asm/vol_rpts-340
                      5.0G   49M  5.0G   1% /apps/oracle/acfsmounts/data_vol_rpts
/dev/asm/vol_logfile-340
                      2.0G   41M  2.0G   2% /apps/oracle/acfsmounts/data_vol_logfile

Click on the Return button to go back to the Mount Cluster File System screen. Click the Return button again to back to the ASM Cluster File System main screen.

Posted by Charles Kim, Oracle ACE

September 11th, 2009

Creating ASM Snapshots with Enterprise Mangers in 11g Release 2

Earlier we went through the exercise to create ASM Volumes and Cluster File Systems within ASM disk groups. Another great feature introduced in Oracle Database 11g Release 2 is the capability to create snapshot images of the ASM cluster file systems. Oracle allows up to 63 read-only snapshots of their file system leveraging the Copy-on-write (COW) technology. When a snapshot request is submitted, COW technology stores only the meta-data about where the original data is stored is copied. The creation of the snapshot should be almost instantaneous since only the meta-data is being copied. The snapshot copy then tracks changed blocks to a snapshot storage location as writes are being performed. The original data that is being written to is copied into the designated area on the file system before the original data is overwritten. This is where the name copy-on-write comes from.

Read requests for unchanged data blocks go directly to the original file system. Read requests for changed data blocks are directed to the copied block on the snapshot storage volume. Please remember that the original data is only copied once. Subsequence change to the same block is not copied more than once.

EM provides full support for ASM snapshots. Let’s go EM Database Control and see how this is done. From the ASM Cluster File System tab, select a mount point and click on the Create Snapshot button.
Picture 125.png
You should se the Create Snapshot on ASM Cluster File System screen. Notice that the Snapshot Name column is auto-populated for you with shapshot_[date]_[time] format. You can change this to any kind of standard you may designate for your company.

Notice the Delete the oldest snapshot (62 remaining before the maximum limit is reached) check box. You will see this check box as you create your second and subsequent ASM snapshots. You will also see the oldest snapshot with the URL for easy convenience.

Click on the Show Command button to see the command line syntax that EM is about to submit:
Picture 126.png

For the command line DBAs, we can create snapshots copying and pasting from the following syntax:

/sbin/acfsutil snap create "snapshot_20090911_104833" /apps/oracle/acfsmounts/data_vol_logfile

Click on the Return button
From the Create Snapshot on ASM Cluster File System screen, click on the OK button. You will be routed to the ASM Cluster File System Host Credentials screen. Enter the username and password for oracle. If you want EM Database Control to remember the username and password, you can click on the option to save as preferred credential checkbox.
Picture 123.png
Click on the Continue button
You will be redirected to the ASM Cluster File System main page and will see a successful confirmation status:
Picture 127.png

We created our snapshot of the /apps/oracle/acfsmounts/data_vol_logfile file system. From the ASM Cluster File System main screen, click on the file system URL and look at some General information about that mount point.
Picture 128.png
You can see the general usage information and alerts for the file system. Usage information of the file system include Size (GB), Used (GB), Free (GB), Used (%), Allocated Space (GB) and Space Used by Snapshots (MB) or (GB).
Also in this screen, you will notice the Snapshots tab. Click on the Snapshots tab to see all the snapshot history for this ACFS file system. You can create additional snapshots or even delete existing snapshots from this screen:
Picture 130.png
And, of course, you can search for a specific snapshot using the search option on the snapshot name.

Posted by Charles Kim, Oracle ACE

September 11th, 2009

Starting dbconsole from command line in Oracle Database 11g Release 2

Note:
1. We are running a single node RAC on Red Hat 5 Update 3
2. We are running 11.2.0.1 of the database

[oracle@jin1 ~]$ . oraenv
ORACLE_SID = [dbtools1] ? +ASM1
The Oracle base for ORACLE_HOME=/apps/11.2.0/grid is /apps/oracle
[oracle@jin1 ~]$ srvctl start database -d DBTOOLS
[oracle@jin1 ~]$ . oraenv
ORACLE_SID = [+ASM1] ? DBTOOLS1
The Oracle base for ORACLE_HOME=/apps/oracle/product/11.2.0/dbhome_1 is /apps/oracle
[oracle@jin1 ~]$ emctl start dbconsole
Environment variable ORACLE_UNQNAME not defined. Please set ORACLE_UNQNAME to database unique name.

Interestingly new, you have to set the ORACLE_UNQNAME environment variable to start dbconsole.

[oracle@jin1 ~]$ export ORACLE_UNQNAME=DBTOOLS
[oracle@jin1 ~]$ emctl start dbconsole
Oracle Enterprise Manager 11g Database Control Release 11.2.0.1.0
Copyright (c) 1996, 2009 Oracle Corporation.  All rights reserved.

https://jin1.dbaexpert.com:1158/em/console/aboutApplication

Starting Oracle Enterprise Manager 11g Database Control ............... started.
------------------------------------------------------------------
Logs are generated in directory /apps/oracle/product/11.2.0/dbhome_1/jin1_DBTOOLS/sysman/log

Posted by Charles Kim, Oracle ACE