How to Install Oracle 11gR2 on Debian vserver

We are going to install an Oracle 11gR2 database onto a Debian VServer (an software environment with own application running space that shares the kernel with host machine). VServer and non-VServer based installation differs only on how to set kernel parameters.

First steps

  • We have installed a simple (no “task” selection) 64 bites Debian Linuxot (5.0 – Lenny) on our VServer, and we become root at the beginning.
  • Add the following users and groups to your system, i.e. run the following commands:
    adduser –group dba
    adduser –group oinstall
    adduser –gid 65534 –group nobody
    useradd -g oinstall -G dba -p put_your_password_here oracle
  • Since the whole operating system is a guest host we will do the maintainance from remote console. Remember to set the proper port forwarding data (SSH, Oracle Listener) on host server. In order to access the server, and for Oracle installation we set up the following Debian packages:
    apt-get install libedit2 libgpm2 libkeyutils1 libkrb53 libx11-6 libx11-data libxau6 \
    libxcb-xlib0 libxcb1 libxdmcp6 libxext6 libxmuu1 openssh-blacklist openssh-blacklist-extra \
    openssh-client openssh-server vim vim-runtime x11-common x11-utils xauth xterm \
    less unzip make binutils gcc libaio-dev libc6-dev ia32-libs rpm libc6-dev-i386 unixODBC-dev \
    pdksh expat sysstat elfutils libebl-dev gawk libstdc++5
  • The next is to make Debian RedHat “compatible”:
    ln -s /usr/bin/awk /bin/awk
    ln -s /usr/bin/rpm /bin/rpm
    ln -s /usr/bin/basename /bin/basename # Suggested by Giuseppe Sacco
    ln -s /etc /etc/rc.d # Required for root.sh
  • We should modify kernel settings on the host machine. To be more precise modify /etc/sysctl.conf file on the host server according to Oracle 11gR2 needs:
    kernel.shmmax = 536870912
    kernel.sem = 250 32000 100 128
    fs.file-max = 6815744
    net.core.rmem_default = 262144
    net.core.rmem_max = 4194304
    net.core.wmem_max = 1048576
    net.core.wmem_default = 262144
    fs.aio-max-nr = 1048576
    net.ipv4.ip_local_port_range = 9000 65500
  • Now run the following command as root (on the host machine, of course):
    sysctl -p
  • [Eventual problem] A problem might arise if VServer /tmp partition is too small then some application (e.g. lynx) like to store temporary files there fail. If file downloads is not a case then you can skip this step.
  • We download Oracle Database 11g R2 install packages including the first, and the second CD.

Installation

  • In order to run installation file at the first time on Debian which is not a supported platform – run the following commands:
    su – oracle
    export ORACLE_HOME=/where/you/will/install/your/files
    export DISPLAY=IP.of.your.display.machine.com:0.0
    cd /where/you/will/put/your/install/files
    unzip /download/location/linux.x64_11gR2_database_1of2.zip
    unzip /download/location/linux.x64_11gR2_database_2of2.zip
    cd database/
    ./runInstaller -ignoreSysPrereqs
  • Graphic interface is now started, and it will ask the following questions:
    • Partioning option: it enables to store table in small data files called partitions – it is very effective for large databases.
    • OLAP option: a new option which supports efficient pivoting and OLAP cube manipulations.
    • Label Security option: supports limitations of user accesses to a single record or fields within records.
    • Oracle Data Mining option: very good in-database mining support (the best but expensive solution)
    • Database Vault option: enables full scale auditing on databases (you need this for Audio Vault), or limiting administrator role users (it is important if sensitive data are stored).
    • Real Application Testing: a testing environment with versioning support to see how your software will work in (the next) changed database environment.
  • 1. If a critical error arise or an update is available then we either ask database to email us or we can use our Metalink account to get information. Since we are making a simple installation we Skip this step.

    2. We choose to whether to set up our database in “playground” mode or in “server” mode. We have chosen Server Mode hence we can set up more options.

    3. The next question is whether we want to use a single database or a database cloud called grids. Single instance.

    4. Are you looking for an interactionless or a professional mode? The former one is an easy way so we choose the latter one. Advanced mode enables more detailed server configuration.

    5. Database native language support is to be set. It sets keyboard settings to default, nevertheless English is very very recommended to be selected in either cases. We have English and Hungarian (our native language) on the right side.

    6. The next tab asks for new options. We can choose between Enterprise Edition (EE), Standard Edition (SE), or Standard Edition One (SE1). This is a good news (and new feature) since in the past, there were 3 different setup kits for these very similar options. If we are looking for database options then EE is the only way. If you are looking for a relatively cheap database (no option) license then SE is enough. If we are a small company with some database served users, and we are not supposed to grow fast in the next 3-5 years then choose SE1. Note that, there exists a free Oracle database license called XE with some limitations (1 core, up to 4GB disc usage, single instance, no grid). We are looking for database options so we choose EE. But… Remember that the most important question is the “Check Options…” button on this page. You can not change these settings later easily, and more importantly it is illegal to install database options without appropriate license (with the exception of non-profit research, teaching – free academy license is required -, and other development – free developer license is required):

    7. Now, it is asked where to put Oracle database management and data files (ORACLE_HOME). If this shell environment is not set do not panic! They are asking now. We suggest that you replace default “dbhome_1″ by something more meaningful name.The next page wants you to declare where to put Oracle common working space (Inventory) used by and required for all(!) Oracle products. That is why you should place these files in a dba group or a commonly writeable, and at least dba group readable directory.

    8. You can choose between transactional (OLTP – many data insert, small queries) and analytical (OLAP – batch insert, reporting, special queries) use of your database. If you need to install a data warehouse then you shall choose OLAP. If you know almost nothing about these notions then OLTP is your choice.

    9. You can set database “global name” which is assumed to be a unique identifier. According to conventions it is a concatenation of SID (local system identifier of your database) and your DNS (server name). If the first word is replaced then it will appear as your SID. Watch out! Non-English characters should not be used here because it will hurt you very very very deep.

    10. In order to confuse you the next window consists of four panels (not 1!). OK, let’s see:

     

  • You can set the global memory space called SGA (Shared Global Area) which is “brain”, cache, operating memory, short and long term memory as well. Large is good for Oracle database management, and bad for all other application. Be wise! If database usage is rather a background application then it might not be a bottleneck so it is wise to set it relatively low (but >1GB). If database intensive processes are common then set SGA to be large but less than 80% (give memory to other applications like operating system).
  • Default character set (UTF-32) is usually the perfect choice. If you do not know what exactly you are doing then do not touch it.
  • Usual paranoid settings can be adjusted here. Paranoia in this case means that you can set how complex (hard to guess) be a password, how often users should change, how many times it can be used in a row, how long a user is banned, etc. Only sadists, unconfidents on colleagues, and those who want to protect stored data according to law (e.g. sensitive data) turn this on.
  • Finally, we can choose whether to install example (scott/tiger) database or not. It is very handy when you are learning, or trying to understand manual. Otherwise it is only a waste of space.11. If you like to get email notification on system errors then set here who, how, and when to get emails.12. Do you prefer file system or ASM (Automatic Storage Management) based storage? If database is in limited used, and you do not intent to store large binary or text files then file system rules. Compression seems to be hardly useful but they say it makes database management fast (our tests indicate only 2-3% gain). We have preferred file system based storage.

    13. Do you need automated data backups? Choose No unless it is mission critical.
    14. You can set passwords for the most “powerful” database users – we have set all at once. Do not forget your password (and noow you face your previous paranoia settings).
    OSDBA, OSOPER.

    15. On this screen great many Oracle verified errors are put. The thing is setup checks the settings with rpm -q command – and no wonder – it won’t work well for Debian (and packages). Because of using VServer some kernel settings also would fail. But, you have set kernel settings on the host machine, don’t you??? Ignore all.
    16. At this point setup smoothly filled the progress bar from 0 to 100%, including database creation. At last it throws a window which tells you run the following commands as root:

    /where/your/oraInventory/is/located/orainstRoot.sh # oraInventory’s location, see step #8
    /where/your/database/binaries/are/located/root.sh # ORACLE_HOME, see step #7