accessing oracle 11 g on mac os (10.7.5) using oracle virtual box

Post on 14-Jun-2015

4.192 Views

Category:

Technology

2 Downloads

Preview:

Click to see full reader

DESCRIPTION

Accessing Oracle 11 g on Mac OS (10.7.5) using Oracle Virtual Box

TRANSCRIPT

Accessing Oracle 11 g on Mac OS (10.7.5) usingOracle Virtual Box

Author : Tejas Pillai (tpillai@gmail.com)

Problem:I am using Macbook Pro (OS­ Mac OS X 10.07 ­ Lion).I need Oracle Database 11g Release 2 Enterprise Edition fordevelopment/testing purpose at home.There is no packageavailable for Mac in Oracle 11 .Refer to Oracle site . Only Oracle Database10g Release 2 is officially supported.

http://www.oracle.com/technetwork/topics/macos/whatsnew/index.html

Solution: There is a way to solve the above problem :

1. Get Oracle VM VirtualBox as VM.2. Get Pre­built 11.2 Database VM3. Use Port forwarding to Connect from Host System ( Mac OS ) to VM

Host OS:

For setting up Virtual Machine (also called Guest Machine) follow the

steps 2 & 3.1. Get Oracle VM VirtualBox as VM.2. Get Pre-built 11.2 Database VMUse the below link to download the VM software as described in the “Blue“ text.http://www.oracle.com/technetwork/database/enterprise­edition/databaseappdev­vm­161299.html

Verify that you have met the required system requirements mentioned inthe above link.

Refer to “Setup Section “ described in above link

Step 1. Download and install Oracle VM VirtualBox on your host system.

Step 2. Download the files (the use of a download manager is highlyrecommended):

Oracle Developer Day.ova (4,345,710,592 bytes, md5sum:2754e276bf3469b17402ba253ce4f943)

It will take good amount of time to download the above software. You cancontinue once the donloadis complete.

< refer to below Screen shots for VM settings >

Step 3. Import your VM: File > Import Appliance to launch Appliance Import Wizard.Click Choose...to browse to the directory you re­assembled all the files in andselect the Oracle Developer Day.ova then click Next> to begin importing the virtualmachine. It will prompt you to agree to the appropriate developer licenses whileimporting. You will see 'Oracle Developer Days (Powered Off)' when it is finishedimporting.

VM Settings are displayed below:

Step 4. Test your VM: Once the import has completed, double­click the OTNDeveloper Days VM. Click OK to close the Virtualbox Information dialogs. Whenyou get to the Enterprise Linux 5 screen you can now login. (Username and

password is oracle.) Allow the process to complete; it is ready when you see aterminal window, which you can close. Once you are finished working in the guestVM you can shut it down via System > Shut Down; this will return the guest VM tothe Powered Off state.

Click “start” icon in Virtual box

enter “oracle” as username

password is “oracle”

open the firefox browser

click on “sql developer link”

click on “Getting Started with Oracle SQL Developer” link

Notice the below lines mentioned in the “getting started with Oracle SqlDeveloper Page “.

1.Install Oracle SQL Developer 3.0 from OTN. Follow the readme instructions here.2 .Install Oracle Database 11g with the Sample schema.3.Unlock the HR user. Login to SQL Developer as the SYS user and execute thefollowing command:alter user hr identified by hr account unlock;

We do not have to perform the steps 1 & 2 .

Sql Developer is already pre­installed.

let us try to connect to “hr” user ,But first we need to unlock it.

check for oracle installation using “lsnrctl status” command.

Note : Service name = orcl

check Service using below commad.ps auxww | grep pmon | grep ­i orcl

unlock user “hr”

login to sqlplus

reference : http://stackoverflow.com/questions/740119/default­passwords­of­oracle­11g

use SQL Developer with “hr/hr” to connect to the DB

So far we are able to connect to the ORacle 11 g Db onOracle Linux. But in order to access it from Host Machine (Mac OS) , weneed to do Port Forwarding as shown below.

3. Use Port forwarding to Connect from Host System( Mac OS ) to VMPort Forwarding on Virtual box:

click on “port forwarding”

We have enabled 2 ports 8888 & 1521.1521 is for connecting to oracle DB from Host machine.Navigate to below URL on VM/Guest machinehttp://localhost:8888/apex/f?p=4550:1:0

Check if port forwading is working by accessing the same url from hostmachine.

Wow, we are able to connect to Guest Machine (Oracel VM ) from HostMachine (Mac OS) and get the port forwardng to work.

Now one should be able to connect to Oracle DB as well from HostSystem.

Access DB from Host Machine

Above Screenshot displays Database explorer of Eclipse to browse theDB.

Cool , we are able to connect to Oracle 11g running on Oracle VM via MacOS.

Sharing Files between Host Machine & Guest Machine

Setting up Shared folder

login as root using su

create a mount point

mkdir /tmp/tejas_mac/shared_folder

Create a shared folder “Mercury” as shown below

Now use the below command to mount the folder on mount point.

Copy files from vm to guest:Suppose we need to copy ojdbc jar from oracle in Vm to Host Machine.find the jar : find / ­type f ­name "ojdbc*.jar" 2> /dev/null

copy to /tmp/tejas_mac_shared_folderNote in the Host OS ( mac ) ,the jar file is now available

top related