Playing with VirtualBox, Oracle 12c ( and OEL 6.4 – Part 2

We will complete our lab by installing the Oracle Database software, create a Pluggable database and take a look in the Oracle Enterprise Manager Database Express.

The steps to install and create an Oracle Database 12c are:

1 – Go to the database directory created when unzipped the 2 Oracle Database Files and run /runInstaller .


2 – Unselect the option [I wish to receive security updates via My Oracle Support] and click [Next]. Of course, if you want to receive updates all you need to do is to leave this option marked and enter your My Oracle Support email and password.


3 – You will receive a warning message that you have not provided an email address. Just click on [Yes].


4 – Select [Skip software updates] and click [Next].


5 – Select [Create and Configure a Database] and click [Next].


6 – Select [Server Class] and click [Next]. *** If you do not have enough resources on your laptop, please choose Desktop Class instead of Server Class.


7 – Select the type of Database to be installed, choose [Single instance database installation] and click [Next].


8 – Select the Install type. For this lab I will choose [Advanced Install] and click [Next].


9 – Select the product Language, here all you need to to is leave English as the default and click [Next].


10 – Select the Database Edition you want to install. Select [Enterprise Edition] and click [Next[.


11 – Specify the Installation location and click [Next].


12 – Create the Inventory and click [Next].


13 – Select the type of database you want to create. Select [General Purpose] and click [Next].


14 – Specify the database identifiers, enter “orcl” as the SID and here you can decide if you want to create a Container Database or as early releases a non-Container Database (by not selecting [Create as Container database]. For this example we will select Container database and create a Pluggable Database called “pdborcl” and click [Next].


15 – Specify the configurations options, by default the Automatic Memory Management is enabled, click [Next].


16 – Specify the storage to be used. Select [File System] and click [Next].


17 – Management options. If you have an EM Cloud Control running on your environment, here is where you specify the EM details to manage this database. Leave as the default and click [Next].


18 – Enable Recovery and click [Next].


19 – Specify Passwords. For this scenario we use the password “oracle” to all accounts. Click [Next].


20 – A warning will appear due that we are using a easy password. Click [Yes].


21 – Click [Next] on Privileged Operating Systems groups.


22 – Review the Summary page and click [install].



23 – Execute the configuration scripts as root and click [Ok] to continue the installation.






24 – In the Finish page click [Close].


25 – Edit /etc/oratab as follows.


26 – Check the listener status.


27 – Check if the Container Database is running.


28 – Connect to the Enterprise Manager Database Express. It will first ask you to add a Security Exception in Firefox.



29 – The Next step will be to download the Adobe Flash Player rpm and install it.


30 – Enter your database username and password. SYS and oracle and click [Login]


31 – This is the First Screen of the new Enterprise Manager Database Express 12c. Here you are not able to use monitoring, set alertings or even execute backup and recovery operations. But you can do a lot of other stuff such  such as per example: Manage Storage such as: Undo, Redo Log Files, and Control Files, Configure Initialization Parameters, Memory  and Database Features and finally Manage  Performance, SQL Tuning and Users. and Roles (Security).









Hope you enjoyed this tutorial and soon many more will come.




Francisco Munoz Alvarez


Tagged with: , , , , , ,
Posted in 12c, General, Linux, Others, Tutorials, Virtualization

Playing with VirtualBox, Oracle 12c ( and OEL 6.4 – Part 1

Now that 12c was released it’s time to install in on OEL 6.4 64 bits OS. Let’s start playing with this.

Before we start with the creation of the VM we will need to download some software first, such as:

Now that we have all the required software, let’s use the following steps to create our virtual machine using VirtualBox.

1 – Start VirtualBox and click on the option [New].

2 – Name the Virtual Machine and select the type of OS (Oracle Linux) and click [Next].


3 – Enter the amount of RAM for the VM. For this example I’m entering 4096MB if you do not have this amount of memory to use, please try with 2048 MB. An click [Next].


4 – Now is time to create the virtual disk for the VM. Select Create a Virtual Hard Drive now and click [Create].


5 – Select a hard drive type to be created, select VMDK and click [Next].


6 – Select the Dynamically allocated option and click [Next].


7 – Now let’s select the file allocation and size for our disk.  Let’s enter 50 GB for the disk Data and click [CREATE] to create the VM.


8 – Select the VM just created, than click [Settings] , select [Storage] , [ADD CD/DVD] , add the OEL 6.4 64 bit ISO image and click [OK].


9 – Due that I have a god number of CPUs available on my laptop, I will edit the VM to have 2 vCPUs. (This is an optional step)


10 – Start  the VM and click on the option [Install or upgrade an existing system].


11 – Select [Skip] the Disk Test.


12 – The installation Welcome Screen will appear. Please click [Next].


13 – Select the installation Language. For this example we will select [English] and click [Next].


14 – Select the VM Keyboard to be use [U.S. English] and click [Next].


15 – Select [Basic Storage Devices] and click [Next].


16 – You will receive a warning message that the device bellow may contain data. Click [Yes, discard any data].


17 – Enter the Host name of the VM, For this example I will use oracle12c and click [Next].


18 – Select your time zone and click [Next].


19 – Enter the Root use password. For this example I used “oracle” and click [Next].


20 – For the type of installation select [Replace Existing Linux System(s)] and click [Next].


21 – Once again you will receive a warning message, this time saying that  the partitions will be written to disk. Please click on [Write changes to disk].


22 – In the next screen select [Basic Server], [Customize now]  and click [Next]


23 –  Now we will select the following packages group on our installation:

  • Base System > Base
  • Base System > Compatibility libraries
  • Base System > Hardware monitoring utilities
  • Base System > Large Systems Performance
  • Base System > Network file system client
  • Base System > Performance Tools
  • Base System > Perl Support
  • Servers > Server Platform
  • Servers > System administration tools
    • Select the Package oracle-rdbms-server-11gR2-preinstall due that the 12c package still not available yet and this will work just fine for this installation.
  • Desktops > Desktop
  • Desktops > Desktop Platform
  • Desktops > Fonts
  • Desktops > General Purpose Desktop
  • Desktops > Graphical Administration Tools
  • Desktops > Input Methods
  • Desktops > X Window System
  • Development > Additional Development
  • Development > Development Tools
  • Applications > Internet Browser


24 – Click [Next] and the Installation Process will start.


25 – The Congratulations screen will appear and you will need to click [Reboot].


26 – On the OEL 6 Welcome page click [Forward].


27 – Review the License Information, select [Yes, I agree to the License Agreement] and click [Forward].


28 – In the Set Up Software Updates page just click [Forward].


29 – In the Create User page just click [Forward].


30 – Enter the Date and Time for your system and click [Forward].


31 – Do not select Enable Kdump and click [Finish] to reboot the machine once again.


32 – After the reboot connect to the machine using the root user.


33 – Disable the Firewall on [Administration] –> [Firewall].


34 – Select [Devices] –> [Install Guest Additions] to install the Virtual Box Guest Additions.


35 – Transfer the Database files to the virtual machine and unzip them.

  • $ unzip
  • $ unzip

36 – Configure the Host file as per the screenshot bellow.


37 – Use YUM (public yum)  to automatically setup the Oracle prerequisites if not used when installing the OS.


*** As you can see above in the screen shot, the oracle-rdbms-server-12cR1-preinstall package still not available. For this scenario we will use the oracle-rdbms-server-11gR2-preinstall package that will do the trick for us.

38 – Now we will need to setup the user oracle password .

$ passwd oracle (for this lab we will user the password oracle)

39 – Create the directories in which the Oracle software will be installed.

mkdir -p /u01/app/oracle/product/12.1.0/db_1
chown -R oracle:oinstall /u01
chmod -R 775 /u01

40 – Login as the oracle user and add the following lines at the end of the “.bash_profile” file.

# Oracle Settings
TMP=/tmp; export TMP

ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/12.1.0/db_1; export ORACLE_HOME

PATH=/usr/sbin:$PATH; export PATH


41 – On the unziped folder created, go to database/rpm and install the cvuqdisk-1.0.9-1.rpm package.

$ rpm –Uvh cvuqdisk-1.0.9-1.rpm

42 – run xhost +

$ xhost +

access control disabled, clients can connect from any host

43 – Stop the Virtual Machine and Remove the OS disk from the [Storage] section and unselect the CD/DVD-ROM from the Boot Order and Start the VM.


Next, on part 2 of this lab, we will install the Oracle Database software and take a look in the Oracle Enterprise Manager Database Express.




Francisco Munoz Alvarez


Tagged with: , , , , ,
Posted in 12c, General, Oracle FAQ, OVM, Tutorials, User Groups, White Papers

Once again, How to Improve your Oracle Career

The main question about the DBA job I hear all the time is: How can I became a successful DBA?

Most of the people that I talk to who have difficulties starting out in their DBA career really have an issue trying to absorb the mountainous volumes of information that a DBA needs to know this days. The evolution of the DBA role in the past few years was amazing, from a role that was basically responsible for administrate one or two small Oracle Databases and interact very closely with some System Administrators to become a super role (most of the time absorbing System and Network administrator responsibilities) some modern DBA responsibilities could be to manage:

  • Several Oracle Databases and Data Warehouses
  • High Availability environments like RAC and Standby Databases
  • Other type of RDBMS (MySQL, SQL Server, DB2, etc)
  • Support servers (Application and DB)
  • Security and Network stability
  • Storages and Clusters
  • Mentor other DBAs
  • Backup and Recovery Strategy
  • Handle User problems (including functional side of applications)
  • Review SQL and PL/SQL codes
  • Control and execute promotions to production environments

As per example, here are some common duties for a DBA in today’s world:

  • Monitor database instances on a daily basis to ensure availability.
  • Resolve unavailability issues.
  • Collect system statistics and performance data for trending and configuration analysis.
  • Configure and tune DB instances for optimal performance under application specific guidelines.
  • Analyze and administer DB security. Control and monitor user access. Audit DB usage when necessary.
  • Monitor backup procedures and Provide recovery when needed.
  • Develop and test backup and recovery procedures.
  • Upgrade RDBMS software and apply patches when needed.
  • Upgrade or migrate database instances as necessary.
  • Support application developers with any and all dB related activities.
  • Keep up with DB trends & technologies.
  • Use new technologies when applicable.
  • Install, test, and evaluate new Oracle related products.
  • Perform storage and physical design.
  • Balance design issues to achieve optimal performance.
  • Create, configure and design new DB instances.
  • Diagnose, troubleshoot and resolve any DB related problems.
  • Work with Oracle Support if necessary to bring problems to a successful resolution.
  • Ensure that Oracle networking software is configured and running properly.
  • Work with System Administrators (UNIX & NT) to ensure Oracle related matters are handled properly, or in some cases, do yourself it.
  • Train/Mentor new DBA’s
  • Create, Manage and Monitor Standby Databases
  • Understand your user Applications and needs.
  • Configure and Manage Database and Application Servers
  • Manage and configure Clusters , DWs and AS
  • Configure and Manage different type of RDBMS (Remember, you are a Database Administrator and they are database)
  • XML, Java, PHP, HTML, Linux, Unix, Windows Scripting
  • Create any necessary scripts for effective and occasionally periodic dB maintenance activities.
  • Capacity Planning /Hardware Planning

Like you can easily see, the DBA job is not easy, and each professional need to be capable to be multitasks and manages a lot of responsibilities and stress.

In this paper, we will see several examples on how to improve your DBA career and how to become a real success DBA.

First, Learn to change yourself

If you want to become a successful professional, first you need to educate yourself to be successful! Your future success depends only in your attitude today. You control your life, nobody else!


Becoming a successful DBA is a combination of:

  • Your professional attitude, always think positive and always look for solutions instead to kill yourself in a cup of water.
  • Learn how to research, before do something, investigate, search in the internet, read manuals. You need to show that you know how to do a properly research and look for solutions for your problems yourself.
  • Innovate, don’t wait for others to do your job, or because the other DBAs don’t care about the business you will do the same. Learn to innovate, learn to become a leader and make everyone follow your example with results. Think Different!
  • Learn to communicate properly; the best way to learn how to communicate effectively is learning to listen first. Listen, than analyze the context expressed and only than communicate an answer in a professional and honest way to your peers. Always treat everyone the same way you would like to be treated.

Albert Einstein said one time:

“If I had one hour to save the world, I would spend fifty-five minutes defining the problem and only five minutes finding the solution”

Learning to be Proactive

Why check the problems only when they are critical, or when is too late and the database is down, or the users are screaming?

Being proactive is the best approach to keep your DB healthy and to show your company, or your clients that you really care about them.

Many DBA’s expend most of their time being fire-fighters only, fixing problems and working on user’s requests all the time. They don’t do any proactive work; this mentality only will cause an overload of work to them, thousands of dollars of overtime, several hours without access to the data to the users,  poor performance to the applications, and what is worse of all, several unhappy users thinking that you doesn’t have the knowledge needed to take care of their data.

Let’s mention a small example, you have the archive log area alert set to fire when it is 95% full, and this happens in the middle of the night, some DBA’s will take seriously the alert and solve the problem quickly, others will wait until the next day to take care of it because they are tired, or sleeping, or they are in a place without internet access at the moment the alert arrived. Will be a lot easier if they set a proactive alert to be fire when 75% or 85%, or even better, take a look in the general health status of the DB before leave their work shift, to try to detect and solve any possible problem before be a real problem and be awake in the middle of the night or during the weekend (Remember how important is your personal and family time). I’ll always recommend to DBA’s to run 2 checklists daily, one in the start of their shift and other before they leave their shift.

I know several DBA’s that complain all the time that they got so many calls when they are on call, but they don’t do anything to solve the root problem, they only expend their time to solve the symptoms.

Here in my blog you can find an Oracle checklist script that will help to make your life a little easier (This is not my complete script, but will be a good start for you). This script is a compilation of several normal checklists and you can setup them with your own requirement and thresholds and always remember to have a baseline to compare. This script will not only help you to detect future or current problems, but also will help you to detect possible tuning requirement.

You also have several tools available in the market that can help you to monitor and setup your DB alerts, and help you with the proactive monitoring like: Oracle Enterprise Manager, Insider (FourthElephant), Spotlight (Quest) or if you prefer, your own scripts. The idea is to use them always on a proactive way, never reactive.

Let’s change our mentality, let stop being a fire-fighter and start to be a real hero!

Backup And Recovery

It’s time to be “Proactive with Backup & Recovery”, always when I arrive on a new client I ask the DBA on charge the following questions:

  • Do you have your recovery strategy documented step by step?
  • Are you 100% sure that your tape backups are usable?
  • Do you know exactly how long a recovery on your production environment will take if necessary?

And almost 90% of the time the answers will be:

  • No!
  • I not sure, but I think so!
  • No idea, probably…!

You will be on shock to know how many times I’m call to support a DBA to try to recover a Database because the most current tape backup is unusable!

Backup & Recovery are a very important (crucial) part of a DBA role, as a DBA I’ll never be stressed enough to repeat over and over what in my opinion is the most important rule for a DBA:

“The most important rule with respect to data is to never put yourself into an unrecoverable situation, never!”

You know, because bad stuff happens….


…When you less expect, and due to this, I’ll always recommend a DBA to perform a proactive approach to his/her Database Backup and Recovery strategy.

The main idea is:

  • Randomly choose a backup tape and recovery it on a test machine (It can be a virtual one).
  • Take this opportunity to document all the recover process.
  • Review the entire process ant try to improve it!
  • Repeat this exercise every month and try to involve other DBAs in the process!

This easy process will allow you to:

  • Test your Tape backups and see if they are being backup correctly.
  • Check and improve your recovery knowledge and strategy.
  • Document all your recovery process that could be used for any other DBA in the company in case you are not available in the recovery situation.
  • Detect any error on your backup & recovery strategy.
  • Know your recovery time. Next time your manager asks you” Do you know how long a recovery will take? You will know the exact answer.
  • Have an opportunity to review your process and try to make it more efficient.

Like you can see, this is an easy proactive exercise that will allow you and your company to be prepared in case of a disaster and recovery situations occurs, and you know when this always happens….



Francisco Munoz Alvarez

Posted in DBA Career Tips, General, Interview Tips, Oracle FAQ

Oracle VM 3.1 Disaster Recovery (HA)

On this scenario we will talk about how to implement HA (High Availability) for OVM 3.1 between a Primary Site (Production) and a Secondary Site (DR) located at 800 km away. On this post we will only talk about the storage replication part and how to make it work when a failover is required (I will not cover the Database replication side (Using Data Guard).


Please note that the Oracle VM Manager should be installed on both sites with the same UUID using the “./ –uuid <uuid>” command. The UUID for the Oracle VM manager could be found in the configuration file of the OVM manager.

$ cat /u01/app/oracle/ovm-manager-3/.config | grep -i uuid


The Preparation

1) Identify the source LUN in the production OVM Manager we want to HUR to the DR site. (360060e8005449c000000449c00004606)


2) Present the LUN to the DR site.

Also specify the HUR source LUN (360060e8005449c000000449c00004606) and HUR target LUN (You will get the LUN ID from the SAN Engineers when they present the LUN to the DR site).

Ask the San Engineers to activate the HUR process.


The Failover

In the event of a primary site failure, DR procedures will be kicked off as shown below.


1) Production site is down, the storage replication synchronization between the production site and the DR site would have to be stopped.

2) Since these are block devices, there will be an OCFS2 filesystem on the devices. You will not be able to present the replicated repositories to the OVM servers at the DR site because of the cluster ID tamped into the repositories. This will cause mounting of the OCFS2 filesystems at the DR site to fail.

“mount.ocfs2: Cluster name is invalid while trying to join the group”

3) Find the former cluster ID stamped on the replicated repository.

We know what the target LUN ID should be (When the SAN Engineers presented the LUN to the DR site) eg 360060e8005458e000000458e00004075


Find the former cluster ID stamped on the replicated repository. (360060e8005458e000000458e00004075)


Cluster ID = 16a67562c33aa4fe



4) Find the new OCFS2 cluster ID at DR site.


5) Change the clusterID of the replicated repository (360060e8005458e000000458e00004075)

$ tunefs.ocfs2 –update-cluster-stack /dev/sde (360060e8005458e000000458e00004075)


Run fsck.ocfs2 /dev/sde


Y to continue.




6) Check that cluster ID is already updated.


7) Repositories before refresh ( service ovmm stop / start)


8) After repositories refresh ( service ovmm stop / start)

Log onto DR OVM Manager. (console)



9) You should now see a VM under the unassigned Virtual Machines tag.


10) Edit VM and replace network adapter.


11) Migrate VM to a host.


12) Start VM.

13) Configure MAC address and ip address. (VM OS)

Edit /etc/sysconfig/network-scripts/ifcfg-eth0


Get new MAC address from DR OVM Manager.


Update /etc/sysconfig/network-scripts/ifcfg-eth0 with the new MAC address.


14) Service network restart.


Francisco Munoz Alvarez

Posted in Cloud, General, OVM, Virtualization

Improving VM Performance, Converting repository disk to LUN

If using OVM virtual disks, you can easily improve your VM performance by replacing the virtual disks for raw LUN’s. It gives an extra boost in the performance specially if using the PVM mode.

Note that here we are using OVM 3.1 and the guest VM is using OEL 5.7.

On this scenario we will convert the OVM DB11 virtual disks to raw LUN’s as follow:


1. Identify how many disk and sizes you want to copy to raw LUN’s


2. The disk sizes in the window above are not the actual size of the disks just an indication.

3. Identify the repository ID.


4. SSH to the OVM Server that hosts the VM, in this case it will be the host 1B09


5. Move to the folder that have the name of the repository ID you identified on the step 3.

$ cd /OVS/Repositories/0004fb00000300001176e2bcac96fae5/VirtualDisks


6. Note the size of the two disks.

7. Present a 1 x 45GB LUN and a 1 x 110GB LUN to your OVM Server Pool.

8. Using the OVM Console, Log onto the VM (DB11) to get the mount points


9. Identify the new LUNS presented (At the OVM Manager).


10. Rename the storages.


11. Get the LUN ID’s of new LUN’s


12. In the OVM Server (1B09) that host the VM check for the LUN’s IDs you just identified on step 11.

$ cd /dev/mapper

$ ll


13. Shutdown the VM DB11.

14. Get ID of OVM.


15. On the OVM Server (1B09) make a backup of the VM DB11 config file.

$ cd /OVS/Repositories/0004fb00000300001176e2bcac96fae5/VirtualMachines/0004fb00000600002fd4b407b58c8e5a

$ cp vm.cfg to vm.cfg.bak


16. Create partition on raw LUN’s

$ fdisk –l to get disk device



17. Create partition on disk

$ fdisk /dev/sdl

  • N
  • P
  • 1
  • Use all the storage
  • W

$ fdisk –l /dev/sdl


18. Copy the img file to new LUN.

$ dd if=/OVS/Repositories/0004fb00000300001176e2bcac96fae5/VirtualDisks/0004fb0000120000fe9000e9ccaa5d08.img of=/dev/mapper/360060e8005b14a000000b14a00004301


19. Follow the same process for the other drives.

20. Change the virtual disk to physical disks.



21. Start the VM.

22. Delete vm.cfg.bak and img virtual disks.



23. Refresh Repository.


Kind regards,

Francisco Munoz Alvarez

Posted in General, OVM, Tutorials, Virtualization

OVM V2V – Converting ESX VM to OVM using ISO boot CD

In this blog post we will learn how to convert an ESX VM to OVM  3.1 (V2V) using an ISO boot CD. Basically all you need to do to achieve this objective is to follow the following steps:

1. Uninstall VMtools from VM

2. Attache OVS-3.1.1-524.iso to the VM.

3. Boot VM from CD


4. Enter p2v


5. Press ENTER.


6. Select Skip.


7. Enter the ip address of the VM or obtain address from DHCP.


8. Select the disk(s) to include in the image. You will select all the disks.


9. Use space bar to select the disk(s) and select OK


10. Enter the VM name, Memory and CPUs . Console Password “Password123”

Note that you will have to edit the vm.cfg file after the import and delete the line containing vncpasswd = ‘Password123’.

If you do not remove the line you will be asked to provide a VNC Authenticate password.


11. Select OK


12. On the Transition VM Connect to web server using IE or Firefox.




13. Save System-sda.img and vm.cfg into a folder (VM Name) on the transition VM.

If you have more than one disk you will see more than one System-sda.img.

14. Control-C to restart the VM.

15. Copy the files to their management server and create a TAR ball of the System-sda.img and vm.cfg files.

16. Import the TAR file to the OVM Manager as a template.

17. Clone the template as a VM.

And your are ready to go 😉




Posted in Cloud, General, OVM, Tutorials, Virtualization

What was new for Oracle Backup and Recovery at 11g?

Oracle 12c is around the corner and due that I have received many questions from fellow DBAs about what was new about Backup and Recovery at 11g I have decided to write a small white paper about it.

Hope you will enjoy reading it as much I enjoyed writing it.



Francisco Munoz Alvarez

Posted in 11gR2, Backup & Recovery, General, Oracle FAQ, Tutorials, White Papers