Está en la página 1de 13

Installing Oracle 11g Release 2 on Fedora 14

Installing Oracle 11g Release 2 on


Fedora 14
Finnbarr P. Murphy
(fpm@fpmurphy.com)

This post will show you how to install Oracle Database 11g Release 2 on Fedora 14 (Laughlin),
configure Oracle Enterprise Manager to access the database and how to access the database from
a Window platform using Oracle SQLPlus Instant Client. Note, however, that Oracle Database 11g

ly
R2 is not certified by Oracle to run on Fedora 14 so you will not get support from Oracle if you
have any questions.

on
The following steps should be done as root. First add a number of kernel parameters to
/etc/sysctl.conf if they do not already exist in this file or have values less than what is shown here.

se
fs.aio-max-nr = 1048576
fs.file-max = 6815744 lu
kernel.shmall = 2097152
kernel.shmmax = 536870912
kernel.shmmni = 4096
# semaphores: semmsl, semmns, semopm, semmni
kernel.sem = 250 32000 100 128
a
net.ipv4.ip_local_port_range = 9000 65500
nn

net.core.rmem_default=262144
net.core.rmem_max=4194304
net.core.wmem_default=262144
net.core.wmem_max=1048586
o

These are minimum required values by the way; they can be higher. The current value of a
rs

particular kernel parameter can be displayed using the following command:


pe

# /sbin/sysctl -a | grep

If you do not want to reboot your system after updating /etc/sysctl.conf, just execute the following
r

command to update the kernel with the new parameters:


Fo

# /sbin/sysctl -p

If the Fedora 14 Development Tools package group is already installed, the majority of the
necessary packages to build and run the Oracle database are already installed; otherwise install
the Development Tools package group using yum. If the following additional packages are not
already installed on your system:

● binutils
● libaio, libaio-devel
● ksh
● sysstat
● unixODBC, unixODBC-devel
● compat-libstdc++-33

02-25-2011 Copyright 2004-2011 Finnbarr P. Murphy. All rights reserved. 1/13


Installing Oracle 11g Release 2 on Fedora 14

you also need to install them using yum.

Next, you need to modify PAM (Plugable Authentication Module) configuration files to increase
the session limits for the oracle user which we will create later on. Add the following line to
/etc/pam.d/login if it does not already exist:

session required pam_limits.so

and add the following lines to /etc/security/limits.conf:

oracle soft nproc 2047

ly
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536

on
If /etc/security/limits.conf does currently exist on your system, then create this file with the
appropriate permissions.

se
Next create the oracle user account and a number of associated groups using the following script:

groupadd oinstall
lu
groupadd dba
groupadd oper
groupadd asmadmin
a
nn

useradd -g oinstall -G dba,oper,asmadmin oracle

and then set a password for the new oracle user account.
o

You also must disable Secure Linux (SELINUX) while installing the Oracle database software. To
rs

do this, edit /etc/selinux/config as follows:


pe

SELINUX=disabled

and execute setenforce off. Do not forget to enable SELINUX after you have completed the
r

installation!
Fo

The release information in /etc/redhat-release is incorrect as far as the Oracle installer is


concerned. It knows nothing about Fedora 14 but does know about Red Hat. Therefore the release
string needs to be modified as follows:

# cp /etc/redhat-release /etc/redhat-release.org
# echo "redhat release 5" > /etc/redhat-release

You must create the directories in which the Oracle database software will be installed. In our
example, the directory is /app/oracle.

mkdir -p /app/oracle/product/11.2.0/
chown -R oracle:oinstall /app
chmod -R 775 /app

02-25-2011 Copyright 2004-2011 Finnbarr P. Murphy. All rights reserved. 2/13


Installing Oracle 11g Release 2 on Fedora 14

The next few steps require that you are logged in as oracle. As user oracle, download Oracle
Database 11g R2 from Oracle and place the two files you downloaded into the same subdirectory.
I placed them in ~oracle but you are free to choose any subdirectory. Then unzip both files.

# unzip linux.x64_11gR2_database_1of2.zip
# unzip linux.x64_11gR2_database_2of2.zip
# ls -d */
database/
#

A single subdirectory called database is created. This subdirectory contains the unzipped files.

ly
Oracle supplies quite a lot of user documentation. You can access the documention in either
HTML or PDF format by pointing your web browser to ~oracle/database/doc/index.htm

on
se
a lu
o nn
rs
pe
r

Assuming that the user oracle is using the bash shell, add the following lines to
Fo

~oracle/.bash_profile, changing ORACLE_HOSTNAME, ORACLE_HOME, etc. as needed to suit


your particular requirements:

# Oracle Settings
TMP=/tmp; export TMP
TMPDIR=$TMP; export TMPDIR
ORACLE_HOSTNAME=ultra.xfpmurphy.com; export ORACLE_HOSTNAME
ORACLE_UNQNAME=orcl; export ORACLE_UNQNAME
ORACLE_BASE=/app/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/11.2.0; export ORACLE_HOME
ORACLE_SID=orcl; export ORACLE_SID
ORACLE_TERM=xterm; export ORACLE_TERM
PATH=/usr/sbin:$PATH; export PATH
PATH=$ORACLE_HOME/bin:$PATH; export PATH
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; export LD_LIBRARY_PATH
CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPATH
if [ $USER = "oracle" ]; then

02-25-2011 Copyright 2004-2011 Finnbarr P. Murphy. All rights reserved. 3/13


Installing Oracle 11g Release 2 on Fedora 14

if [ $SHELL = "/bin/ksh" ]; then


ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi

Note that the ORACLE_UNQNAME environmental variable was previously known as


DB_UNIQUE_NAME. This environmental variable is used by Oracle Enterprise Manager; it need
not be the same as ORACLE_SID.

If you are using a different shell, you will need to set up these environmental variables and limits
using the appropriate shell syntax and shell initialization file. You may also need to set the

ly
NLS_LANG environmental variable to match your country, language and desired character set, e.g.
ENGLISH_IRELAND.AL32UTF8 for UTF-8 support in Ireland.

on
Oracle databases are installed using the Oracle Universal Installer (OUI) which is a Java-based
GUI that uses the X Window system. There is no command line installer. You can record your OUI
session to a response file. All the options you selected during the database installation are saved in

se
the response file. This feature makes it easy to duplicate the results of a successful installation on
multiple systems. You may need to set the your DISPLAY environmental variable and use the xhost
utility to configure server access.
lu
Start OUI by issuing the runInstaller command in the ~oracle/database directory. If OUI cannot
determine your IP address because it is not in /etc/hosts then you will get the following error:
a
nn

[INS-06101] IP address of localhost could not be determined

If you see an error message similar to one of the following: “Failed to connect to server”,
o

“Connection refused by server” or “Can’t open display”, then you have a problem with X Windows,
either with permissions or the DISPLAY variable. I am going to assume you know how to fix such
rs

problems.
pe

After answering a few basic questions, you should see the following Typical Install Configuration
screen:
r
Fo

02-25-2011 Copyright 2004-2011 Finnbarr P. Murphy. All rights reserved. 4/13


Installing Oracle 11g Release 2 on Fedora 14

ly
on
se
lu
Check the settings carefully before proceeding further.

Next OUI checks that the installed software development and runtime packages are correct:
a
o nn
rs
pe
r
Fo

Fedora 14 will fail all these checks. Just tick the check box Ignore All on the top right hand to
ignore these errors. So long as you have the latest version of each of these packages installed, all
will be fine. Note that you do not need to install pdksh (Public Domain Korn Shell) if you have ksh
installed.

During the installation, OUI will popup a dialog window advising you that an error has occurred

02-25-2011 Copyright 2004-2011 Finnbarr P. Murphy. All rights reserved. 5/13


Installing Oracle 11g Release 2 on Fedora 14

with ins_emagent.mk. See below:

ly
on
se
lu
This error is due to a change to GCC linker which first occurred in Fedora 13. The announcement
a
is here. The fix is to edit $ORACLE_HOME/sysman/lib/ins_emagent.mk, search for the line
$(MK_EMAGENT_NMECTL) and replace the line with $(MK_EMAGENT_NMECTL) -lnnz11 as
nn

shown above.

After saving the changed file, select the Retry option, and the install should successfully continue.
o

Eventually you should see the Database Configuration Assistant screen followed shortly by a
Password Management screen as shown below:
rs
pe
r
Fo

02-25-2011 Copyright 2004-2011 Finnbarr P. Murphy. All rights reserved. 6/13


Installing Oracle 11g Release 2 on Fedora 14

Do not ignore the Password Management button; press it and change the passwords for SYS and
SYSTEM.

After this you will be asked to run two shell scripts as root. Just open up a root terminal window
and execute these shell scripts. One script installs three scripts, coraenv, oraenv and dbhome in
/usr/local/bin (or another user-specified directory) and the other creates /etc/oratab.

At this stage the installer has finished installing the Oracle database and you can press the Finish
button. The Oracle database does not need to be started; it is already up and running.

If you would like to do a basic smoketest of the installed database software to confirm the
installation was successful, try doing the following:

ly
$ cd $ORACLE_HOME
$ pwd

on
/app/oracle/product/11.2.0
$
$ id
uid=501(oracle) gid=501(oinstall) groups=501(oinstall),502(dba),503(oper),504(asmadmin)
$ emctl stop dbconsole

se
Oracle Enterprise Manager 11g Database Control Release 11.2.0.1.0
Copyright (c) 1996, 2009 Oracle Corporation. All rights reserved.

https://ultra.xfpmurphy.com:1158/em/console/aboutApplication
lu
Stopping Oracle Enterprise Manager 11g Database Control ...
... Stopped.
$ lsnrctl stop
a
LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 04-DEC-2010 14:28:44
nn

Copyright (c) 1991, 2009, Oracle. All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
o

The command completed successfully


[oracle@ultra 11.2.0]$ sqlplus / as sysdba
rs

SQL*Plus: Release 11.2.0.1.0 Production on Sat Dec 4 14:28:54 2010


pe

Copyright (c) 1982, 2009, Oracle. All rights reserved.

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
r
Fo

SQL> shutdown
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> quit
$
$ lsnrctl start

LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 04-DEC-2010 14:30:21

Copyright (c) 1991, 2009, Oracle. All rights reserved.

Starting /app/oracle/product/11.2.0/bin/tnslsnr: please wait...

TNSLSNR for Linux: Version 11.2.0.1.0 - Production


System parameter file is /app/oracle/product/11.2.0/network/admin/listener.ora
Log messages written to /app/oracle/diag/tnslsnr/ultra/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=ultra.xfpmurphy.com)(PORT=1521)))

02-25-2011 Copyright 2004-2011 Finnbarr P. Murphy. All rights reserved. 7/13


Installing Oracle 11g Release 2 on Fedora 14

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 11.2.0.1.0 - Production
Start Date 04-DEC-2010 14:30:21
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /app/oracle/product/11.2.0/network/admin/listener.ora
Listener Log File /app/oracle/diag/tnslsnr/ultra/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=ultra.xfpmurphy.com)(PORT=1521)))
The listener supports no services

ly
The command completed successfully
$ sqlplus / as sysdba

on
SQL*Plus: Release 11.2.0.1.0 Production on Sat Dec 4 14:30:45 2010

Copyright (c) 1982, 2009, Oracle. All rights reserved.

Connected to an idle instance.

se
SQL> startup
ORACLE instance started. lu
Total System Global Area 839282688 bytes
Fixed Size 2217992 bytes
Variable Size 524290040 bytes
Database Buffers 310378496 bytes
a
Redo Buffers 2396160 bytes
Database mounted.
nn

Database opened.
SQL> quit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Produc
tion
o

With the Partitioning, OLAP, Data Mining and Real Application Testing options
$
rs

$ emctl start dbconsole


Oracle Enterprise Manager 11g Database Control Release 11.2.0.1.0
Copyright (c) 1996, 2009 Oracle Corporation. All rights reserved.
pe

https://ultra.xfpmurphy.com:1158/em/console/aboutApplication

Starting Oracle Enterprise Manager 11g Database Control ....... started.


------------------------------------------------------------------
r

Logs are generated in directory /app/oracle/product/11.2.0/ultra.xfpmurphy.com_orcl/sysman


Fo

/log
$

If you have got this far with your installation of Oracle 11g, all is well. The core Oracle 11g
database software is installed and working. You may have some tweaking to do for your particular
requirements but that is outside the scope of this post.

Before you go any further, as root, you need to do some housekeeping and fix up a couple of files.
Edit the /etc/oratab file and change the restart flag for the orclinstance to Y:

orcl:/app/oracle/product/11.2.0:Y

Then replace /etc/redhat-release to restore the correct release information:

02-25-2011 Copyright 2004-2011 Finnbarr P. Murphy. All rights reserved. 8/13


Installing Oracle 11g Release 2 on Fedora 14

# mv /etc/redhat-release.org /etc/redhat-release

If the Oracle Enterprise Manager dbconsole is running (start with emctl start dbconsole, check
status with emctl status dbconsole), you should be able to use your web browser to access the
console at port 1158. For the initial login, use the username SYS, the password you configured for
this user and set the role to SYSDBA.

ly
on
se
a lu
o nn

To display graphs on certain pages of the Enterprise Manager console you need to have an Adobe
rs

Flash plugin installed. If you are on 64-bit Fedora, I recommend that you install the new Adobe
Square Flash plugin. See this post for details of how to download and install this plugin.
pe
r
Fo

02-25-2011 Copyright 2004-2011 Finnbarr P. Murphy. All rights reserved. 9/13


Installing Oracle 11g Release 2 on Fedora 14

ly
on
se
lu
As part of the database installation a sample HR schema was installed but left locked. Here is how
to unlock this sample schema using sqlplus:
a
$ sqlplus / as sysdba
nn

SQL*Plus: Release 11.2.0.1.0 Production on Sat Dec 4 16:51:07 2010

Copyright (c) 1982, 2009, Oracle. All rights reserved.


o

Connected to:
rs

Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production


With the Partitioning, OLAP, Data Mining and Real Application Testing options
pe

SQL> ALTER USER hr ACCOUNT UNLOCK IDENTIFIED BY xxxxxxx;

User altered.

SQL> quit
r

Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Produc
Fo

tion
With the Partitioning, OLAP, Data Mining and Real Application Testing options
$

At this stage you should be able to invoke the Oracle sqldeveloper GUI by invoking
$ORACLE_HOME/sqldeveloper/sqldeveloper/bin/sqldeveloper. However before you can log in, you
have to configure a valid connection. As an example of how to configure a valid connection, here is
my HR connection properties:

02-25-2011 Copyright 2004-2011 Finnbarr P. Murphy. All rights reserved. 10/13


Installing Oracle 11g Release 2 on Fedora 14

ly
on
se
lu
Once you have configured a valid connection, you will be able to login as user HR and examine the
HR schema.
a
o nn
rs
pe
r
Fo

To automatically start and stop the Oracle database during system startup and shutdown you need
to place an appropriate script in the /etc/rc.d/init.d directory and symbolically link it to the
appropriate rc directories. See this post for an example of such a script.

An Oracle Instant Client gives customers the ability to quickly install and deploy Oracle
applications including sqlplus on various platforms including Microsoft Window 7 without
installing the standard Oracle client or having an ORACLE_HOME. Instant Clients for 32-bit

02-25-2011 Copyright 2004-2011 Finnbarr P. Murphy. All rights reserved. 11/13


Installing Oracle 11g Release 2 on Fedora 14

Microsoft Windows are available here. You need to download two packagee, i.e the Instant Client
Package – Basic Lite (contains English error messages and Unicode, ASCII, and Western European
character set support) and the Instant Client Package – SQL*Plus (contains additional libraries
and executable for running SQL*Plus with Instant Client.)

Unzip the two packages into a single directory such as C:\SQLPLUS. Then edit the configuration
file tnsnames.ora which you will find in this directory to configure the connection to your Fedora
14 system.

ORCL =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS =

ly
(PROTOCOL =TCP)
(HOST = ultra.xfpmurphy.com)
(PORT = 1521)

on
)
)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl.xfpmurphy.com)

se
)
)
lu
If you are using a firewall on your Fedora 14 platform (which you should be!), you will have to
modify iptables to open port 1521 for TCP packet send and receive. Here are the appropriate lines
to add to /etc/sysconfig/iptables:
a
nn

-A INPUT -p tcp --dport 1521 -j ACCEPT


-A OUTPUT -p tcp --sport 1521 -j ACCEPT
o

In a production environment these rules should be modified to restrict the range of IP addresses
rs

that can access the 1521 port.

Once you have configured a valid connection, you will be able to connect to the Oracle database
pe

from your Windows 7 platform.


r
Fo

02-25-2011 Copyright 2004-2011 Finnbarr P. Murphy. All rights reserved. 12/13


Installing Oracle 11g Release 2 on Fedora 14

ly
on
se
lu
If security is not an issue, you can add a shortcut as shown above so that you are automatically
connected to a schema.
a
Well, time to stop. The information in this post should be enough to get you up and running.
Please let me know if I left out anything important that you feel would of been of help to you in
nn

installing Oracle 11g on Fedora 14 and I will add it to this post.


o
rs
pe
r
Fo

02-25-2011 Copyright 2004-2011 Finnbarr P. Murphy. All rights reserved. 13/13

También podría gustarte