Oralcle 10g Fedora Core X上快速安装指南
2024-07-21 02:09:43
供稿:网友
 
本文来源于网页设计爱好者web开发社区http://www.html.org.cn收集整理,欢迎访问。
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<ship.db.cpio 
all four installation files unpack to directory named "disk1", so rename directory before you eventually unpack another file. 
you may want to create oracle installation cd set from unpacked installation files. as i don't have a cd-burner on any of my linux boxes, i created iso images using 
mkisofs -jr -l -o ship.db.iso disk1/ 
and burned cds on windows machine. 
2. preparing your system 
2.1 steps to perform as root user 
install following fedora packages using rpm -ivh package_name: 
from fedora-core disk 1: 
setarch-1.0-1.i386.rpm 
from fedora-core disk 2: 
openmotif-2.2.2-16.1.i386.rpm 
from fedora-core disk 3: 
compat-libstdc++-7.3-2.96.118.i386.rpm 
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-libstdc++-devel-7.3-2.96.118.i386.rpm 
compat-libgcj-devel-7.3-2.96.118.i386.rpm 
now we have to make oracle installer think that we have one of the supported distributions: create a backup of your /etc/redhat-release file, an change its contents: 
# cp /etc/redhat-release /etc/redhat-release.orig 
# echo "red hat enterprise linux as release 3 (taroon)" > /etc/redhat-release 
change kernel parameters by adding the following lines in /etc/sysctl.conf: 
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 = 32768 65000 
update kernel configuration: 
[[email protected] root]# sysctl -e -p /etc/sysctl.conf 
add the following lines to /etc/security/limits.conf file: 
* soft nproc 2047 
* hard nproc 16384 
* soft nofile 1024 
* hard nofile 65536 
add the following line to the /etc/pam.d/login file, if it does not already exist: 
session required /lib/security/pam_limits.so 
create user and groups that will own oracle installation. in this exaple the username will be oracle: 
[[email protected]]# groupadd oinstall 
[[email protected]]# groupadd dba 
[[email protected]]# useradd -g oinstall -g dba oracle 
[[email protected]]# passwd oracle 
create 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: 
[[email protected]]# mkdir -p /home/oracle/product/10g 
[[email protected]]# chown -r oracle.oinstall /home/oracle/* 
2.2 steps to perform as oracle user 
make 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. 
[[email protected] oracle]$ mkdir /home/oracle/bin 
[[email protected] oracle]$ cd /home/oracle/bin 
[[email protected] bin]$ ln -s /usr/bin/gcc296 gcc 
put the following lines in oracle user .bash_profile 
export oracle_base=/home/oracle 
export oracle_home=/home/oracle/product/10g 
export oracle_sid=orcl 
export oracle_term=xterm 
export path=$home/bin:$oracle_home/bin:$path 
ulimit -u 16384 -n 65536 
# 
# change this nls settings to suit your country: 
# example: 
# german_germany.we8iso8859p15, american_america.we8iso8859p1 etc. 
# 
export nls_lang='croatian_croatia.ee8iso8859p2' 
since 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. 
listing of valid oracle nls data parameters including supported languages, territories and storage character sets can be found here. 
in 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. 
update environment to include new variables: 
[[email protected]]$ source /home/oracle/.bash_profile 
everything is now ready to start the oracle installer. 
3. running the installer 
if you have oracle 10g database cd, login as root and mount it: 
[[email protected]]# mount /mnt/cdrom 
oracle installer needs to be run from xwindows, so start xwindows and login as user oracle. 
make sure that your envionment is correctly set up: 
[[email protected] oracle]$ set|grep oracle 
oracle_base=/home/oracle 
oracle_home=/home/oracle/product/10g 
oracle_sid=orcl 
oracle_term=xterm 
[[email protected] oracle]$ gcc --version 
2.96 
start the installer: 
[[email protected] oracle]$ /mnt/cdrom/runinstaller 
note: if you get thew following error when running the installer from cd-rom 
bash: /mnt/cdrom/runinstaller: /bin/sh: bad interpreter: permission denied 
you 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: 
/dev/cdrom /mnt/cdrom auto exec,noauto,owner,kudzu,ro 0 0 
now the installer should be up and running. 
4. post-installation steps 
first we want to change back the /etc/redhat-release file: 
[[email protected]]# cp /etc/redhat-release.orig /etc/redhat-release 
next, 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: 
*:/home/oracle/product/10g:n 
entries are of the form: $oracle_sid:$oracle_home:<n|y> 
change the last field (n) to y, and you will be able to start the database using dbstart utility. 
4.1. starting database services 
note: if you just installed oracle, the database, tns listener and enterprise manager are already running. 
start tns listener: 
[[email protected] oracle]$ lsnrctl start 
you can start the database via dbstart utility: 
[[email protected] oracle]$ dbstart 
or via sql*plus: 
[[email protected] oracle]$ sqlplus / as sysdba 
sql*plus: release 10.1.0.2.0 - production on sat feb 21 18:05:43 2004 
copyright (c) 1982, 2004, oracle. all rights reserved. 
connected to an idle instance. 
sql> startup 
oracle instance started. 
total system global area 188743680 bytes 
fixed size 778036 bytes 
variable size 162537676 bytes 
database buffers 25165824 bytes 
redo buffers 262144 bytes 
database mounted. 
database opened. 
sql> exit 
disconnected from oracle database 10g enterprise edition release 10.1.0.2.0 - 
production with the partitioning, olap and data mining options 
[[email protected] oracle]$ 
start enterprise manager server: 
[[email protected] oracle]$ emctl start dbconsole 
4.2. stopping database services 
stop enterprise manager server: 
[[email protected] oracle]$ emctl stop dbconsole 
you can stop the database via dbshut utility: 
[[email protected] oracle]$ dbshut 
or via sql*plus: 
[[email protected] oracle]$ sqlplus / as sysdba 
sql*plus: release 10.1.0.2.0 - production on sat feb 21 18:11:23 2004 
copyright (c) 1982, 2004, oracle. all rights reserved. 
connected to: 
oracle database 10g enterprise edition release 10.1.0.2.0 - 
production with the partitioning, olap and data mining options 
sql> shutdown immediate 
database closed. 
database dismounted. 
oracle instance shut down. 
sql> exit 
disconnected from oracle database 10g enterprise edition release 10.1.0.2.0 - 
production with the partitioning, olap and data mining options 
[[email protected] oracle]$ 
stop tns listener: 
[[email protected] oracle]$ lsnrctl stop 
4.3 automating oracle startup and shutdown 
to 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. 
copy the script to /etc/rc.d/init.d as root user, edit environment variables to match your settings and modify its permissions: 
[[email protected] root]# chown root.root /etc/rc.d/init.d/ora10 
[[email protected] root]# chmod 755 /etc/rc.d/init.d/ora10 
the 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. 
initialize new service: 
[[email protected] root]# chkconfig ora10 reset 
[[email protected] root]# chkconfig --list ora10 
ora10 0:off 1:off 2:off 3:on 4:off 5:on 6:off 
now 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. 
to manually start/stop oracle services you can use 
[[email protected] root]# service ora10 start 
and 
[[email protected] root]# service ora10 stop 
hope this helps. 
denis. 
home -> oracle -> oracle 10g release 1 (10.1.0.2) on fedora core 1 
--------------------
happymeng