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軟件包