solaris下安装oracle 11g与11g rac
1、to find swap, ram, and os version
对于 solaris 操作系统,查看 swap, ram, and os version 的方法:
swap -l
/usr/sbin/prtconf | grep -i memory
uname -r
2、to determine the unix kernel parameters
solaris
/etc/system
command to search
"/etc/sysdef | grep shm" or "/etc/sysdef | grep sem"
3.配制资源
#id -p oracle
uid=1001(oracle) gid=1003(oinstall) projid=3(default)
# projadd -u oracle -p 1001 -c "oracle kernel parameters setting" user.oracle
其中:
-u: 指定应用到该项目的用户列表.
-c: 项目的描述信息.
-p: 非负整数,项目id号.
# id -p oracle
uid=1001(oracle) gid=1003(oinstall) projid=1001(user.oracle)
# projmod -a -k "project.max-shm-memory=(priv,17179869184,deny)" user.oracle (设置最大共享内存为12g,系统物理内存为32g,单位为字节.)
或者
# projmod -a -k "project.max-shm-memory=(priv,1073741824,deny)" user.oracle (设置最大共享内存为1g,系统物理内存为2g,单位为字节.)
# projmod -a -k "project.max-sem-ids=(priv,100,deny)" user.oracle
# projmod -a -k "process.max-sem-nsems=(priv,256,deny)" user.oracle
# projmod -a -k "project.max-shm-ids=(priv,100,deny)" user.oracle
==============================================================================================
安装之 安装步骤:
#以下操作在root用户环境下操作
#切换到root用户
su root
#设置虚拟内存
zfs set volsize=4g rpool/swap
zfs list
#设置固定ip
netadm list
netadm enable -p ncp defaultfixed
ipadm create-ip net0
ipadm show-addr
ipadm delete-addr net0/v4
ipadm create-addr -t static -a 192.168.56.111/24 net0/v4
route -p add default 192.168.1.1 -ifp net0
netstat -rn
#设置dns
svccfg -s dns/client
setprop config/nameserver = (8.8.8.8 114.114.114.114)
listprop config
svcadm refresh dns/client
svcadm restart dns/client
svccfg -s name-service/switch
setprop config/host="files dns"
listprop config
#建立目录:
mkdir -p /export/home/oracle
#建立oracle用户和dba,oinstall用户组
groupadd dba
groupadd oinstall
useradd -g oinstall -g dba -m -d /export/home/oracle -s /usr/bin/bash oracle
passwd oracle
chown -r oracle:dba /export/home/oracle
#设置系统内核参数
projadd -u oracle user.oracle
projmod -a-k "project.max-shm-memory=(priv,4g,deny)" user.oracle
projmod -a-k "project.max-sem-ids=(priv,100,deny)" user.oracle
projmod -a-k "process.max-sem-nsems=(priv,500,deny)" user.oracle
projmod -a-k "project.max-shm-ids=(priv,100,deny)" user.oracle
#查看系统内核参数
cat /etc/project
#设置系统网络参数
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
#查看系统网络参数
ipadm show-prop|grep anon|egrep 'tcp|udp'
#加载solaris11 离线软件包
mount -f hsfs /export/home/solaris/sol-11_2-repo.iso /mnt
pkg publisher
pkg set-publisher -g '*' -g /mnt/repo solaris
pkg publisher
#检查软件包
pkginfo -i sunwarc sunwbtool sunwhea sunwlibm sunwlibms sunwpool sunwpoolr sunwsprot sunwtoo sunwuiu8 sunwmfrun sunwxwfsw sunwxwplt sunwi1cs sunwi15cs assembler
#安装软件包
pkg install compatibility/packages/sunwxwplt sunwmfrun sunwhea sunwi1cs sunwi15cs assembler
#以下操作在oracle 用户环境下操作
#切换到oracle用户(用oracle用户名在登录x桌面)
#解压oracle包装包
unzip solaris.x64_11gr2_database_1of2 -d /export/home/oracle/
unzip solaris.x64_11gr2_database_2of2 -d /export/home/oracle/
#设置oracle 用户 数据库启动参数 以下操作在oracle 用户环境下操作
vi .profile
oracle_base=/export/home/oracle/app/oracle;export oracle_base
oracle_home=$oracle_base/product/11.2.0;export oracle_home
oracle_sid=testdb
tmp=/tmp;export tmp
tmpdir=/tmp;export tmpdir
ld_library_path=$oracle_home/lib
path=$path:/usr/bin:/usr/sbin:$oracle_home/bin
export oracle_base oracle_home oracle_sid ld_library_path path
umask 022
#在x桌面
cd database
export display=192.168.17.1:0.0
./runinstaller -ignoresysprereqs -force -ignoreprereq
#以下操作在root用户环境下操作
#切换到root用户
su solaris
su root
#执行oracle 11gr2 完成安装脚本
/export/home/oracle/app/orainventory/orainstroot.sh
/export/home/oracle/app/oracle/product/11.2.0/dbhome_1/root.sh
-------------------------------以下可以不用配置:
#设置oracle 11g为自动启动
1:建立 /etc/init.d/oracle
vi /etc/init.d/oracle
#!/usr/sbin/sh
case "$1" in
'start')
su - oracle -c "dbstart" &
su - oracle -c "emctl start dbconsole" &
;;
'stop')
su - oracle -c "emctl stop dbconsole" &
su - oracle -c "dbshut" &
;;
*)
echo "usage: $0 { start | stop}"
exit 1
;;
esac
2:连接文件到启动项
ln -s /etc/init.d/oracle /etc/rc2.d/s100oracle
ln -s /etc/init.d/oracle /etc/rc3.d/s100oracle
ln -s /etc/init.d/oracle /etc/rc0.d/k100oracle
3修改/var/opt/oracle/oratab中的"n"为"y"
vi /var/opt/oracle/oratab
4修改 dbstart dbshut 脚本
vi /export/home/oracle/app/oracle/product/11.2.0/dbhome_1/bin/dbstart
#oracle_home_listner=$1
oracle_home_listner=$oracle_home
export oracle_home_listner
vi /export/home/oracle/app/oracle/product/11.2.0/dbhome_1/bin/dbshut
#oracle_home_listner=$1
oracle_home_listner=$oracle_home
export oracle_home_listner
#查看oracle 11g进程
ps -ef | grep tnslsnr
ps -ef | grep -i "ora_"
#数据库em
emctl start dbconsole
emctl stop dbconsole
emctl status dbconsole
=============================================================
solaris 11 安裝oracle 11gr2 rac
安裝過程分以下四個步驟
一,安裝準備
二,下載安裝
三,相關設置
四,常見錯誤
一,安裝準備
1,創建oracle用戶
以root用戶登錄,創建oracle用戶以及其所屬的dba組
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,設置系統參數
執行下面命令
# 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” 命令對配置進行檢查
執行下面命令
# 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
並驗證
# ipadm show-prop|grep anon|egrep 'tcp|udp'
tcp largest_anon_port rw 65500 65500 65535 1024-65535
tcp smallest_anon_port rw 9000 9000 32768 1024-65535
udp largest_anon_port rw 65500 65500 65535 1024-65535
udp smallest_anon_port rw 9000 9000 32768 1024-65535
以root用戶編輯 /etc/ssh/sshd_config 並修改 logingracetime 值為 0
logingracetime 0
載入配置
# svcadm restart ssh
3,創建oracle目錄
# 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 並添加下列行:
oracle_base=/opt/oracle
oracle_home=$oracle_base/112
oracle_sid=ora11gr2
crs_home=/opt/grid/112
ld_library_path=$oracle_home/lib:$crs_home/lib
path=$path:/usr/local/bin:$oracle_home/bin:$crs_home/bin
export oracle_base oracle_home oracle_sid ld_library_path path
保存後通過下面命令是配置生效
su - oracle
cd /home/oracle
. .bash_profile
二,下載安裝
1,配置並安裝需要軟件包
下載repository 鏡像文件
下載地址:
http://download.oracle.com/otn/solaris/express/sol-11-exp-201011-repo-full-iso-a.zip
http://download.oracle.com/otn/solaris/express/sol-11-exp-201011-repo-full-iso-b.zip
解壓文件:
unzip sol-11-exp-201011-repo-full-iso-a.zip
unzip sol-11-exp-201011-repo-full-iso-b.zip
合併文件
cat sol-11-exp-201011-repo-full.iso-a sol-11-exp-201011-repo-full.iso-b > sol-11-exp-201011-repo-full.iso
掛載鏡像
# mount -f hsfs -o ro `lofiadm -a /home/oracle/sol-11-exp-201011-repo-full.iso` /mnt
設置鏡像為本地repository
# pkg set-publisher -pe -o file:///mnt/repo/ solaris
或者使用在線repository
# pkg set-publisher -pe -o http://pkg.oracle.com/solaris/release solaris
進行軟件包檢查
# 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 一般會默認安裝
進行軟件包安裝
# 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)
unzip solaris.x64_11gr2_grid.zip
對於database
unzip solaris.x64_11gr2_database_1of2.zip
unzip solaris.x64_11gr2_database_2of2.zip
3,進行安裝
對於grid (crs)
cd grid
./runinstaller
對於database
cd database
./runinstaller
三,相關配置
1,以root用戶執行下面腳本
# /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軟件包
上一篇: Keep如何删除我练过的课程?
推荐阅读
-
在Red Hat Enterprise Linux 7.0 x86_64下安装Oracle 11g R2
-
Linux下Oracle 11G r2 (64位)安装说明
-
RHEL 6下安装Oracle 11g R2
-
Linux虚拟机下安装Oracle 11G教程图文解说
-
Linux虚拟机下安装Oracle 11G教程图文解说
-
Oracle 11g服务器与客户端卸载、安装全过程
-
win10下oracle安装(11g)的步骤教程
-
Window下Oracle Database 11g 发行版2安装教程
-
Oracle 11g数据库安装与卸载的方法图解
-
Windows 64位下装安装Oracle 11g,PLSQL Developer的配置问题,数据库显示空白的完美解决方案(图文教程)