<< 如何安装Nutch和Hadoop | 首页 | UML统一建模语言简介 >>

HOWTO Install Oracle 10g

Contents

 Introduction

The aim of this post was originally to provide a tested installation procedure to setup an Oracle 10g Release 1 (10.1.0.3) (without RAC) utilizing x86 or amd64/em64t Gentoo Linux. This procedure has been tested on at least one computer and it works. You can try to adapt the procedures on your platform if it is different from this as there are oracle 10g available for various other linux architectures. This document is in flux and being updated to reflect installation procedures used for Oracle 10g R2 version 10.2.0.1.0 by various interested parties. The installation of Oracle 10g R2 provides many bugfixes useful for generic installations of 10g on non Oracle certified platforms that have been fixed since this howto was originally authored.

If you need the Oracle 10g R2 database software point your browser here:

External Link: Oracle Download Center

To install Oracle 10g R2 on x86 you need to download 10201_database_linux32.zip file available here:

10201_database_linux32.zip

To install Oracle 10g R2 on amd64 you need to download 10201_database_linux_x86_64.cpio.gz file available here:

10201_database_linux_x86_64.cpio.gz

 Server Base Setup

Compute a cyclic redundancy check (CRC) checksum for the downloaded files and compare the checksum numbers against the numbers posted on OTN's website. For example:

After you have downloaded the software compute a cyclic redundancy check (CRC) and compare with the following numbers (are the same posted on Oracle OTN).

cksum ship.db.lnx32.cpio.gz
138716919 649170227 ship.db.lnx32.cpio.gz (OK!)
cksum ship.db_Disk1.lnxx86-64.cpio.gz
484993383 599566752 /mnt/raid0/home/p/pat/Desktop/ship.db_Disk1.lnxx86-64.cpio.gz (OK!)
cksum ship.db_Disk2.lnxx86-64.cpio.gz
1599972490 57467433 /mnt/raid0/home/p/pat/Desktop/ship.db_Disk2.lnxx86-64.cpio.gz (OK!)

Now uncompress the files.

gunzip ship.db*gz

that will produce file(s) matching ship.db*cpio that you can unpack with

for i in ship.db*cpio ; do cpio -idmv < $i ; done ;

At this point open two distinct Console windows, one with root privilege and one with your user. The last one later becomes the oracle window. From this point forward execute the root and the unprivileges operations in these windows. Having said that, let's go!

 Checking your Environment

Oracle needs this to work.

 Hardware Requirements

Requirement Minimum Value
Physical memory (RAM) 512 MB (524288 KB)
Swap space 1 GB (1048576 KB)
Disk space in /tmp 400 MB (409600 KB)
Disk space for software files * 2.5 GB (2621440 KB)
Disk space for database files 1.2 GB (1258290 KB)

* This value includes 1 GB (1048576 KB) of disk space required to install the Oracle Database 10g Products from the Companion CD (optional, but recommended).

 Setting Swap Size

Oracle require a system that fit the following requrements:

  • At least 512MB of RAM
  • At least 1GB of swap space or twice the size of RAM

To summarize Oracle's recommendation and to take system configurations easy use the following table to chek your swap memory configuration:

   RAM    Swap Space
1 GB 2 GB
2 GB 3 GB
3 GB 3 GB
4 GB 4 GB
8 GB 4 GB
16 GB 8 GB

The swap space will not be utilized until the system runs out of physical memory. So don't configure too much swap space. Keep in mind that if the system starts using swap space, it has a negative impact to the performance of the database. So make sure that the system has always enough physical RAM and that it doesn't use swap space continuously.

If you don't have the required swap memory, don't worry, you can add a swap file in real time to your linux box. Following this example to do that. NOTE: you must be root to do that.

dd if=/dev/zero of=/root/tmpswp bs=1k count=500000
500000+0 records in
500000+0 records out
chmod 600 tmpswp
mkswap tmpswp
Setting up swapspace version 1, size = 511995 kB
swapon tmpswp
grep SwapTotal /proc/meminfo
SwapTotal: 1504044 kB

 Checking /tmp space

The Oracle Universal Installer requires up to 400 MB of free space in the /tmp directory. If you do not have enough space in the /tmp filesystem, you can temporarily create a tmp directory in another filesystem. Here is how you can do this (/u01 is another filesystem)

mkdir /u01/tmp
chown root:root /u01/tmp
chmod 1777 /u01/tmp

When you are done with the Oracle installation, shutdown Oracle and remove the temporary /tmp directory:

rmdir /u01/tmp
unset TEMP
unset TMPDIR

 Setting /tmp variable

During the installation Oracle requires these variables, so set them in the root window

export TEMP=/your_temp_directory      # used by Oracle
export TMPDIR=/your_temp_directory    # used by Linux programs like the linker "ld"

 Checking and Setting Shared Memory

Shared memory allows processes to access common structures and data by placing them in shared memory segments. It's the fastest form of IPC (Interprocess Communication) available since no kernel involvement occurs when data is passed between the processes. In fact, data does not need to be copied between the processes. Oracle uses shared memory segments for the SGA (Shared Global Area) which is an area of memory that is shared by all Oracle background and foreground processes. The size of the SGA has a major impact to Oracle's performance since it holds database buffer cache and much more.

To see all shared memory settings, run:

ipcs -lm

To see all kernel parameters, execute:

sysctl -a

For Oracle10g, the following kernel parameters have to be set to values greater than or equal to the recommended values which can be changed in the proc filesystem.

Needed Check with
shmmax = 2147483648 cat /proc/sys/kernel/shmmax
shmmni = 4096 cat /proc/sys/kernel/shmmni
shmall = 2097152 cat /proc/sys/kernel/shmall
shmmin = 1 ipcs -lm |grep "min seg size"
semmsl = 250 awk '{print $1}' /proc/sys/kernel/sem
semmns = 32000 awk '{print $2}' /proc/sys/kernel/sem
semopm = 100 awk '{print $3}' /proc/sys/kernel/sem
semmni = 128 awk '{print $4}' /proc/sys/kernel/sem
file-max = 65536 cat /proc/sys/fs/file-max
ip_local_port_range = 1024 65000 cat /proc/sys/net/ipv4/ip_local_port_range

To change this kernel parameters at every boot you have to add the following lines to the /etc/sysctl.conf file

# Kernel Parameters for Oracle 10.1.0 # this is a comment
kernel.shmall = 2097152
kernel.shmmax = 2147483648
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
fs.file-max = 65536
net.ipv4.ip_local_port_range = 1024 65000

To become sure that the new added lines in /etc/sysctl.conf become effective immediately (and every time), execute the following command:

# sysctl -p

Creating Oracle User Account

Oracle recommends using two separate groups that maintain the software and the database. In this scenario, the group membership prevents unauthorized access to the database by personnel who maintain the software, and it prevents the database administrators from making changes to the software and the installations inventory directory.

When using oinstall during the install of the software, one must set their default group to the one that will be maintaining the database before creating the database or permission problems will arise.

Oinstall is not needed when the same people will be maintaining the software and the database. In this situation, it will create more work and add an extra layer of complexity to the maintenance of the installation.

Recommendation: if you don't need the oinstall group for added security, just install using the dba group.

To create the oracle account and groups, execute the following commands in the root window:

groupadd dba         # group of users to be granted SYSDBA system privilege
groupadd oinstall    # group owner of Oracle files
useradd -c "Oracle Software Owner" -g oinstall -G dba -d /opt/oracle oracle

Maybe you want to give passwords to the users (in root window):

passwd oracle

 Creating Oracle Directories

In this example, make sure that the /opt filesystem is large enough, see Requirement for more information. If /opt is not on a separate filesystem, then make sure the root filesystem "/" has enough space.

mkdir -p /opt/oracle/product/10.1.0.3
chown -R oracle:oinstall /opt/oracle
chmod 755 /opt/oracle/

 Setting Shell Limits for the Oracle User

Most shells like Bash provide control over various resources like the maximum allowable number of open file descriptors or the maximum number of processes available to a user.

To see all shell limits, run:

su - oracle
ulimit -a

 Setting Limits for the Maximum Number of Open File Descriptors for the Oracle User

After you changed and increased /proc/sys/fs/file-max (see: Checking Kernel Parameters), there is still a per user limit of open file descriptors which is set to 1024 by default:

su - oracle
ulimit -n
1024

To change this, you have to edit the file /etc/security/limits.conf as root and make the following changes or add the following lines, respectively:

# To increase the shell limits for Oracle 10.1.0.3
oracle               soft    nofile  4096
oracle               hard    nofile  63536

The «soft limit» in the first line defines the number of file handles or open files that the Oracle user will have after login. If the Oracle user gets error messages about running out of file handles, then the Oracle user can increase the number of file handles like in this example up to 63536 («hard limit») by running the following command:

ulimit -n 63536

Note that we do not recommend to set the «hard limit» for nofile for the oracle user equal to /proc/sys/fs/file-max.If you do that and the user uses up all the file handles, then the system would run out of file handles. This could mean that you won't be able to initiate new remote logins any more since the system won't be able to open any PAM modules which are required for performing a login. That's why we set the hard limit to 63536 and not to 65536.

You also need to make sure that pam_limits is configured in the file /etc/pam.d/system-auth. This is the PAM module that will read the /etc/security/limits.conf file. The entry should read like:

session required /lib/security/pam_limits.so
session required /lib/security/pam_unix.so

Now login to the oracle account again since the changes will become effective for new login sessions only.

su - oracle
ulimit -n
4096

 Setting Limits for the Maximum Number of Processes for the Oracle User

To see the current limit of the maximum number of processes for the oracle user, run:

su - oracle
ulimit -u

To change the "soft" and "hard" limits for the maximum number of processes for the oracle user, add the following lines to the /etc/security/limits.conf file:

# To increase the shell limits for Oracle 10.1.0.3
*               soft    nproc   2047
*               hard    nproc   16384

(Remark-AW: * means for every user, using user 'oracle' or group @ora and @oinstall should also work)

 Make Settings Permanent

For the Bourne, Bash, or Korn shell, add the following lines to the /etc/profile, or in a new /etc/profile.d/oracle.sh file.

  if [ $USER = "oracle" ]; then
           if [ $SHELL = "/bin/ksh" ]; then
                 ulimit -u 16384
                 ulimit -n 63536
           else
                 ulimit -u 16384 -n 63536
           fi
   fi

(The first condition checks that user is oracle, to avoid setting ulimit for all users on that system that high.)

 Setup Variables

Copy the file below to your /etc/env.d/99oracle file. You probably will not have one. That's ok. Just create it.


Code: /etc/env.d/99oracle
ORACLE_BASE=/opt/oracle
ORACLE_HOME=/opt/oracle/product/10.1.0.3
ORACLE_SID='YOURSID'
ORACLE_TERM=xterm
ORACLE_OWNER=oracle
TNS_ADMIN=/opt/oracle/product/10.1.0.3/network/admin
NLS_LANG=AMERICAN_AMERICA.WE8ISO8859P1
ORA_NLS10=/opt/oracle/product/10.1.0.3/nls/data
CLASSPATH=/opt/oracle/product/10.1.0.3/jdbc/lib/classes12.zip
LD_LIBRARY_PATH=/opt/oracle/product/10.1.0.3/lib:/opt/oracle/product/10.1.0.3/lib32
DISABLE_HUGETLBFS=1
PATH=/opt/oracle/product/10.1.0.3/bin
ROOTPATH=/opt/oracle/product/10.1.0.3/bin
LDPATH=/opt/oracle/product/10.1.0.3/lib:/opt/oracle/product/10.1.0.3/lib32
TZ=GMT
 

Note: If you're like me, and your system clocks are not set to GMT or UTC, you will likely want to change the TZ variable to something other than GMT. Setting TZ=EST5EDT restored my system to my preferred setting.

Note: If you want to use variables and so have less work when changing oracle variables use this:

Code: /etc/env.d/99oracle
ORACLE_BASE=/opt/oracle
ORACLE_HOME=${ORACLE_BASE}/product/10.2.0.1
ORACLE_SID='YOURSID'
ORACLE_TERM=xterm
ORACLE_OWNER=oracle
TNS_ADMIN=${ORACLE_HOME}/network/admin
NLS_LANG=AMERICAN_AMERICA.WE8ISO8859P1
ORA_NLS10=${ORACLE_HOME}/nls/data
CLASSPATH=${ORACLE_HOME}/jdbc/lib/classes12.zip
LD_LIBRARY_PATH=${ORACLE_HOME}/lib:${ORACLE_HOME}/lib32
DISABLE_HUGETLBFS=1
PATH=${ORACLE_HOME}/bin
ROOTPATH=${ORACLE_HOME}/bin
LDPATH=${ORACLE_HOME}/lib:${ORACLE_HOME}/lib32
TZ=GMT
 

10g 10.2.0.1 notes:

I've managed to install 10g 10.2.0.1 on an amd64 smp 246 opteron using this guide with some mostly obvious substitutions. Both the console and ora listener are working but the database server will not start i believe due to the databases not being created during the installation which results in the SID not being found.

 hammer ~ # /etc/init.d/ora.console start
 Start Oracle Enterprise Manager DB Console ...
 TZ set to Canada/Central
 OC4J Configuration issue. /opt/oracle/product/10.2.0/db_1/oc4j/j2ee/OC4J_DBConsole\

_hammer.domain.com_PROD not found.

The installer for 10.2.0.x varies considerably in some areas and has been sustantially improved.One thing that seems to have eluded explaination un this section of the guide is the fuction of the ORACLE_SID='YOURSID' env. variable. Perhaps someone might be able to expand with some further information on how to set the SID for 10.2.1.x - ali3nx

[10g 10.2.0.1 note--ORACLE_SID]

I have about the same question as ali3nx RE the ORACLE_SID var. As best I can figure from googling, it simply exists to differentiate Oracle instances, and as such is a user-defined string. I'm basing this conclusion on a demon.co.uk oracle set sid page. Please feel free to correct - wrs4


[10g 10.2.0.1 notes]


[10gR2 notes] I added

 ORACLE_HOSTNAME=myhost.domain.org

for my DHCP-based computer. Some notes Oracle had indicated that /etc/hosts is used to determine the hostname (I think for servers with multiple network cards). Since I am DHCP I do not have an entry in /etc/hosts. [/10gR2 notes]

Don't forget to alter YOURSID with the SID, you're about to create when making your database. Once that's done and this value is altered in /etc/env.d/99oracle, you should do the following as root in order to make the startup script work properly.

env-update
source /etc/profile

This way, the variable configuration is kept in one single place (/etc/env.d/99oracle) and it is available in oracles's interactive shell sessions.


 

Before we go to install, we should check all necessary software installed in a box. We need;

  • openmotif
  • gcc 3.4 or later
  • libXtst
  • xorg-x11 (not needed if you don't want to have an X server, but only use the client)
  • glibc=2.3.x (some oracle utils may require linuxthreads, glibc 2.4 supports only NPTL)
  • libaio.

[10gR2 notes] I have been able to install 10gR2 on a x86 only with gcc-4.x and glibc 2.5. I'm also using the 2005.0 selinux profiile, so maybe that makes the difference.

You also need libstdc++v3. There is a problem with libstdc++: Oracle expects the libstdc++.so.5 to be in /usr/lib when it is in the /usr/lib/libstdc++-v3/ directory. Create a symbolic link so that Oracle can find it:

 ln -s /usr/lib/libstdc++-v3/libstdc++.so.5 /usr/lib

This also allows the links to run automatically. [/10gR2 notes]

Those are which i could detect so far by now. I will report the latest changes when installation succesful. Cheers

 Installing Oracle10g

Ok. Now that our environment is set, we can start the installation. Switch to the root's window and execute this command

xhost +

and then from your Oracle user

export DISPLAY=<Any X-Window Host>:0.0
./runInstaller -ignoreSysPrereqs

wait that Universal installer coming up an control and leave the default values (recommended)

 Running Installer

Note From alan <<dot>> j <<dot>> larkin <<at>> ucd <<dot>> ie

Oracle 10.2.0.1.0 on AMD64. I needed to:

   $ mkdir /oratmp && chown oracle:oinstall /oratmp && chmod 777 /oratmp
   $ export TEMPDIR=/oratmp
   $ export TMP=/oratmp

, but am still stuck on a NullPointerException:

   $ ./database/runInstaller -ignoreSysPrereqs -jreLoc /opt/sun-jdk-1.6.0/jre
   Starting Oracle Universal Installer...
   Checking installer requirements...
   Checking operating system version: must be redhat-3, SuSE-9, redhat-4, UnitedLinux-1.0, asianux-1 or asianux-2
                                         Failed <<<<
   >>> Ignoring required pre-requisite failures. Continuing...
   Preparing to launch Oracle Universal Installer from /oratmp/OraInstall2007-05-01_04-21-52PM. Please wait ... 
Exception java.lang.NullPointerException occurred..
   java.lang.NullPointerException
           at oracle.sysman.oii.oiix.OiixPathOps.concatPath(OiixPathOps.java:553)
           at oracle.sysman.oii.oiic.OiicBaseApp.setAdditionalProperties(OiicBaseApp.java:369)
           at oracle.sysman.oii.oiic.OiicInstaller.processCommandLine(OiicInstaller.java:668)
           at oracle.sysman.oii.oiic.OiicInstaller.runInstaller(OiicInstaller.java:887)
           at oracle.sysman.oii.oiic.OiicInstaller.main(OiicInstaller.java:866)

A java process is left doing apparently nothing. From decompilation I've determined that the exception is raised during construction of a library path. One of the system information strings cannot be determined (on Gentoo) and is left as null.

Eager to hear suggestions.


Note From Danny at polonious dot com dot au when I was installing Oracle 10.2.0.1.0 on AMD64, I followed the above instruction exactly and changed only SU as mentioned below,others were kept as the default.e.g. I kept installer create a database instance for me. everything was smooth.maybe I was lucky:-) End of note

Note from "goetzger <<at>> web <<dot>> de" about Oracle 10g R2 (10.2.0.1.0) for Linux:

The installer for hangs during linking of ntcontab at my box, so we need to fix $ORACLE_HOME/bin/gennttab.

In this script they try to replace a space with a newline using sed but the code fails with a sed command error. To fix replace the part reading

 LIB=`$ECHO ${TtoLIB}  | $SED 's/ /\\
 /g' | $GREP "^${T}:" | $AWK -F: '{print $2}'`

with

 LIB=`$ECHO ${TtoLIB}  | $SED 's/ /\n/g' | $GREP "^${T}:" | $AWK -F: '{print $2}'`

This info have been posted here, thanks to admjal!

I had to replace this script during the installation by checking with

  find product/10.2.0.1.0 -name gennttab 

and then replace the script by the fixed one before it starts with linking!

end of note.

Note from "chous <<at>> acm-sl <<dot>> org" about Oracle 10g R2 (10.2.0.1.0) for Linux:

In my environment, the installer window appears, but its contents are not displayed. It's possible to manage the installer using the keys, so I guessed it had to do with the JRE it was using. I'm installing Oracle 10g on a gentoo-hosted gentoo virtual server, and the problem gets solved by installing JDK 1.5

emerge -uav jdk

and then

./runInstaller -nobackground -ignoreSysPrereqs -jreLoc /opt/sun-jdk-1.5.0.08/jre

end of note.


Note (karsten baumgarten at gmx net) You may encounter the same problems as above, when installing on a remote server via SSH. Simply use trusted X-forwarding (ssh -Y) and the content of the windows will be there.


Image:Ora_inst_screenshot1.jpg
Confirm the values
Image:Ora_inst_screenshot2.jpg
Run the script in the root's window
Image:Ora_inst_screenshot3.jpg
Confirm the values
Image:Ora_inst_screenshot4.jpg
Select Custom Installation if you want
Image:Ora_inst_screenshot5.jpg
If Custom Installation was selected, Select/Unselect the highlited items
Image:Ora_inst_screenshot6.jpg
Confirm the values
Image:Ora_inst_screenshot7.jpg
Do NOT create database. We will do it later

Notes from "gbevin <<at>> uwyn <dot> com about Oracle 10g R2 for Linux:

[Oracle10gR2] You can create the database at this point, everything in the installed works just fine and I didn't have to perform any of the manual tasks below. The scripts that need to be run as root also functioned without requiring any modifications.[/Oracle10gR2]

Image:Ora_inst_screenshot8.jpg
Check the summary befor install. Press install button, sit back and relax... There are extra stuff to make Oracle 10g work on AMD64/EM64T at the end of this HOWTO. You may need them during this install phase.
Image:Ora_inst_screenshot9.jpg

Do NOT run the last root script yet, otherwise the script will crash.

Delete the following two lines from root.sh:

$LNS $ID/init.cssd $rc/"$RC_START"init.cssd || { $ECHO $?; exit 1; }
$LNS $ID/init.cssd $rc/"$RC_KILL"init.cssd  || { $ECHO $?; exit 1; }

as well as the line:

$CP $CH/css/admin/init.cssd $ID/init.cssd

Now do the following:

cp /opt/oracle/product/10.1.0.3/css/admin/init.cssd /etc/init.d/init.cssd
ln -s /etc/init.d/init.cssd /etc/init.d/S96init.cssd
ln -s /etc/init.d/init.cssd /etc/init.d/K96init.cssd

Then edit the /etc/init.d/init.cssd file and change the line

SU='/bin/su -l'

to

SU='/bin/su'

NOTE: This is declared multiple times - change the occurance in the $PLATFORM case statement ( ~ line 82)

 ln -s /opt/oracle/product/10.1.0.3/lib/libclntsh.so /opt/oracle/product/10.1.0.3/lib/libclntsh.so.10.1
 ln -s /opt/oracle/product/10.1.0.3/lib32/naedhs.o /opt/oracle/product/10.1.0.3/lib/
 ln -s /opt/oracle/product/10.1.0.3/lib32/naect.o /opt/oracle/product/10.1.0.3/lib/

Make sure that you:

a) Don't create a database as part of the install

b) Ignore any errors from relinking during installation


1. add the "pic" flag to your USE flags in /etc/make.conf

2. re-emerge glibc (Not 100% sure if this is necessary, but I did the rebuild)

3. Apply the patches below to various make files and to relink

4. run relink manually:

relink oracle

relink network

relink client

relink client_sharedlib

relink interMedia

relink ctx

relink utilities

relink sqlplus

relink ldap

5. Run dbca to create a new database. (Make sure to remove any references to Enterprise Manager when configuring the database)


Code: Patch for $ORACLE_HOME/bin/relink
 
 --- relink.org  2005-01-12 18:05:59.061221392 -0500
+++ relink      2005-01-12 18:11:58.346601712 -0500
@@ -56,7 +56,7 @@
 #-----------------------------
 # make sure ORACLE_HOME is set

-if [ x${ORACLE_HOME} = x ] -o [ ${ORACLE_HOME} = "" ];
+if [ x${ORACLE_HOME} = "x" ];
 then
     echo "ORACLE_HOME is either unset or empty."
     exit 1
@@ -75,7 +75,7 @@
 ARGUMENTS="<parameter>"
 USAGE="usage:\n\t$SCRIPTNAME $ARGUMENTS"
 HELPMESG="\nparameters: all, oracle, network, client, client_sharedlib,\
-          interMedia,\n\tctx, precomp, utilities, oemagent, ldap"
+          interMedia,\n\tctx, precomp, utilities, sqlplus, ldap"

 if [ $# -ne 1 ];
 then
@@ -89,10 +89,10 @@
 #---------------------------
 # check for valid parameter

-if [ $1 != "all" -a $1 != "oracle" -a $1 != "client" -a\
+if [ $1 != "all" -a $1 != "oracle" -a $1 != "sqlplus" -a $1 != "client" -a\
      $1 != "client_sharedlib" -a $1 != "network" -a $1 != "interMedia" -a\
      $1 != "ctx" -a $1 != "precomp" -a $1 != "utilities" -a\
-     $1 != "oemagent" -a $1 != "ldap" ] ; then
+     $1 != "ldap" ] ; then
     echo "No valid parameter"
     echo $HELPMESG
     exit 1
@@ -196,8 +196,6 @@
                  files="$ORACLE_HOME/rdbms/lib/ins_rdbms.mk" ;;
         sqlplus)
                  files="$ORACLE_HOME/sqlplus/lib/ins_sqlplus.mk" ;;
-        oemagent)
-                 files="$ORACLE_HOME/sysman/lib/ins_sysman.mk" ;;
         ldap)
                  files="$ORACLE_HOME/ldap/lib/ins_ldap.mk" ;;
         all)
@@ -291,9 +289,9 @@
     cleanup
 }

-oemagent () {
-    call_make $param "install"
-    cleanup
+sqlplus () {
+       call_make $param "install"
+       cleanup
  }

  all () {


Code: Patch fro $ORACLE_HOME/rdbms/lib/env_rdbms.mk
 
--- env_rdbms.mk.org    2005-01-13 18:41:23.000000000 -0500
+++ env_rdbms.mk        2005-01-13 18:43:41.000000000 -0500
@@ -2412,10 +2412,10 @@
 KSMS=$(ORACLE_HOME)/rdbms/lib/ksms.o

 INSTALL_TARGS=clean idbv itstshm imaxmem iorapwd idbfsize idumpsga\
-       imapsga icursize iextproc $(IEXTPROC32) iagtctl ihsalloci ihsots ihsdepxa isbttest\
+       imapsga icursize iextproc ihsalloci ihsots ihsdepxa isbttest\
        ikgmgr iloadpsp idgmgrl $(IHSO) inid iextjobo iextjob ikfod
 ITEST=ioracle idbv itstshm imaxmem iorapwd idbfsize icursize \
-       iextproc $(IEXTPROC32) ihsalloci ihsots ihsdepxa iosh isbttest iexp iimp isqlldr \
+       iextproc ihsalloci ihsots ihsdepxa iosh isbttest iexp iimp isqlldr \
        irman iexpst iimpst isqlldrst ikgmgr iloadpsp idgmgrl $(IHSO) $(ITG4) \
        inid iexpdp iimpdp iextjobo iextjob ikfod
 IUTILITIES=iimp iexp isqlldr itkprof irman ikgmgr iloadpsp iimpdp iexpdp igenezi


Code: $ORACLE_HOME/rdbms/lib/ins_rdbms.mk
 
--- ins_rdbms.mk.org    2005-01-13 18:38:24.000000000 -0500
+++ ins_rdbms.mk        2005-01-13 18:40:33.000000000 -0500
@@ -125,11 +125,6 @@
        -mv $(ORACLE_HOME)/rdbms/lib/extproc $(ORACLE_HOME)/bin/extproc
        -chmod 751 $(ORACLE_HOME)/bin/extproc

-iextproc32: extproc32
-       -mv -f $(ORACLE_HOME)/bin/extproc32 $(ORACLE_HOME)/bin/extproc32O
-       -mv $(ORACLE_HOME)/rdbms/lib/extproc32 $(ORACLE_HOME)/bin/extproc32
-       -chmod 751 $(ORACLE_HOME)/bin/extproc32
-
 iagtctl: $(AGTCTL)
        -mv -f $(ORACLE_HOME)/bin/agtctl $(ORACLE_HOME)/bin/agtctlO
        -mv $(ORACLE_HOME)/rdbms/lib/agtctl $(ORACLE_HOME)/bin/agtctl


Now you can run the root.sh script.

Wait until the script finishes and prints output similar to this:


Code: The root.sh script output
 sh root.sh
  Running Oracle10 root.sh script...
  The following environment variables are set as:
    ORACLE_OWNER= oracle
    ORACLE_HOME=  /opt/oracle/product/10.1.0.3
 Enter the full pathname of the local bin directory: [/usr/local/bin]:
 Copying dbhome to /usr/local/bin ...
 Copying oraenv to /usr/local/bin ...
 Copying coraenv to /usr/local/bin ...
 Creating /etc/oratab file...
 Adding entry to /etc/oratab file...
 Entries will be added to the /etc/oratab file as needed by
 Database Configuration Assistant when a database is created
 yFinished running generic part of root.sh script.
 Now product-specific root actions will be performed.
 /etc/oracle does not exist. Creating it now.
 Successfully accumulated necessary OCR keys.
 Creating OCR keys for user 'root', privgrp 'root'..
 Operation successful.
 Oracle Cluster Registry for cluster has been initialized
 
 Adding to inittab
 Checking the status of Oracle init process...
 Expecting the CRS daemons to be up within 600 seconds.
 CSS is active on these nodes.
        zeus
 CSS is active on all nodes.
 Oracle CSS service is installed and running under init(1M)


 

Note (AlFa - aleskx at yahoo dot com): this may fail and failure can be safely ignored - it is only needed if you want to use ASM (Automatic Storage Management) - if you are using normal database files for storage, you'll be fine without this step succeding.


 

Now answer the default to the network Assistant and you have finished the installation. Congratulation!

Notes from "herbert <<dot>> fischer <<at>> gmail.com" about Oracle 10g R2 for Linux:

10g R2 is much easier to install. There is no need to that CSS hacking above. The install flow is more linear.

You may have problems with OUI Inventory. After running the two "root scripts" and before clicking OK at OUI, change the owner and permissions of /etc/oraInst.loc to be accessible by oracle user, so, OUI can read the Inventory.

After finishing the install you may run ldconfig as root to see if there is empty libraries. I don't know if this empty libs affects Oracle, but I like to see things right. If there are empty libs, you may run "relink all" as oracle and "ldconfig" as root again. I had some symlinks related errors, so I deleted some files to ldconfig create the symlinks again.

I also suggest making a full backup of the installed oracle before creating the databases, so if you run with problems after some change you can consult the backup.



[10gR2 notes and may be for all oracle versions]

[START]

1) Before continuing, do vi /etc/oratab and see if there is a row of type: 'SID':'home/dir/of/the/database':N . Do not expect to see the same row as here :) If the last letter as N , as the example above, you may wish to change it to Y ,because after reboot your database wich has SID = 'SID', will not start. And if you try to login you will get the error:

ORA-01034: ORACLE not available

ORA-27101: shared memory realm does not exist

Linux Error: 2: No such file or directory

After I has done some research with Google I found out that this ERROR is very common thing not only for Oracle 10g, 
but also for lower versions. 

Of course the solution which I posted here is only in case you forget to run properly the database.

2)

 And one more thing, in order to run your Oracle 10gR2 db, see the starting script "dbstart", which is provided along with 
the oracle installion, 
i.e. the script is automatically installed. You can find it in ${ORACLE_HOME}/10.2.0/bin/. I found strange row containing 
the path to the oracle 
listener, which was wrong and if your path is wrong too you most probably will wish to make it right. :) 

For me the wrong row path was: ORACLE_HOME_LISTNER=/ade/vikrkuma_new/oracle. You may see where is your listener located with: type tnslsnr or locate tnslsnr but MOST probably "tnslsnr" is in ${ORACLE_HOME}/10.2.0/bin/.

3) For 10gR2 you can access the enterprise manager at http://localhost:1158/em/

You can start enterprise manager with: emctl start dbconsole

4) For 10gR2 you can access isql*plus at http://localhost:5560/isqlplus

You can start isqlplus with: isqlplusctl start

[END]

[edit] Automatically Start / Stop the Database and Listener

First of all edit the file /etc/oratab and change from this:


Code: /etc/oratab
 *:/opt/oracle/product/10.1.0.3:N
  NAME_OF_YOUR_INSTANCE:/opt/oracle/product/10.1.0.3:N

to that


Code: /etc/oratab
 NAME_OF_YOUR_INSTANCE:/opt/oracle/product/10.1.0.3:Y

Then to start automatically Oracle and the listner create this files


 

(Note (AlFa aleskx at yahoo dot com) dbstart and dbshut scripts have ORATAB pointing to /var/opt/oracle/oratab - this has to be changed to /etc/oratab)


Code: /etc/init.d/ora.database
 
#!/sbin/runscript
# ----------------------------------------------------------------------
# File:    /etc/init.d/ora.database
# Purpose:  Startup Oracle Database(s) defined in /etc/oratab
# ----------------------------------------------------------------------

depend() {
    need net logger hostname clock
}

start() {
    source /etc/profile.env

    if [ ! -f $ORACLE_HOME/bin/dbstart ]
    then
        echo "Oracle not started (no dbstart script)"
        return 1
    fi

    ebegin "Starting Oracle"
    /bin/su - $ORACLE_OWNER -c $ORACLE_HOME/bin/dbstart
    eend $? "Failed to start Oracle."
}

stop() {
    source /etc/profile.env

    if [ ! -f $ORACLE_HOME/bin/dbshut ]
    then
        echo "Oracle not stopped (no dbshut script)"
        return 1
    fi

    ebegin "Stopping Oracle"
    /bin/su - $ORACLE_OWNER -c $ORACLE_HOME/bin/dbshut
    eend $? "Failed to stop Oracle."
}
 


Code: /etc/init.d/ora.listener
 
#!/sbin/runscript
#----------------------------------------------------------------------
# file /etc/init.d/ora.listener
# Startup Oracle Listeners
# ----------------------------------------------------------------------

depend() {
    need net
    after ora.database
}

start() {
    source /etc/profile.env
    ebegin "Start Oracle Listeners"
    /bin/su $ORACLE_OWNER -c "$ORACLE_HOME/bin/lsnrctl start LISTENER"
    eend $? "Failed to start Oracle Listeners."
}

stop() {
    source /etc/profile.env
    ebegin "Stopping Oracle Listeners"
    export ORACLE_OWNER=oracle;
    /bin/su $ORACLE_OWNER -c "$ORACLE_HOME/bin/lsnrctl stop LISTENER"
    eend $? "Failed to stop Oracle Listeners."
}



Code: file /etc/init.d/ora.console
 
#!/sbin/runscript
# ----------------------------------------------------------------------
# File:    /etc/init.d/ora.console
# Purpose:  Startup Oracle Enterprise Manager DB Console and ISQL
# ----------------------------------------------------------------------

depend() {
    need net
    after ora.listener
}

start() {
    source /etc/profile.env
    ebegin "Start Oracle Enterprise Manager DB Console"
    /bin/su $ORACLE_OWNER -c "$ORACLE_HOME/bin/emctl start dbconsole"
    /bin/su $ORACLE_OWNER -c "$ORACLE_HOME/bin/isqlplusctl start"
    eend $? "Failed to start Oracle Enterprise Manager DB Console."
}

stop() {
    source /etc/profile.env
    ebegin "Stopping Oracle Enterprise Manager DB Console"
    /bin/su $ORACLE_OWNER -c "$ORACLE_HOME/bin/emctl stop dbconsole"
    /bin/su $ORACLE_OWNER -c "$ORACLE_HOME/bin/isqlplusctl stop"
    eend $? "Failed to stop Oracle Enterprise Manager DB Console."
}
  

Give the execute permission with

chmod +x /etc/init.d/ora.*

To start the Database automatically on Boot-Time, create or use our Startup Scripts dbora, lsnrora and consoleora. (The oracle installer already created an instance of these processes. Make sure they are not running before using these scripts.)

rc-update add ora.database default
rc-update add ora.listener default
rc-update add ora.console default

...and you have finished!

 Test your Database

First You should create a user. The easiest way to do this is to use Oracle Enterprise Manager. In Your web browser type:

http://localhost:5500/em/

and login using user SYS and password provided during install (select also "connect as SYSDBA"). In “Security” section select “Users” and then create a new user.

For me this was at http://localhost:1158/em and I didn't have to type any username or password for some reason. 216.13.217.231 23:07, 22 November 2006 (UTC)

Now verify, that ORACLE environment variables are set and You can connect to database using sqlplus utility with:

sqlplus new_user/his_password

Then You can create some test table:

CREATE TABLE “test” (“id” NUMBER, “text” VARCHAR2(10));

make some inserts:

INSERT INTO “test” VALUES (1, ‘xyz’);

and selects:

SELECT * from “test”;

 NetCA and ORA files

My instance would start when I created databases, but I couldn't restart them because it didn't create any .ora files. I finally found netca which will create all the necessary ora files so you can start the database with sqlplus. Just make sure your ORACLE_SID is set.

libaio problems

If you have problems getting iSQL Plus to work, and are getting errors about not being able to find /usr/lib/libaio.so.1 or errors stating version `LIBAIO_0.4' not found such as the example below

oracle@gentoo-amd64 ~ $ sqlplus /nolog
SQL*Plus: Release 10.2.0.1.0 - Production on Sun Apr 23 01:14:32 2006
Copyright (c) 1982, 2005, Oracle.  All rights reserved.
SQL> connect / as sysdba
oracleGEN1: /usr/lib/libaio.so.1: version `LIBAIO_0.4' not found (required by oracleGEN1)
ERROR:
ORA-12547: TNS:lost contact

then you will probably need to install >=dev-libs/libaio-0.3.1 This is generally a problem with the 10.2.* release of Oracle 10g. There are now ebuilds available in portage for libaio for both x86 and x86_64 which provide the LIBAIO_0.4 symbol iSQL Plus requires to start correctly. Kerin Millar provides some insight at http://comments.gmane.org/gmane.linux.gentoo.server/2731

As root user:

echo "dev-libs/libaio ~*">>/etc/portage/package.keywords
emerge -a libaio

iSQL Plus should now be able to launch without any problems.

 Extra stuff to make Oracle 10g work on AMD64

Before the install, you need to add some extra packages, and compile glibc with a specific USE flag.

# put 'pic' into your USE flags or add pic to the USE flag in make.conf
USE="pic" emerge glibc binutils app-emulation/emul-linux-x86-baselibs app-emulation/emul-linux-x86-xlibs

18 Feb 06 Stephen Prendergast : - After the linker failed on relocation errors I realised that ld also needed to be rebuilt hence added binutils.

On first linker error from the installer, modify ${ORACLE_HOME}/lib32/stubs/libc.so from this:

GROUP ( libc.so.6 /usr/lib/libc_nonshared.a )

to this:

GROUP ( libc.so.6 /usr/lib32/libc_nonshared.a )

Don't Ignore other linker errors. Watch make.log in /opt/oracle/product/10.1.0.3/install/make.log and search for compiling errors. Most of them are from the "libc_nonshared" problem. Try to run the command that are on the make.log before the error. After running all of them, you can click on retry.

If Oracle Net Configuration Assistant does not runs during installation, run it with the user oracle and the command bellow:

${ORACLE_HOME}/bin/relink client_sharedlib
netca

And as root:

ldconfig -v

When the Database Config Assistant bails, do this as the oracle user:

vi /opt/oracle/product/10.1.0.3/network/admin/listener.ora
# Find (ADDRESS = (PROTOCOL = TCP)(PORT = 1521))*
Change to "(ADDRESS = (PROTOCOL = TCP)(PORT = 1521)(HOST = your_address))"
# This might only be needed if your hostname does not appear in /etc/hosts or DNS

Hit retry yet again. All should be good.

 Weblinks

标签 :



发表评论 发送引用通报