Getting Oracle to Run on Redhat (RHEL 6, Oracle 12c)
A good, free VM system is VirtualBox
Redhat and Oracle are available on mjolnir at
Make sure your HDD partition has 30+GB of space
Detailed Preinstall steps are here: http://docs.oracle.com/cd/E16655_01/install.121/e17720/pre_install.htm#LADBI222
Note that (especially if installing into a VM), the base system needs 1.5-2 GB of RAM to work with.
Step 1: Install Prerequisites
See http://docs.oracle.com/cd/E16655_01/install.121/e17720/pre_install.htm#LADBI7534 for a full list of packagess to be installed.
You can find these packages on the Redhat ISO, in the Packages directory.
The list of packages that need to be installed is
binutils-184.108.40.206.2-5.11.el6 (x86_64) compat-libcap1-1.10-1 (x86_64) compat-libstdc++-33-3.2.3-69.el6 (x86_64) compat-libstdc++-33-3.2.3-69.el6 (i686) gcc-4.4.4-13.el6 (x86_64) gcc-c++-4.4.4-13.el6 (x86_64) glibc-2.12-1.7.el6 (i686) glibc-2.12-1.7.el6 (x86_64) glibc-devel-2.12-1.7.el6 (x86_64) glibc-devel-2.12-1.7.el6 (i686) ksh libgcc-4.4.4-13.el6 (i686) libgcc-4.4.4-13.el6 (x86_64) libstdc++-4.4.4-13.el6 (x86_64) libstdc++-4.4.4-13.el6 (i686) libstdc++-devel-4.4.4-13.el6 (x86_64) libstdc++-devel-4.4.4-13.el6 (i686) libaio-0.3.107-10.el6 (x86_64) libaio-0.3.107-10.el6 (i686) libaio-devel-0.3.107-10.el6 (x86_64) libaio-devel-0.3.107-10.el6 (i686) libXext-1.1 (x86_64) libXext-1.1 (i686) libXtst-220.127.116.11 (x86_64) libXtst-18.104.22.168 (i686) libX11-1.3 (x86_64) libX11-1.3 (i686) libXau-1.0.5 (x86_64) libXau-1.0.5 (i686) libxcb-1.5 (x86_64) libxcb-1.5 (i686) libXi-1.3 (x86_64) libXi-1.3 (i686) make-3.81-19.el6 sysstat-9.0.4-11.el6 (x86_64)
Step 2: Install Oracle
Load the zip files and unzip them into a single directory. Then do:
The configuration steps are mostly obvious. A few points:
- You don't need to sign up for emails or support
- At one point, the installer complains about missing packages. YOU CAN INSTALL IN SPITE OF THIS ERROR
You will be asked to run two scripts as root.
- Error PRVF-0002 means that your hostname might need to be added to
Step 3: Configure Oracle
export ORACLE_HOME=.../oracle/product/12.1.0/dbhome_1 export PATH=$PATH:/$ORACLE_HOME/bin
A gui will pop up and you can create a database
MAKE SURE TO USE ALL LOWER-CASE LETTERS in the database name
DO NOT CREATE A PLUGGABLE DATABASE It does not work with flashback.
Make sure that the environment variable
ORACLE_SID is set to the database name (the plugin, not the outer db if using pluggable).
Step 4: Configure A TCP Listener
VirtualBox note: VirtualBox's NAT network adaptor allows you to set up port forwarding
RedHat Note: RHEL has a firewall enabled by default. Make sure that this firewall allows through port 1521.
You will need to configure things. Start by editing the file
$ORACLE_HOME/network/admin/listener.ora At a minimum, the file should contain the following (this declares a TCP listener named LISTENER on localhost:1521, oracle's default port):
LISTENER = (DESCRIPTION_LIST = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521)) ) )
Then you need to declare every database that the listener will be hosting:
SID_LIST_LISTENER = (SID_LIST = (SID_DESC = (GLOBAL_DBNAME=*** GLOBALLY VISIBLE NAME ***) (SID_NAME = *** SID USED WHEN CREATING DB ***) (ORACLE_HOME = *** THE SAME AS $ORACLE_HOME ***) ) (SID_DESC = ... ) ... )
Finally, you start the listener
As it starts up, you should see a listing of every database that is running.
Other Listener commands include stop and status
$>lsnrctl stop $>lsnrctl status
Note that, like oracle, the listener needs to be restarted if the system reboots.
Step 5: Adding users
$> sqlplus /nolog SQL> CONNECT SYS/[password] AS SYSDBA; SQL> CREATE USER [username] IDENTIFIED BY [password] SQL> GRANT [ALL PRIVILEGES | ...] TO [username]
You need to connect
AS SYSDBA or you can't create users.
For pluggable databases (which you shouldn't be using), you need to prefix the username with C## or c##.
If you get an
ORA-27101: shared memory realm does not exist error, that means your
ORACLE_SID environment variables are not configured properly
Step 6: Using Oracle
Make sure that you have environment variables set up correctly. You need two:
ORACLE_HOME: A path to the directory where oracle is installed. Typically
ORACLE_SID: The SID (database name) of the database you want to connect to/use.
Notes: Rebooting Oracle
In the case of a system shutdown or restart, you will need to restart the database (there's probably a cleaner way to do this...)
The database itself gets started as:
$> sqlplus /nolog SQL> CONNECT sys/[password] AS SYSDBA Connected to an idle instance. SQL> STARTUP
The listener also needs to be restarted
$> lsnrctl start
Getting Oracle to Run on Redhat (RHEL 6, Oracle 10g)
The big install matrix: http://www.oracle-base.com/articles/linux/articles-linux.php
There are a crapload of required packages. Be sure to install them all. Many of them need both the i686 and x86_64 versions of the packages installed. When in doubt install both.
Make sure to make the relevant changes to sysctl.conf and MAKE SURE TO RUN sysctl -p so that the changes stick.
If using GCC3.4 (most likely), compat-glibc++33 needs to be installed. This manifests itself as an LD error when the installer is first run.
Trial and error kind of works. The log file is pretty good about letting you know what libraries are missing. Occasionally, the installer will need to be restarted from scratch if you're going about it this way.
The error: .../.../oracle/database/product/10.2.0/db_1/sysman/lib/snmccolm.o: could not read symbols: File in wrong format
can be safely ignored.
The error: ORA-27125: unable to create shared memory segment may arise during supplemental installation. This is an issue with the HUGETLB feature of later linux kernels. The simplest fix is to disable this by replacing the oracle binary with a script that sets the relevant environment variable
linux: # cd $ORACLE_HOME/bin linux: # mv oracle oracle.bin cat >oracle <<"EOF" 1.!/bin/bash export DISABLE_HUGETLBFS=1 exec $ORACLE_HOME/bin/oracle.bin $@ EOF linux: # chmod +x oracle
The "correct" solution involves recompiling the kernel to support this feature.
To start the actual oracle instance, you need to modify the config file. When oracle first starts up, it will complain about a missing config file. The directory it points to has a default (init.ora) that can be copied almost directly.
I encountered an issue with memory allocation : ORA-00371 (Not enough shared pool memory). The fix was to set the 'sga_target' parameter in the config file to the size suggested by oracle.
The 'sga_target' parameter doesn't seem to play well with the 'db_block_buffers' parameter, so the latter may need to be commented out.
After the config file is created, you'll need to start up oracle itself. This is done using the sqlplus command
$> sqlplus /nolog
starts up sqlplus without asking for a logon
SQL> CONNECT [username]/[password] AS SYSDBA; -- establishes an oracle instance SQL> CREATE SPFILE FROM PFILE; -- compiles the config file SQL> STARTUP -- starts oracle ------ DON'T DO THE FOLLOWING... USE bin/dbca instead SQL> CREATE DATABASE -- instantiates a database SQL> CREATE USER [username] IDENTIFIED BY [passwordnoquotes]; SQL> GRANT ALL PRIVILEGES TO [username] WITH ADMIN OPTION;