Wednesday, December 21, 2011

Setup Oracle 11g 11.0.2.1 for Solaris 10 - 64bit

setup vnc
svccfg -s application/x11/x11-server add display1
svccfg -s application/x11/x11-server:display1 addpg options application
svccfg -s application/x11/x11-server:display1 addpropvalue options/server astring: "/usr/X11/bin/Xvnc"
svccfg -s application/x11/x11-server:display1 addpropvalue options/server_args astring: '"SecurityTypes=None"'


vncserver


mount iso for Solaris
root@TT4-BCCLML1-S # lofiadm -a /u01/sol-10-u10-ga2-sparc-dvd.iso
/dev/lofi/1

mkdir /dvd_iso
root@TT4-BCCLML1-S # mount -F hsfs -o ro /dev/lofi/1 /dvd_iso


root@TT4-BCCLML1-S # cd /dvd_iso/

Use umount command to unmount image:
# umount /mnt

Now remove/free block device:
# lofiadm -d /dev/lofi/1




/usr/sbin/prtconf | grep "Memory size"

/usr/sbin/swap -l

#check  64bit
/bin/isainfo -kv

uname -r

cat /etc/release

df -k /tmp

pkginfo -i SUNWarc SUNWbtool SUNWhea SUNWlibC SUNWlibms SUNWsprot \
  SUNWtoo SUNWi1of SUNWi1cs SUNWi15cs SUNWxwfnt

#cai goi
pkgadd -d /dvd_iso/Solaris_10/Product SUNWi1cs SUNWi15cs


nếu cài oracle trước đó
more /var/opt/oracle/oraInst.loc

root@kinhnghiem # more /var/opt/oracle/oraInst.loc
inventory_loc=/u02/app/oraInventory
inst_group=oinstall


prtconf | grep Mem
Memory size: 32760 Megabytes
groupadd oinstall
groupadd dba
groupadd oper

useradd -g oinstall -G dba -d /export/home/oracle oracle
mkdir /export/home/oracle
chown oracle:oinstall /export/home/oracle
passwd -r files oracle



$ id -p
uid=59008(oracle) gid=10001(dba) projid=3(default)


By default, Oracle 10 will allocate 40% of the total system physical memory to create SGA and PGA. So for 32G system memory, the shmmax for Oracle 10 will be 0.4*32G = 12.8G.

40% 13105
50% 16442
75% 24536
100% 32764


# cat /etc/project
projmod -sK "project.max-shm-memory=(privileged,10G,deny)" oracle
projmod -p 100  -c 'lptrung add' -U oracle -G dba  -K 'project.max-shm-memory=(privileged,21G,deny)' oracle

projadd -p 100  -c 'lptrung add' -U oracle -G dba  -K 'project.max-shm-memory=(privileged,21G,deny)' projoracle

usermod -K project=projoracle oracle

projects -l

# su - oracle
$ id -p
uid=100(oracle) gid=100(dba) projid=100(group.dba)
$ prctl -n project.max-shm-memory -i process $$
process: 5754: -bash
NAME                    PRIVILEGE     VALUE     FLAG     ACTION    RECIPIENT
project.max-shm-memory  privileged    21.00GB     -       deny 
 
- Nếu cài 2 oracle 10g và 11g vào chung một server(nếu tổng ram server là 32G muốn cho oracle 10g: 10G ram, oracle 11g: 10G ram) thì  set shmsys:shminfo_shmmax là 20G ram

vi /et/system
set shmsys:shminfo_shmmax=21474836480
set semsys:seminfo_semmni=1024
set semsys:seminfo_semmsl=1024
set shmsys:shminfo_shmmni=100

Reboot lại hệ thống

mkdir -p /u01/app/oracle/product/11.2.0.2/db_1
chown -R oracle:oinstall /u01

vi .profile

ulimit -s 32768
ulimit -n 4096
TMP=/tmp; export TMP
TMPDIR=$TMP; export TMPDIR
# Select the appropriate ORACLE_BASE
ORACLE_HOSTNAME=KINHNGHIEM-S; export ORACLE_HOSTNAME
ORACLE_UNQNAME=bcclml; export ORACLE_UNQNAME
ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/11.2.0.2/db_1; export ORACLE_HOME
ORACLE_SID=bcclml; export ORACLE_SID
PATH=$ORACLE_HOME/bin:$PATH; export PATH



solaris
the following command displays a summary of I/O activity ten times, at ten-second intervals:
sar -b 10 10

update 11.2.0.2
Fix error tcp_largest_anon_port ....

bash-3.00# ndd -set /dev/tcp tcp_largest_anon_port 65535
bash-3.00# ndd -set /dev/udp udp_smallest_anon_port 9000
bash-3.00# ndd -set /dev/udp udp_largest_anon_port 65500
bash-3.00# ndd -set /dev/tcp tcp_smallest_anon_port 9000
bash-3.00# ndd -set /dev/tcp tcp_largest_anon_port 65500

No comments: