Desktop Virtualization Tools…

Tim... | Jul 5, 2008 09:10 -0600

Some quick thoughts on the state of desktop virtualization tools…

Background: If you’ve been checking out my RAC articles, you’ll have probably noticed I’m a bit of a VMware fan. I originally used VMware Workstation, but switched to the free VMware Server when it was released in 2006. I don’t have much cause to complain about VMware Server, but it’s always good to take a look at the competition to see if I’m missing out…

I guess before I start talking about virtualization, I should define what I mean by desktop virtualization. For me, “server” virtualization tools should install on the bare-bones hardware, like Oracle VM and VMware ESXi. I don’t want to waste resources on having a host OS running as well as my virtual machine. On the other hand, desktop virtualization tools should run on top of my host OS, so I can play about with other operating systems, but don’t have to dedicate my hardware to that task.

Vmware Server: Even though the name contains the word “Server”, I still think of this as a desktop virtualization tool as it installs on top of the host OS, not on the bare-bones hardware. That said, it’s the most server-like of the desktop virtualization tools I’ve used. It’s very stable and very feature rich. That’s a good point for someone like me, but may be off-putting to the more casual users.

I guess the standout feature for me is the ability to share disks between VMs. This makes RAC installations using ASM, OCFS2 and raw disks possible, which is a pretty big thing for me. Obviously, if you never do RAC installations using shared disks this is irrelevant.

I guess my only real gripe about this product is VMware are slow to add new OS support. I’ve been waiting for the final release of version 2.0 for a long time, so I still don’t have proper RHEL5 support. That said, I’ve not yet run into any problems running RHEL5 or any other OS, so I guess I’m being mega-picky considering it’s free. :)

If you’re an Apple fan you are out of luck. VMware Server is a Linux and Windows tool only. That’s not as much of a limitation as it sounds since it’s supposed to be a server tool. VMware Fusion supports Macs, but it’s not free.

Parallels: I got my current laptop about 1 year ago and it came with Windows Vista. I tried to use VMware Server on it and ran into a bunch of network related problems. I knew some people who were using Parallels Workstation on Apple Macs and I saw from the website it was compatible with Vista, so I spent some money and got a copy of it.

Parallels was easy to use and “did what it said on the tin”. I had no problems running Windows and Linux guests, but it wouldn’t let me share virtual disks between VMs and it cost money. The first point was a major issue for me. The second one wasn’t so bad, but a little annoying when I was used to using a free product. :)

While using Parallels on my laptop I was still using VMware Server on my main Linux boxes. Not long after buying parallels I found a solution to my VMware Server on Vista networking issues, so I switched back to VMware Server and never launched Parallels again.

I guess Parallels trump card has been the support for Apple Macs, so you can use one tool for Windows, Linux and Mac.

Xen: This has been knocking on the door of VMware for some time. I guess two really big steps for Xen, as far as people like me are concerned, have been its inclusion in enterprise distributions, like RHEL5, and the introduction of Oracle VM. The enterprise linux distributions (Red Hat, SUSE etc.) approach is to run Xen on top of the Host operating system, making it look very much like a desktop tool. This is a bit unfair as it’s certainly got more to it than that, but that’s how it appears. Oracle’s approach with Oracle VM is to “remove” the host OS and allow it to be installed on bare-bones hardware. I say “remove” because it is still there, but it’s a very small footprint, not a complete kernel+tools installation. This is much the same as the approach used by VMware ESXi. The inclusion in heavyweight distributions like RHEL and its use by Oracle in Oracle VM send out a strong signal about the power of Xen.

As soon as I got my hands on CentOS 5, I gave Xen a try and was pleasantly surprised. It works well and has the “server clout” that some of the other tools lack. When chatting to some Red Hat staff about a year ago, the general consensus was Xen out-performs VMware for Linux VMs, but it a little slower than VMware for Windows VMs. I’m not sure if that position has altered since then and I certainly have no evidence to backup that statement. :)

I guess the biggest issue for most people will be that Xen is only available on Linux. That’s fine as far as server virtualization is concerned, but it means it drops off the map where desktop virtualization is concerned because it’s still a MIcrosoft world out there.

VirtualBox: Available for about 18 months, and acquired by Sun about 5 months ago, I only noticed VirtualBox a few weeks ago when I was looking through the “Add/Remove Applications” utility on Ubuntu 8. A bit of Googling and it turned out to be the current darling of desktop virtualization. Of course, now I know it exists I can’t go a day without noticing someone else writing about it. So today I thought I would give it a shot, which ultimately inspired this post.

I’ve done a test drive of Virtual Box Open Source Edition (OSE) on Ubuntu and it’s pretty sweet. The interface is very simple and it works fine. I can’t speak for the paid-for product, but the OSE edition has no pretensions of being a server virtualization product, so it lacks some of the things I hold dear, like shared disks. What’s more, looking through the forum, it is unlikely to add this type of functionality in the near future, as its quite rightly not considered a must-have for the desktop.

If you are thinking about running Oracle 11g on VirtualBox, you might want to read this post by Eddie Awad.

I guess the two big plus points in favor of Virtual Box are its free, and its available for Windows, Linux and Mac. Those two alone make it pretty compelling.

Others: I know there’s a bunch of other virtualization tool out there, but I don’t consider any of them particularly mainstream. I know Microsoft Virtual PC 2007 could be considered a biggy, but I would never use a Windows only product like this because I’m not a Windows only guy. Call me biased, but it is my blog. :)

Conclusion: For the time being I will be sticking with VMware Server. The main reason for this is it allows me to do my RAC installations using shared disks. Added to that, I can share my VMs between my Linux and Windows boxes with no problems.

If you don’t need shared disks I would seriously consider VirtualBox because it’s simple, free and supports all the right platforms. Seems like the obvious choice for most people. :)

Cheers

Tim…

Latvian Nationwide Song and Dance Celebration in RigaToday is

Latvian Nationwide Song and Dance Celebration in Riga

Today is the beginning of 24th song festival - unique celebration of choral songs, which started 135 years ago with the first song festival. In these times under the rule of Russian Czar, later they continued during the short freedom period as well as even in Soviet times. This year about 35 000 singers and dancers will come to Riga to sing and dance in various concerts. This means more than 2% of all Latvians are coming together to sing and dance and many many more are coming to see them on the concerts or via TV.

Brief history

The first All Latvian Song Festival took place in Riga, year 1873. There were 1003 singers in these times. Under the Russian Czar there were 5 festivals. During the Latvian independence there were 4 festivals and participant count raised to more than 14 000 people. During the Soviet times these festivals partially become the weapon of Soviet propaganda, however these were like two-edged sword, for example, the 100th anniversary of song festival in 1973 was some kind of emotional uprising against Soviet regime. Since 1990 song festivals are held in independent state again and the participant count has raised to impressive more than 2% of all Latvians. The learning process of songs and dances is continued all the time and it is worth to mention that noone pays a single sant?ms (centime) to participants both for preparation process lasting a few years and also the very festival, although of course there is governmental material support for the organizational purposes of the festival.

Events

During the festival there are many concerts and other kind of events. I'll mention a few of them. The first is participant parade. In the picture below one can look at one of the best choirs in the world "Kam?r", which has won many international awards and also takes part in this festival.

The second one is main dance concert. In recent times more than 10 000 dancers are taking part in it.

The last and biggest event is the final concert with all the singers in one big choir. It is very impressive moment.

Some links

Cool Firefox 3 add-on…

Tim... | Jul 5, 2008 06:30 -0600

Robert Scoble just shared a link to Pencil Turns Firefox into a Drawing Tool, points to the home of the Pencil add-on. It’s a pretty neat tool for drawing basic diagrams and prototyping screens.

Cheers

Tim…

Declarative Security in JDeveloper/ADF 11g

In JDeveloper 11g, with a help of Oracle ADF framework you can in easy and straightforward way add security to your application. And this way is based on declarative approach, no coding is needed. Main goal of this post is not to describe about how to configure security, but more about how it can be applied in your applications.

Let's take a case when there is a requirement to open the same form in different modes (editable/read-only) for users with different sets of roles assigned. With JDeveloper 11g you can implement this requirement in 3 quick steps. I will describe those steps here, also you can download developed sample application - DeclarativeSecurity.zip. In order to run this sample, you need to have standard HR schema in your database. Additionally, you need to use this system-jazn-data.xml file, where two users are defined - john (managers) and scott (clerks). For both users password - welcome is defined.

Three steps you need to use in order to implement declarative security:

1. Entity Object level security

This step will allow to secure row data. In Entity Object wizard, define Security Operation Mapping. I have secured two standard Actions - Update and Delete for Jobs Entity:


When security options are defined, specify authorization for Jobs Entity. In my sample, I allowed Update and Delete actions only for users with managers role:


2. Page Definition level security

In this step we will secure Actions defined in Page Definition:


Example of Security definition for Delete action:


In Authorization settings, I have specified Delete action availability only for managers role:


3. Expression Language

And last step is to specify using EL, disabled property for button component. This will allow to have button in disabled state, when user is not authorized to perform associated action. EL expression is pointing to Action security in Page Definition:


All 3 steps are explained, now will show how it works. At first, let's login as scott user, this user have clerks role assigned:


Security definition in Entity Object makes row data read-only, since clerks are not allowed to modify it. Delete button also appears disabled:


But, what is nice, when Search Find button is pressed, Oracle ADF automatically puts form into Find mode:


And finally, when entering using john account:


Since john is granted with permission to update and delete existing rows, form appears in edit mode with Save and Delete buttons enabled:

Hancock…

Tim... | Jul 5, 2008 02:50 -0600

Hancock was a bit of a surprise. It’s a story about a superhero who’s down on his luck and is looking for redemption. It was a genuinely funny movie that only descended into cornball cheese a couple of times. I knew nothing about the story before I went to the movie, so there were a couple of very unexpected bits.

It’s not the best story in the world, but it works pretty well for a dumbass blockbuster movie. I hope they don’t try to make it into a franchise because I don’t think we need another Superman. Come to think of it, I don’t think we need Superman at all. :)

Cheers

Tim…

Taking the Plunge: Part 3

Jake | Jul 4, 2008 20:30 -0600

I decided earlier in the week that the long Fourth of July would be a great time to reimage my work laptop from XP to Ubuntu.

A couple reasons from this: 1) I’m supposed to be off today, so I can muck around with my laptop without worrying about work stuff and 2) it’s a bit fitting to declare my independence from Windows on the 4th.

Not that I’m fully abandoning Windows, since as I write this, I’m installing a virtual image of XP, but rather, I’m opening up my options to include Linux. Like I said before, choice is good.

Rich told me yesterday over IM that it would take about 30 minutes to install Ubuntu and a bit longer to get it running. He also assured me that dual monitors and docking stations were supported. I think he said something similar to out-of-the-box, but I can’t check my chat log just now.

He’s partially right. It was a quick install, unless you try to take out the install CD when the restart is happening, and then you have to reburn another image. User error on my part.

Ubuntu did auto-configure my hardware, USB, sound, video, monitor, wireless card, all very impressively. I got the updates downloaded and installed and had Firefox 3 configured to my liking with all my favorite add-ons and bookmarks in a couple hours.

Then I spent the rest of the day fighting dual monitors.

I have a docking station with dual monitors, one LCD, one old CRT, different resolutions. I love my dual monitors; the productivity gain you get from multiple monitors is astounding. I highly recommend it, even if you just open your laptop and use it as a second monitor with your regular monitor, you’ll reap the benefits.

Anyway, XP did a passable job managing this setup. For some reason, it never could reboot and remember the settings, but I lived with that.

So, not having dual monitors is a huge gap for me. I spent literally hours trying to get it working until I tabled that to move on to installing the Cisco VPN client.

Which went equally well. Rich warned me about this one, and true to form, it failed. So, I skipped ahead to easy stuff because by then, I needed a win. I moved some files around, which is a great exercise.
Tim Hall commented on my first post:

If I lost my laptop tomorrow I could be back online in the amount of time it takes to buy the new laptop, install VMware Server and copy over the VMs.

Really good advice, and exactly why I keep current backups, JIC. I’m a pack rat though, so I have gigs of old work data. Reimaging gave me a chance to marginalize that old stuff on the backup drive.

So after getting a second wind, I moved on to installing VirtualBox, and I’m still walking through the XP install that I’ll need for IE 6, Oracle Web Conference and my old Palm Desktop calendar that has 10 years of data that I’m not ready to archive just yet.

So far, I’m pleased with Ubuntu. It’s very simple and easy, and it hasn’t crashed yet, in the BSOD Windows style. It has hung up a few times, but it starts so fast that hard rebooting doesn’t seem to be that bad a deal.

Well, XP has finished and needs me. Plus, I suppose I should enjoy the outside, maybe some fireworks.

Then back at this tomorrow.

Oracle 11g Monitoring and Goodbye Alert Log!

Oracle 11g has introduced many new features for database monitoring and administration. This month, we will examine the new interface for monitoring database events within the Oracle 11g database release. In previous releases of Oracle database, there was the alert.log text based file that contains all database activity of use to the vigilant DBA. The alert.log file contains error messages and major database activities and operations which are monitored by the DBA as part of daily maintenance. However, this alert.log file disappears with Oracle 11g and is now replaced by an XML file called the log.xml file.

Oracle 11g also introduces a new command line utility called the ADR Command Interface or ADRCI to review the contents of the log.xml file. By default, the ADR tool is located under the Oracle 11g directory ORACLE_BASE/diag/rdbms/SID/SID/alert
. In order to use the ADR tool, the command adrci is issued with Oracle 11g.


Let's explore an example on how to use the new ADR command tool to view our new Oracle 11g diagnostic log contents.

The default location where the log.xml file is located on the test Oracle 11g Red Hat Linux server in this example:

/u01/app/oracle/diag/rdbms/ora11g/ORA11G/alert


Start a new session of ADR command tool by issue command adrci:







Now let's check out some of the cool new features of the ADR command tool. To display options with the help command from within ADRCI:




For extended help options we can use the help extended command from within the ADR command tool and shown below:




We can get detailed explanations of an option such as the BEGIN BACKUP command which will present a series of screens much like that found in the old UNIX man pages.





What you should finally realize at this point is that Oracle 11g has taken monitoring to a whole new level over 10g release. In fact, think of it as monitoring on steroids. We will next view an example of how to look at the log files for database monitoring with Oracle 11g on Red Hat Linux.




Lets scroll down and see more options for the show alert option with ADRCI:





As you can see, there are now options to review the old style alert.log files as well as the ability to view the log files from the Oracle listener and host. We can also parse the log file to see just a recent activity which is useful for quick monitoring tasks. Lets take a peek at one of the recent log files in the next example.

We choose option 1 and the alert log file is displayed below:




By default the log files are stored under the Linux /tmp directory structure.





To exit and return to the main ADR command screen we use the :q command within the Linux vi editor.


The ADR command tool also lets us view the new health monitor reports and functions.

For instance, if I wish to look at the most recent health monitor execution tasks then I can simply issue the show hm_run command within the ADR command interface.







Also of note with Oracle 11g are several new V$ tables that correspond to the ADR and new health monitoring features:

V$HM_CHECK
V$HM_CHECK_PARAM
V$HM_FINDING
V$HM_INFO
V$HM_RECOMMENDATION
V$HM_RUN


Complete syntax and further details on the ADR command tool is available online in the Oracle 11g Documentation located here

We have barely scratched the surface in how to use this potent new monitoring feature for Oracle 11g. Explore the power of the tool as it promised much needed functionality and useful instrumentation for busy Oracle DBAs in monitoring of large and complex Oracle 11g environments.

Regards,
Ben

Cleaning up logs & trace files

Old logs , trace files etc can take up huge space & fill the disks very quickly , so we need to clean them up on periodic basis ........and sometimes a need comes where we need to clean up sapce instantly , then we need to identify the logs before a particular date , we have some simple commands & script to clean up old logs & trace files :

Simple command
/usr/bin/find /u01/app/oracle/product/crs/log/test040/client/css*.log -mtime +31 -exec rm {} ;

Above will delete old CRS logs which are more that 31 days old

# Cleanup trace and dump files over 14 days old
for ORACLE_SID in `cat /etc/oratab|egrep ':N|:Y'|grep -v *|cut -f1 -d':'`
do
   ORACLE_HOME=`cat /etc/oratab|grep ^$ORACLE_SID:|cut -d":" -f2`
   DBA=`echo $ORACLE_HOME | sed -e 's:/product/.*::g'`/admin
   /usr/bin/find $DBA/$ORACLE_SID/bdump -name *.trc -mtime +14 -exec rm {} ;

Source : internet

Simulating ASM Disks

Most of the Oracle 10g databases are using ASM for storage as its very  simple to maintain the  storage  wrt to Disks , Datafiles etc

You can get most of the ASM details & implementation details from OTN here : http://www.oracle.com/technology/asm/index.html

When i started to learn ASM , the real difficult part was to get a test hardware to play with , i looked are to find ways to simulate the asm env & have documented the procedure as below :

Caution: This
method is for Testing & Learning purposes only.

Simulating Asm by faking hardware

-->Faking Hardware
-->Instaling ASM Lib
-->Configuring the disks
-->Install DB & ASM instance

Faking Hardware:

Step 1) Here we create 4 zero-filed files using the DD comand

As Root run the following commands, this will create 4 files of 2Gb each

mkdir /asmdisk
dd if=/dev/zero of=/asmdisk/disk1 bs=1024k count=2000
dd if=/dev/zero of=/asmdisk/disk2 bs=1024k count=2000
dd if=/dev/zero of=/asmdisk/disk3 bs=1024k count=2000
dd if=/dev/zero of=/asmdisk/disk4 bs=1024k count=2000

Step 2) Use the loopback device to assign these disks

/sbin/losetup /dev/loop1 /asmdisk/disk1
/sbin/losetup /dev/loop2 /asmdisk/disk2
/sbin/losetup /dev/loop3 /asmdisk/disk3
/sbin/losetup /dev/loop4 /asmdisk/disk4

Now we need to configure entries to the file "/etc/rc.local" so that these divices are reinitialised on reboot also.

Add the following entries to the file "/etc/rc.local"
/sbin/losetup /dev/loop1 /asmdisk/disk1
/sbin/losetup /dev/loop2 /asmdisk/disk2
/sbin/losetup /dev/loop3 /asmdisk/disk3
/sbin/losetup /dev/loop4 /asmdisk/disk4
/etc/init.d/oracleasm createdisk ASM1 /dev/loop1
/etc/init.d/oracleasm createdisk ASM2 /dev/loop2
/etc/init.d/oracleasm createdisk ASM3 /dev/loop3
/etc/init.d/oracleasm createdisk ASM4 /dev/loop4

Instaling ASM Lib

ASMLib is a support library for the Automatic Storage Management feature of Oracle Database 10g. ASMLib allows an Oracle Database using ASM more efficient and capable access to the disk groups it is using. ASMlib are provided by Oracle from below link : http://www.oracle.com/technology/tech/linux/asmlib/index.html

Pls download the Lib files accoring to your OS & kernel version.

[root@csstage root]# uname -r
2.4.21-27.EL

It gives 3 rpms for download as per the version , pls install then using below command

[root@csstage asm]# rpm -ivh *.rpm

After this completes we go to next step of configuring the disks.

Configuring the ASM Lib & disks
Now we need to use the ASM Lib , configure it & configure the disks accordingly


[root@csstage root]# /etc/init.d/oracleasm configure


Configuring the Oracle ASM library driver.

This will configure the on-boot properties of the Oracle ASM library
driver.  The following questions will determine whether the driver is
loaded on boot and what permissions it will have.  The current values
will be shown in brackets ('[]').  Hitting <ENTER> without typing an
answer will keep that current value.  Ctrl-C will abort.


Default user to own the driver interface []: oracle
Default group to own the driver interface []: oinstall
Start Oracle ASM library driver on boot (y/n) [n]: y
Fix permissions of Oracle ASM disks on boot (y/n) [y]: y
Writing Oracle ASM library driver configuration:           [  OK  ]
Creating /dev/oracleasm mount point:                       [  OK  ]
Loading module "oracleasm":                                [  OK  ]
Mounting ASMlib driver filesystem:                         [  OK  ]
Scanning system for ASM disks:                             [  OK  ]

Now as the ASM Lib are configured, we will configure the disks
[root@csstage root]# /etc/init.d/oracleasm createdisk ASM1 /dev/loop1
Marking disk "/dev/loop1" as an ASM disk:                  [  OK  ]

[root@csstage root]# /etc/init.d/oracleasm createdisk ASM2 /dev/loop2
Marking disk "/dev/loop2" as an ASM disk:                  [  OK  ]

[root@csstage root]# /etc/init.d/oracleasm createdisk ASM3 /dev/loop3
Marking disk "/dev/loop3" as an ASM disk:                  [  OK  ]

[root@csstage root]# /etc/init.d/oracleasm createdisk ASM4 /dev/loop4
Marking disk "/dev/loop4" as an ASM disk:                  [  OK  ]

So now our hardware is all set to go & we need to install 10g database on the server using the above disks.

Install DB & ASM instance

Now we install the Database with ASM option
Create the ASM Instance
ASM runs as a separate Oracle instance, which can be created and configured using OUI.  Now that ASMLib is installed and the disks are marked for use, you can create an ASM instance.
Log in as oracle and start runInstaller:
$ ./runInstaller
1.    Select Installation Method
  •     Select Advanced Installation
  •     Click on Next
2.    Specify Inventory Directory and Credentials
  •     Inventory Directory: /u01/app/oracle/oraInventory
  •     Operating System group name:  oinstall
  •     Click on Next
3.    Select Installation Type
  •     Select Enterprise Edition
  •     Click on Next
4.    Specify Home Details
  •     Name:   Ora10gAsm
  •     Path:      /u01/app/oracle/product/10.2.0/asm
Note:Oracle recommends using a different ORACLE_HOME for ASM than the ORACLE_HOME used for the database for ease of administration.
  •     Click on Next
5.    Product-specific Prerequisite Checks
    If you've been following the steps in this guide, all the checks should   pass without difficulty. If one or more checks fail, correct the problem before proceeding.
  •     Click on Next
6.    Select Configuration Option
  •     Select Configure Automatic Storage Management (ASM)
  •     Enter the ASM SYS password and confirm
  •     Click on Next
7.    Configure Automatic Storage Management
  •     Disk Group Name:  DATA
  •     Redundancy
- High mirrors data twice.
- Normal mirrors data once.  This is the default.
- External does not mirror data within ASM. This is typically used if an external RAID array is providing redundancy.
  •     Add Disks
The disks you configured for use with ASMLib are listed as Candidate Disks.  Select each disk you wish to include in the disk group.
  •     Click on Next
8.    Summary
  •     A summary of the products being installed is presented.
  •     Click on Install.
9.    Execute Configuration Scripts
  •     At the end of the installation, a pop up window will appear indicating scripts that need to be run as root.  Login as root and run the indicated scripts.
  •     Click on OK when finished.
10.    Configuration Assistants
  •     The Oracle Net, Oracle Database, and iSQL*Plus configuration assistants will run automatically
11.    End of Installation
  •     Make note of the URLs presented in the summary, and click on Exit when ready.
12.    Congratulations! Your new Oracle ASM Instance is up and ready for use.
 
Create the Database
Once the ASM instance has been created, create a database that uses ASM for storage:
Log in as oracle and start runInstaller:
$ ./runInstaller
1.    Select Installation Method
o    Select Advanced Installation
o    Click on Next
2.    Select Installation Type
o    Select Enterprise Edition
o    Click on Next
3.    Specify Home Details
o    Name:   OraDb10g
o    Path:      /u01/app/oracle/product/10.2.0/db
Note:Oracle recommends using a different ORACLE_HOME for the database than the ORACLE_HOME used for ASM.
o    Click on Next
4.    Product-specific Prerequisite Checks
o    If you've been following the steps in this guide, all the checks should pass without difficulty. If one or more checks fail, correct the problem before proceeding.
o    Click on Next
5.    Select Configuration Option
o    Select Create a Database
o    Click on Next
6.    Select Database Configuration
o    Select General Purpose
o    Click on Next
7.    Specify Database Configuration Options
o    Database Naming:  Enter the Global Database Name and SID
o    Database Character Set:  Accept the default
o    Database Examples:  Select Create database with sample schemas
o    Click on Next
8.    Select Database Management Option
o    Select Use Database Control for Database Management
o    Click on Next
9.    Specify Database Storage Option
o    Select Automatic Storage Management (ASM)
o    Click on Next
10.    Specify Backup and Recovery Options
o    Select Do not enable Automated backups
o    Click on Next
11.    Select ASM Disk Group
o    Select the DATA disk group created in the previous section
o    Click on Next
12.    Specify Database Schema Passwords
o    Select Use the same password for all the accounts
o    Enter the password and confirm
o    Click on Next
13.    Summary
o    A summary of the products being installed is presented.
o    Click on Install.
14.    Configuration Assistants
o    The Oracle Net, Oracle Database, and iSQL*Plus configuration assistants will run automatically
15.    Execute Configuration Scripts
o    At the end of the installation, a pop up window will appear indicating scripts that need to be run as root.  Login as root and run the indicated scripts.
o    Click on OK when finished.
16.    End of Installation
o    Make note of the URLs presented in the summary, and click on Exit when ready.
17.    Congratulations! Your new Oracle Database is up and ready for use.

Note : In between the installation , You might be asked to start CSS Deamon , if you havent already done
To start the CSS daemon and configure the host to always start the daemon upon reboot, do the following:

   1.      Log in to the host as root.
   2.      Ensure that $ORACLE_HOME/bin is in your PATH environment variable.
3.    Enter the following command:  localconfig add

Start the ASM instance:
$ export ORACLE_SID=+ASM
$ sqlplus "/ as sysdba"

SQL*Plus: Release 10.2.0.1.0 - Production on Sun Sep 3 00:28:09 2006
Copyright (c) 1982, 2005, Oracle.  All rights reserved.
Connected to an idle instance.
SQL> startup
ASM instance started
Total System Global Area   83886080 bytes
Fixed Size                  1217836 bytes
Variable Size              57502420 bytes
ASM Cache                  25165824 bytes
ASM diskgroups mounted

SQL> select group_number,disk_number,name,state,mode_status,mount_status,total_mb, from v$asm_disk;

G# D# NAME  STATE    MODE_ST MOUNT_S   TOTAL_MB   
---- ---------- ----------
 1  0 ASM1 NORMAL   ONLINE  CACHED        2000       
 1  1 ASM2 NORMAL   ONLINE  CACHED        2000       
 1  2 ASM3 NORMAL   ONLINE  CACHED        2000       
 1  3 ASM4 NORMAL   ONLINE  CACHED        2000       
 1  4 ASM5 NORMAL   ONLINE  CACHED        2000       
 2  0 ASM6 NORMAL   ONLINE  CACHED        2000       
 2  1 ASM7 NORMAL   ONLINE  CACHED        1000       

You can get most of the ASM details & implementation details from OTN here : http://www.oracle.com/technology/asm/index.html


Rman Backup scripts

Backup a complete database:

(If the target database is in archive mode, this can be done while the database is open)





RMAN>


run {                                      

# backup complete database to disk            

allocate channel c1 type disk;                

backup full                                   

tag full_db                                   

format '/usr1/ora817/test/rman/db_d.dmp'

(database);                                   

release channel c1;                           

}                                             



You can create a script and use it multiple times, so each time you
don't need to type the above script. Just make sure to drop the old
backup files.



RMAN>

create script full_db_backup {            

allocate channel c1 type disk;            

backup full database                      

format '/usr1/ora817/test/rman/db_%d.dmp';

release channel c1;                       

}                                         



This is how you run the script:



RMAN>

run { execute script full_backup ;}    





Archive logs too can be backed up along with the database in one script:



RMAN>

create script full_db_arc_backup {            

allocate channel c1 type disk;                                            

backup full database                                                      

format '/usr1/ora817/test/rman/db_%d.dmp';                                

release channel c1;                                                      

allocate channel c2 type disk format '/usr1/ora817/test/rman/arc_%d.dmp';

backup (archivelog all delete input);                                     

release channel c2;                                                       

}                                                                         



- '%d' puts database name in the backup file name.

- 'all delete input' in above script deletes all the archive logs once the backup is   

   complete, thus frees up the space.



RMAN>

run { execute script full_db_arc_backup ;}    


Recovery Scenarios Part -1

I am covering some of the basic recovery recovery scenarios via RMAN in below , this will be a 2 part series  :

Part 1:Database open, datafile deleted
Recovery Scenarios:

Note: If the database is opened with resetlogs, it is necessary to register the new incarnation of the database in the Recovery Catalog with the RESET DATABASE command.

(A) Database open, datafile deleted:

(a) Datafile recovery:

Find the datafile # and tablespace name by querying v$datafile table.

RMAN>
run {
allocate channel dev1 type disk;
sql "alter tablespace users offline immediate";
restore datafile 4;
recover datafile 4;
sql "alter tablespace users online";
release channel dev1;
}

 (b) Tablespace recovery:

RMAN>
run {
allocate channel dev1 type disk;
sql "alter tablespace users offline immediate";
restore tablespace users;
recover tablespace users;
sql "alter tablespace users online";
release channel dev1;
}
(c) SYSTEM Tablespace recovery:

Note: If it is the system tablespace datafiles to be restored, the database must be closed. It is not possible to offline the system tablespace.
SVRMGRL> shutdown immediate;
SVRMGRL> STARTUP MOUNT;

RMAN>
run {
allocate channel c1 type disk;
restore tablespace SYSTEM;
recover database;
sql "alter database open resetlogs";
release channel c1;
}
RMAN> Reset database;
(This command NOT allowed if you are NOT using Recovery Catalog)

Will post some more .............stay tunned ........

Recovery Scenarios Part-2

Part 2 for the recovery scenarios

B) Lost control File or Media Failure:
      (Disk lost with all the files w/o SYSTEM tablespace)

SVRMGRL> shutdown abort;
SVRMGRL> STARTUP NOMOUNT;

RMAN>
run {
allocate channel c1 type disk;
restore controlfile to '/usr1/ora817/test/dbs/control01.ctl';
replicate controlfile from '/usr1/ora817/test/dbs/control01.ctl';
restore database;
sql "alter database mount";
recover database;
sql "alter database open resetlogs";
release channel c1;
}
RMAN> Reset database

(C) Table recovery: (Incomplete recovery)

This
happens when some one drops table by mistake, and by the time he/she
informs the DBA, other people are still working on the database. So the
DBA has to recover the database until time when the table was dropped.
That causes other people to re-work from that point onwards, and hence
it is an "Incomplete recovery"

When something like this happens, try to find out the exact time of accident.

SVRMGRL> shutdown immediate;
SVRMGRL> STARTUP MOUNT;

RMAN>
run {                                 
allocate channel c1 type disk;           
set until time "to_date('2004-01-16:13:17:00','YYYY-MM-DD:HH24:MI:SS')";  
restore database;                        
recover database;                        
sql "alter database open resetlogs";     
}  
RMAN> Reset database
 
 

(D) If both the ACTIVE redolog files are gone:

SVRMGRL> startup nomount;

RMAN>
run {
allocate channel c1 type disk;
set until logseq=7 thread=1;
restore controlfile to '/usr1/ora817/test/dbs/control01.ctl';
replicate controlfile from '/usr1/ora817/test/dbs/control01.ctl';
restore database;
sql "alter database mount";
recover database;
sql "alter database open resetlogs";
release channel c1;
}

If for some reason this attempt fails,

SVRMGRL> alter database mount;  (equivalent of startup mount;)
SVRMGRL> alter database drop logfile group 2;  (optional)
SVRMGRL> recover database using backup controlfile until cancel;  

(Recover to the point till you have good archivelogs, and then Type CANCEL at the prompt)
 
SVRMGRL> alter database open resetlogs;

RMAN> Reset database

Run the following script to find out the status of backup process:

alter session set NLS_DATE_FORMAT = 'MM/DD/YY (HH:MIAM)';

col start_time format a20 heading "Backup of this|Database started at"
col a format 999.99 heading "% Complete|so far"
col b format a20 heading "Time taken so far|for this backup"

select start_time,round(sofar/totalwork*100,2) a ,
mod(floor((sysdate-start_time)*24),24)||'
Hrs and
'||floor(((mod(round((sysdate-start_time)*24,2),24))-(mod(floor((sysdate-start_time)*24),24)))*60)||'
Mins' as b
from v$session_longops
 where substr(opname,1,4)='RMAN'
 and (round(sofar/totalwork*100,2))<100
 and (round(sofar/totalwork*100,2))>0
 and totalwork !=0;
-- -----------------------------------------

Get Ready for Oracle Database 11g -July 11th 2007

The Countdown Has Begun to July 11, 2007, when 11g DB will be here :)
Its much awaited release as it has some new feature improvements in high availability, performance, scalability, manageability and diagnosability.

http://www.oracle.com/webapps/events/EventsDetail.jsp?p_eventId=66665


Administring OCR

Administring OCR
We will see how OCR(Oracle cluster Registry) backup & recovery is done .

Backup
Oracle clusterware automatically creastes a OCR backup every 4 hrs & retains the last 3 backups . Actually the CRSD process creates & manages the backup for each full day & a weekly backup at nd of the week .
Default backup Location : $CRS_HOME/cdata/$clustername

Other than the automated backup , you can export the content any time you want to a file .
eg : $ ocrconfig -export emergency_export.ocr

You can see the list of ocrbackup by using :
$ ocrconfig -showbackup

As the backup directory is default , you can change the dir by using below command
$  ocrconfig -backuploc <directory>

Restore
OCR can be restored (if you have a backup ) be below command

NOTE: Should you need to restore, make sure all CRS daemons on all nodes are stopped.

To perform a restore, execute the command:

$ cd CRS_Home/cdata/crscluster
$ ocrconfig -restore  week.ocr

If you had exported using the above command & want to resore , then you can use import
IMPORTANT: Importing a backup when CRS daemons are running will only corrupt OCR.  

$ ocrconfig -import emergency_export.ocr

If anything is wrong than you can use the OCRDUMP comand to dump all info to a file & check
$ ocrdump OCR_DUMP

Also you can use :

$ ocrcheck 
to check for the stats of OCR

Backing Up and Recovering Voting Disks

Backing Up and Recovering Voting Disks

What is a voting disk & why its needed ?
The voting disk records node membership information. A node must be
able to access more than half of the voting disks at any time.

For example, if you have seven voting disks configured, then a node must
be able to access at least four of the voting disks at any time. If a
node cannot access the minimum required number of voting disks it is evicted, or removed, from the cluster.

Backing Up Voting Disks

When to backup voting disk ?

  1.       After installation
  2.       After adding nodes to or deleting nodes from the cluster
  3.       After performing voting disk add or delete operations

To make a backup copy of the voting disk, use the Linux dd command. Perform this operation on every voting disk as needed where voting_disk_name is the name of the active voting disk and backup_file_name is the name of the file to which you want to back up the voting disk contents:
dd if=voting_disk_name of=backup_file_name

If your voting disk is stored on a raw device, use the device name in place of voting_disk_name. For example:
dd if=/dev/sdd1 of=/tmp/voting.dmp

Note : When you use the dd command for making backups of the voting disk, the backup can be performed while the Cluster Ready Services (CRS) process is active; you do not need to stop the crsd.bin process before taking a backup of the voting disk.

Recovering Voting Disks

If a voting disk is damaged, and no longer usable by Oracle Clusterware, you can recover the voting disk if you have a backup file.

dd if=backup_file_name of=voting_disk_name

11g whitepapers @ OTN

I have seen couple of good technical whitepapers at otn , below is the link to the same .
These cover the complete series for new features , security , HA etc

http://www.oracle.com/technology/products/database/oracle11g/index.html

11g , get -set - go !!!!

11g for linux is available for download @OTN from here.
Read all abt the new features for HA , Db Replay   etc from http://www.oracle.com/technology/products/database/oracle11g/index.html


Installing Apex 3.0.1

I have been using Apex extensively now , have created 3-4 application for production usage & i can finally say that its easy to use for us non developers also ;)

I will be covering the installation of Apex 3.0.1 in this post & will cover the SSO part in next .

Software Req:

  1. Download Apex 3.0.1 from here
  2. 10g Db
  3. Http server
In short , the process of Installing & configuring apex goes like this :
Install 10g Db --> Install Http server (i used 10g AS) -->Install Apex

Starting the Apex Installation
I assume you have 10g Db installed , else read this post for details .

You need to create 2 table space , i created  apex1 & apex2 to seed the apex data :

create tablespace apex1 datafile '/apexdb/apex1.dbf' size 50M autoextend on next 10M maxsize 300M;

create tablespace apex2 datafile '/apexdb/apex2.dbf' size 50M autoextend on next 10M maxsize 300M;

Now we will seed the db with Apex configs .
Download Apex 3.0.1 from here & unzip it .

This will craete a subdirectory with name apex , cd into it & start sqlplus as sysdba & run apexins.sql as shown below.
cd apex

sqlplus system@tns_alias as sysdba
@apexins.sql {pass} {ts for user} {ts for files} {ts for temp} /i/

Where

pass - Password for Apex Super User
ts for user - Tablespace for User data (Created above)
ts for files - Tablespace for Apex files (Created above)
ts for temp - temporary tablespace (Usually Temp)
i - is the alias for image directory configuration in Application Server (Apache httpd.conf)

According to our config above , i used :

Sqlplus > @apexins.sql welcome apex1 apex2 temp /i/

It Takes ard 1 hr to get the seed data .

After this is complete , we go to the HTTP server location to configure Apex with it . AS we have the Oracle 10g AS installed we go to $ORACLE_HOME/Apache/modplsql/conf directory .

There in dads.conf we add the below lines :

#######
Alias /i/ "/apex/images/"  (replace with your image location)

AddType text/xml xbl
AddType text/x-component htc
<Location /pls/apex>
Order deny,allow
PlsqlDocumentPath docs
AllowOverride None
PlsqlDocumentProcedure wwv_flow_file_mgr.process_download
PlsqlDatabaseConnectString host:port:service_name ServiceNameFormat
PlsqlNLSLanguage AMERICAN_AMERICA.AL32UTF8
PlsqlAuthenticationMode Basic
SetHandler pls_handler
PlsqlDocumentTablename wwv_flow_file_objects$
PlsqlDatabaseUsername APEX_PUBLIC_USER
PlsqlDefaultPage apex
PlsqlDatabasePassword apex_public_user_password
Allow from all
</Location>
###################

For above replace according to your server & install locations , we did below :
PlsqlDatabaseConnectString xyz.com:1521:apexdb apexdb

Post Install
After this you need to restart the Appache server as shown below :

dcmctl updateconfig -ct ohs
opmnctl restartproc ias-component=HTTP_Server (Restart HTTP Server to check it)
ou are all set to use the Apex , try http://hostname.domainname:port/pls/apex

I will be writing on how to configure sso in next post

Configure SSO(single sign-on) with Apex

I am loving the experience with Apex , we plan to have couple of new application using APEX , for that i neeed to configure SSO with apex .

It can be done in 3 steps :

  1. Creating partner app
  2. Installing sdk (You need to get sso sdk from midtier)
  3. Configuring apex for sso(You need to login a zip file from here)
For step 1 , you need below :
HOME URL : http: // apex_server_name/pls/apex
Success URL : http: // apex_server_name/pls/apex/wwv_flow_custom_auth_sso.process_success
Log Out URL : http: // apex_server_name/pls/apex/apex

Note : not covering the actual creation process , pls look at "Creating Partner App in AS admin guide"

For Step 2:
First unlock the flows schema according to the apex version you have .
SQL> alter user flows_030100 account unlock; (If your Apex version is 2.0.0.0.0 change acccordingly)

Now you need to copy sso sdk from the midtier , Login to Middle tier $ORACLE_HOME/sso/lib
copy ssosdk902.zip , unzip it . It creates some sql scripts & packages .

Login to db as user flows_030100 & run loadsdk.sql
SQL>@loadsdk.sql (Make sure you are executing under flows_XXXX)

Above will load the sso schema into flows account.

For Step 3:
Now we need to wire sso & apex schema(flows_xx)

SQL> @regapp.sql
It will prompt you for
Enter value for listener_token: HTML_DB:Hostname:7777
Enter value for site_id: enter_value_returned_while_registering_sso
Enter value for site_token: enter_value_returned_while_registering_sso
Enter value for login_url: http: // apex_url_here/pls/orasso/orasso.wwsso_app_admin.ls_login
Enter value for encryption_key: enter_value_returned_while_registering_sso
Enter value for ip_check: N

These above value you will get from Registring as partner app in step 1

Now configure authentication packages under flows_XXX schema
You need to login a zip file from here:
Unzip & get 2 files , execute as below

SQL> @custom_auth_sso.sql
SQL> @custom_auth_sso.plb

Finally you should lock flows_XXXX schema & grant execute permission to public user
SQL> alter user flows_020200 account unlock;
SQL> grant execute on wwv_flow_custom_auth_sso to APEX_PUBLIC_USER;

All set , once you use the authentication schema as sso , you can see the login page .

Applying CPU Patch on RAC using EM -A White paper

I wrote this paper to describes the process & benefits of applying patches using the EM.
Case : RAC - 3 node 10.2.0.3
Patch : CPU July 2007
Method : Rolling patch , zero downtime , using Deployment procedures in EM.

You can access the paper here on OTN.
or by copying the below url :
http://www.oracle.com/technology/products/oem/pdf/saving%20time%20and%20labor%20on%20oracle%20patching%20with%20em%20provisioning%20pack%20-%20a%20case%20study%20with%20oracle%20internal%20it.pdf

Other interesting white papers on EM are also listed here .