Quite too often when developers are to setup a development, test or even the production environment of Oracle database running on Solaris 10 (mostly for the first time), too much hurdles and bumpers are there to cause somebody to give up too easily. I’ve been through these tough bumpy roads too, especially when it comes to adding the proper user and groups, dealing with $DISPLAY export (just to get the installer’s UI up), changing of Kernel parameters when Oracle DB REQUIRES it, sizing of swap space if the installer yells at you and whatever the Oracle installer requires. It has always been in my heart for a very long time to write this “one page” installation guide as to aid people who are doing this installation process so that their journey could be short, sweet and less bumpy.
The objective of this tutorial is to guide you to a complete installation of Oracle 11g Database Enterprise Edition in Single Server mode on Solaris 10 u10 x86-64.
- Readers are assumed to have at least some basic Unix/Linux administrative skills.
- Readers are assumed to have FRESH running copy of Solaris 10 8/11 (u10-ga2). We’ll be running on a x86-64 system.
- Readers are assumed to have NO previously installed Oracle Database version in the system.
- Readers are assumed to have backed up any critical data before the installation.
- The Oracle Database version used for this tutorial is 11g R2 for Solaris x86-64.
- Knowledge of using editors like VI. Check on this tutorial: VI tutorial from www.unix-manuals.com
- No firewall is blocking the way! Assuming that all ports are free to use.
- Must have “root” access to Solaris 10 OS
- Readers are to take full responsibility of any potential software, data, hardware, financial and life damages prior to following this tutorial.
As the title states: “Installing Oracle 11 R2 on Solaris 10 through SSH and VNC”. If you are running servers on a virtualized environment and accessing it through some proprietary GUI client, you don’t have to initialize the VNC server. However, there are situations where installing Oracle DB to the direct physical server is required from a remote connection through SSH and VNC; if you belong to this category, then please read through all the below and perform them step-by-step.
Hardware Environment Basics:
I’m going through this tutorial in a virtualized server environment using VirtualBox with the below server and network properties:
- No. of CPUs: 2 (both are 64-bit capable)
- RAM: 4GB
- Harddisk space: 50GB
- Hostname: Oracle11gServer
- IP: 192.168.2.124
- Netmask: 255.255.255.0
- Gateway: 192.168.2.1
- Network mode: Bridge
- Operating System: Solaris 10 u10 (Bare basic and newly installed)
- Do download the Oracle 11g R2 release for Solaris x86-64 from Oracle’s website download page. At the time of writing, Oracle’s download page gave me 2 files namely solaris.x64_11gR2_database_1of2.zip and solaris.x64_11gR2_database_2of2.zip. Please store it in the directory /usr/files. We will be using this directory as the Oracle DB installer zip file location.
- After downloading the files, just unzip them by typing: “unzip solaris.x64_11gR2_database_1of2.zip” and “unzip solaris.x64_11gR2_database_2of2.zip”. Do this as the “root” user. The decompression will produce a “database” directory in the /usr/files path. Leave it for now.
- You’ll need a vnc viewer. Please get if from RealVNC or TightVNC.
- You’ll need a SSH connection tool as well (For Windows, Putty is a choice. For most Linux/Unix, they do have their own SSH tool)
SSH To The Server (Perform This As The “root” User):
- By default, the Solaris 10 doesn’t allow the “root” user to login from remote SSH. In order to enable this, you need to edit the /etc/ssh/sshd_config file and make sure PermitRootLogin is set to yes. You need to do this on site with a direct physical/local login to the system.
## Look for the line below: PermitRootLogin no ##And change the this line to: PermitRootLogin yes** If you are not permitted to login as the “root” user through SSH due to security policies, just SSH to the system with your other given username and password, then switch to the “root” user by typing: “su root”. Just be sure to change this back once the installation is done for security reasons.
- Restart the SSH service by typing “svcadm restart ssh“.
- Now, you should be able to SSH from a remote location as root.
VERY IMPORTANT: Checking & Configuring the Server’s SWAP Space and /etc/system
Before you go on, please, I urge you to check on the SWAP space of the system. The rule of thumb for most Unix system is that the SWAP space should be at 2 times of the memory size. For example if I have 4GB of RAM, then my SWAP space should be 8GB in the HDD storage. SWAP space was pre-allocated when you install the operating system.
You can always do the below to check on the SWAP space:
- To list the SWAP space, type: “swap -l“
- To monitor the SWAP space, type: “swap -s“
For demonstration purposes, my SWAP space result after typing “swap -l” is as below:
Since my memory is 4GB of RAM, I can assure you the SWAP space above IS NOT ENOUGH and you will encounter obstacles during the Oracle DB installation. If you are lacking of SWAP space, fear not, you can always add them by:
- Perform this as the “root” user, go to the “/” path by typing: “cd /“
- Make a directory call “swap” by typing “mkdir swap“. Change the directory into swap by typing: “cd swap“.
- Create a binary file with the size plus existing SWAP space up to time 2 of the RAM: “mkfile 7000m swapfile1“
- Now, append the newly created file as part of the SWAP space by typing: “swap -a /swap/swapfile1“
You can always check the newly added SWAP file and the available SWAP space with “swap -l” and “swap -s“. Unfortunately, the SWAP space added just now won’t be available during the next boot. In order to have it permanently available during boot time, please edit the file /etc/vfstab through VI. Go to the very bottom of the file and append the below line:
/swap/swapfile1 - - swap - no -
Now, your appended SWAP file will be available during boot time.
Kernel Parameters In /etc/system
Another headache in installing Oracle 11g DB on Solaris 10 is that the default Kernel parameters are not to the requirements of Oracle 11g DB. For the below, I have stated a pre-configured Kernel parameters for this tutorial. This is not the silver bullet though. As you go on from here, certain tunings are necessary. But some of the Kernel parameters are necessary for me to bring to your attention.
Maximum Shared Memory (shmsys:shminfo_shmmax)
One of the Kernel parameter is the Maximum Shared Memory that you can set as shmsys:shminfo_shmmax is needed to be identified in the system for successful Oracle DB installation. In order to identify this, just do the following in the terminal as the “root” user (We thank David for sharing this in Oracle’s forum. Read Here):
- In the terminal as “root”, type: “prtconf | grep Memory“
- For my case, it shows: “Memory size: 4000 Megabytes“. You might have a different value. For me, I’m taking the 4000 as my initial value.
- To determine the shmmax, the formula is <RAM in megabytes> x 1024 x 1024 x 70 / 100. Therefore, I’ll type: “expr 4000 \* 1024 \* 1024 \* 70 / 100“. The result shows 2936012800. That’s the value of my shmmax! The below is how it looks in the terminal:
# prtconf | grep Memory Memory size: 4000 Megabytes # expr 4000 \* 1024 \* 1024 \* 70 / 100 2936012800
Editing the /etc/system file:
Once you’ve calculated the Maximum Shared Memory, do the following to set the right Kernel parameters.
- Do edit the /etc/system file, and append the below at the bottom of the line. The shmsys:shminfo_shmmax value must be gotten from the above formula. For my case, it is 2936012800. Just change it according to your system:
set shmsys:shminfo_shmmax=2936012800 set shmsys:shminfo_shmmni=100 set shmsys:shminfo_shmseg=10 set semsys:seminfo_semmni=100 set semsys:seminfo_semmns=1024 set shmsys:shminfo_shmmin=1 set max_nprocs=30000 set maxuprc=16384
- After this, you need to reboot the system. Issue the command: “init 6“
After the system reboots, you can always check the Kernel parameters through “kstat“. Ok, we are good to go from here.
Oracle User and Groups Setup (Perform This As The “root” User):
From here onwards, everything that we are about to do is from a remote location. Now that you’ve SSH-ed into Solaris 10 as the “root” user, the next step is to create the appropriate groups and user for the Oracle database. Follow the steps below:
- Create the group “dba” by typing: “groupadd dba”
- Create the group “oinstall” by typing: “groupadd oinstall”
- Create the group “oper” by typing: “groupadd oper”
- Now, create a directory “oracle” in /export/home by typing: “mkdir –p /export/home/oracle”. This should be the home directory for the “oracle” user that is about to be created.
- Create the “oracle” user by typing: “useradd –g oinstall –G dba,oper,root –d /export/home/oracle oracle”. Many administrators are quite reluctant to have “oracle” user under the “root” group. Why I’ve added the “oracle” user into the root group is for the VNC process later actually. If you are not running on VNC for the installation process, you can leave the “root” group out when creating the user. Therefore, the command will be: “useradd –g oinstall –G dba,oper,root –d /export/home/oracle oracle”.
- Change the ownership of the /export/home/oracle directory by typing: “chown –R oracle:oinstall /export/home/oracle”.
- Give a password to the “oracle” user by typing: “passwd oracle”, then enter the password. For now, I’ll use the password “oracle1234” just for this tutorial.
- Change the ownership of the decompressed contents of the “database” directory in /usr/files /database by typing: “chown –R oracle:oinstall /usr/files/database”.
Oracle Directories Creation (Perform This As The “root” User):
- Still logging in as the “root” user, we need to create the adequate directories for Oracle DB to be installed and change the ownership afterwards.
- Change the directory to the “/” path by typing: “cd /”.
- Create the directory “/u01/app/oracle” at the “/” path by typing: “mkdir –p /u01/app/oracle”.
- The “/u01/app/oracle” directory is what referred as the ORACLE_BASE path.
- Change the ownership of the ORACLE_BASE by typing: “chown –R oracle:oinstall /u01”.
Starting the VNC Server For Remote Connection (Perform This As The “oracle” User):
- This time, we need to switch the user from “root” to “oracle”. Still on the SSH session, type: “su oracle” to switch the user.
- In order for VNC Server to run properly as the “oracle” user, we need to make sure that both /usr/X11/bin and /usr/openwin/bin is in the $PATH. You can have /usr/ucb for some snappy commands in the path as well.
- As “oracle” user, you should be in your home directory. If not, change the directory to the home by typing: “cd /export/home/oracle”
- The next step is to setup the PATH to start the VNC server by typing the below:
$ PATH=$PATH:/usr/X11/bin:/usr/openwin/bin:/usr/ucb $ export PATH
- Start the VNC server by typing: “vncserver”, it will prompt you for the password for the VNC session. Just key in the password as “oracle1234” for now. You should be able to see the below message:
xauth: creating new authority file /export/home/oracle/.Xauthority New 'Oracle11gServer:1 ()' desktop is Oracle11gServer:1 Creating default startup script /export/home/oracle/.vnc/xstartup Starting applications specified in /export/home/oracle/.vnc/xstartup Log file is /export/home/oracle/.vnc/Oracle11gServer:1.logIf you are able to see the message above, that means you can now VNC into the server through a VNC client. The “:1” after the word “Oracle11gServer” is the port number for the VNC. Therefore, when you connect through the VNC client later, the URL should be 192.168.2.124:1. In case you need to specify another port for the vncserver, just type: “vncserver :<port>”.
Now, the journey had just begun.
Running The Oracle Database Installer Step-By-Step
- The first step after having the VNC server activate is to do a remote VNC connection into the server. I’m going to use the IP:Port of 192.168.2.124:1 for the connection through a VNC Viewer/Client.
- On my VNC viewer, I am able to see a plain terminal with user “oracle” already logged in. Do change the directory to /usr/files/database by typing: “cd /usr/files/database“.
- Run the Oracle Database Installer by typing: “./runInstaller
- The splash screen will appear as below:
- Next, the installer will ask for your email as the administrator. For now, I’ll just disable the check box “I wish to receive security updates via My Oracle Support”. Click “Next” to continue.
- Here, it is our intention to create a new database, so just click on the radio button “Create and configure a database”. Click “Next” to continue.
- Select “Server class” and click “Next”.
- Select “Single instace database installation” and click “Next”.
- Here, we’ll choose the “Advanced install” path for more options of configuration later. Click “Next” to continue.
- Language(s) availability, just accept as it is and click “Next”.
- Select “Enterprise Edition” and click “Next”.
- In this page, you should specify the Oracle Base directory and the Oracle Home. For Oracle Base, key in “/u01/app/oracle” and for Oracle Home, do key in “/u01/app/oracle/product/11.2.0/dbhome_1“. Keep a note on this two paths. Click “Next” to continue.
- Define the Inventory Directory as “/u01/apporaInventory” and have the inventory group name as “oinstall“. Click “Next” to continue.
- Select “General Purpose / Transaction Processing” for now and click “Next” to continue.
- This is where we define the Global Database Name and the Service Identifier.
:- For Global Database Name, key in “orclDB”
:- For Oracle Service Identified (SID), key in “orclSID”
** It is okay to use the same name for both DB name and SID. For me, I’ll always distinguish both names.
Click “Next” to continue.
For the Configuration Option, there are 4 tabs altogether.
:- For the Memory tab, just accept the default values.
:- For the Character sets tab, I’ll select “Use Unicode (AL32UTF8)” for multiple language and character set support.
:- For the Security tab, accept as default.
:- For the Sample Schema tab, check on the “Create database with sample schemas“. This is good for study and future reference.
Once done, just click “Next” to continue.
- Next, select “User Database Control for database management“. For now, I’m leaving out the “Enable email notification check box”. Click “Next” to continue.
- For the Backup and Recovery section, select “Enable automatic backups” and select “File System” for now. Have the Recovery area location to be “/u01/app/oracle/recovery_area“. As for the user to perform the backup, just enter the “oracle” username for now and password “oracle1234“. Click “Next” to continue.
- Schema Passwords: This is totally up to you. You can have different password for each different Oracle users@schemas or you can have a common one for all of them. Just remember the password.
- Operating System Groups: Select “DBA” for Database Administrator (OSDBA) Group and “oper” for Database Operator (OSPER) Group. Click “Next” to continue.
- Now after setting up all of the configuration, the installer will verify the system if all things are okay for the installation to carry out. Just wait for a while.
** Do take note that if you have not follow through the section on checking of SWAP space and the Kernel parameters in /etc/system, you might bump into problems in the step. Most of the time, the installer will complain about the Hard Limit Maximum User Processes (something to do with Kernel parameter) or the SWAP space is not enough. If the installer complains, do read the complains carefully one by one. You can either click on the “Fix & Check again” button or simple fix it yourself if you know what you are doing.
- After verification and if everything passed, the installer will lead you to a Summary page. Here, there’s a “Save Response File” button. I highly suggest that you save the response file into the “oracle” user’s home directory as it is being used for future automated installation process without needing to go through all the length steps again. Click “Next” to continue.
- Now, sit back, relax or do something else as the installation will take quite a long while. Once it has created the database, click “OK” to proceed.
Now when this screen appears, you need to have another terminal and login as the “root” user. You can do this through SSH and follow the instructions:
:- First, change the directory by typing: “cd /u01/app/oraInventory”
:- Next, execute the script by typing: “./orainstRoot.sh”
You should be able to see the below response:
Changing permissions of /u01/app/oraInventory. Adding read,write permissions for group. Removing read,write,execute permissions for world. Changing groupname of /u01/app/oraInventory to oinstall. The execution of the script is complete.
:- Then change the directory by typing: “cd /u01/app/oracle/product/11.2.0/dbhome_1”
:- Execute another script by typing: “./root.sh”
You should see the below response:
Running Oracle 11g root.sh script... The following environment variables are set as: ORACLE_OWNER= oracle ORACLE_HOME= /u01/app/oracle/product/11.2.0/dbhome_1 Enter the full pathname of the local bin directory: [/usr/local/bin]: Creating /usr/local/bin directory... Copying dbhome to /usr/local/bin ... Copying oraenv to /usr/local/bin ... Copying coraenv to /usr/local/bin ... Creating /var/opt/oracle/oratab file... Entries will be added to the /var/opt/oracle/oratab file as needed by Database Configuration Assistant when a database is created Finished running generic part of root.sh script. Now product-specific root actions will be performed. Finished product-specific root actions.
Take note of the dbhome, oraenv, coreenv and the oratab file and their respective paths. You’ll need this during your administration process.
- Done! Click on the “Close” button to exit the installer.
Looking into System Variables For User “oracle” And The /var/opt/oracle/oratab
I know that you are anxious to start the database, connect it and start playing with it. There are a few things which are needed to configure and which will come in very handy later. Now, we need to define a few system variables and modify the /var/opt/oracle/oratab file before the database could be started.
We need to define a few system variables below:
|ORACLE_BASE||The Oracle Base Directory which points to /u01/app/oracle|
|ORACLE_HOME||The Oracle Home Directory which points to /u01/app/oracle/product/11.2.0 (This directory will be the working directory for all of the task.|
|ORACLE_HOME_LISTENER||The Home Listener Directory. In this case, it should be same as $ORACLE_HOME for now|
|ORACLE_SID||The SID value, in this case, it should be orclSID, just like what we have defined during the installation earlier|
|ORACLE_UNQNAME||The Oracle Unique Name, which refers to the database name. In this case, it should be orclDB just as defined earlier during installation.|
Perform This As The “oracle” User:
- Through SSH, login as the “oracle” user. You should be leaded to your home directory “/export/home/oracle”. If not, please change the directory to your home.
- If you have not created a “.profile” file in your home directory, this is a good time. The .profile file will be run every time when a user logs in, which initializes any system variables and other initialization stuff for convenience sake. It must be the in the home directory of the user. It will not be visible when you do a “ls” command. But you can see if it exist when you perform a “ls -al” command. Just “vi .profile” to create/edit the .profile file. The below should be the contents of the .profile:
#!/bin/sh ORACLE_BASE=/u01/app/oracle ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1 ORACLE_HOME_LISTENER=$ORACLE_HOME ORACLE_SID=orclSID ORACLE_UNQNAME=orclDB export ORACLE_BASE export ORACLE_HOME export ORACLE_HOME_LISTENER export ORACLE_SID export ORACLE_UNQNAME PATH=$PATH:$ORACLE_HOME/bin export PATH
- Now, we need to edit the “oratab” file. Change the directory by typing “cd /var/opt/oracle“. Edit the oratab file and change the ‘N‘ character to ‘Y‘. Save the file.
## Edit this line: orclSID:/u01/app/oracle/product/11.2.0/dbhome_1:N ## Change it to: orclSID:/u01/app/oracle/product/11.2.0/dbhome_1:Y
Now that you have your .profile defined and the oratab file edited, just logout and login back again as “oracle” user. Your system variables should be defined and you are ready to start the database.
Starting, Connecting and Stopping The Database
How to start the Database
- In order to start the database, just login as “oracle” and change the directory to $ORACLE_HOME/bin by typing: “cd $ORACLE_HOME/bin“.
- There’s a little problem with the “dbstart” file install by default, you need to edit it and change the first line:
## Please change the below line: #!/bin/sh ## Change it to: #!/bin/bash
Use vi editor to do this and do the same for the “dbshut” file as well.
- Once done, you may start the database by issueing a command: “./dbstart $ORACLE_HOME $ORACLE_HOME_LISTENER“. The result should be something like the below:
$ ./dbstart $ORACLE_HOME $ORACLE_HOME_LISTENER Processing Database instance "orclSID": log file /u01/app/oracle/product/11.2.0/dbhome_1/startup.log
Congratulations! Things look pretty good now.
How to start/stop the DBConsole
The DBConsole is a web application that connects to the database for administrator purposes. To start the DBConsole, to be following in the $ORACLE_HOME/bin directory by typing: “./emctl start dbconsole“. You should be able to see the out put below:
$ ./emctl start dbconsole Oracle Enterprise Manager 11g Database Control Release 126.96.36.199.0 Copyright (c) 1996, 2009 Oracle Corporation. All rights reserved. https://Oracle11gServer:1158/em/console/aboutApplication Starting Oracle Enterprise Manager 11g Database Control ......... started. ------------------------------------------------------------------ Logs are generated in directory /u01/app/oracle/product/11.2.0/dbhome_1/Oracle11gServer_orclDB/sysman/log
To test this out, you can point your browser to the stated URL: https://Oracle11gServer:1158/em/console/aboutApplication or with the specific IP address…for my case, https://192.168.2.124:1158/em/console/aboutApplication. If the DBConsole had successfully started, it should automatically redirect you to the login page. You may login as “SYSTEM” with the password define earlier during the installation process.
In order to stop the dbconsole, just type: “./emctl stop dbconsole“.
How to connect to the Database
You may try connecting the database through sqlplus by typing: “./sqlplus SYSTEM/
How to stop the Database
In order to stop the database, issue a command: “./dbshut $ORACLE_HOME“. The output should be:
$ ./dbshut $ORACLE_HOME Processing Database instance "orclSID": log file /u01/app/oracle/product/11.2.0/dbhome_1/shutdown.log
Ah finally, the sweet success of Oracle 11g DB installation. Its a lengthy, tedious and inconvenient process. However, I hope that once you’ve completed this tutorial instruction, please do leave a remark at the comments column if it was a success for you, or if there are any errors which you had encountered or if there are any contents that are needed to be improved. I have yet to write anything on starting the database when system boots though, but I’ll just leave that as my next post.
Thank you for reading and I hope it helps you as much as it had helped me in all of my other Oracle 11g Database installations.