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- from Oracle site.

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

IV. Connect to Oracle 11g database

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

SQL*Plus: Release 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 - 64bit Production

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


  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 )

Google photo

You are commenting using your Google 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 )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.