Install Oracle 11gR2 on Solaris 10

Install Oracle 11gR2 on Solaris 10

This document is a step-by-step guide howto install Oracle 11gR2 on Solaris 10.

One of Favourite Design‘s bigger customers have such an Oracle 11gR2 installation burried deep down in an application stack of Favourite Designs contractual responsibility. With no prior Solaris nor Oracle experience within Favourite Design, I decided we needed to have a similar installation in our office for the relevant consultants to test on, especially Oracle backup & restore tests. Naively I bragged that I would set up the test environment myself in a couple of days – well I am too embarrashed to say how long time it took, but had I known, I would have let one of the younger programmers figure it out for me.

Eventually, I got it and I feel that with a little extra time for documentation, I may be able to help others spare some of the frustration and loss of both hair and selfesteem.

This howto is divided into 3 main parts :

  1. Pre installing Oracle – you skip this, you fail
  2. Running the Oracle installer
  3. Post installing Oracle – nearly there
  4. Appendix : common errors and solutions

 Pre installing Oracle

My test installation environment : Solaris 10 update 9 on a VirtualBox virtual machine with 4 GB RAM and 40 GB virtual harddrive. Whether or not you use a virtual machine for test, best to have 4 GB RAM and no less than 30 GB harddrive.

  1. Logon to your Solaris system as root.
  2. Start a shell (I use an sh bourne shell but a bash shell should also work).
  3. #> cat /etc/release : check your Solaris 10 update version – if it is less than 9, then you should consult another Oracle installation guide, eg. this great guide (it’s the best guide I found but it lacks 2 things: importance of ORACLE_HOSTNAME, see step 9, and how to startup Oracle after a Solaris system boot).
  4. Create a new user called oracle. This user is later used to run the Oracle installer as well as to start several services etc. (it cannot be root)
    1. #> groupadd oinstall : create a group called oinstall.
    2. #> groupadd dba : create a group called dba.
    3. #> useradd -d /export/home/oracle -m oracle : create a user called oracle (the -d switch specifies the home directory and the -m switch specifies that the home directory actually have to be created, which is necessary for the X graphics forwarding to work on remote terminals and indeed we need the oracle user to forward X graphics later then executing the Oracle installer).
    4. #> usermod -g oinstall -G dba oracle : add the oracle user to the oinstall and dba groups.
  5. #> df -h /tmp : check your tmp size (the -h switch makes the output human readable). The official documentation is inconsistent on this point, however I have success with setting tmp size to more than 1.5 GB.
  6. #> prtconf | grep Memory : shows your RAM size. According to official documentation it should be no less than 1.5 GB, however I have better experience with 4 GB.
  7. #> swap -s : shows your swap size. According to official documentation it should be the same size as your RAM (except if you have less than 2 GB RAM). I add an extra 4 GB swap myself for a total of 6 GB swap :
    1. #> mkfile 4G /export/home/extraswap : create a 4 GB file (file swap is allegedly slower than partition swap, however this swap is just for test).
    2. #> swap -a /export/home/extraswap : add (-a switch) the file to swap (this association is lost upon system boot).
    3. #> gedit /etc/vfstab : open /etc/vfstab in gedit. I want to persist the swap resources by adding the extraswap file on system boot.
      • insert the following line : /export/home/extraswap – – swap – no – : this will auto enable the swap file on boot (the mount-at-boot field should indeed be no as no mounting is going on, instead I think that a script, /sbin/swapadd, will pick up the entry on system boot).
    4. #> swap -s : shows your swap size.
    5. #> swap -l : list your swap resources.
  8. Set the shared memory kernel parameter for the Oracle user to 4 GB :
    1. #> projadd -K “project.max-shm-memory=(privileged,4G,deny)” user.oracle :
    2. Confirm the value :
      1. #> su Oracle switch user to oracle.
      2. $> prctl -n project.max-shm-memory -i project user.oracle : shows shared memory kernel settings.
      3. $> exit : back to root user.
  9. Set and persist Oracle specific environment variables :
    1. #> echo $HOME : identify home directory of root user (default is /)
    2. #> cd $HOME : be sure you are in your home directory
    3. A users environment variables can be persisted on boot by adding them to a .profile file inside the users home folder
      1. #> gedit .profile : will either open an existing profile file or create a new if it does not already exists
      2. Append the following to the end of the .profile file :
        • ORACLE_HOME=/export/home/app/oracle/product/11.2.0/dbhome_1
        • ORACLE_SID=orcl
        • ORACLE_HOSTNAME=localhost : very important, otherwise you will get significant problems (I think the problems may be related only to a desktop class install)
        • ORACLE_OWNER=oracle : disk backup will fail without this variable set.
        • PATH=$PATH:$ORACLE_HOME/bin : appending Oracle tool bin to the existing PATH entries.
        • export ORACLE_HOME ORACLE_SID PATH
  10. Confirm your Oracle environment have been persisted :
    1. Restart Solaris.
    2. Logon as root.
    3. Open a shell.
    4. #> echo $ORACLE_HOME : value should be /export/home/app/oracle/product/11.2.0/dbhome_1.
    5. #> echo $ORACLE_SID : value should be orcl.
    6. #> echo $ORACLE_HOSTNAME : value should be localhost.
    7. #> echo $ORACLE_OWNER : value should be oracle.
    8. #> echo $PATH : you should see that Oracle tool bin folder have been added to $PATH.
    9. #> swap -s : confirm your swap resources have been persisted.
    10. #> su oracle : switch user to oracle.
    11. $> prctl -n project.max-shm-memory -i project user.oracle : confirm shared memory kernel settings.
    12. $> exit : back to root user.

 Running the Oracle installer

The Oracle installer must be run from a remote terminal by the oracle user created above – you cannot run the Oracle installer as root user and you cannot run from a local terminal.

How you launch a remote terminal depends on your environment. If you do not know how to launch a remote terminal (which also need to forward X graphics), then you can do as me : use a Windows7 host with Xming & Putty :

  1. Download Putty. No need to install, Putty starts right away from the executable.
  2. Download Xming and install it (since the Oracle installer is graphical, you need a way to display X graphics on Windows – Xming is an X server for Windows).
  3. Start Xming and you should be able to see Xming in the windows taskbar notification area.

  4. Start Putty by double clicking the executable.
    • Insert the IP address of the Solaris machine (in my case Solaris is a virtual machine under VirtualBox on a Windows7 host).

    • Enable the X forwarding (X graphics on Solaris will now be sent through Putty to Xming).

    • Press the Open button and you should get a terminal prompt.
    • Login as the oracle user.

You should now be logged on to Solaris as the oracle user from a remote terminal – the rest of the installation should be done from that terminal :

  1. Navigate to the Oracle download folder containing the runInstaller file.
  2. $> ./runInstaller : start the installer (there are some initial checks at this point, eg. temp space, swap space and display, it’s best if you pass these checks).
  3. If you passed or ignored the initial checks then the Oracle graphical installer should be loaded.

  4. Configure Security Updates screen : you don’t need fill in anything and you can de-check the “wish to receive security updates ..” checkbox.

  5. Installation Option screen : choose the default “Create and configure a database”.

  6. System Class screen : here I choose the default “Desktop Class”, however “Server Class” allows for more configuration, eg. if you want to select a specific character set, like say thai.

  7. Create Inventory screen : I set the inventory folder as a sibling folder to the Oracle base folder. Also be sure that oraInventory Group Name is set to oinstall.

  8. Typical Installation screen 1 : default the Oracle installer will nest the Oracle base folder inside the oracle users home directory. I don’t like that.

  9. Typical Installation screen 2 : instead I move the Oracle installation folder out of the oracle users home directory. Now Oracle base folder and oraInventory are siblings.

  10. Prerequisite Checks screen : here you hopefully see only the “Maximum User Processes” fail, which I have had no problem ignoring.

  11. Summary screen : just a summary of your choices

  12. Install Product screen : this can take a long time.

  13. Execute scripts : at the end of the Install Product screen you are prompted to logon to Solaris as root and execute 2 scripts.

  14. Finish screen : if everything went well, you will see the finish screen and you can press the Close button.

  15. Exit your remote terminal

You are ready to test Enterprise Manager and the database :

  1. Logon to Solaris locally as root.
  2. Open a browser on this url : https://localhost:1158/em : Enterprise Manager should start in the browser
  3. Login as sysdba using the sys password you entered in the oracle installation process.

  4. Enterprise Manager should now show you that the orcl database instance is up.

If everything works I congrat you, however after you restart Solaris both orcl database instance and Enterprise Manager will be down. Continue to Post installing Oracle.

 Post installing Oracle

  1. Boot your Solaris system.
  2. Logon to Solaris locally as root.

As of current, your orcl database instance is not started nor is your Enterprise Manager dbconsole.

  • To confirm Enterprise Manager is down do the following :
  • To start Enterprise manager do the following :
    1. Open a shell prompt
    2. #> su oracle : switch user to oracle as root does not have access to start Enterprise Manager dbconsole.
    3. $> emctl start dbconsole : this can take a long time, you should make coffee.
    4. Open a browser on https://localhost:1158/em : dbconsole is started and Enterprise Manager should load.

  • To confirm orcl database instance is not started :
    1. Open a browser on https://localhost:1158/em and login as sysdba using the sys password you entered in the oracle installation process.

    2. Enterprise Manager will show that your orcl database instance is down and also the listener is down.

  • To start your listener :
    1. Open a shell prompt.
    2. #> su oracle :
    3. $> lsnrctl start : start the listener.
    4. Go back to your browser there Enterprise Manager shows your database instance is down and press the Refresh button.
    5. Enterprise Manager should now show that your listener is up.
  • To start your orcl database instance :
    1. Open a shell prompt.
    2. #> su oracle : switch user to oracle (root does not have sufficient privileges to logon as sysdba).
    3. $> sqlplus / as sysdba : logon to SQL*Plus as sysdba.
    4. sql> select open_mode from v$database; : errors ORA-01034: ORACLE not available, which just means that the database is not started.
    5. sql> startup : this should start, mount and open the database without any errors (read more about Oracle startup stages).
    6. sql> select open_mode from v$database; : you should now get the value “READ WRITE” – the database instance is running without any problem.
    7. Go back to your browser there Enterprise Manager shows your database instance is down and press the Refresh button.
    8. Enterprise Manager should now show that your database instance is up. Press the “Database” button.

    9. After pressing the “Database” button, you should get Enterprise Manager homepage for the database instance.

You are now able to start Enterprise Manager and your orcl database instance also on system boot and that finishes this howto.

Good luck.

Howto implement automatic startup (for multiple oracle databases on same server) : http://www.linuxquestions.org/questions/linux-software-2/start|stop-multiple-oracle-databases-in-the-same-oracle-server-422050/

Appendix : common errors and solutions

  1. $> emctl dbconsole status : errors EM Configuration issue. /export/home/app/oracle/product/aa.2.0/dbhome_1/HOSTNAME_DBNAME not found
  2. $> emctl dbconsole start : exactly the same error as 1.
  3. $> emctl start dbconsole : errors OC4J Configuration issue. …/oc4j/j2ee/OC4J_DBConsole_HOSTNAME_DBNAME not found

Reason : If you have one of the above errors, 1, 2 or 3, you have most likely not set the $ORACLE_HOSTNAME environment variable. The problem is that the Oracle installer will use localhost for HOSTNAME at least then installing a desktop class system. However, then services start, Oracle will match hostname with $ORACLE_HOSTNAME and if $ORACLE_HOSTNAME is empty then substitute with the system hostname, which likely is different from localhost.

Example : If your hostname is Solaris10 and your database name is orcl, then emctl will search for ../oc4j/j2ee/OC4J_DBConsole_Solaris10_orcl, but the installer created ../oc4j/j2ee/OC4J_DBConsole_localhost_orcl.

Solution : There are different possible solutions of which by far the easiest is to set the $ORACLE_HOSTNAME to localhost :

  1. Open a shell as root.
  2. #> ORACLE_HOSTNAME=localhost : initialize the variable.
  3. #> export ORACLE_HOSTNAME : add the variable to your environment.
  4. #> echo $ORACLE_HOSTNAME : confirm the variable – you should get localhost.

To persist $ORACLE_HOSTNAME on system boot, see Pre installing Oracle step 9 above. 

  1. $> lsnrctl status : errors The listener supports no services
  2. rman> startup mount; : errors ORA-12514: TNS: listener does not currently know of service requested in connect descriptor
  3. Enterprise Manager shows the listener is up but Agent connection is down with error ORA-12505: TNS:listener does not currently know of SID given in connect descriptor (DBD ERROR: OCIServerAttach)

Reason : If you have one of the above errors, 4, 5 or 6, I think a typical reason is that the database have not registered with the listener. Furthermore the database cannot register if it is shutdown.

Example : If you have shutdown the database, eg. sql> shutdown immediate;, it will not help to issue $> lsnrctl start, because the database cannot register if it is shutdown.

Solution : One solution is to startup the database from RMAN :

  1. Open a shell.
  2. #> rman target / : logon to RMAN using host credentials.
  3. rman> shutdown immediate; : be sure to start from a shutdown database.
  4. rman> startup; : the database will auto register with the listener under the startup procedure

Sobre Alexandre Pires

ORACLE OCS Goldengate Specialist, OCE RAC 10g R2, OCP 12C, 11g, 10g , 9i e 8i - Mais de 25 anos de experiência na área de TI. Participei de projetos na G&P alocado na TOK STOK, EDINFOR alocado na TV CIDADE "NET", 3CON Alocado no PÃO DE AÇUCAR, DISCOVER alocado na VIVO, BANCO IBI e TIVIT, SPC BRASIL, UOLDIVEO alocado no CARREFOUR e atualmente na ORACLE ACS atendendo os seguintes projetos: VIVO, CLARO, TIM, CIELO, CAIXA SEGUROS, MAPFRE, PORTO SEGURO, SULAMERICA, BRADESCO SEGUROS, BANCO BRADESCO, BASA, SANTANDER, CNJ, TSE, ELETROPAULO, EDP, SKY, NATURA, ODEBRESHT, NISSEI, SICREDI, CELEPAR, TAM, TIVIT, IBM, SMILES, CELEPAR, SERPRO,OKI,BANCO PAN, etc
Esse post foi publicado em ORACLE 11gR2. Bookmark o link permanente.

Deixe uma resposta

Preencha os seus dados abaixo ou clique em um ícone para log in:

Logotipo do WordPress.com

Você está comentando utilizando sua conta WordPress.com. Sair / Alterar )

Imagem do Twitter

Você está comentando utilizando sua conta Twitter. Sair / Alterar )

Foto do Facebook

Você está comentando utilizando sua conta Facebook. Sair / Alterar )

Foto do Google+

Você está comentando utilizando sua conta Google+. Sair / Alterar )

Conectando a %s