Oralcle 10g Fedora Core X上快速安装指南


Home -> oracle -> Oracle 10g release 1 (10.1.0.2) on Fedora core 1
Oracle Database 10g release 1 (10.1.0.2) installation on Fedora core 1
Please note that Oracle Database 10g is not certified to run on Fedora Linux, therefore you should not use this combination on a production server. You can examine Oracle certification matrix at Metalink
Contents
1. Downloading and unpacking installation files
2. Preparing your system
2.1 Steps to perform as root user
2.2 Steps to perform as oracle user
3. Running the installer
4. Post-installation steps
4.1 Starting database services
4.2 Shutting down database services
4.3 Automating oracle startup and shutdown
1. Downloading and unpacking installation files
Download Oracle Database 10g from Oracle Technology Network. Four files are available:

ship.ccd.cpio.gz - Oracle 10g Companion CD
ship.client.cpio.gz - Oracle 10g Client
ship.crs.cpio.gz - Oracle 10g Cluster Ready Services
ship.db.cpio.gz - Oracle 10g Database
Only ship.db.cpio.gz is required in order to install the database.
Once you downloaded the file, unpack it:
gunzip ship.db.cpio.gz
cpio -idmv

  1<ship.db.cpio "disk1",="" "red="" #="" (taroon)"="" -ivh="" -jr="" -l="" -o="" 1:="" 2.1="" 2:="" 2\.="" 3="" 3:="" a="" all="" an="" and="" another="" any="" as="" backup="" before="" boxes,="" burned="" cd="" cd-burner="" cds="" change="" compat-db-4.0.14-2.i386.rpm="" compat-gcc-7.3-2.96.118.i386.rpm="" compat-libgcj-7.3-2.96.118.i386.rpm="" compat-libgcj-devel-7.3-2.96.118.i386.rpm="" compat-libstdc++-7.3-2.96.118.i386.rpm="" compat-libstdc++-devel-7.3-2.96.118.i386.rpm="" contents:="" cp="" create="" created="" directory="" disk="" disk1="" distributions:="" don't="" echo="" enterprise="" etc="" eventually="" fedora="" fedora-core="" file,="" file.="" files="" files.="" following="" four="" from="" hat="" have="" i="" images="" install="" installation="" installer="" iso="" its="" linux="" machine.="" make="" may="" mkisofs="" my="" named="" now="" of="" on="" one="" openmotif-2.2.2-16.1.i386.rpm="" oracle="" package_name:="" packages="" perform="" preparing="" redhat-release="" redhat-release.orig="" release="" rename="" root="" rpm="" set="" setarch-1.0-1.i386.rpm="" ship.db.iso="" so="" steps="" supported="" system="" that="" the="" think="" to="" unpack="" unpacked="" user="" using="" want="" we="" windows="" you="" your=""> /etc/redhat-release   
  2Change kernel parameters by adding the following lines in /etc/sysctl.conf:   
  3kernel.shmall = 2097152   
  4kernel.shmmax = 2147483648   
  5kernel.shmmni = 4096   
  6kernel.sem = 250 32000 100 128   
  7fs.file-max = 65536   
  8net.ipv4.ip_local_port_range = 32768 65000   
  9Update kernel configuration:   
 10[root@fedora root]# sysctl -e -p /etc/sysctl.conf   
 11Add the following lines to /etc/security/limits.conf file:   
 12* soft nproc 2047   
 13* hard nproc 16384   
 14* soft nofile 1024   
 15* hard nofile 65536   
 16Add the following line to the /etc/pam.d/login file, if it does not already exist:   
 17  
 18session required /lib/security/pam_limits.so   
 19Create user and groups that will own oracle installation. In this exaple the username will be oracle:   
 20[root@fedora]# groupadd oinstall   
 21[root@fedora]# groupadd dba   
 22[root@fedora]# useradd -g oinstall -G dba oracle   
 23[root@fedora]# passwd oracle   
 24Create directories in which oracle software will be installed. Oracle recommends OFA - Optimal Flexible Architecture (see oracle installation guide), but in this example everything will be installed under /home/oracle:   
 25[root@fedora]# mkdir -p /home/oracle/product/10g   
 26[root@fedora]# chown -R oracle.oinstall /home/oracle/*   
 272.2 Steps to perform as oracle user   
 28Make gcc296 default compiler for user oracle by creating symbolic link. It is important that the directory containing the link (/home/oracle/bin) is listed in the PATH variable before /usr/bin.   
 29[oracle@fedora oracle]$ mkdir /home/oracle/bin   
 30[oracle@fedora oracle]$ cd /home/oracle/bin   
 31[oracle@fedora bin]$ ln -s /usr/bin/gcc296 gcc   
 32Put the following lines in oracle user .bash_profile   
 33export ORACLE_BASE=/home/oracle   
 34export ORACLE_HOME=/home/oracle/product/10g   
 35export ORACLE_SID=orcl   
 36export ORACLE_TERM=xterm   
 37export PATH=$HOME/bin:$ORACLE_HOME/bin:$PATH   
 38ulimit -u 16384 -n 65536   
 39#   
 40# change this NLS settings to suit your country:   
 41# example:   
 42# german_germany.we8iso8859p15, american_america.we8iso8859p1 etc.   
 43#   
 44export NLS_LANG='croatian_croatia.ee8iso8859p2'   
 45Since I am from Croatia, I use Croatian national language support (NLS_LANG, NLS_DATE_LANGUAGE, NLS_SORT and NLS_DATE_FORMAT). You should set these variables to suit your needs.   
 46Listing of valid Oracle NLS Data parameters including supported languages, territories and storage character sets can be found here.   
 47In this example ORACLE_SID=orcl. You will be prompted by installer to specify SID and global database name, and you should replace the SID in .bash_profile with your own SID.   
 48Update environment to include new variables:   
 49  
 50[oracle@fedora]$ source /home/oracle/.bash_profile   
 51Everything is now ready to start the oracle installer.   
 523\. Running the installer   
 53If you have Oracle 10g Database CD, login as root and mount it:   
 54[root@fedora]# mount /mnt/cdrom   
 55Oracle installer needs to be run from Xwindows, so start Xwindows and login as user oracle.   
 56Make sure that your envionment is correctly set up:   
 57[oracle@fedora oracle]$ set|grep ORACLE   
 58ORACLE_BASE=/home/oracle   
 59ORACLE_HOME=/home/oracle/product/10g   
 60ORACLE_SID=orcl   
 61ORACLE_TERM=xterm   
 62[oracle@fedora oracle]$ gcc --version   
 632.96   
 64Start the installer:   
 65[oracle@fedora oracle]$ /mnt/cdrom/runInstaller   
 66Note: if you get thew following error when running the installer from CD-ROM   
 67bash: /mnt/cdrom/runInstaller: /bin/sh: bad interpreter: Permission denied   
 68you should check how your CD-ROM was mounted. It should be mounted by user root, and the information about the filesystem in /etc/fstab sohuld look similar to this:   
 69/dev/cdrom /mnt/cdrom auto exec,noauto,owner,kudzu,ro 0 0   
 70Now the installer should be up and running.   
 714\. Post-installation steps   
 72First we want to change back the /etc/redhat-release file:   
 73[root@fedora]# cp /etc/redhat-release.orig /etc/redhat-release   
 74Next, modify the /etc/oratab file in order to use database startup and shutdown scripts provided by oracle. Find the line in /etc/oratab that looks similar to this:   
 75*:/home/oracle/product/10g:N   
 76Entries are of the form: $ORACLE_SID:$ORACLE_HOME:<n|y>   
 77Change the last field (N) to Y, and you will be able to start the database using dbstart utility.   
 784.1. Starting database services   
 79Note: If you just installed Oracle, the database, TNS listener and enterprise manager are already running.   
 80Start TNS Listener:   
 81  
 82[oracle@fedora oracle]$ lsnrctl start   
 83You can start the database via dbstart utility:   
 84[oracle@fedora oracle]$ dbstart   
 85or via SQL*Plus:   
 86[oracle@fedora oracle]$ sqlplus / as sysdba   
 87  
 88SQL*Plus: Release 10.1.0.2.0 - Production on Sat Feb 21 18:05:43 2004   
 89  
 90Copyright (c) 1982, 2004, Oracle. All rights reserved.   
 91  
 92Connected to an idle instance.   
 93  
 94SQL&gt; startup   
 95ORACLE instance started.   
 96  
 97Total System Global Area 188743680 bytes   
 98Fixed Size 778036 bytes   
 99Variable Size 162537676 bytes   
100Database Buffers 25165824 bytes   
101Redo Buffers 262144 bytes   
102Database mounted.   
103Database opened.   
104SQL&gt; exit   
105Disconnected from Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 -   
106Production With the Partitioning, OLAP and Data Mining options   
107[oracle@fedora oracle]$   
108Start Enterprise manager server:   
109[oracle@fedora oracle]$ emctl start dbconsole   
1104.2. Stopping database services   
111Stop Enterprise manager server:   
112[oracle@fedora oracle]$ emctl stop dbconsole   
113You can stop the database via dbshut utility:   
114[oracle@fedora oracle]$ dbshut   
115or via SQL*Plus:   
116[oracle@fedora oracle]$ sqlplus / as sysdba   
117  
118SQL*Plus: Release 10.1.0.2.0 - Production on Sat Feb 21 18:11:23 2004   
119  
120Copyright (c) 1982, 2004, Oracle. All rights reserved.   
121  
122  
123Connected to:   
124Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 -   
125Production With the Partitioning, OLAP and Data Mining options   
126  
127SQL&gt; shutdown immediate   
128Database closed.   
129Database dismounted.   
130ORACLE instance shut down.   
131SQL&gt; exit   
132Disconnected from Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 -   
133Production With the Partitioning, OLAP and Data Mining options   
134[oracle@fedora oracle]$   
135Stop TNS listener:   
136[oracle@fedora oracle]$ lsnrctl stop   
1374.3 Automating oracle startup and shutdown   
138To automatically start/shut oracle database during system startup/shutdown you need to write a script in /etc/rc.d/init.d directory. You can view or Download an example script.   
139Copy the script to /etc/rc.d/init.d as root user, edit environment variables to match your settings and modify its permissions:   
140[root@fedora root]# chown root.root /etc/rc.d/init.d/ora10   
141[root@fedora root]# chmod 755 /etc/rc.d/init.d/ora10   
142The script I wrote uses chkconfig utility to simplify service management. It is configured to start oracle services in runlevels 3 and 5,with start priority 95 and stop priority 1.   
143Initialize new service:   
144[root@fedora root]# chkconfig ora10 reset   
145[root@fedora root]# chkconfig --list ora10   
146ora10 0:off 1:off 2:off 3:on 4:off 5:on 6:off   
147Now oracle services will be automatically started when entering runlevels 3 and 5, and shut down when entering any other runlevel. For more information on chkconfig utility refer to its man page.   
148To manually start/stop oracle services you can use   
149[root@fedora root]# service ora10 start   
150and   
151[root@fedora root]# service ora10 stop   
152Hope this helps.   
153Denis.   
154Home -&gt; oracle -&gt; Oracle 10g release 1 (10.1.0.2) on Fedora core 1   
155  
156  
157  
158  
159\--------------------   
160HAPPYMENG</n|y></ship.db.cpio>
Published At
Categories with 数据库类
comments powered by Disqus