Vagrant script to install Oracle Database 11g.
Detailed instructions are at http://java.paykin.info/install-oracle-database-vagrant-puppet/.
-
Clone this repo.
-
Download Oracle Database installation from Oracle downloads site. For this tutorial we need Oracle Database 11g Release 2 (11.2.0.1.0) for Linux 64bit (Linux x86-64). There are 2 files to download. You need to place them to
vagrant-oracle-11g/modules/oracle/files
directory. While it is downloading, proceed to next step. -
In
Vagrant
file you may set machine host name, amount of memory. -
In
manifests/base.pp
you can set Oracle database parameters. -
In command line, go to directory you extracted attached file and write
vagrant up
. That’s it. Installation will take a while, on my machine it too about 10 minutes. When it finishes, you can connect to the machine via SSH, issuingvagrant ssh
command. If you prefer using standard ssh, you can connect to it withssh vagrant@localhost -p 2222
command. Vagrant default root password is vagrant. In order to validate that everything works, you can runsqlplus / as sysdba
and execute some simple query, saySELECT SYSDATE FROM dual
. If you see current date – everything works ok. Also you can connect using SqlDeveloper or any othe client. -
Connect to virtual machine via
vagrant ssh
; Runsqlplus / as sysdba
and execute following commands to create schema for project:create user user_name identified by password; grant dba to user_name; drop user user_name cascade; -- to delete schema
-
Install Oracle database backend for Python (instructions for Mac OS X):
pip install cx_Oracle
Configure database in django settings:
DATABASES = { 'default': { 'ENGINE': 'django.db.backends.oracle', 'NAME': 'localhost/orcl', 'USER': 'user_name', 'PASSWORD': 'password', # Empty for localhost through domain sockets or '127.0.0.1' for # localhost through TCP. 'HOST': '', 'PORT': '', # Set to empty string for default. 'OPTIONS': { 'threaded': True, }, } }
Create tables and load initial data:
# django <1.7 python manage.py syncdb --all python manage.py migrate --fake # django >=1.7 python manage.py migrate python manage.py loaddata /path/to/initial_data.json