Learning Oracle with Oracle VM VirtualBox Whitepaper

  • 12,509 views
Uploaded on

 

More in: Technology
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
    Be the first to like this
No Downloads

Views

Total Views
12,509
On Slideshare
0
From Embeds
0
Number of Embeds
4

Actions

Shares
Downloads
381
Comments
0
Likes
0

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. Database, Development LEARNING ORACLE WITH ORACLE VM VIRTUALBOX Leighton L. Nelson, MercyTable of ContentsINTRODUCTION .........................................................................................................................................................2VIRTUALIZATION AND VIRTUALBOX ...........................................................................................................................2 GETTING STARTED.................................................................................................................................................................... 4USE CASES .................................................................................................................................................................4OTN DATABASE APP DEVELOPMENT PRE-BUILT VM SETUP .........................................................................................6BUILD YOUR OWN VIRTUALBOX APPLIANCE ............................................................................................................. 17LEARNING RESOURCES ............................................................................................................................................. 26 THE ORACLE LEARNING LIBRARY ............................................................................................................................................... 26GETTING THE MOST OUT OF VIRTUALBOX ................................................................................................................ 27CONCLUSION ........................................................................................................................................................... 28ADDITIONAL RESOURCES ......................................................................................................................................... 29ACKNOWLEDGEMENTS ............................................................................................................................................ 29 1 Session #374
  • 2. Database, DevelopmentINTRODUCTIONHave you ever heard or read about a new technology that you had to see work for yourself? Or maybe you learned some newprogramming technique and you wanted to practice. We sometimes just need to “kick the tires” on a new technology to getfamiliar with it. The problem is that it usually requires some basic infrastructure. Your desktop or laptop computer is usuallyrunning only a single operating system – typically Windows or Mac OS X. You‟ve become quite efficient at using it and haveno plans for spending additional money on buying one just to create a sandbox environment. In addition, dual booting, whichinvolves creating a second operating system on your hard drive by partitioning and using a boot loader1 to select which one toboot into, is not fool-proof and can sometimes lead to loss of data. A virtualized environment is a cost-effective and simplemethod to accomplish this.VirtualBox makes it easy (and inexpensive) to create cross-platform sandbox environments for testing, development and as aneducational tool. Developers, systems and database administrators can benefit from the ability to provision and distribute pre-packaged VirtualBox images or appliances. Oracle Technology Network also provides pre-configured Oracle environment forits OTN Developer Day Hands-On workshops, consisting of up-to-date versions of Oracle Enterprise Linux 5, OracleDatabase 11gR2, Oracle Apex, SQL Developer and others.VIRTUALIZATION AND VIRTUALBOXVirtualBox is robust virtualization software that runs on top of an existing host operating system. It supports a large numberof guests including the latest version of Windows 7, RHEL 6, Solaris 11, Ubuntu 11.10 and Mac OS X Server 10.7. Previously,if you wanted to try another operating system, you would have to use either a separate physical machine or dual-boot (ortriple-boot) your computer. Switching to another operating system would require restarting your machine each time. This wasnot a very efficient way to use multiple operating systems. Virtualization provides the ability to run multiple operating systemssimultaneously without rebooting or modifying your existing operating system.Figure 1 (Courtesy of Ginny Henningsen) displays the high level Oracle VM VirtualBox architecture.1 Grub boot loader is the default for many Linux operating systems. 2 Session #374
  • 3. Database, Development Figure 1 . Host Platforms and Guest Operating EnvironmentsVirtualBox is an open-source, cross-platform virtualization software that runs on Windows, Linux, Mac OS X and Solaris.This makes it ideal for getting systems that don‟t run natively on one platform to run on your computer. For example, Oracle11g XE runs on Windows and Linux operating systems. If you use a Mac then you can install VirtualBox and then run Oracle 3 Session #374
  • 4. Database, Development11g XE on an Oracle Linux or Windows VM . This will then allow you to connect to your database using your native desktopclients such as SQL Developer using various techniques, which will be described later in this paper.The instructions in this whitepaper are based on Mac OS X. Instructions for other platforms should be similar. Please read theVirtualBox User Manual for platform specific commands.GETTING STARTEDFirst you need to download the VirtualBox installation package for your platform. This can be downloaded from thevirtualbox.org or Oracle Technology Network. VirtualBox requires a computer with at least 512MB of RAM. However, ifyou‟re planning on running something like Oracle database then a minimum of 2GB is recommended. You should also haveenough hard disk space to store your VM guest operating system as well as data for your applications. Nearly every moderncomputer is built with a CPU2 fast enough to handle VirtualBox. Read the VirtualBox User Manual for the installationinstructions for your platform.USE CASES“Why using Oracle VM VirtualBox makes my inner geek go genuinely giddy.” – Ginny Henningsen,Today, virtualization has become quite predominant within the enterprise. Likewise, desktop virtualization has becomeincreasingly popular. Developers can use the technology to develop code on different platforms. Programming languages suchas Java make this even easier to accomplish due to its cross-platform nature. Oracle developers can also test code running ondifferent versions of the database. System administrators can test installation procedures for different types and versions ofoperating systems such as Oracle Linux and Solaris. They are also able to learn about new operating system features bycreating a personal sandbox environment. Database administrators can also test installation and creation of Oracle databaseserver using different versions of the database on different platforms much more quickly than they would in a physicalenvironment.OTN PRE-BUILT APPLIANCESVirtualBox lends itself as an excellent education tool. Oracle Technology Network has provided several pre-built VirtualBoximages or appliances that contain complete stacks of pre-configured Oracle software. Currently there are nine pre-built imagesavailable from the OTN download page. The current list of pre-built VMs is below. Name ContentsDatabase App Development VM Oracle Linux 5 Oracle Database 11g Release 2 Enterprise Edition Oracle TimesTen In-Memory Database Cache Oracle XML DB Oracle SQL Developer Oracle SQL Developer Data Modeler Oracle Application Express 4.1 Oracle JDeveloper Video chats with engineers and expertsEnterprise Java Development VM Oracle Linux 5, JDK 1.6 + Oracle WebLogic Server 12.1.12 VirtualBox only runs on x86 platforms. Intel/AMD 4 Session #374
  • 5. Database, Development Oracle Coherence 3.7 Oracle TopLink 12.1.1 Hudson 2.2 Subversion 1.4.2 Maven 3.0.1 NetBeans IDE 7.1 RC2 Oracle Enterprise Pack for Eclipse 12.1.1 / Eclipse 3.7 Easter Egg: Bonus introductory labs for Coherence 3.7Oracle VM Manager 3.0 VM Oracle Linux 5 update 7 with the Unbreakable Enterprise Kernel (2.6.32) Oracle VM Manager 3.0.3 demo installation Oracle WebLogic Server 10.3 Oracle Database 11g Express EditionSolaris 11 Admin VM Oracle Solaris 11 11/11Oracle WebCenter Portal Framework 11g Hands-on VM Oracle Linux 5 Oracle XE Universal Database 10.2.0.1 Oracle WebLogic Server 10.3.4.0 Oracle WebCenter Portal Framework 11gR1 PS3 (11.1.1.4.0) Oracle JDeveloper 11.1.1.4 Oracle WebCenter Extension for JDeveloper (11.1.1.4.0)Oracle Tuxedo Web Application Server Demo V Oracle Linux 5.6 Oracle Tuxedo 11gR1 PS1 1 1(1.1.1.2.0) Oracle SALT 11gR1 (11.1.1.2.2) Oracle TSAM 11gR1 (11.1.1.2.0) Oracle Database XE 10.2 PHP 5.3.6, xDebug extension Apache HTTP Server 2.2.17 NetBeans PHP IDE 7.0 Beta JDK 1.6 +Oracle Business Intelligence Enterprise Edition Plus VM Oracle Database 11g Release 2 Oracle TimesTen Essbase Server Access Provisioning Services OBIEE 11.1.1.5 with BI Composer configured SampleApp 10722 Oracle JDev Oracle SQL Developer Oracle Internet DirectorySOA & BPM Development VM Oracle Linux 5 Oracle Database XE 10.2 Oracle WebLogic Server 10.3.3.0 Oracle SOA Suite 11g R1 PS2 Oracle BPM Suite 11g R1 PS2 (with bundle patch #1) Oracle BAM 11g R1 PS2 5 Session #374
  • 6. Database, Development Oracle B2B 11g R1 PS2 Oracle JDeveloper 11.1.1.3Enterprise PHP Development VM Oracle Linux 5.7(Provided and supported by Zend) Zend Server 5.5 Oracle Database XE 11.2OTN has also included hands-on labs and tutorials for some of the VirtualBox images. These labs are also used as part of theOTN Virtual Developer Day series of webinars. The OTN Virtual Developer day for Database for example, is a half-dayonline training class consisting several tracks including – Java, Database, APEX and .NET.OTN DATABASE APP DEVELOPMENT PRE-BUILT VM SETUPGo to http://www.oracle.com/technetwork/database/enterprise-edition/databaseappdev-vm-161299.html to download thePre-Built Developer VMReview the requirements and download the Oracle Developer Day ova file. The OVA is an archived format, which includesboth the virtual disks and meta-data for the VM. 6 Session #374
  • 7. Database, DevelopmentAfter you have downloaded the file you need to import it using VirtualBox, you can use either the VirtualBox Manager ImportAppliance Wizard or the command line. However, we will use the former for this demonstration.Choose File->Import Appliance 7 Session #374
  • 8. Database, DevelopmentNavigate to the directory where you downloaded and saved the archive. Select the file and click Open. 8 Session #374
  • 9. Database, DevelopmentClick the Continue in the button. 9 Session #374
  • 10. Database, DevelopmentYou can also modify the VM settings including RAM and CPU. The defaults work fine. Click on the Import button to begin. 10 Session #374
  • 11. Database, DevelopmentYou have to agree to the OTN license term agreement before you can begin importing the VM. 11 Session #374
  • 12. Database, DevelopmentThe import will begin 12 Session #374
  • 13. Database, DevelopmentAfter the Import has completed you will see the VM listed in the VM Manager. Click the green Start arrow to start up the VM. 13 Session #374
  • 14. Database, Development 14 Session #374
  • 15. Database, DevelopmentAfter the VM has booted you should see the screen shown below. Type „oracle‟ in the username field and then type „oracle‟ forthe password and press Enter/Return on your keyboard to log in.After successfully logging in you will see information about the available labs and as well the EM URL and IP addresses. Youare now ready to begin your labs. Click on the Start Here icon on the desktop to access the Hands-On Lab instructions 15 Session #374
  • 16. Database, DevelopmentTo get started click on the Start Here icon to launch the OTN Developer Days Hands-on Oracle Database 11g ApplicationDevelopment labs. Here you will see three tracks – Oracle Application Express, Database and Java. 16 Session #374
  • 17. Database, DevelopmentBUILD YOUR OWN VIRTUALBOX APPLIANCEIf you cannot find a suitable VirtualBox image or you would like to build your own appliance for getting hands-on experiencewith the installation process, then there are a few extra steps you should take.Figure 2 below (Courtesy of Ginny Henningsen) shows a configuration involving three VMs, running different versions ofOracle Linux on a Solaris host. The VMs contain Oracle Database 10g and Oracle Database 11g. It‟s possible to build justabout any configuration of supported Oracle stack (given enough resources) with VirtualBox. 17 Session #374
  • 18. Database, DevelopmentFigure 2Here I will demonstrate how to create a new VM from the VirtualBox Manager GUI.First you need to create a new VM. Click New. 18 Session #374
  • 19. Database, DevelopmentThe New VM Wizard will appear. Click Continue. 19 Session #374
  • 20. Database, DevelopmentType a name for your VM and select an OS type. 20 Session #374
  • 21. Database, DevelopmentChoose the amount of memory available you want to allocate to your VM. Remember to allocate enough memory to run theguest VM without causing performance problems on your host. Click Continue.Choose where or not to create a new hard disk or use an existing one. By default it will allow the disk to be a Start-up Disk. Ifusing an existing disk it must not currently be attached to an existing VM. Click Continue. 21 Session #374
  • 22. Database, DevelopmentSelect the format of virtual disk image file to create. VDI is the default format used by VirtualBox. VMDK is used by VMwarewhile VHD and HDD are Microsoft and Parallels specific image file formats. 22 Session #374
  • 23. Database, DevelopmentChoose whether you prefer a use a dynamically allocated or fixed size disk. A dynamically allocated disk will grow as data iswritten to it, while a fixed size disk will pre-allocate its space specified in the next screen. Dynamic disks are suitable for typicalVMs.Choose a location and size for the virtual disk image file. For a dynamic image file this will be the maximum its maximum size. 23 Session #374
  • 24. Database, DevelopmentThe Summary screen will then be displayed. You will have a chance to review the settings before creating the VM. If anythingneeds to be changed you can go back and make changes.Your new VM will now appear in the VirtualBox Manager. 24 Session #374
  • 25. Database, DevelopmentNow that your VM is created you can proceed to install your Operating System and Oracle software desired. For this Irecommend taking a look at some of the tutorials on the Oracle Learning Library, which will be explored further below. RAC Attack on Virtualbox The popular hands-on lab (which originated at Collaborate) for building Oracle Real Application Clusters on your PC called “RAC Attack” has been enhanced to include VirtualBox. This was originally created using VMware but there are many users who already use VirtualBox as a desktop virtualization solution. 25 Session #374
  • 26. Database, DevelopmentLEARNING RESOURCESTHE ORACLE LEARNING LIBRARYThe Oracle Learning Library is an APEX application and provides a comprehensive repository of learning resources foralmost every product available in the Oracle stack. You can search the library by product family, product, release, content typeetc.Content type currently available includes the following: Tutorials Demos Videos White paper e-Course Blog 26 Session #374
  • 27. Database, DevelopmentGETTING THE MOST OUT OF VIRTUALBOXNETWORKINGVirtualBox Supports several networking modes including:- Network Address Translation (NAT) Host-Only Networking Bridged Networking Internal NetworkingDifferent modes can be used with the same guest VM depending on what you would like to accomplish. For example, youcould set up an Internal Networking mode to simulate RAC Clusters interconnect. At the same time you can setup BridgedNetworking so that you can communicate with your guest VM simulating a public network.For details on the different networking modes please consult the User Manual.ACCESSING YOUR VM DATABASES FROM YOUR HOST MACHINEIf you need to access your databases within your network using a native tool such as SQL Developer then you have severalmethods of doing so.NAT Port Forwarding allows you to access your databases or other services within the VM as if they were running directly onyour desktop. The following is an example of how to setup port forwarding using the command line utility VBoxManage. Thedefault listener port (1521) is forwarded to the VM so that you can use native tools such as SQL Developer and SQL*Plus toaccess your databases on you VM.iMac:~ User$ VBoxManage modifyvm "Oracle Developer Days" --natpf1"tns,tcp,127.0.0.1,1521,,1521"You can also access your databases in your VM using Bridged-Networking. See details about bridged networking in theVirtualBox User Manual.SNAPSHOTSSnapshots allow you to take a point in time image of your VM. When a snapshot is taken it makes the base virtual disks read-only. New changes are written to a new snapshot delta file. Deleting a snapshot removes the delta images. It makes it reallyconvenient to test changes within your VM. You can take a snapshot just before you make your change and revert to it ifsomething goes wrong or to compare the results of different changes. Using snapshots, you cannot only revert changes, butyou can also roll forward those changes.I recommend using snapshots sparingly i.e. no more than 2 or 3 children for a parent image. This can cause performanceissues since VirtualBox has to search all children for the correct snapshot image when doing read operations. Snapshots alsocan grow over time and consume a lot of space.CLONINGOnce you have created a VirtualBox VM that you are satisfied with, you can then clone it to produce similar guest VMs. Theclone can either be registered on the same host or copied to another computer.Cloning can be done either using the command line or the VM Manager GUI.Example.VBoxManage clonevm OraDev1 --mode all --options keepdisknames --name OraDev2 --basefolder/Volumes/MyDrive/Virtualbox/ --register 27 Session #374
  • 28. Database, Development0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%Machine has been successfully cloned as "OraDev2"GUEST ADDITIONS AND SHARED FOLDERSThe Guest Additions provides additional functionality to guest VMs such as automatic mouse capture, better graphics, seamlesswindows, shared folders and general performance improvements.Shared Folders allow you to access files on your host computer from within your VirtualBox guest. To enable this feature youhave to first install Guest Additions in your VM.EXTENSION PACKSExtension packs takes advantage of the modularity of VirtualBox by providing additional features to its already rich feature set.Oracle‟s extension pack adds support for USB 2.0 and Virtual Remote Desktop Protocol (VRDP)VBOXHEADLESSThe VBoxHeadless command-line interface allows a VM to run on a host without displaying a graphical user interface. This isuseful in a server environment, which does not require a display.CONCLUSIONWe have seen how Oracle VM VirtualBox enables us to quickly provision a fully provisioned Oracle VM appliance completewith software from the Oracle stack. These appliances can then be used for educational and learning purposes for systemsadministrators, database administrators and developers. While Oracle Technology Network has done most of the work inbuilding these appliances, we are also able to build our own custom software environments complete with Oracle Linux orSolaris and Database 11gR2 or XE to get hands-on with the installation process.Oracle has also provided a complete library of learning resources through the Oracle Learning Library portal with videos,demos, tutorials and e-Courses to help users get the most out of their learning experience with Oracle technology.Oracle VM VirtualBox makes this all possible on a single computer without rebooting or partitioning. Run multiple OSesconcurrently and enjoy all the goodness that VirtualBox has to offer – for free. 28 Session #374
  • 29. Database, DevelopmentADDITIONAL RESOURCESOracle VM VirtualBox User Manual: http://www.virtualbox.org/manual/UserManual.htmlOracle VM VirtualBox documentation library: http://www.virtualbox.org/wiki/DocumentationOracle VM VirtualBox forums: http://forums.virtualbox.orgComputer In Your Computer: How to Use VirtualBox: http://www.makeuseof.com/pages/how-to-use-virtualbox"Fat Bloke Sings" blog: http://blogs.oracle.com/fatblokeOracle Learning Library: http://apex.oracle.com/pls/apex/f?p=44785:1RAC Attack Lab Handbook: http://en.wikibooks.org/wiki/RAC_Attack_-_Oracle_Cluster_Database_at_HomeACKNOWLEDGEMENTSKris Rice – Sr. Director Database Tools, OracleGinny Henningsen - My New Favorite Tool: Oracle VM VirtualBoxhttp://www.oracle.com/technetwork/articles/servers-storage-admin/vmlove-1368887.html 29 Session #374