Install Oracle 11g on Solaris / OpenSolaris
Note: this guide describes a very basic installation, with the whole system installed in a single slice.
It assumes that sudo is installed and enabled. This post describes how to set it up in Solaris, and this one for OpenSolaris.
The installation is mostly the same for both distributions. The first exception is that, in OpenSolaris, it is needed to install the motif package, using the package manager. Otherwise the installation will abort with a java error such as:
java.lang.UnsatisfiedLinkError...fatal: libXm.so.4: open failed: No such file or directory
The another exception is that the installation under OpenSolaris will issue a warning with the message:
minimum requirement were not met for this environment
This warning can be safely ignored.
To prepare the system, is needed to create dba group and oracle accounts, and prepare the target installation directory under /opt/oracle:
groupadd -g 300 dba useradd -m -d /export/home/oracle -g dba -u 300 -s /bin/bash oracle passwd oracle mkdir /opt/oracle mkdir /opt/oraInventory chown oracle:dba /opt/oracle chown oracle:dba /opt/oraInventory chmod 755 /opt/oracle chmod 755 /opt/oraInventory usermod -G wheel oracle
Some settings are needed to pass the oracle installation checks. Edit /etc/system and add:
set max_nprocs=20000 set maxuprc=16384 set shmsys:shminfo_shmmax=4294967295
Now, login as oracle user, and download the installation discs. Register at Oracle and start the download of Oracle 11g for Solaris x86-64 from Oracle.
Once downloaded the installation disks, unzip them. A directory database is created where unzipped. Execute the installer:
cd database ./runInstaller
The installation is graphical, and, mostly, automatized. A few questions must be asked, like the action to take (I choose create and configure database), the type of installation (desktop class), and the target directories (/opt/oracle and /opt/oraInventory) and global database name (oracle). When the installation completes, it pop-ups a message to execute two scripts as root:
/opt/oraInventory/orainstRoot.sh /opt/oracle/product/11.2.0/dbhome_1/root.sh
(in this last one, it is needed to provide the local bin directory, which is /usr/bin, not /usr/local/bin)
To make oracle available everywhere, the following variables should be added to the environment (for example, adding it into /etc/profile):
ORACLE_HOME=/opt/oracle/product/11.2.0/dbhome_1 ORACLE_OWNER=oracle ORACLE_SID=oracle
and extend PATH with
${ORACLE_HOME}/bin
I will not start the Oracle instance automatically, so I prefer not adding scripts into the /etc/rc?.d directory. However, I setup a couple of scripts in $ORACLE_HOME/bin, to start or stop the database:
startOracle:
#!/usr/bin/bash if [[ $EUID -ne 0 ]]; then if [[ $EUID -ne 300 ]]; then echo No root or oracle, sudoing this command sudo -i $0 exit 0 fi fi WHERE=`dirname $0` if [ "$ORACLE_HOME" = "" ]; then ORACLE_HOME=${WHERE}/.. export ORACLE_HOME fi echo Starting database su - oracle -c "${WHERE}/dbstart ${WHERE}/.." echo Starting enterprise manager su - oracle -c "${WHERE}/emctl start dbconsole"
stopOracle:
#!/usr/bin/bash if [[ $EUID -ne 0 ]]; then if [[ $EUID -ne 300 ]]; then echo No root or oracle, sudoing this command sudo -i $0 exit 0 fi fi WHERE=`dirname $0` if [ "$ORACLE_HOME" = "" ]; then ORACLE_HOME=${WHERE}/.. export ORACLE_HOME fi echo Stopping database su - oracle -c "${WHERE}/dbshut $ORACLE_HOME" echo Stopping enterprise manager su - oracle -c "${WHERE}/emctl stop dbconsole"
But for these scripts to work, it is needed to setup correctly the oratab file (/var/opt/oracle/oratab). You will find there your oracle instance, so edit the associated line, and set the last character as 'Y' to be automatically started (N is the default)
for example: oracle:/opt/oracle/product...:Y
There will be probably problems when starting the Enterprise Manager, reporting an OC4J problem. In my case, my database instance is called oracle, and my host name is lianli, and the error reports a missing file /opt/oracle/product/11.2.0/dbhome_1/oc4j/j2ee/OC4J_DBConsole_lianli_oracle. However, that directory contains a directory OC4J_DBConsole_localhost_oracle, so the solution requires:
cd /opt/oracle/product/11.2.0/dbhome_1/oc4j/j2ee ln -s OC4J_DBConsole_localhost_oracle OC4J_DBConsole_lianli_oracle cd /opt/oracle/product/11.2.0/dbhome_1/ ln -s localhost_oracle lianli_oracle
Now, to start the database it is needed to do:
startOracle