Solaris 11 安装Oracle 11GR2

来源:互联网 发布:深圳市软件测试培训 编辑:程序博客网 时间:2024/06/07 12:54

安装过程分以下四个步骤

一,安装准备
二,下载安装
三,相关设置
四,常见错误


一,安装准备
1,创建oracle用户

以root用户登录,创建oracle用户以及其所属的dba组

1234567
su -# groupadd dba# groupadd oinstall# groupadd asmdba# groupadd asmadmin# useradd -g oinstall -G dba,asmdba,asmadmin -m -d /export/home/oracle -s /usr/bin/bash oracle# passwd oracle

2,设置系统参数

执行下面命令

1234
# projadd -U oracle -K "project.max-shm-memory=(priv,5g,deny)" user.oracle# projmod -sK "project.max-sem-nsems=(priv,512,deny)" user.oracle# projmod -sK "project.max-sem-ids=(priv,128,deny)" user.oracle# projmod -sK "project.max-shm-ids=(priv,128,deny)" user.oracle

可以通过”prctl -i project user.oracle” 命令对配置进行检查

执行下面命令

1234
# ipadm set-prop -p smallest_anon_port=9000 tcp# ipadm set-prop -p largest_anon_port=65500 tcp# ipadm set-prop -p smallest_anon_port=9000 udp# ipadm set-prop -p largest_anon_port=65500 udp


并验证

12345
# ipadm show-prop|grep anon|egrep 'tcp|udp'tcp largest_anon_port rw 65500 65500 65535 1024-65535tcp smallest_anon_port rw 9000 9000 32768 1024-65535udp largest_anon_port rw 65500 65500 65535 1024-65535udp smallest_anon_port rw 9000 9000 32768 1024-65535

以root用户编辑 /etc/ssh/sshd_config 并修改 LoginGraceTime 值为 0

1
LoginGraceTime 0

载入配置

1
# svcadm restart ssh

3,创建oracle目录

12345
# mkdir /opt/oracle# mkdir /opt/oracle/112# mkdir /opt/grid/112# chown -R oracle:dba /opt/oracle # chown -R oracle:dba /opt/grid

4,设置oracle环境变量

编辑 /home/oracle/.bash_profile 并添加下列行:

12345678
ORACLE_BASE=/opt/oracleORACLE_HOME=$ORACLE_BASE/112ORACLE_SID=ORA11GR2CRS_HOME=/opt/grid/112LD_LIBRARY_PATH=$ORACLE_HOME/lib:$CRS_HOME/libPATH=$PATH:/usr/local/bin:$ORACLE_HOME/bin:$CRS_HOME/bin export ORACLE_BASE ORACLE_HOME ORACLE_SID LD_LIBRARY_PATH PATH

保存后通过下面命令是配置生效

123
su - oraclecd /home/oracle. .bash_profile

二,下载安装

1,配置并安装需要软件包

下载repository 镜像文件
下载地址:

12
http://download.oracle.com/otn/solaris/express/sol-11-exp-201011-repo-full-iso-a.ziphttp://download.oracle.com/otn/solaris/express/sol-11-exp-201011-repo-full-iso-b.zip

解压文件:

12
unzip sol-11-exp-201011-repo-full-iso-a.zipunzip sol-11-exp-201011-repo-full-iso-b.zip

合并文件

1
cat sol-11-exp-201011-repo-full.iso-a sol-11-exp-201011-repo-full.iso-b > sol-11-exp-201011-repo-full.iso

挂载镜像

1
# mount -F hsfs -o ro `lofiadm -a /home/oracle/sol-11-exp-201011-repo-full.iso` /mnt

设置镜像为本地repository

1
# pkg set-publisher -Pe -O file:///mnt/repo/ solaris

或者使用在线repository

1
# pkg set-publisher -Pe -O http://pkg.oracle.com/solaris/release solaris

进行软件包检查

1
# pkginfo -i SUNWarc SUNWbtool SUNWhea SUNWlibm SUNWlibms SUNWpool SUNWpoolr SUNWsprot SUNWtoo SUNWuiu8 SUNWfont-xorg-core SUNWfont-xorg-iso8859-1 SUNWmfrun SUNWxorg-client-programs SUNWxorg-clientlibs SUNWxwfsw SUNWxwplt

注:软件包SUNWbtool SUNWlibms SUNWpool SUNWpoolr SUNWsprot SUNWtoo SUNWuiu8 一般会默认安装

进行软件包安装

1
# pkg install compatibility/packages/SUNWxwplt SUNWmfrun SUNWarc SUNWhea SUNWlibm

2,下载oracle 11g

下载地址:

http://www.oracle.com/technology/software/products/database/oracle11g/112010_sparc_x64soft.html

对于Grid (CRS)

1
unzip solaris.x64_11gR2_grid.zip

对于database

12
unzip solaris.x64_11gR2_database_1of2.zipunzip solaris.x64_11gR2_database_2of2.zip

3,进行安装

对于Grid (CRS)

12
cd grid./runInstaller

对于database

12
cd database./runInstaller

三,相关配置

1,以root用户执行下面脚本

12
# /opt/oracle/oraInventory/orainstRoot.sh# /opt/oracle/102/root.sh

四,常见错误

1,错误:[INS-13001] Environment does meet minimum requirements. Are you sure you want to continue?

下载oracle补丁10098816,并安装

2,错误:Checking monitor: must be configured to display at least 256 colors >>> Could not execute auto check for display colors using command /usr/openwin/bin/xdpyinfo. Check if the DISPLAY variable is set. Failed <<<< Some requirement checks failed. You must fulfill these requirements before continuing with the installation,at which time they will be rechecked.

安装SUNWxwplt 软件包,并设置DISPLAY参数,并以root用户执行”xhost +“命令

3,错误:Exception in thread “main” java.lang.UnsatisfiedLinkError:
… libmawt.so: ld.so.1: java: fatal: libXm.so.4: open failed: No such file or directory

安装SUNWmfrun软件包