安装ORACLE在/OPT/ORACLE下
/oracle 为oracle用户的家 /opt/oracle为oracle安装路径
1安装好linux操作系统,确保安装了以下的RPM开发包
gcc
cpp
glibc-devel
compat-libstdc++
glibc-kernheaders
binutils
可以使用命令来查看是否已安装了这些包
rpm –q gcc cpp compat-libstdc++ glibc-devel glibc-kernheaders
binutils
2从Oracle官方网站下载Oracle9i安装文件并使用如下命令解包
zcat lnx_920_disk1.cpio.gz | cpio –idmv
zcat lnx_920_disk2.cpio.gz | cpio –idmv
zcat lnx_920_disk3.cpio.gz | cpio –idmv
然后会有Disk1 Disk2 Disk3三个子目录。
3创建Oracle用户帐号和安装目录
在shell下,作为root
groupadd dba
useradd -g dba -d /oracle -m oracle
passwd oracle
mkdir /opt/oracle
chown –R oracle:dba /opt/oracle
4设置内核参数 root用户
echo 250 32000 100 128 > /proc/sys/kernel/sem
echo 1073741824 > /proc/sys/kernel/shmmax
echo 65536 > /proc/sys/fs/file-max
安装oracle10g的时候还需设置以下参数
执行如下命令# cat >> /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 = 1024 65000
> EOF
# /sbin/sysctl -p
5安装oracle9i补丁
chmod -R 755 ./patchRPM
./patchRPM/rhel3_pre_install.sh
rpm -ivh ./patchRPM/*.rpm
其中patchRPM中包含 以下rpm包
compat-gcc-32-3.2.3-47.3.i386.rpm
compat-gcc-32-c++-3.2.3-47.3.i386.rpm
compat-libcwait-2.0-2.i386.rpm
compat-libgcc-296-2.96-132.7.2.i386.rpm
compat-libstdc++-296-2.96-132.7.2.i386.rpm
compat-libstdc++-33-3.2.3-47.3.i386.rpm
compat-oracle-rhel4-1.0-5.i386.rpm
fontconfig-devel-2.2.3-7.i386.rpm
freetype-devel-2.1.9-1.i386.rpm
libaio-0.3.105-2.i386.rpm
libaio-devel-0.3.105-2.i386.rpm
openmotif21-2.1.30-11.RHEL4.6.i386.rpm
xorg-x11-deprecated-libs-6.8.2-1.EL.13.36.i386.rpm
xorg-x11-deprecated-libs-devel-6.8.2-1.EL.13.36.i386.rpm
xorg-x11-devel-6.8.2-1.EL.13.36.i386.rpm
rhel3_pre_install.sh
全部可以从as4u4光盘中找到
6设置环境变量,此处的ORACLE—HOME与用户的家无关
编辑/opt/oracle/.bashrc文件,添加下列行
export DISPLAY=:0.0
export ORACLE_BASE=/opt/oracle
export ORACLE_HOME=/opt/oracle/product/9.2.0
export ORACLE_SID=ora9i
export NLS_LANG=american_america.ZHS16GBK
export ORA_NLS33=$ORACLE_HOME/ocommon/nls/admin/data
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib:$LD_LIBRARY_PATH
export PATH=$PATH:/usr/sbin:/etc:$ORACLE_HOME/bin
export LANG=en_US
export LD_ASSUME_KERNEL=2.4.1
export THREADS_FLAG=native
7安装
su - oracle
vncserver
图形界面下 ./runInstall.sh
如果出现Exception in thread "main" java.lang.InternalError: Can't connect to X11 window server using ':0.0' as
the value of the DISPLAY variable
修改.bashrc 中的DISPLAY=:0.0为1.0 该处应该为vncserver 输出的窗口
非第一次安装oracle时,安装前删除/etc/oratab 和/etc/oraInst.loc 文件
在安装的过程中,最常见的是在配置oracle net configuration assistant时jre, 提示: jre was not found ,这时做个链接就
可,使用安装用户 oracle $cd /opt/oracle/oracle/product/9.2.0/oracle.swd.jre/bin/i386/native_threas/ $ ln -s java jre
8启动oracle
oracle 9i : #lsnrctl
#sqlplus "sys/change_on_install as sysdba" 或者 sqlplus " /as sysdba"
SQL> startup
关闭oracle #sqlplus "sys/change_on_install as sysdba"
SQL> shutdown immediate
启动oracle时报错
SQL> startup
ORA-01078: failure in processing system parameters
LRM-00109: could not open parameter file '/oracle/product/9.2.0/dbs/initora9i.ora'
这个是sid的问题,oracle10G的默认sid为orcl,安装时设置的sid与oracle环境变量不一样
关于emca的错误
Unrcognized option: -nojit
Could not create the Java virtual machine.
vi emca
将JRE=...变量中的 -nojit去掉
附ORACLE9i安装脚本:]
oracle安装脚本
#!/bin/bash
#gunzip an cpio all files
filelist=`ls |grep gz`
tmp=$?
if [ $tmp -gt 1 ]; then
echo "error for gz or cpio"
else
for i in $filelist
do
gunzip $i
echo "$i gunzip ok"
done
fi
filelist=`ls |grep cpio`
for i in $filelist
do
cpio -idmv < $i
echo "$i cpio uncmopress ok "
done
#creat user and group
if [ -d /opt/oracle ];then
echo "oralce dir ok!"
else
echo "oracle dir not exits,now creat it!"
mkdir /opt/oracle
fi
groupadd dba
echo "group dba creat ok !"
useradd -g dba -d /opt/oracle -m oracle
echo "user oracle creat ok"
chown oracle /opt/oracle
echo "oracle dir owner is user oracle"
chgrp dba /opt/oracle
echo "oracle dir group owner is dba"
echo "set oracle password and exit"
passwd oracle
# install patch for oracle9i
chmod -R 755 ./patchRPM
./patchRPM/rhel3_pre_install.sh
rpm -ivh ./patchRPM/*.rpm
# set kernel
echo "export DISPLAY=:0.0" >>/oracle/.bashrc
echo "export ORACLE_BASE=/opt/oracle" >>/oracle/.bashrc
echo "export ORACLE_HOME=/opt/oracle/product/9.2.0" >>/oracle/.bashrc
echo "export ORACLE_SID=ora9i" >>/oracle/.bashrc
echo "export NLS_LANG=american_america.ZHS16GBK" >>/oracle/.bashrc
echo 'export ORA_NLS33=$ORACLE_HOME/ocommon/nls/admin/data' >>/oracle/.bashrc
echo 'export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib:$LD_LIBRARY_PATH' >>/oracle/.bashrc
echo 'export PATH=$PATH:/usr/sbin:/etc:$ORACLE_HOME/bin' >>/oracle/.bashrc
echo "export LANG=en_US" >>/oracle/.bashrc
echo "export LD_ASSUME_KERNEL=2.4.1" >>/oracle/.bashrc
echo "export THREADS_FLAG=native" >>/oracle/.bashrc
echo "Now,set the kernel"
echo "kernel.shmall = 2097152" >>/etc/sysctl.conf
echo "kernen.nhmmax = 2147483648" >>/etc/sysctl.conf
echo "kernel.shmmni = 4096" >>/etc/sysctl.conf
echo "kernel.sem = 250 32000 100 128" >>/etc/sysctl.conf
echo "fs.file-max = 65536" >>/etc/sysctl.conf
echo "net.ipv4.ip_local_port_range = 1024 65000" >>/etc/sysctl.conf
/sbin/sysctl -p
附ORACLE10g设置环境变量脚本:
#!/bin/bash
if [ -d /oracle ];then
echo "oralce dir ok!"
else
echo "oracle dir not exits,now creat it!"
mkdir /oracle
fi
groupadd dba
echo "group dba creat ok !"
useradd -g dba -d /oracle -m oracle
echo "user oracle creat ok"
chown oracle /oracle
echo "oracle dir owner is user oracle"
chgrp dba /oracle
echo "oracle dir group owner is dba"
# set enviremnet
echo "export DISPLAY=:0.0" >>/oracle/.bashrc
echo "export ORACLE_BASE=/oracle" >>/oracle/.bashrc
echo "export ORACLE_HOME=/oracle/product/10g" >>/oracle/.bashrc
echo "export ORACLE_SID=orcl" >>/oracle/.bashrc
echo "export NLS_LANG=american_america.ZHS16GBK" >>/oracle/.bashrc
echo 'export ORA_NLS33=$ORACLE_HOME/ocommon/nls/admin/data' >>/oracle/.bashrc
echo 'export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib:$LD_LIBRARY_PATH' >>/oracle/.bashrc
echo 'export PATH=$PATH:/usr/sbin:/etc:$ORACLE_HOME/bin' >>/oracle/.bashrc
echo "export LANG=en_US" >>/oracle/.bashrc
echo "export LD_ASSUME_KERNEL=2.4.1" >>/oracle/.bashrc
echo "export THREADS_FLAG=native" >>/oracle/.bashrc
##set the kernel for 10g
echo "Now,set the kernel"
echo "kernel.shmall = 2097152" >>/etc/sysctl.conf
echo "kernen.nhmmax = 2147483648" >>/etc/sysctl.conf
echo "kernel.shmmni = 4096" >>/etc/sysctl.conf
echo "kernel.sem = 250 32000 100 128" >>/etc/sysctl.conf
echo "fs.file-max = 65536" >>/etc/sysctl.conf
echo "net.ipv4.ip_local_port_range = 1024 65000" >>/etc/sysctl.conf
/sbin/sysctl -p
echo "set oracle password and please reboot!!!!"
echo "next login use oracle to lonin"
passwd oracle
数据库建立完成后挂起oracle
启动oracle监听
$lsnrctl
lsnrctl>;status (查状态)
lsnrctl>;start
检查oracle服务是否挂起
$ps –ef |grep ora
连接数据库
$sqlplus /nolog
SQL>;connect / as sysdba
SQL>;startup mount
检查是否连接oracle
SQL>;select sysdate from dual;
Sp2-0640:Not connected
挂起
SQL>;startup
如果出现错误信息:
ORA-01078:failucr in processing system parameters
LRM-00109:could not open parametet
file/opt/ora9/product/9.2/dbs/initora9i.or
执行:
#cp /opt/ora9/admin/orcl/pfile/init.ora.613200412101
/opt/ora9/product/9.2/dbs/initora9.ora
安装过程错误信息和解决方法
*************************************************************
安装oracle前执行 xhost + 命令,出现提示信息:
access control disablad.clients can connect form any host.
不能正常安装oracle
xhost命令: #xhost +192.168.0.2(本地IP地址)
执行:#unset LANG 将语言默认为英文,可安装oracle,使用简体中文问题未解决。
不能正常安装oracle可尝试执行下面语句:
#su – oracle
$echo $LD_ASSUME_KERNEL
*************************************************************
oracle安装完成,打开终端,在oracle用户下:
#sqlplus
name:#system
pass:#manager
在试图启动数据库的时候 ,Oracle报告下列错误:
ERROR:
ORA-27101 Shared memory realm does not exist
ORA-01034 ORACLE not available
基本解释
Error:ORA-27101
Text:shared memory realm does not exist
Cause:Unable to locate shared memory realm
Action:Verify that the realm is accessible
ORACLE_SID和ORACLE_HOME设置不正确
尝试命令:
查看数据库是否启动: $ps –ef |grep ora
SQL>;sqlplus internal
SQL>;startup error:insufficient privileges
$sqlplus /nolog
SQL>;connect / as sysdba error:ORA-12705:inralid or unknown NLS
parameter ralue specified.
SQL>;connect
name-pass: system/manager@huiheng as sysdba
error:ORA-12154:INS:could not resdve service name
SQL>;startup
ORA-01078:failucr in processing system parameters
LRM-00109:could not open parametet
file/opt/ora9/product/9.2/dbs/initora9i.or
执行命令:
$cp /opt/ora9/admin/orcl/pfile/init.ora
/opt/ora9/product/9.2/dbs/initora9.ora
SQL>;startup
ORA-00209:control file blocksize mismatch,check alert log
for more info
最初安装dbca数据库没关,数据建了一半终止,数据不能吻合
错误信息.log文件存放在:/opt/ora9/admin/orcl/create
*************************************************************
阅读(2942) | 评论(0) | 转发(0) |