Category Archives: Uncategorized

First iBook on Oracle ASM 12c Pocket Reference Guide

IOUG 2013 Data Guard Best Practices Abstract Accepted

Session Title: Automate Data Guard Best Practices
Session Number: 614
Track: Database
Session Type: Lecture
Sub-Categorization: High Availability and Data Protection
Initial Submission: Oct 12, 2012 11:32 AM America/Arizona
Status: Submitted
Session Submitter: Charles Kim
Primary Presenter: Charles Kim [Oracle ACE Director – Viscosity North America]
Co-Presenter: Nitin Vengurlekar [CTO – Viscosity North America]
Co-Presenter 2: [Unassigned]
Co-Presenter 3: [Unassigned]
Last Update: Oct 12, 2012 11:58 AM America/Arizona
Abstract: Compliance to industry best practices can easily be achieved with automation. This session will disseminate fundamental Data Guard best practices and demonstrate how DBAs can automate setup, configuration, and monitoring of Data Guard environments with assistance from the Date Guard Toolkit (DG Toolkit).

The original Data Guard Menu (DG Menu) was presented and documented in the Oracle Data Guard 11g Handbook published with Oracle Press. We took the DG Menu to another level and now it is called the DG Toolkit. We included a dedicated set of options for building physical standby with best practices in mind and made this into a mature toolkit that anyone can download from website. We have significantly updated the monitoring and setup menu options as well.

Come see Data Guard best practices in action. The session concentrates on:
o Building the Physical Standby
o Monitoring and Maintaining the Physical Standby
o Configuring Data Guard Broker
o Performing Backup and Recovery with RMAN
o Setting Archive Retention
o Performing Switchovers and Failovers

Learning Objective #1: Most importantly, learn how to build the physical standby with ease and automation using the DG Toolkit
Learning Objective #2: Learn how to monitor the physical standby database with DG Toolkit
Learning Objective #3: Learn how to setup the Data Guard Broker with DG Toolkit
Outline / Content Structure: Perform preliminary check prior to starting the Data Guard Build
1. Perform assessments on the source database
2. Perform assessments on the physical standby

Perform detailed steps to build the physical standby database
1. Look at building the physical standby with easy menu steps
2. Look at duplicating the physical standby database

Configure the Data Guard Broker

Perform monitoring of the Data Guard Environment
1. Monitor the physical standby for performance
2. See how far behind we are

Perform RMAN to disk configuration options

# ————————————————————————- #
# Data Guard Menu System #
# Primary Host: prod1 Standby Host: drdb1 #
# ————————————————————————- #
# 10. Launch Preliminary Check Submenu #
# ————————————————————————- #
# 20. Launch Build Standby Database Submenu #
# ————————————————————————- #
# 30. Launch the Data Guard Broker Submenu #
# ————————————————————————- #
# 40. Launch Monitor Physical Standby Data Guard Submenu #
# ————————————————————————- #
# 50. Launch Monitor Logical Standby Data Guard Submenu #
# ————————————————————————- #
# 60. Launch Automatic Diagnostic Repository (ADR) CLI Submenu #
# ————————————————————————- #
# 100. Launch RMAN Backup to Disk Submenu #
# ————————————————————————- #
# x. Exit #
# ————————————————————————- #

2nd Track: Manageability
Content Level: Mid-Level
Product Line: Active Data Guard, Oracle Database, Real Application Clusters
Company Type: Consultant
Have you presented at an IOUG event before?: Yes
Speaker Guidelines: Yes 

Upcoming: OTN Expert+ Conference

Below is the Final Schedule for the OTN Expert+ Conference on Oct 16, 2012: 7am – 12pm Central Daylight Time:
Oct 16, 2012 (All times in Central Daylight Time Zone: GMT – 5):
  • 7am – 7:40am – Tariq Farooq, Kai Yu, Charles Kim, Honglin Su
  • 7:45am – 8:25am – Mike Ault
  • 8:30am – 9:10am – Bert Scalzo
  • 9:15am – 9:55am – Tim Gorman
  • 10am – 10:40am – Rich Niemiec
  • 10:40am – 11:15am – Fahad Mirza
  • 11:20am – 12pm – Nitin Vengurlekar
Note: There are 5-minute breaks between each session; this is buffer time to get the next speaker setup; we will try to minimize this break as less as possible.
Attendance/Speaking Instructions:
  • Please register at:
  • Please join  the webinar as a regular attendee 15-20 minutes before your time slot; i will then make you a Speaker in GoToWebinar then.
  • Please finish your slide-deck 5-10 minutes before your allocated time-slot ends for questions from the physical/virtual audience.

The Only Photo Allowed

ASM Diskgroup

ASM Disk Group


ASM Disk Group Configuration

Everyone should be leveraging ASMLIB instead of using block devices to create our ASM disk groups    

Proper ASM configuration and standardization and following best practices is just as important in a virtualized environment as it is in a bare metal environment            

First, create ASMLIB disks with oracleasm

  • sudo to root
  • cd /etc/init.d 
  • ./oracleasm createdisk DATA101_DISK000 /dev/oracle/DATA101_disk000p1
    • Repeat for each disk
  • On other RAC nodes
    • ./oracleasm scandisks
    • ./oracleasm listdisks

List of available disks on April 29, 2012
cd /dev/oracle
lrwxrwxrwx 1 root root 8 Apr 28 16:22 DATA501_disk009p1 -> ../dm-85

lrwxrwxrwx 1 root root 9 Apr 28 16:22 DATA501_disk003p1 -> ../dm-105
lrwxrwxrwx 1 root root 9 Apr 28 16:22 DATA101_disk003p1 -> ../dm-100
lrwxrwxrwx 1 root root 8 Apr 28 16:22 DATA101_disk001p1 -> ../dm-99
lrwxrwxrwx 1 root root 9 Apr 28 16:22 DATA101_disk002p1 -> ../dm-102
lrwxrwxrwx 1 root root 9 Apr 28 16:22 DATA501_disk005p1 -> ../dm-110
lrwxrwxrwx 1 root root 9 Apr 28 16:22 DATA101_disk004p1 -> ../dm-101
lrwxrwxrwx 1 root root 9 Apr 28 16:22 DATA101_disk000p1 -> ../dm-104
lrwxrwxrwx 1 root root 9 Apr 28 16:22 DATA501_disk006p1 -> ../dm-111
lrwxrwxrwx 1 root root 9 Apr 28 16:22 DATA501_disk008p1 -> ../dm-107
lrwxrwxrwx 1 root root 9 Apr 28 16:22 DATA501_disk004p1 -> ../dm-112
lrwxrwxrwx 1 root root 9 Apr 28 16:22 DATA501_disk000p1 -> ../dm-108
lrwxrwxrwx 1 root root 9 Apr 28 16:22 DATA501_disk002p1 -> ../dm-109
lrwxrwxrwx 1 root root 9 Apr 28 16:22 DATA501_disk001p1 -> ../dm-103
lrwxrwxrwx 1 root root 9 Apr 28 16:22 DATA501_disk007p1 -> ../dm-106

Naming Convention Legend for Disk Groups

  • Diskgroup names will be DATA101 or PF101 for RAID 10 disk groups
  • Diskgruop names will DATA501 or PF501 for RAID 5 disk groups
Naming Convention Legend for Disks
  • pd = production data
  • pf = production fast recovery area(fra)
  • dd = would be development data
  • df = would be development fra
  • 101 = raid 10 first disk group
  • 501 = raid 05 first disk group
  • And _diskxxx can be disk000 to disk999

Modify /etc/sysconfig/oracleasm (on each node)

As root:  Make changes to the following lines:
# ORACLEASM_SCANORDER: Matching patterns to order disk scanning


# ORACLEASM_SCANEXCLUDE: Matching patterns to exclude disks from scan
  Important Notes:

  • Only use the partitioned disk when creating ASMLIB disks
  • The partitioned disk will have p1, p2, etc. at the end of the device name
  • After you scan the disk, you should see an entry in /proc/partitions
  • Do NOT use /dev/oracle devices
  • Instead use /dev/mapper devices

[root@dllprdorl01 tmp]# cat ora_asm.txt

/etc/init.d/oracleasm createdisk DATA101_DISK000 /dev/mapper/DATA101_disk000p1
/etc/init.d/oracleasm createdisk DATA101_DISK001 /dev/mapper/DATA101_disk001p1
/etc/init.d/oracleasm createdisk DATA101_DISK002 /dev/mapper/DATA101_disk002p1
/etc/init.d/oracleasm createdisk DATA101_DISK003 /dev/mapper/DATA101_disk003p1
/etc/init.d/oracleasm createdisk DATA101_DISK004 /dev/mapper/DATA101_disk004p1

/etc/init.d/oracleasm createdisk DATA501_DISK000 /dev/mapper/DATA501_disk000p1
/etc/init.d/oracleasm createdisk DATA501_DISK001 /dev/mapper/DATA501_disk001p1
/etc/init.d/oracleasm createdisk DATA501_DISK002 /dev/mapper/DATA501_disk002p1
/etc/init.d/oracleasm createdisk DATA501_DISK003 /dev/mapper/DATA501_disk003p1
/etc/init.d/oracleasm createdisk DATA501_DISK004 /dev/mapper/DATA501_disk004p1
/etc/init.d/oracleasm createdisk DATA501_DISK005 /dev/mapper/DATA501_disk005p1
/etc/init.d/oracleasm createdisk DATA501_DISK006 /dev/mapper/DATA501_disk006p1
/etc/init.d/oracleasm createdisk DATA501_DISK007 /dev/mapper/DATA501_disk007p1
/etc/init.d/oracleasm createdisk DATA501_DISK008 /dev/mapper/DATA501_disk008p1
/etc/init.d/oracleasm createdisk DATA501_DISK009 /dev/mapper/DATA501_disk009p1

ASM Disk Group Information

  • First, we will set our Allocation Unit (AU) to 4MB in size
  • Second, we will use ‘ORCL:*’ disks instead of block devices when creating our new disk groups
SQL> alter system set asm_diskstring=’/dev/oracle’,’ORCL:PD*’;

System altered.
Add the following to the init+ASM1.ora on each node
For automatic mount of diskgroups

For the time being, manually mount the diskgroups on each node:
SQL> alter system set asm_diskstring=’/dev/oracle’,’ORCL:PD*’;

System altered.

SQL> alter diskgroup DATA101 mount;
Diskgroup altered.

SQL> alter diskgroup DATA501 mount;
Diskgroup altered.
Creating ASM Disk Groups

RAID 10 DATA Disk Group

+ASM1 > cat cr_DATA101.sql

create diskgroup DATA101 external redundancy disk ‘ORCL:DATA101_DISK000’,
ATTRIBUTE ‘au_size’ = ‘4M’,
‘compatible.rdbms’ = ‘11.1’,
‘compatible.asm’ = ‘11.1’;

RAID 5 DATA Disk Group
+ASM1 > cat cr_DATA501.sql

create diskgroup DATA501 external redundancy disk ‘ORCL:DATA501_DISK000’,
ATTRIBUTE ‘au_size’ = ‘4M’,
‘compatible.rdbms’ = ‘11.1’,
‘compatible.asm’ = ‘11.1’;

Physical to Virtual (P2V) Migration with Oracle VM

One easy way to migrate from the physical bare metal world to the virtual world is to use the physical to virtual conversion utility (p2v utility).  The P2V conversion utility is included as part of the Oracle VM Server CD.  

At a high level, the P2V conversion utility will create the vm.cfg configuration file, convert the disks on the physical hardware to virtual disk images, and replicates the virtual disk images to the server pool’s repository.  

Leveraging the Oracle VM Server CD, at the boot prompt, simply type:  “linux p2v”

You can leverage the p2v conversion utility as part of a kickstart image.

The Evolution of the DBA

Kind of DBA


Early 90’s DBAs
Late 90’s and Dot Com
Google DBA
Dot Com and 2000’s
Dot Com, IOUG iDBA Master Curriculum
2000+ after 9.2 (but major spike with 10.2)
2010+ Database Machine Administrator
Evolving role of a DBA in the virtual world
Cloud DBA

OCFS2 for Oracle VM

OCFS2 is a cluster file system for Linux, which allows multiple nodes (Oracle VM Servers) to access the same disk at the same time. OCFS2, which provides both performance and HA, is used in many applications that are cluster-aware or that have a need for shared file system facilities. With Oracle VM, OCFS2 ensures that Oracle VM Servers belonging to the same server pool access and modify resources in the shared repositories in a controlled manner.

The OCFS2 software includes the core file system, which offers the standard file system interfaces and behavioral semantics and also includes a component which supports the shared disk cluster feature. The shared disk component resides mostly in the kernel and is referred to as the O2CB cluster stack. It includes:

  • A disk heartbeat to detect live servers

  • A network heartbeat for communication between the nodes

  • A Distributed Lock Manager (DLM) which allows shared disk resources to be locked and released by the servers in the cluster

OCFS2 also offers several tools to examine and troubleshoot the OCFS2 components. For detailed information on OCFS2, see the OCFS2 documentation at:

When you create a server pool, you specify:

  • Server pool name and description

  • A virtual IP address

  • Whether or not to activate the cluster

  • A server pool file system for the global heartbeat and other cluster information

During server pool creation, the server pool file system specified for the new server pool is accessed and formatted as an OCFS2 file system. This formatting creates several management areas on the file system including a region for the global disk heartbeat. Oracle VM formats the server pool file system as an OCFS2 file system whether the file system is accessed by the Oracle VM Servers as an NFS share, a FC LUN or iSCSI LUN.

Sample vm.cfg file

A simple example of a configuration file to create a guest follows:

disk = [ ‘file:/mnt/el4u5_64_hvm//system.img,hda,w’ ] memory=4096

vif = [ ‘ ‘ ] #By default no n/w interfaces are configured. E.g: A default hvm install will have the line as vif=[ ‘type=ioemu,bridge=xenbr0’ ]
builder = “hvm”
device_model = “/usr/lib/xen/bin/qemu-dm”

vnc=1 vncunused=1

serial = “pty” # enable serial console

on_reboot = ‘restart’ on_crash = ‘restart’

For RAC impleentation, we have to add an exclamation mark at the end of the line as shown below:
# xen config file example for RAC Guest Domain
name = “vmrac1″
memory = “8192″
disk = [ 
vif = [
‘mac=00:16:3E:00:00:08, bridge=xenbr0’,
‘mac=00:16:3E:10:A5:96, bridge=xenbr1’,
vfb = [“type=vnc,vncunused=1”]
uuid = “3d6f1de4-626c-e02a-42a1-458c9c17e728”
on_reboot   = ‘restart’
on_crash    = ‘restart’

OVM Console

To access the console from the OVM Manager, you must download and install the OVM console.
Download 64-bit version of OVM Console:


Download 32-bit version of OVM Console
And if you are not using FireFox and happen to be on Windows:
[root@ovm22 ~]# wget

–2011-08-01 23:03:03–
Connecting to||:80… connected.
HTTP request sent, awaiting response… 200 OK
Length: 45259 (44K) [text/plain]
Saving to: `ovm-console-1.0.0-2.x86_64.rpm’

100%[======================================>] 45,259      –.-K/s   in 0.1s   

2011-08-01 23:03:18 (442 KB/s) – `ovm-console-1.0.0-2.x86_64.rpm’ saved [45259/45259]

[root@ovm22 ~]# wget
–2011-08-01 23:03:51–
Connecting to||:80… connected.
HTTP request sent, awaiting response… 200 OK
Length: 42607 (42K) [text/plain]
Saving to: `ovm-console-1.0.0-2.i386.rpm’

100%[=============================================================================>] 42,607      –.-K/s   in 0.04s  

2011-08-01 23:04:06 (1.09 MB/s) – `ovm-console-1.0.0-2.i386.rpm’ saved [42607/42607]

[root@ovm22 ~]# wget
–2011-08-01 23:04:14–
Connecting to||:80… connected.
HTTP request sent, awaiting response… 200 OK
Length: 251012 (245K) [text/plain]
Saving to: `tightvnc-java-1.3.9-1.noarch.rpm’

100%[=============================================================================>] 251,012      955K/s   in 0.3s   

2011-08-01 23:04:29 (955 KB/s) – `tightvnc-java-1.3.9-1.noarch.rpm’ saved [251012/251012]

[root@ovm22 ~]# rpm -ihv tightvnc-java-1.3.9-1.noarch.rpm ovm-console-1.0.0-2.x86_64.rpm

warning: tightvnc-java-1.3.9-1.noarch.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159
Preparing…                ########################################### [100%]
   1:ovm-console            ########################################### [ 50%]
   2:tightvnc-java          ########################################### [100%]