July 2, 2008

A New Blog Server

If you've received all my blogs again in your blog reader, apologies, but we've just gone through a migration of our underlying blog server. I think all my blog entries are now hunky-dory, so no further interruption to the scheduled programming should occur. You shouldn't need to do anything at your end, but if you do, please leave me a comment so I can let others know.

As we've now completed the blog server migration, I can get back to writing my Oracle VM blogs, so stay tuned.

Alison

May 29, 2008

Connecting to the Oracle VM Server Guest Virtual Machine

So now you have a guest virtual machine running on Oracle VM Server. You want to connect to it of course. As I've not yet introduced Oracle VM Manager to this scenario, I'll not talk about connecting to it from there just yet, though this is probably the easiest way. So my next blog will be devoted to Oracle VM Manager.

There are many ways to connect to the guest virtual machine. Here I'll show you how to do it using VNC. Before you connect to it,  you'll need to find the VNC port used by the domain. On the Oracle VM Server, run:

# xm list -l |more

In the output, look for the device vfb and the location entry in that section. It will be something similar to:

location 0.0.0.0.:5900

The last part of that string is the VNC port you can use to connect to the guest. From another host, use VNC to connect to the guest:

# vnc -Shared 192.168.2.21:5900

The -Shared flag allows others to connect to the port as well as yourself. The IP address is the IP address of the Oracle VM Server. If all goes well, you'll see a command shell login. Log in using the default template login root/ovsroot.

If you used an Oracle Database template when you created the guest, here's how to log in to the database with SQL*Plus (the Oracle Database command-line tool):

Once you're logged in to the guest as root, su as the oracle user (oracle/oracle):

su oracle

Start SQL*Plus:

$ORACLE_HOME/bin/sqlplus /nolog

The $ORACLE_HOME environment variable is already set in the template to /u01/app/oracle/product/db10g, which is the location of the Oracle Database installation (the Oracle Home).

At the SQL*Plus prompt, log in as the SYSDBA user using operating system authentication:

SQL> connect / as sysdba

You are logged into SQL*Plus and connected to the Oracle Database with full database administration privileges.

Huzzah!

April 24, 2008

Creating a Guest Virtual Machine with Oracle VM Server

Now you've got Oracle VM Server and Oracle VM Manager installed, you'll obviously want to create a virtual machine. The easiest way is to use one of the preconfigured templates supplied by Oracle. In this example, I'm going to use an Oracle Enterprise Linux Release 5 Update 1 template that is hardware virtualized (fully virtualized) for an x86_64 bit platform.

You can use Oracle VM Manager to create guest virtual machines, but in this example I am going to use the Oracle VM Server command line tools. I'll write an example of creating a virtual machine using Oracle VM Manager in an upcoming blog.

At the end of this install, I will have a hardware virtualized guest (virtual machine) running Oracle Enterprise Linux Release 5 Update 1.

To start off, download the following template from OTN:

OVM_EL5U1_X86_64_HVM_4GB.tgz

There's a readme for these templates which gives more information that I give you here if you get stuck or want to know more.

You can put the template onto an FTP or HTTP server, and import it into Oracle VM Server from there, or, the easiest way for me at least, is to copy it onto a USB drive and mount the drive on the Oracle VM Server box. When you've plugged in the USB drive to your Oracle VM Server, find the mount point by entering:

# dmesg |tail

Look for an entry like:

sdb: sdb1

In this case, the mount point is "sdb1". Once you've worked out where the mount point is, make a directory to mount the USB drive:

# mkdir /mnt/exthdd

Now, use this entry to mount the USB drive with the command:

# mount /dev/sdb1 /mnt/exthdd

Copy the template to the /OVS/templates directory:

# cp /mnt/exthdd/OVM_EL5U1_X86_64_HVM_4BG.tgz /OVS/templates/

Uncompress the template:

# tar -xzf OVM_EL5U1_X86_64_HVM_4GB.tgz

Copy the directory and files that are created into /OVS/seed_pool:

# mkdir /OVS/seed_pool/OVM_EL5U1_X86_64_HVM_4GB
# cp /OVS/templates/OVM_EL5U1_X86_64_HVM_4GB/* /OVS/seed_pool/OVM_EL5U1_X86_64_HVM_4GB/

Edit the /OVS/seed_pool/OVM_EL5U1_X86_64_HVM_4GB/vm.cfg file to make sure it is correct for your setup. Mostly this is just confirming the path to the vm.cfg file.

Create and start the virtual machine using the command:

# xm create /OVS/seed_pool/OVM_EL5U1_X86_64_HVM_4GB/vm.cfg

The virtual machine is created and started. You can see that the virtual machine is running with the xm list command. You should see dom0 and OVM_EL5U1_X86_64_HVM_4GB in the output.

# xm list

You can start and stop virtual machines using the xm command. If you want to shut down a domain, use the xm list command to get the domain ID, then use that to shut it down, for example

# xm shutdown 1

Coming next ... Connecting to the virtual machine.

April 11, 2008

Installing Oracle VM

This is the first of my Oracle VM blogs. I figured I'd start at the beginning. How to install it.

There's an Oracle VM Quick Start Guide that gives you a bit more information than I've given you here, but not quite as much as the install guides (links given later).


You'll need a machine that supports virtualization. Most newer machines support virtualization, but if you're using an older machine, you might need to use this as an excuse to go shopping. You'll also need at least 2GB RAM if you want to run more than one virtual machine at once. Oracle VM Server has it's own operating system, so it will wipe any existing data on your hard drive. Make sure you install this on a machine that you're happy to have wiped and dedicated to running your virtual machines.

So onto the install part. It's pretty easy. Very easy in fact.

Download the Oracle VM 2.1.1 ISO file.

You'll need both the Oracle VM Server and Oracle VM Manager ISO files:

Oracle VM Server 2.1.1     Part number V12540-01     315M
Oracle VM Manager 2.1.1 Part number V12499-01     534M

Use your favourite CD burner software and burn the Oracle VM Server ISO to a bootable CD.

Then burn the Oracle VM Manager ISO to a CD. This one doesn't need to be bootable.

You don't need to waste DVDs as both installs fit nicely onto a CD.
 
Boot your machine from the Oracle VM Server CD. Follow the prompts during login, and you're away. When the install has finished, log in as "root" with the password you set during the install. Oracle VM Server is installed and ready to go now.

Now, to install Oracle VM Manager. You'll need an Enterprise Linux (either Oracle's or RedHat's) installation. Yes, this needs to be on another machine, though it doesn't wipe out the data, and you can use a lower spec'd machine, any old machine that will handle Enterprise Linux.

Start up the operating system, and mount the CD. Run the installation script as "root":

# sh runInstaller.sh

Follow the prompts during the install and you're done. You can accept the defaults by hitting Enter. A lot of people seem to miss this so I thought it was worthy of pointing out.

If you want more detailed install info, you can get it in these books:

Oracle VM Server Installation Guide
Oracle VM Manager Installation Guide

Now you've got both the Oracle VM Server and Oracle VM Manager installed, you need to let Oracle VM Manager know about the Oracle VM Server.

Open the Oracle VM Manager interface in a web browser:

http://hostname:8888/OVS
Log in as "admin" with the password you set during the installation.

Create a Server Pool.

Add the Oracle VM Server to the Server Pool. You can set whether the Oracle VM Server acts as a Server Pool Master, a Utility Server, and a Virtual Machine Server. If you need to enter a login while doing this, use the "root" password for the Oracle VM Server.

The next blog entry will show you how to create a virtual machine with your newly installed setup.

Oracle VM

I've been a bit quiet recently. That's because I've been head-down, fingers flying across the keyboard, working on Oracle VM. That's Oracle's virtualization platform, which was released late last year. We've just released the first patch, so now we're up to version 2.1.1. We're positively pumping out product here.

In the coming days I'll be posting some blogs about how to install and use Oracle VM. I hope you find these useful. If there are any topics you want covered, leave me some feedback and I'll get something written for you.

Oh, and I'll be back on updating the Underground PHP and Oracle Manual shortly, so expect a new version soon.

Alison

September 19, 2007

I'm Still Here

For those of you wondering where I've gone, and where my blogs are lately, I just wanted to let you know I'm still here. I have been working on things I can't talk about just yet, so my blog has been quiet recently. Hang in there, I'll be back soon enough with lots of juicy info.

2008 PHP Quebec Call for Papers

The PHP Quebec Conference is happening in Montreal, Canada on 12-14 March 2008. They've put a call out for speakers willing to share their expertise with Canadian and United States PHP professionals.

The Conference features the PHPLab, where speakers and visitors will try to find solutions to actual business problems. The two days of technical talks will be dedicated to advanced software development techniques with PHP5 and PHP6, XML, web services, databases, etc.

Go check it out at http://conf.phpquebec.com



July 3, 2007

PHP RPMs for Oracle

Good news everyone. We've just released a set of RPMs for PHP which include OCI8 and the Oracle PDO driver, as well as many other PHP extensions. These are for development testing only, as Oracle doesn't support them. The RPMs are based on PHP 5.2.3.

You can download the PHP RPMs from the oss.oracle.com site.

To install them:

  1. As root, run:

    rpm -ivh php-common-5.2.3-1.i386.rpm 
    php-cli-5.2.3-1.i386.rpm php-5.2.3-1.i386.rpm

  2. To verify the PHP RPMs have been installed, run rpm -qa |grep php. You should see:


    php-common-5.2.3-1
    php-5.2.3-1
    php-cli-5.2.3-1

The php-oci8 package depends on Oracle's free Instant Client Basic package and on PHP's php-pdo package. To install the Oracle components:
  1. Download oracle-instantclient-basic-10.2.0.3-1.i386.rpm and install it with:


    rpm -ivh oracle-instantclient-basic-10.2.0.3-1.i386.rpm
  2. Install PHP's PDO extension with:


    rpm -ivh php-pdo-5.2.3-1.i386.rpm

  3. Install PHP's Oracle OCI8 and PDO_OCI extensions with:


    rpm -ivh php-oci8-5.2.3-1.i386.rpm 

You're done.

Alison

May 24, 2007

phpinfo() Not Displayed Correctly

Since I've started blogging about little idiosyncracies I've been experiencing in PHP, I've been getting feedback that you want more. Okay. I'll start adding little tid-bits that might help out someone out there. So here's one I found (again) today.

While testing the bug fix I mentioned in an blog entry last week, I found that trying to load the phpinfo() script caused my browser to try loading the file as an application. That is, it tried to download the file, rather than execute the script. This happened in Firefox and IE. For those not familiar with phpinfo(), it's a function that displays the setup of PHP, including loaded extensions, environment variables, PHP variables, and so on. Here's what you would use:

phpinfo.php

<?php
phpinfo();
?>
I'm getting side-tracked. You'll likely all know how to use this function, but that was for newbies.

So, if you try to load this script using localhost in the URL, your browser will not know how to deal with it, nor will PHP, so it strangely asks you what to do with it. This doesn't happen to my other PHP scripts. So, don't use:

http://localhost/phpinfo.php

Use

http://127.0.0.1/phpinfo.php

If this is far too simple a blog, let me know. I'll get back into the more unusual stuff.

Zend Core for Oracle 2.0 Released

Zend have just released a new version of Zend Core for Oracle. This is a prebuilt and tested stack of Apache, PHP and Oracle Instant Client. If you haven't used it before, you will like the easy setup. I promise.

Try this with an existing Oracle database install, or download and install Oracle Database XE, our free database.

Zend Core for Oracle is also supported with Oracle Enterprise Linux.

Zend Core for Oracle release 2.0 includes PHP 5.2.1, the refactored OCI8 driver, Oracle Instant Client, and an optional Apache HTTP Server 2.2.2.

Zend Core for Oracle is supported by Zend on the following operating systems: 

* Oracle Enterprise Linux 
* X86 running SLES9 or RHEL3 or RHEL4 
* X86 running Windows XP/2003/Vista 
* X86-64 running Windows Vista in 32bit mode 
* X86-64 running SLES9 or RHEL3 or RHEL4 
* pSeries running AIX 5.2 or 5.3 
* Sun Solaris Sparc 8, 9 10

The web servers that are supported are: 

* Apache 1.3.x (except on Windows Vista), Apache 2.x 
* Oracle HTTP Server 10.1.2.0.0 (on Linux and Windows x86) 
* Microsoft IIS 5, 6, 7

Zend Core for Oracle is supported (by Zend) against Oracle Database 10g and 9i. That means that you can have a fully supported stack of database, web server and PHP.

If you aren't sure how to use it, or want more information on install, configuration, and use, go and have a read of the Underground PHP and Oracle Manual. Yet another handy resource for all things PHP and Oracle. And another shameless plug from me.

Don't forget there are lots of articles, FAQs, downloads and links at the OTN PHP Developer Center.

About

Alison Holloway's mug shot

I'm a Senior Product Manager in the Linux Development group at Oracle. I work out of Melbourne, Australia (lucky me!).

I have been at Oracle for over 14 years. I've worked on products like PHP, SQL*Plus/iSQL*Plus, Oracle Power Objects, Oracle Book, and even some parts of the Oracle Applications stack. I've written and co-written a number of books, technical references and white papers for these products, and been active on OTN discussion groups for these products.

I mostly work on Oracle VM, Oracle's virtualization product. So this blog is now pretty much an Oracle VM blog, with the odd bit of PHP thrown in the mix for good measure.

Powered by
Movable Type and Oracle