1前言:
看过很多很多文档,有些文档格式难看,有些则是图形不够全面。本人比较喜欢一些格式整齐,全面的图形界面,文字又比较让人觉的轻松的文档。本文档的目的是让不接触Oracle的人能够顺利的安装上Oracle服务器。安装时在网上参考了很多文档,在此表示感谢!
1.1 安装Oracle的环境
? /home/mzl/目录:下载的10201_database_linux32.zip放在该目录
? /u01/app/oracle/目录:为Oracle安装的ORACLE_BASE
2 安装前的准备配置
安装Oracle前的准备很重要,如果没有准备好,导致多次安装数据库不成功。
2.1 查询所需安装包是否完整
进入系统,用root用户,终端命令:
# rpm -q gcc make binutils openmotif setarch compat-dbcompat-gcc compat-gcc-c++ compat-libstdc++ compat-libstdc++-devel
缺少的都需要安装相关的软件包,RHEL5一共有5张光盘,这些软件都在那些光盘呢,请参考下面:
安装下面的包:
# 从RedHat AS5 光盘1
cd /media/cdrom/Server
rpm -Uvh setarch-2*
rpm -Uvh make-3*
rpm -Uvh glibc-2*
rpm -Uvh libaio-0*
cd /
eject
# 从RedHat AS5 光盘2
cd /media/cdrom/Server
rpm -Uvh compat-libstdc++-33-3*
rpm -Uvh compat-gcc-34-3*
rpm -Uvh compat-gcc-34-c++-3*
rpm -Uvh gcc-4*
rpm -Uvh libXp-1*
cd /
eject
# 从RedHat AS5 光盘3
cd /media/cdrom/Server
rpm -Uvh openmotif-2*
rpm -Uvh compat-db-4*
cd /
eject
然后在检查需要的软件包都安装成功。
2.2 检查安装Oracle的硬件要求
内存,交换区,硬盘空间等。
我装的是双系统,先装了WindowsXP,在装RHEL5时怎么也创建不了交换区,内存和硬盘都满足了要求,交换区暂时不用理会,后面安装好系统可以创建。内存最好1G以上,硬盘空间最好5G以上。
2.3 OS参数要求vi /etc/sysctl.conf , 在行末添加以下内容
#use for oracle
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
net.core.rmem_default=262144
net.core.rmem_max=262144
net.core.wmem_default=262144
net.core.wmem_max=262144
再运行sysctl -p应用以上参数
2.4 vi /etc/security/limits.conf 行末添加以下内容
#use for oracle
* soft nproc 2047
* hard nproc 16384
* soft nofile 1024
* hard nofile 65536
2.5 vi /etc/pam.d/login 行末添加以下内容
session required pam_limits.so
2.6 vi /etc/selinux/config 确保以下内容
SELINUX=disabled
关闭SELIINUX
到此准备安装Oracle的相关参数告一段落。
3 创建安装Oracle的用户、组及配置
3.1 解压10201_database_linux32.zip
我把10201_database_linux32.zip放在了/home/mzl下
终端命令:
Chmod –R 777 home (让oracle可以有权限执行安装文件)
unzip 10201_database_linux32.zip
3.2 创建安装Oracle的用户及所属组
#groupadd oinstall
#groupadd dba
#useradd -m -g oinstall -G dba oracle
#id oracle
为Oracle用户设置密码:
#passwd oracle
3.3 创建安装目录mkdir -p /u01/app/oracle
# chown -R oracle.oinstall /u01/app/oracle
# chmod -R 775 /u01/app/oracle
3.4 设置oracle用户的.bash_profile
在改文件的末行加上#Oracle Settings下的内容,
# Oracle Settings
TMP=/tmp; export TMP
TMPDIR=$TMP; export TMPDIR
ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1; exportORACLE_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; exportLD_LIBRARY_PATH
CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib;export CLASSPATH
if [ $USER = "oracle" ]; then
if [ $SHELL ="/bin/ksh" ]; then
ulimit -p16384
ulimit -n65536
else
ulimit -u16384 -n 65536
fi
fi
3.5 设置主机名和ip
Vi /etc/hosts
内容:192.168.130.189 mzl.net dbserver
保存后在终端运行命令:
#hostname
是否主机名变成了mzl.net,如果没有改变则要运行以下命令
#service network restart
3.6 设置Oracle10g支持RHEL5的参数
因为在官方的Oracle10g是不支持RHEL5的,所以需要改变相关的参数,不然在Oracle10g安装前不能通过检测!
网上有两种更改的方法:(本人按照第一种方法安装成功,第二种安装不能成功)
第一种:所以要修改版本说明,编辑文件 /etc/redhat-release 把Red Hat Enterprise Linux Server release 5 (Tikanga) 改成版本4:
redhat-4
第二种:更改10201_database_linux32.zip解压后的/database/install/oraparam.ini文件。本人比较倾向于第一种,因为这种修改,在Oracle安装时第一次检测可以通过,但安装到一般时,再次检测无法通过,导致安装不成功!(个人观点)
### #[Certified Versions]
Linux=redhat-3,SuSE-9,redhat-4,redhat-5,UnitedLinux-1.0,asianux-1,asianux-2]
再添加
[Linux-redhat-5.0-optional]
TEMP_SPACE=80
SWAP_SPACE=150
MIN_DISPLAY_COLORS=256
上面的准备,都是为了能够成功安装,下面就可以运行oracle的安装文件了。
4 安装Oracle
4.1 用oracle用户运行runInstaller文件
不能用root用户安装Oracle数据库,在root用户下,新建一个终端,然后切换到oracle用户来安装,也不行! 这样则会出现下图的错误信息:
所以需要注销到oracle用户下,或者是重起机器用oracle用户登陆。
执行命令:
切换到运行文件的目录:
#cd /home/mzl/database
# export DISPLAY= "192.168.130.189:0.0 "
# export LC_CTYPE=C.iso88591 (设置字符码,如果字符不一样,则会出现乱码)
#./runInstanller
然后出现最受欢迎的界面:
Next
Next
在这里所有的验证都通过了! (两行*号之间的大家不用看,如果检测不通过,则可以参考)
*************************************************************************
插一段话,如果没有出现上面的界面,最好重新检查还缺少什么东西。如果出现下面的界面,就先停止安装。
在这里有2个警告,4个要求没有通过。
我们看看都什么警告和要求:
Checking operating system requirements ...
Expected result: One ofredhat-3,redhat-4,SuSE-9,asianux-1,asianux-2
Actual Result: redhat-Red Hat Enterprise Linux Serverrelease 5 (Tikanga)
Check complete. The overall result of this check is:Failed <<<<
Problem: Oracle Database 10g is not certified on thecurrent operating system.
Recommendation: Make sure you are installing thesoftware on the correct platform.
这里说不支持RHEL5系统,如果按照上面的第二种则会出现,按照第一种方式修改则通过检测
Checking operating system package requirements ...
Check complete. The overall result of this check is:Not executed <<<<
OUI-18001: The operating system 'Linux Versionredhat-Red Hat Enterprise Linux Server release 5 (Tikanga)' is not supported.
Recommendation: Install the required packages beforecontinuing with the installation.
这里说不支持RHEL5系统,如果按照上面的第二种则会出现,按照第一种方式修改则通过检测
Checking kernelparameters
Check complete. The overall result of this check is:Not executed <<<<
OUI-18001: The operating system 'Linux Versionredhat-Red Hat Enterprise Linux Server release 5 (Tikanga)' is not supported.
Recommendation: Perform operating system specificinstructions to update the kernel parameters.
这里说不支持RHEL5系统,如果按照上面的第二种则会出现,按照第一种方式修改则通过检测
Checking Recommendedglibc version
Check complete. The overall result of this check is:Not executed <<<<
OUI-18001: The operating system 'Linux Versionredhat-Red Hat Enterprise Linux Server release 5 (Tikanga)' is not supported.
Recommendation: You may actually have installedpackages which have obsoleted these, in which case you can successfullycontinue with the install. If you have not, it is recommended that you do notcontinue. Refer to the readme to find out how to get the missing packages.
这里说不支持RHEL5系统,如果按照上面的第二种则会出现,按照第一种方式修改则通过检测
Checking available swap space requirements ...
Expected result: 1416MB
Actual Result: 0MB
Check complete. The overall result of this check is:Failed <<<<
Problem: The system does not have the required swapspace.
Recommendation: Make more swap space available toperform the install.
这里是交换空间要求为1416MB,而我的系统为0,现在我把它改为1800MB.
执行图形中的命令即可。
Checking Network Configuration requirements ...
Actual Result::java.lang.NullPointerException:Exception/Error Occurred
Check complete. The overall result of this check is:Not executed <<<<
Recommendation: Oracle supports installations onsystems with DHCP-assigned public IP addresses. However, the primary network interface on the system should beconfigured with a static IP address in order for the Oracle Software tofunction properly. See the InstallationGuide for more details on installing the software on systems configured withDHCP.
这里不支持动态的ip地址,修改上面提到的/etc/hosts文件即可。
Vi /etc/hosts
内容:192.168.130.189 mzl.net dbserver
保存后在终端运行命令:
#hostname
是否主机名变成了mzl.net,如果没有改变则要运行以下命令
#service network restart
*************************************************************************
Next
Install
这是安装过程,然后出现:
OK
用root用户执行上面的root.sh文件
回来刚才的界面
OK
Exit
Yes
到此安装完毕! 终于结束了!
'/sj.sh: line 242:syntax error near unexpected token `
'/sj.sh: line 242: `install_FEE()