HP-UX双机-安装ORACLE10g

HP-UX双机-安装ORACLE10g

1.        硬件设备:
rx4640*2
          DL380*2
          Hsv200*2
2.        软件环境:
HP-UX ia64 11.23
3.        安装准备
3.1.        软件准备:
3.1.1.        确定HP-UX的版本:
# uname –a
HP-UX rx46401 B.11.23 U ia64
3.1.2.        确定所需补丁:
swlist –l patch | more
PHSS_29658: Aries cumulative patch
PHSS_29660: linker + fdp cumulative patch
说明:要求HP客服人员安装系统后,将所有最新的补丁打一遍,即可。如果没有,从HP网站下载后,用swinstall安装(注:注册HP网站时,必须要用8位密码注册,我的密码是12345678。从HP官方网站下的补丁不知道为什么,总是解压不成功,最后只好求助HP客服人员,将最新的补丁打一遍)。
3.1.3.        创建UNIX组和用户
# groupadd oinstall(查询:grep osinstall /etc/group)
# groupadd dba(查询:grep dba /etc/group)
# useradd –g oinstall –G dba oracle (如果存在,则usermod –g oinstall –G dba oracle)
说明:oinstall是primary group;dba是secondary group
# passwd oracle(改变oracle的密码)
创建用户时最好使用sam,这样更快捷。Sam添加用户时会执行下列操作:
        在/etc/passwd中为用户创建一个条目(可以使用vipw进行编辑);
        为用户创建一个主目录;
        将启动文件(.cshrc、.exrc、.login、.profile)复制到用户的主目录下。
3.1.4.        创建所需目录及路径
利用bdf查看所有mount成功的文件系统的状态;
利用diskinfo查看所有disk的状态。
        在文件系统中建立/u01/app/oracle作为oracle base directory,过程如下:
# lvcreate –L 20000 vg00(因为其他disk还要做磁盘镜像,因此没有在其他disk上做vgcreate,而是在vg00上建立20G的逻辑分区)
Logical volume "/dev/vg00/lvol1" has been successfully created with
character device "/dev/vg00/rlvol1".
Logical volume "/dev/vg00/lvol1" has been successfully extended.
Volume Group configuration for /dev/vg02 has been saved in /etc/lvmconf/vg00.conf
# newfs –F vxfs /dev/vg00/rlvol1
说明:vxfs是文件系统类型,文件系统类型分为五种,hfs、vxfs、nfs、cdfs、lofs。hfs(High Performance File System,高性能文件系统,在需要与早期hp-ux发行版兼容时使用);vxfs(对应于JFS-Journaled File System,定期文件系统,通常建议安装此类型,缺省安装在hp-ux 11.0以上版本中,具有文件系统快速恢复功能和执行多种联机管理任务的能力。);rlvol1是该逻辑卷的字符设备文件(character device)
# mkdir /u01
# mount /dev/vg00/lvol1 /u01
说明:lvol1是该逻辑卷名;因为只可以mount上文件系统,所以必须要newfs后才可以mount。
# mkdir /u01/app/oracle
# chown –R oracle:oinstall /u01/app/oracle
# chmod 777 /u01/app/oracle
说明:chmod abc file,a表示user,b表示group,c表示other。r=4,w=2,x=1。如果user要有rwx的权限,则a=4+2+1=7。
        在disk中建立/dev/vg03/rwhdba裸设备(raw device)做为用户whdba缺省表空间所在数据文件的directory,过程如下:
# pvcreate -f /dev/rdsk/c13t0d2  (将磁盘初始化为LVM磁盘)
Physical volume "/dev/rdsk/c13t0d2" has been successfully created.
说明:-f
# mkdir /dev/vg03  (为卷组创建一个目录)
# mknod /dev/vg03/group c 64 0x020000  (在上面的目录中创建一个名为group的设备文件)
说明:c 64 0x20000,02是可变的,c表示group是字符设备文件,64是group设备文件的主编号,主编号始终是64。0xnn0000是group文件的十六进制形式的次编号。注意每个NN必须在所有卷组中是唯一的。
# vgcreate -s 16 vg03 /dev/dsk/c13t0d2  (创建卷组,指定卷组中包括的每个物理卷)
Increased the number of physical extents per physical volume to 63999.
Volume group "/dev/vg03" has been successfully created.
Volume Group configuration for /dev/vg03 has been saved in /etc/lvmconf/vg03.conf
说明:-s 16说明每个PE(盘区)的大小是16m,这个参数在该磁盘环境中是要增加的。否则将会出现错误:
Warning: Max_PE_per_PV for the volume group (65535) too small for this PV (255999).
         Using only 65535 PEs from this physical volume.
Increased the number of physical extents per physical volume to 65535.
vgcreate: Volume group "/dev/vg03" could not be created:
VGRA for the disk is too big for the specified parameters. Increase the
extent size or decrease max_PVs/max_LVs and try again.
因为我的磁盘大小是1T,-s是PE数,默认是4,(65535*4=262140也就是256G)。因为我的磁盘大小是1T,所以-s应该是16。(65535*16=1048560)
# lvcreate -L 50000m -n whdba /dev/vg03  (创建逻辑卷)
Logical volume "/dev/vg03/whdba" has been successfully created with
character device "/dev/vg03/rwhdba".
Logical volume "/dev/vg03/whdba" has been successfully extended.
Volume Group configuration for /dev/vg03 has been saved in /etc/lvmconf/vg03.conf
# chown oracle:oinstall /dev/vg03/rwhdba
# chmod 777 /dev/vg03/rwhdba

        目前所建立好的裸设备空间及大小如下表:
system=/dev/vg03/rsystem  8000m
spfile=/dev/vg03/rspfile  52m
users=/dev/vg03/ruser  3000m
temp=/dev/vg03/rtemp  3000m
undotbs1=/dev/vg03/rundotbs1  6000m
example=/dev/vg03/rexample  2000m
cwmlite=/dev/vg03/rcwmlite  2000m
xdb=/dev/vg03/rxdb  1024m (sysaux01)
odm=/dev/vg03/rodm  3000m
indx=/dev/vg03/rindex  3000m
tools=/dev/vg03/rtools  500m
control1=/dev/vg03/rcontrol1  1024m
control2=/dev/vg03/rcontrol2  1024m
control3=/dev/vg03/rcontrol3  1024m
redo1=/dev/vg03/rredo1  2048m
redo2=/dev/vg03/rredo2  2048m
redo3=/dev/vg03/rredo3  2048m
whdba=/dev/vg03/rwhdba   50000m
3.1.5.        配置Kernel Parameters
根据ORACLE官方网站上的文档做为参考,但存在一些问题,在有问题的参数后,会加以标注
ksi_alloc_max: (nproc*8)
max_thread_proc: 256
maxdsiz: 1073741824 (1 GB)
maxdsiz_64bit: 2147483648 (2 GB)
maxssiz: 134217728 (128 MB)
maxssiz_64bit: 1073741824 (1 GB)
maxswapchunks: 16384 注:没有该参数
maxuprc: ((nproc*9)/10)
msgmap: (2+msgmni)
msgmni: 4096
msgseg: 32767
msgtql: 4096
ncsize: (ninode+vx_ncsize) 注:没有该参数
nfile: (15*nproc+2048) 注:没有该参数
nflocks: 4096
ninode: (8*nproc+2048)
nkthread: (((nproc*7)/4)+16)
nproc: 4096
semmap: (semmni+2) 注:没有该参数
semmni: 4096
semmns: (semmni*2)
semmnu: (nproc-4)
semvmx: 32767
shmmax: The size of physical memory (0X40000000) or 1073741824, whichever is greater.
Shmmni: 512
Shmseg: 120
vps_ceiling: 64
3.2.        oracle安装文件准备:
因为HP-UX是ia64,所以要下载for hp-ux itanium版本的oracle。
Oracle Database 10g Release 1 (10.1.0.2) for HP-UX Itanium
解压所下载的文件:
# gunzip ship_db_ia64hp_disk1.cpio.gz
说明解压后的文件名是:ship_db_ia64hp_disk1.cpio
# cpio -idmv <ship_db_ia64hp_disk1.cpio
说明:<必须要有。解压文件放在Disk1文件夹中。
3.3.        安装oracle
以oracle用户登录,编辑.profile(如果在用户主目录下没有该文件,将根目录下的该文件cp到用户主目录下,然后进行编辑)
TEMP=/tmp
TMDIR=/tmp
export TEMP TMDIR
ORACLE_BASE=/u01/app/oracle
ORACLE_SID=whdbdev
ORACLE_HOME=/u01/app/oracle/product/10.2.0
export ORACLE_BASE ORACLE_SID ORACLE_HOME
umask 022
编辑完成,执行该profile:. ./.profile(在用户主目录下编辑了该文件,就会在每次启动该用户的时候,执行该文件。)
# export DISPLAY=192.168.3.100:0.0
# export LC_ALL
# /u01/app/Disk1/runInstaller
出现ORACEL的安装界面。

3.4.        安装后
Oracle 管理工具
Ultra Search URL:
[url]http://debian:5620/ultrasearch[/url]
Ultra Search 管理工具 URL:
[url]http://debian:5620/ultrasearch/admin[/url]
iSQL*Plus URL:
[url]http://debian:5560/isqlplus[/url]
Enteprise Manager 10g Database Control URL:
[url]http://debian:5500/em[/url]

将安装完的oracle目录打包ftp到另一台服务器的相同目录下。
# cd /u01/app
# tar cvf oracle.tar /u01/app
# ftp 192.168.1.2
Ftp>cd /u01/app
Ftp>bin
Ftp>hash
Ftp>put oracle.tar
在另外一台服务器上将oracle.tar解压。
# tar xvf oracle.tar
在第一台服务器上用dbca在裸设备上创建数据库WHDBDEV
注意:在创建数据库期间,一定要考虑字符集的问题。因为不同字符集之间的数据进行交换会产生乱码的问题。并且字符集的转换是从子集到超集受支持,反之不行。所谓超集是指:当前字符集中的每一个字符在新字符集中都可以表示,并使用同样的代码点。如果两种字符集之间根本没有子集和超集的关系,那么字符集的转换是不受oracle支持的。ZHS16GBK、ZHS16CGB231280、WE8ISO8859P1是不存在子集和超集关系,因此他们之间的转换是不受支持的。例如ZHS16GBK转换成WE8ISO8859P1。
SQL>select userenv(‘language’) from dual;
USERENV('LANGUAGE')
----------------------------------------------------
SIMPLIFIED CHINESE_CHINA.ZHS16GBK
SQL>shutdown immediate
SQL>startup mount
SQL>alter system enable restricted session;
SQL>alter system set JOB_QUEUE_PROCESSES=0;
SQL>alter system set AQ_TM_PROCESSES=0;
SQL>alter database open;
SQL>alter database character set WE8ISO8859P1;
     alter database character set WE8ISO8859P1
*
第 1 行出现错误:
ORA-12712: new character set must be a superset of old character set

root# vi /etc/oratab 将最后的: oracle_sid:/home/oracle/product/10.2.0:N 改为: oracle_sid:/home/oracle/product/10.2.0:Y

建立启动/关闭脚本:
start.sh(启动脚本)
vi start.sh
date >> /tmp/logdata
echo start >> /tmp/logdata
su - oracle -c "/u01/app/oracle/product/10.1.0/bin/lsnrctl start"
su - oracle -c "/u01/app/oracle/product/10.1.0/bin/sqlplus /nolog <<EOF
connect / as sysdba
startup
EOF"
stop.sh(关闭脚本)
vi stop.sh date >> /tmp/logdata
echo stop >> /tmp/logdata
su - oracle -c "/u01/app/oracle/product/10.1.0/bin/sqlplus /nolog << EOF
connect / as sysdba
shutdown immediate
EOF"

su - oracle -c "/u01/app/oracle/product/10.1.0/bin/lsnrctl stop"

在集群软件包(/etc/cmcluster/pkg/)中加入这两个启动/关闭脚本。 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值