Home > debian, Interesting > Working with “Vagrant and Oracle database 11g”

Working with “Vagrant and Oracle database 11g”

This is a follow up to my earlier post here.

I. Some changes made to Vagrantfile

1. Changed the host port to 1234 as it complained that 1521 was already in use. (This is the one to connect to via sqlplus64)
config.vm.network :forwarded_port, guest: 1521, host: 1234
2. Changed the amount of memory database should use from 512 to 2048
i. In the VagrantFile
# Oracle claims to need 512MB of memory available minimum
"--memory", "2048",

ii. In /modules/oracle/manifests/init.pp file, changed from 1024 to 4096
"/bin/dd if=/dev/zero of=/swapfile bs=1M count=4096",

II. Bring up Oracle 11g database on virtual instance of Ubuntu

$ cd vagrant-ubuntu-oracle-xe/
:~/vagrant-ubuntu-oracle-xe$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Clearing any previously set forwarded ports...
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
    default: Adapter 1: nat
==> default: Forwarding ports...
    default: 1521 => 1234 (adapter 1)
    default: 22 => 2222 (adapter 1)
==> default: Running 'pre-boot' VM customizations...
==> default: Booting VM...
... <deleted a bit of output>
==> default: Machine already provisioned. Run `vagrant provision` or use the `--provision`
==> default: to force provisioning. Provisioners marked to run always will still run.
:~/vagrant-ubuntu-oracle-xe$ vagrant provision
==> default: Running provisioner: shell...
    default: Running: inline script
==> default: stdin: is not a tty
... <deleted a bit of output>
==> default: notice: /Stage[main]/Oracle::Server/Exec[apt-update]/returns: executed successfully
==> default: notice: /Stage[main]/Oracle::Xe/File[/tmp/oracle-env.sh]/ensure: defined content as '{md5}c874e5a7a4cc6b15ff68055335c136fb'
==> default: notice: /Stage[main]/Oracle::Xe/File[/tmp/xe.rsp.orig]/ensure: defined content as '{md5}b79c95d12321f3eb55d855082d1d6831'
==> default: notice: /Stage[main]/Oracle::Server/File[/tmp/60-oracle.conf]/ensure: defined content as '{md5}61b22d59fdc07f9fa6929ab74f5b6e99'
==> default: info: /Stage[main]/Oracle::Server/File[/tmp/60-oracle.conf]: Scheduling refresh of Exec[procps]

III. Install sqlplus
Download oracle-instantclient11.2-sqlplus-11.2.0.4.0-1.x86_64.rpm from Oracle site.
http://download.oracle.com/otn/linux/instantclient/11204/oracle-instantclient11.2-sqlplus-11.2.0.4.0-1.x86_64.rpm

1. Install alien
# apt-get install alien
2. Convert rpm to deb
# alien -k --scripts oracle-instantclient11.2-sqlplus-11.2.0.4.0-1.x86_64.rpm
3. Install deb
# dpkg -i oracle-instantclient11.2-sqlplus_11.2.0.4.0-1_amd64.deb

IV. Connect to Oracle 11g database

$ sqlplus64 system/manager@//localhost:1234/XE

SQL*Plus: Release 11.2.0.4.0 Production on Sat Dec 6 13:44:32 2014

Copyright (c) 1982, 2013, Oracle.  All rights reserved.

Connected to:
Oracle Database 11g Express Edition Release 11.2.0.2.0 - 64bit Production
SQL> 

If you have an issues with sqlplus64, try to follow instructions in this post. YMMV.

V. Adding History
# apt-get install rlwrap

As a normal user
$ rlwrap sqlplus64 system/manager@//localhost:1234/XE

Source:
http://webikon.com/cases/installing-oracle-sql-plus-client-on-ubuntu
https://wiki.kuali.org/display/KULRICE/Install+Oracle+11g+using+Vagrant
http://pastebin.com/tsJ32r4p

Advertisements
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s