Userspace Oracle XE
We needed to run Oracle XE in a “developer hostile” environment for testing. That meant running Oracle with no access to root or the dba group.
Now that might sound impossible, but we seem to have found a way to make it happen, provided you can do some preparatory work on a separate machine (eg a VM) where you do have those rights.
Here’s what you do:
First, build a binary bundle of Oracle:
Create a new VM with the same OS as the target machine.
Install Oracle XE in the VM - this will appear under
Create a new directory tree that is where you will run install and run Oracle on the target machine (ie a directory tree that your unprivileged user can write to).
Copy across everything under
In the copied files, change all file paths (using
sed) to reflect the new locations. You need to edit the init script, along with any
Also modify the init script to change
SAVE_LLP, and to replace
oracle:dbawith your own user and group.
Once all paths are changed, run the new initializer (with the
configureargument, as you would when installing a new database).
Add your user to the
dbagroup (this is still on the VM where you have the ability to do this).
Inside the database (ie running
sqlplus) create your user and grant sysdba to them. You can do this via
sqlplus / as sysdbabecause you just made yourself a member of the
Now drop the
dbagroup. You no longer need it because the change above will have modified the password file (to start the database you either need to be a member of
dbaor you need to appear in the Oracle password file - this is how we work round not having the
dbagroup on the target machine).
Shutdown the database within
sqlplus(you can do this is your user -
sqlplus user/password as sysdba).
Create a tarball with the new directory tree.
On the target machine, you can now:
Unpack the tarball.
lsnrctland the database as your own user (I hope it’s obvious this should be the same user you used on the VM).
You can also import a data dump using
imp \'username/password as sysdba\'
I hope that was clear enough!
In summary, the basic idea is:
Create a copy of the installed Oracle with all paths modified.
Create a password file that grants
sysdbarights to your user.
That’s basically all that is needed - Oracle will run wherever it is
installed if the paths are consistent (so you can install in a user’s
directories) and you can avoid the need for the
dba group by using a
password file entry.
- Jekyll on Bitbucket
- Pipes, Clojure and Choco (part 5: Choco)
- An ORM for C?
- CMake with Check Unit Tests
- OpenSSH Certificates
- Pipes, Clojure and Choco (part 1: Limits of Laziness)
- Pipes, Clojure and Choco (part 3: Smart Search)
- Pipes, Clojure and Choco (part 2: Direct Search)
- Choco and Regular Expressions