Gentoo Wiki



Automatically installing Using Installer Scripts

Came across a handy utility which installed Oracle perfectly on Gentoo. Instructions and utility available on: (doesn't work for now)

This is a personal link because I had the scripts before they go down.

Manually: Downloading and installing


Download oracle-xe-univ- from

Install the Red Hat Package Management Utils

emerge app-arch/rpm
emerge app-arch/rpm2targz

Note: In some cases, an error "rpmdav.c:106: error: expected declaration specifiers or '...' before 'ne_conn_status' rpmdav" occurs during emerging app-arch/rpm. If so, please read this - The clue is to apply sugested patches (in comment #5 & #6) and recreate Manifest file with "ebuild /path/to/rpm-4.4.6/ebuild_file digest"

Kernel Parameters for Oracle 10g

Change the kernel parameters, add the following lines to the /etc/sysctl.conf file:

File: /etc/sysctl.conf
kernel.shmall = 2097152
kernel.shmmax = 2147483648  
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
fs.file-max = 65536
net.ipv4.ip_local_port_range = 1024 65000

Effective immediately

sysctl -p

Install required packages

glibc-2.3.2, libaio-0.3.96 and sys-devel/bc was required

emerge -s glibc
emerge -s libaio
emerge -s bc
Warning: Don't downgrade glibc, that will mess up your system!

Create oracle group and user

groupadd oinstall
useradd -g oinstall oracle
passwd oracle

Install rpm packes with 'nodeps' option

rpm -ivh downloads/oracle-xe-univ- --nodeps
Warning: sometimes an error could break the installation:
rpmdb: Berkeley DB library configured to support only private environments
rpmdb: Berkeley DB library configured to support only private environments
error: db4 error(22) from dbenv->open: Invalid argument
error: cannot open Packages index using db3 - Invalid argument (22)
error: cannot open Packages database in /var/lib/rpm

Maybe the rpm was compiled without nptl-devel installed (see

In order to fix the problem described above:
1. create the /etc/rpm directory

mkdir -p /etc/rpm

2. insert the following line in /etc/rpm/macros:

echo "%__dbi_cdb  create cdb private mpool mp_mmapsize=16Mb mp_size=1Mb" >> /etc/rpm/macros

3. retry to install oracle:

rpm -ivh downloads/oracle-xe-univ- --nodeps



There is a Config file named oracle-xe under the /etc/init.d,Modify the config file

sed -i -e "s/\$SU -s \/bin\/bash \{1,2\}\$ORACLE_OWNER -c/\$SU \$ORACLE_OWNER -l -c/g" oracle-xe

User and group

Confirm the oracle user is in the dba group .otherwise you can not through the OS authentication.

groups oracle
wheel dba

Config and Install Database

/etc/init.d/oracle-xe configure

Enter the following configuration information:

Check the Process.

netstat -an |grep 1521
ps -ef |grep ora

To enable remote access by HTTP


# sqlplus /nolog
Enter password: 

Then you can access it from the following URL: http://host_ipaddress:port/apex/ PS: You can login with the username SYS and the password PS: Does not seems to work with Firefox, however works with Konqueror.

Start and stop

You can start/stop Database by follow command

/etc/init.d/oracle-xe start
/etc/init.d/oracle-xe stop

External links

Retrieved from ""

Last modified: Tue, 23 Sep 2008 07:37:00 +0000 Hits: 17,788