Differences between revisions 5 and 6
Revision 5 as of 2011-04-26 01:29:38
Size: 9011
Editor: FelipeWiel
Comment:
Revision 6 as of 2012-10-16 11:58:56
Size: 9016
Editor: ?DavidDouglas
Comment: has to be named local-oracle.conf or pamd will not source the contents
Deletions are marked like this. Additions are marked like this.
Line 91: Line 91:
 . Edit {{{ /etc/security/limits.conf }}}, my recommendation is to create a file {{{ /etc/security/limits.d/local-oracle }}} with the following contents:  . Edit {{{ /etc/security/limits.conf }}}, my recommendation is to create a file {{{ /etc/security/limits.d/local-oracle.conf }}} with the following contents:

Work in progress

Oracle

# Oracle XE Debian repository
deb http://oss.oracle.com/debian unstable main non-free
  • Please, keep in mind that I'm no Oracle specialist, this is a minimalist guideline to try help people during this process (hopefully with less pain). I documented the steps and made different comments and references with regards to what I found on the Internet. There are probably different (and better) ways to install and deploy Oracle and I'll be more than happy to add such info (or to see somebody else do it). The main goal is to make a tutorial more Debian way. I really hope this helps. :-)

Preparations

  • One of the hard things if you're a first time adventurer in Oracle (or if there's a long time since of you last mess with it), is to know how the system works in terms of partitions and file system space.
  • Both 10g and 11g needs a few special things:
    • At least 1.5GiB of space for the zip files containing the database, installer and documentation, I put those in  /srv/oracle 

    • At least 1.5GiB of space for the installed binaries and resources, that should appear under /opt

    • Some free space for the databases, they usually go under /u01, /u02 and sequentially. Oracle documentation says you can choose whatever letter you want and a fixed width number, it could be /z0001.

    • Regarding swap space, for some bizarre reason Oracle 10g asked for 12GiB and Oracle 11g asked for 15GiB. I did one installation with less, but our team decided to reinstall it with the requested amount.
  • Although there is a graphical installer you don't need to install X Window System on the server. You can use X11Forwarding or use the Oracle Silent Install. First, I'm documenting graphical install via SSH (using X11 forwarding).

Creating users and groups

  • Personally, I decided to create system users and groups because they take care of a service (Oracle database and family of applications). You'll find several articles creating regular groups and users, this should be equivalent just with a different point of view in terms of organization and philosophy. :-)

# addgroup --system oinstall
# addgroup --system dba
# adduser --system --ingroup oinstall --shell /bin/bash oracle
# adduser oracle dba

Oracle 10g on Squeeze (amd64)

  • There is a great reference document that helped clearing up some doubts with regards to what should I add or not in terms of configuration, it is an official Oracle documentation called: Oracle® Database Quick Installation Guide, it briefly documents the aspects of installation for Oracle 10g Release 1 (10.1.0.3) in Linux x86-64 (amd64).

Initial steps

We need to install some packages

aptitude install build-essential gcc-multilib ia32-libs libaio1 libstdc++5 rpm xauth
  • build-essential gcc-multilib ia32-libs libaio1 libstdc++5 rpm are dependencies of Oracle either direct or indirect because of 32-bit and 64-bit mess. And yes, I tried to install without any extra packages and only installed what was necessary to fix a given problem.

  • xauth will make the X11 forwarding magic happen.

Oracle requirements (sysctl and security limits)

sysctl
  • Usually you'll find articles recommending you edit  /etc/sysctl.conf , I would recommend you to create a file  /etc/sysctl.d/local-oracle.conf  with the following contents:

fs.file-max = 65536
# semaphores: semmsl, semmns, semopm, semmni
kernel.sem = 250 32000 100 128
kernel.shmmax = 2147483648
kernel.shmall = 2097152
kernel.shmmni = 4096
net.ipv4.ip_local_port_range = 1024 65000
vm.hugetlb_shm_group = 111
vm.nr_hugepages = 64
  • I didn't find recommendations of vm in the Oracle docs, but several articles spoke about it and the installer failed without it. The value for vm.hugetlb_shm_group should be the gid number of the dba group.

  • To load the sysctl configuration you can run sysctl or reboot the machine

# sysctl -p /etc/sysctl.d/local-oracle.conf

security limits
  • Edit  /etc/security/limits.conf , my recommendation is to create a file  /etc/security/limits.d/local-oracle.conf  with the following contents:

oracle          soft    nproc           2047
oracle          hard    nproc           16384
oracle          soft    nofile          1024
oracle          hard    nofile          65536
  • Those are not magical numbers, I took them from the Oracle® Database Quick Installation Guide.

  • Usually, on a regular Debian 6 installation, you just have to enable  pam_limits.so  in /etc/pam.d/su, but make sure it is active for  /etc/pam.d/{login,sshd,su} 

Nasty hacks
  • Yes, it's required, believe me, I tried to install without it. :-)

# ln -s /usr/bin/awk /bin/awk
# ln -s /usr/bin/basename /bin/basename
# ln -s /usr/bin/rpm /bin/rpm
  • awk is used by the final scripts to parse username/groups and change permissions, it works without it, but better be safe than sorry.

  • basename and rpm are used during installation.

Installation

  • You must run the installer as the oracle user.
  • If you'll use the installer via SSH with X11 forwarding, you either have to login directly as  oracle  user or using xauth to transport the authentication from the user that logins in thru SSH and the  oracle  user.

    • You may have noticed that a system user (as the one I created in this article) doesn't have a password. To login directly as oracle you could use SSH keys to login or simply  passwd oracle . Don't forget to enable X11Forwarding in configuration files or use:

$ ssh -XC $SOMEUSER@orclserver.example.org
  • If you decided to create a different non-privileged user to login via SSH (or if you are using root) you should use:

$ ssh -XC $SOMEUSER@orclserver.example.org

$ xauth list
orclserver/unix:10  MIT-MAGIC-COOKIE-1  abcdef0123456789abcdef0123456789

$ su - oracle
$ xauth add orclserver/unix:10  MIT-MAGIC-COOKIE-1  abcdef0123456789abcdef0123456789
  • Once you are the  oracle  user with the proper xauth permissions, just run the installer. As you are installing on Debian and it is not certified by Oracle, you need to tell the installer to ignore some checks or pre-requisites using -IgnoreSysPreReqs. If you want to see all the options you can use -help.

$ /path/to/oracle/database/runInstaller -IgnoreSysPreReqs
  • From this point on, it's up to you and your DBA. Just for the record, here are the values we used:
    • Inventory directory: /opt/oracle/oraInventory
    • OS group name: oinstall
    • Standard Edition
    • Installation Name: OraDb10g_home1

    • Path: /opt/oracle/product/10.2.0/db_1
  • You'll hit a problem about the  collect . I couldn't fix it, but I found some places mentioned it is just for certified systems and won't affect the install, just hit the  Continue  button and finish the installation.

  • The rest is pretty straightforward as Oracle will tell you what to do (including running a pair of shell scripts to fix permissions and copy some binaries into /usr/local/bin

Common problems

gcc-multilib: linking pthread problems

  • Problem

/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.4.5/.../libpthread.a when searching for -lpthread
/usr/bin/ld: skipping incompatible /usr/lib/libpthread.so when searching for -lpthread
/usr/bin/ld: skipping incompatible /usr/lib/libpthread.a when searching for -lpthread
/usr/bin/ld: cannot find -lpthread

INFO: collect2: ld returned 1 exit status

INFO: make: *** [ctxhx] Error 1

INFO: End output from spawned process.
INFO: ----------------------------------
INFO: Exception thrown from action: make
Exception Name: MakefileException
Exception String: Error in invoking target 'install' of makefile '/opt/oracle/product/10.2.0/db_1/ctx/lib/ins_ctx.mk'.
  • Solution: install gcc-multilib and its dependencies.

Oracle 11g on Squeeze (amd64)

Word in progress


?CategoryDatabases ?CategoryNonFree