Oracle Database 12c Release 1 Installations on Solaris 11.1 (x86-64)


In this article we’ll describe the installation of Oracle Database 12c Release 1 on Solaris 11.1 (x86-64). This article is based on a default server installation.



Prerequisites:

Solaris 11 repository image Part-A and Part-B
Oracle database 11g-Release-2 file1 and file2

Lab environment:

Platform:              VMware vSphere Hypervisor 5.0 (VM)
Hostname:            labdbsrv
IP Addr:                172.22.2.10
Memory:               8GB
HDD:                    80GB (VMware Thin Provision)



Setup Solaris local repository

root@labdbsrv:~# pkg unset-publisher solaris
root@labdbsrv:~# pkg set-publisher –g file:///media/SOL_11_1_REPO_FULL/repo solaris

Install Prerequisites

root@labdbsrv:~# pkg install SUNWhea SUNWmfrun SUNWxorg-client-programs SUNWxorg-clientlibs SUNWxwfsw
 
  

Create new groups, users & Installation directory
Now we need to create few groups, an ‘oracle user’ a non-root account that will own the Oracle database software installation. Become root, issue the following commands:

root@labdbsrv:~# groupadd oinstall
root@labdbsrv:~# groupadd dba
root@labdbsrv:~# groupadd dbgroup
root@labdbsrv:~# mkdir –p /export/home/oracle

root@labdbsrv:~# useradd -g oinstall -G dba -d /export/home/oracle oracle
root@labdbsrv:~# passwd -r files oracle
root@labdbsrv:~# chown –R oracle:oinstall /export/home/oracle

root@labdbsrv:~# mkdir -p /u01
root@labdbsrv:~# mkdir -p /oradata
root@labdbsrv:~# chown -R oracle:oinstall /u01
root@labdbsrv:~# chown -R oracle:oinstall /oradata

Login as the oracle user and add the following lines at the end of the /export/home/.profile file, making sure you have set the correct ORACLE_BASE value.


oracle@labdbsrv:~$ vi /export/home/oracle/.profile

export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=/u01/app/oracle/product/12.1.0/dbhome_1
export ORACLE_SID=orcl
export ORACLE_UNQNAME=orcl
export ORACLE_HOSTNAME=labdbsrv
export PATH=$ORACLE_HOME/bin:$PATH

Configure a Resource Project
You might be familiar with Oracle installations under Linux. If so, you’d know that part of the preparation stage in getting that right is to configure assorted kernel parameters, so that memory and other system resources are adequate. The same thing happens under Solaris, but we do it in a completely different way: we create a “resource project” in which memory and system resources are specified. Later, we assign those resource projects to specific users.

Issue the following command to create resource project and then append following line to the /etc/user_attr file.

root@labdbsrv:~# projadd oracle
root@labdbsrv:~# vi /etc/user_attr

oracle::::project=oracle

Save and exit

If you've performed a default installation, it is likely that the only kernel parameter you need to alter is "max-shm-memory" to meet the minimum installation requirements.

To modify the following value, make sure at least one SSH session is logged in as the oracle user, then from the root user issue the following commands.
To check the current value issue the following command.

root@labdbsrv:~# prctl -n project.max-shm-memory -i project oracle

project: 100: oracle
NAME    PRIVILEGE       VALUE    FLAG   ACTION     RECIPIENT
project.max-shm-memory
        privileged       254MB      -   deny                       -
        system          16.0EB    max   deny                    -

root@labdbsrv:~# prctl -n project.max-shm-memory -v 4gb -r -i project oracle
root@labdbsrv:~# projmod -s -K "project.max-shm-memory=(priv,4gb,deny)" oracle



The virtual machine I was using while writing this article created with 8GB memory so I’m actually allocating 50% of the memory to SGA here.  The first command dynamically resets the value, while the second command makes changes into the "/etc/project" file so the value is persistent between reboots.

Verify /etc/project file

root@labdbsrv:~# more /etc/project

system:0::::
user.root:1::::
noproject:2::::
default:3::::
group.staff:10::::
oracle:100::::project.max-shm-memory=(priv,4294967296,deny)



Probably the key resource value to set is that first one: max-shm-memory governs the largest size of shared memory segment that the project can create.  Set it to the sum of all the SGAs you think you’re going to create on a box, plus some spare for growth. The usual principle is that, after allowing some memory to the OS for its own use, you allocate 50% of your RAM to SGA and 50% to PGA. The SGA value is then what you’d set your max-shm-memory to.

For example - I have a Server Machine with 64GB memory. I’d maybe allow 32GB RAM for the server OS itself. That means there are 32GB available RAM. Basic principle then says, ‘allow 16GB for SGA and 16GB for PGA’ so set max-shm-memory to 16GB.



Switch user from root to oracle
You must have already installed Xmanager 3.0 under windows workstation machine and Xmanager passive should be running in order to run Oracle database graphical installation. Switch root user to oracle and export Graphical display to your windows Xmanager workstation.


  

root@labdbsrv:~# su – oracle
oracle@labdbsrv:~$ export DISPLAY=172.22.2.50:0.0

Run Oracle Database Installer
oracle@labdbsrv:$ unzip -q solaris.x64_12cR1_database_1of2.zip
oracle@labdbsrv:$ unzip -q solaris.x64_12cR1_database_2of2.zip

oracle@labdbsrv:$ /export/home/oracle/database/runInstaller
Starting Oracle Universal Installer...

Checking Temp space: must be greater than 180 MB.   Actual 1034 MB    Passed
Checking swap space: must be greater than 150 MB.   Actual 1129 MB    Passed
Checking monitor: must be configured to display at least 256 colors.    Actual 16777216    Passed



This is the first screen of database 12c installation


Sign up for email alerts and security updates if you have oracle support otherwise leave blank and carry on with the installation. 


If you switch off the security updates option and click [Next], you will see the following warning; just click [Yes] to move to next installation screen.


Configure appropriate settings for software update, otherwise Click [Skip software updates] then click [NEXT]


Click [Create and configure a database] then click [NEXT]



Select [Desktop Class] then click [NEXT]




The only thing to do here is to provide a password that will apply to the SYS and SYSTEM users when your starter database is finally created. Click [NEXT]


The path to the Inventory directory is again derived automatically from environment variables and ‘oinstall’ is the correct group to owning the OraInvenrory location. Click [NEXT] 


This screen displaying summary contains information of oracle installation, Click [Finish] and the software installation will begin:



This will take quite some time to complete, meanwhile have a cup of coffee and enjoy your free time.


Both of these scripts have to be run as root; don’t click [OK] at this stage.


Run each of the scripts mentioned in turn. The first script won’t require any input, but the second script will prompt you for the full pathname of the local bin directory. It will make a default suggestion of /usr/local/bin. This should be changed, by typing the actual path, which is /usr/bin.


root@labdbsrv:~# /u01/app/oraInventory/orainstRoot.sh
 
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.

root@labdbsrv:~# /u01/app/oracle/product/12.1.0/dbhome_1/root.sh
Performing root user operation for Oracle 12c
The following environment variables are set as:
 
ORACLE_OWNER= oracle
ORACLE_HOME= /u01/app/oracle/product/12.1.0/dbhome_1

Enter the full pathname of the local bin directory: [/usr/local/bin]: /usr/bin
Copying dbhome to /usr/bin ...
Copying oraenv to /usr/bin ...
Copying coraenv to /usr/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 script.
Now product-specific root actions will be performed.


Once both scripts have completed, you can return to the earlier dialog box and click [OK] to close it.

The Database Configuration Assistant (DBCA) will be launched automatically:


If everything goes fine then eventually you’ll see the following screen, note down “EM Database Express URL” then click [OK]


You’ll get one more dialog box, just click [Close] and the installation is complete.



Post Configuration

There are two post install configuration to be done. First, we need to be able to make the Oracle database come up automatically every time the server is rebooted.

To do this, become root and issue the following command:

root@labdbsrv:~# vi /etc/init.d/dboras

#!/bin/sh
ORACLE_HOME=/u01/app/oracle/product/12.1.0/dbhome_1
ORACLE_OWNER=oracle
ORACLE_SID=orcl
PATH=$ORACLE_HOME/bin:$PATH:.

if [ ! -f $ORACLE_HOME/bin/dbstart ]; then
  echo "Oracle Startup: cannot start"
  exit
fi

case "$1" in
'start')
    su - $ORACLE_OWNER -c "$ORACLE_HOME/bin/dbstart $ORACLE_HOME"
    su - $ORACLE_OWNER -c "$ORACLE_HOME/bin/emctl start dbconsole"
    ;;
'stop')
    su - $ORACLE_OWNER -c "$ORACLE_HOME/bin/emctl stop dbconsole"
    su - $ORACLE_OWNER -c "$ORACLE_HOME/bin/dbshut $ORACLE_HOME"
    ;;
esac
exit 0

Save and exit

Now issue the following commands:

root@labdbsrv:~# ln -s /etc/init.d/dboras /etc/rc0.d/K01oracle
root@labdbsrv:~# ln -s /etc/init.d/dboras /etc/rc2.d/K01oracle
root@labdbsrv:~# ln -s /etc/init.d/dboras /etc/rc2.d/S99oracle
root@labdbsrv:~# ln -s /etc/init.d/dboras /etc/rc3.d/K01oracle
root@labdbsrv:~# ln -s /etc/init.d/dboras /etc/rc3.d/S99oracle

That links in the new script to the Solaris Shutdown and Startup initialization mechanism.

Finally, issue the following command:

root@primarylabsrv:~# vi /var/opt/oracle/oratab

orcl:/u01/app/oracle/product/12.1.0/dbhome_1:N

and replace the very last “:N” to be “:Y”  (that mean “Yes”, I want the database involved to be auto-started).

orcl:/u01/app/oracle/product/12.1.0/dbhome_1:Y

Save and exit

If you reboot at this point, you should be able to log on as the oracle user and immediately connect to a running database without you having to manual intervene at all.

The final step to do in post-installation is to make sure you can connect to the Enterprise Manager Database Control.

That should be available at the URL your database machine IP Address or Hostname: in my case, https://172.22.2.10:5500/em as shown in images below.



That's all what you need to do

No comments:

Powered by Blogger.