oracle 10g for hp HP-UX Itanium 11.31 installation
标签:hp-ux上安装oracle10g
1,硬件信息检验:
/usr/sbin/dmesg | grep "Physical:" 确定物理RAM高于1000M
/usr/sbin/swapinfo -a 确定交换分区有没有空间
bdf /tmp 确定tmp的空闲空间,要保障在400M以上
(扩展/tmp要到init 1但用户状态去umount掉,
lvextend -L 800 /dev/vg00/lvol5(/tmp所在的lv) /dev/dsk/盘号)
extendfs -F vxfs /dev/vg00/lvol5)
bdf 确定磁盘大小,需要2个大于4.7G的磁盘系统
# /bin/getconf KERNEL_BITS 确定系统是否64位
2,检查软件需求:
uname -a 检查操作系统版本:必须是hp-ux 11i v3
show_patches|grep PHKL_40240
show_patches|grep PHKL_39624
show_patches|grep PHKL_39625
注:hp Unix patch 每个季度都会有更新
确定hp 系统patch已经打上,如果没有,到itrc找到patch打上。
(swinstall -s 完全路径。先解析,再install)
3,java -version 查看java版本。必须安装Java版本SDK1.4.2。
(如果不能直接打出,把/opt/java1.4/bin/:加入 /.profile的PATH=中,再加入
export JAVA_HOME=/opt/java1.4)
4,创建需要的UNIX组和用户
#/usr/sbin/groupadd oinstall
#/usr/sbin/groupadd dba
创建oracle用户:
#/usr/sbin/useradd -g oinstall -G dba –m oracle
passwd oracle
5,创建必需目录:
mkdir /orabin
mkdir -p /orabin/oracle
mkdir /archive
chmod -R 775 /orabin /archive
chown oracle:dba /orabin
chown oracle:dba /archive
6,配置内核参数:
6.1 Kernel需求表:
Parameter Recommended Formula or Value
ksi_alloc_max (nproc*8) --32768
max_thread_proc 256
maxdsiz 1073741824 (1 GB)
maxdsiz_64bit 2147483648 (2 GB)
Oracle Database 21
maxssiz 134217728 (128 MB)
maxssiz_64bit 1073741824 (1 GB)
maxswapchunks 16384 --
maxuprc ((nproc*9)/10) --3687
msgmap (2+msgmni)
msgmni 4096
msgseg 32767
msgtql 4096
ncsize (ninode+vx_ncsize) 34816
nfile (15*nproc+2048) 61664
nflocks 4096
ninode (8*nproc+2048) 34816
nkthread (((nproc*7)/4)+16) 7184
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
(参数含义请看参数说明)
#调整内核参数
6.2 #kctune 查内核参数
kctune -h -B nproc="4200"
kctune -h -B ksi_alloc_max="33600"
kctune -h -B max_thread_proc="1100"
kctune -h -B maxdsiz="1073741824"
kctune -h -B maxdsiz_64bit="4294967296"
kctune -h -B maxssiz="134217728"
kctune -h -B maxssiz_64bit="1073741824"
kctune -h -B maxuprc="3688"
kctune -h -B msgmni="4096"
kctune -h -B msgtql="4096"
kctune -h -B ncsize="35840"
kctune -h -B nflocks="4096"
kctune -h -B ninode="34816"
kctune -h -B nkthread="8416"
kctune -h -B semmni="8192"
kctune -h -B semmns="16384"
kctune -h -B semmnu="4092"
kctune -h -B semvmx="32767"
kctune -h -B shmmax="34359738368"
kctune -h -B shmmni="512"
kctune -h -B shmseg="300"
kctune -h -B vps_ceiling="64"
如果更改了制定的static参数。需重建kernel和重起系统。
重起系统,用root登录
7,把安装盘mount上(把安装介质传上去)
用oracle用户登录,并修改oracle用户的环境(shell)
7.1、打开另一个会话终端
7.2、输入命令并确定是否可以用在终端输出图形化界面:
$ xhost +
7.3、完成一下步骤:
在这里安装oracle,切换到oracle用户。$ su - oracle
7.4、输入命令确定oracle的默认SHELL
#echo $SHELL
/sbin/sh(每个用户所使用的sh都不一样)
8,更改环境变量:
$ vi .profile
加入以下行:
export ORACLE_BASE=/orabin/oracle
export ORACLE_HOME=$ORACLE_BASE/product/10.2.0.1/db_1
export PATH=:$ORACLE_HOME/bin:$PATH:$ORACLE_HOME/OPatch
export NLS_LANG=american_america.zhs16gbk
export ORACLE_SID=oracle
9,编辑好之后logout再 su – oracle
$echo $ORACLE_HOME
输出ORACLE_HOME的路径
安装ORACLE软件:
拷贝文件到一个文件系统下,例如:/file/database
注意到用户和组为oracle:dba
如果不是执行:
chown –R oracle:dba database 把他所属用户为oracle所属组为dba
chmod –R 775 databse 更改他的执行权限为755
export DISPLAY= 192.168.61.222:0.0
xhost +
su – oracle 切换到oracle用户
echo $DISPLAY 查看输出目录
如果不是本机的IP地址,执行:
export DISPLAY=LOCALHOST_IP:0.0
然后进入oracle_databse所在目录,进行安装oracle
cd /file/databse
./ runInstaller -ignoreSysPreReqs
10,如果提示swap分区不够大,做如下操作:
vgdisplay –v 看看哪个disk上还有空余的空间。(free要*pe值)
lvcreate –L xxx(需要临时swap分区的大小) –n myswap(lv名字) vg00(所在的vg名)
newfs -F vxfs -o largefiles /dev/vg01/rmyswap(注意lv名前有r)
swapon /dev/vg00 /myswap
11,安装完成之后,需要用root用户run两个脚本
再打开一个会话窗口,执行:
/orabin/oracle/oraInventory/orainstRoot.sh
/orabin/oracle/product/10.2.0.1/root.sh
12,上传 oracle 10.2.0.4补丁
以同样的方法安装oracle 10.2.0.4 补丁
13,配置监听:
netca
14, 建库
dbca
使用裸设备
14.1 先创建裸设备
lvcreate -L 6000 -n system01.dbf vg00
lvcreate -L 5000 -n users01.dbf vg00
lvcreate -L 5000 -n temp01.dbf vg00
lvcreate -L 2000 -n undotbs01.dbf vg00
lvcreate -L 2000 -n undotbs02.dbf vg00
lvcreate -L 50 -n control01.ctl vg00
lvcreate -L 50 -n control02.ctl vg00
lvcreate -L50 -n control03.ctl vg00
lvcreate -L 500 -n redo01.log vg00
lvcreate -L 500 -n redo02.log vg00
lvcreate -L 500 -n redo03.log vg00
lvcreate -L 5000 -n sysaux01.dbf vg00
lvcreate -L 50 -n spfileoracle.ora vg00
14.2 改变裸设备的权限为oracle:dba
chown oracle:dba /dev/vg00/rsystem01.dbf
chown oracle:dba /dev/vg00/rusers01.dbf
chown oracle:dba /dev/vg00/rtemp01.dbf
chown oracle:dba /dev/vg00/rundotbs01.dbf
chown oracle:dba /dev/vg00/rcontrol01.ctl
chown oracle:dba /dev/vg00/rcontrol02.ctl
chown oracle:dba /dev/vg00/rcontrol03.ctl
chown oracle:dba /dev/vg00/rredo01.log
chown oracle:dba /dev/vg00/rredo02.log
chown oracle:dba /dev/vg00/rredo03.log
chown oracle:dba /dev/vg00/rsysaux01.dbf
chown oracle:dba /dev/vg00/rspfileoracle.ora
14.3 创建软连接
ln -s /dev/vg00/rspfileoracle.ora /orabin/product/10.2.0.1/db_1/dbs/spfileoracle .ora
ln -s /dev/vg00/rsystem01.dbf /orabin/oradata/oracle/system01.dbf
ln -s /dev/vg00/rusers01.dbf /orabin/oradata/oracle/users01.dbf
ln -s /dev/vg00/rtemp01.dbf /orabin/oradata/oracle/temp01.dbf
ln -s /dev/vg00/rundotbs01.dbf /orabin/oradata/oracle/undotbs01.dbf
ln -s /dev/vg00/rundotbs02.dbf /orabin/oradata/oracle/undotbs02.dbf
ln -s /dev/vg00/rcontrol01.ctl /orabin/oradata/oracle/control01.ctl
ln -s /dev/vg00/rcontrol02.ctl /orabin/oradata/oracle/control02.ctl
ln -s /dev/vg00/rcontrol03.ctl /orabin/oradata/oracle/control03.ctl
ln -s /dev/vg00/rredo01.log /orabin/oradata/oracle/redo01.log
ln -s /dev/vg00/rredo02.log /orabin/oradata/oracle/redo02.log
ln -s /dev/vg00/rredo03.log /orabin/oradata/oracle/redo03.log
ln -s /dev/vg00/rsysaux01.dbf /orabin/oradata/oracle/sysaux01.dbf
14.4 查看裸设备的权限和属组
# ll /dev/vg00/r*
crw-r----- 1 root sys 64 0x000017 Dec 3 15:26 /dev/vg00/rarchive
crw-r----- 1 oracle dba 64 0x00000f Dec 3 15:10 /dev/vg00/rcontrol01.ctl
crw-r----- 1 oracle dba 64 0x000010 Dec 3 15:10 /dev/vg00/rcontrol02.ctl
crw-r----- 1 oracle dba 64 0x000011 Dec 3 15:10 /dev/vg00/rcontrol03.ctl
brw-r----- 1 oracle dba 64 0x000012 Dec 3 15:10 /dev/vg00/redo01.log
brw-r----- 1 oracle dba 64 0x000013 Dec 3 15:10 /dev/vg00/redo02.log
brw-r----- 1 oracle dba 64 0x000014 Dec 3 15:10 /dev/vg00/redo03.log
crw-r----- 1 root sys 64 0x000001 Dec 3 11:44 /dev/vg00/rlvol1
crw-r----- 1 root sys 64 0x000002 Dec 3 11:44 /dev/vg00/rlvol2
crw-r----- 1 root sys 64 0x000003 Dec 3 11:44 /dev/vg00/rlvol3
crw-r----- 1 root sys 64 0x000004 Dec 3 11:44 /dev/vg00/rlvol4
crw-r----- 1 root sys 64 0x000005 Dec 3 11:44 /dev/vg00/rlvol5
crw-r----- 1 root sys 64 0x000006 Dec 3 11:44 /dev/vg00/rlvol6
crw-r----- 1 root sys 64 0x000007 Dec 3 11:44 /dev/vg00/rlvol7
crw-r----- 1 root sys 64 0x000008 Dec 3 11:44 /dev/vg00/rlvol8
crw-r----- 1 root sys 64 0x000009 Dec 3 15:10 /dev/vg00/roraclebin
crw-r----- 1 oracle dba 64 0x000012 Dec 3 15:10 /dev/vg00/rredo01.log
crw-r----- 1 oracle dba 64 0x000013 Dec 3 15:10 /dev/vg00/rredo02.log
crw-r----- 1 oracle dba 64 0x000014 Dec 3 15:10 /dev/vg00/rredo03.log
crw-r----- 1 oracle dba 64 0x000016 Dec 3 15:10 /dev/vg00/rspfileoracle.ora
crw-r----- 1 oracle dba 64 0x000015 Dec 3 15:10 /dev/vg00/rsysaux01.dbf
crw-r----- 1 oracle dba 64 0x00000a Dec 3 15:10 /dev/vg00/rsystem01.dbf
crw-r----- 1 oracle dba 64 0x00000c Dec 3 15:10 /dev/vg00/rtemp01.dbf
crw-r----- 1 oracle dba 64 0x00000d Dec 3 15:10 /dev/vg00/rundotbs01.dbf
crw-r----- 1 oracle dba 64 0x00000e Dec 3 15:10 /dev/vg00/rundotbs02.dbf
crw-r----- 1 oracle dba 64 0x00000b Dec 3 15:10 /dev/vg00/rusers01.dbf
14.5 查看链接文件的权限和属组
/orabin/oradata/oracle
# ll
total 0
lrwxrwxrwx 1 oracle oinstall 24 Dec 4 11:09 control01.ctl -> /dev/vg00/rcontrol01.ctl
lrwxrwxrwx 1 oracle oinstall 24 Dec 4 11:09 control02.ctl -> /dev/vg00/rcontrol02.ctl
lrwxrwxrwx 1 oracle oinstall 24 Dec 4 11:09 control03.ctl -> /dev/vg00/rcontrol03.ctl
lrwxrwxrwx 1 oracle oinstall 21 Dec 4 11:09 redo01.log -> /dev/vg00/rredo01.log
lrwxrwxrwx 1 oracle oinstall 21 Dec 4 11:09 redo02.log -> /dev/vg00/rredo02.log
lrwxrwxrwx 1 oracle oinstall 21 Dec 4 11:09 redo03.log -> /dev/vg00/rredo03.log
lrwxrwxrwx 1 oracle oinstall 23 Dec 4 11:09 sysaux01.dbf -> /dev/vg00/rsysaux01.dbf
lrwxrwxrwx 1 oracle oinstall 23 Dec 4 11:09 system01.dbf -> /dev/vg00/rsystem01.dbf
lrwxrwxrwx 1 oracle oinstall 21 Dec 4 11:09 temp01.dbf -> /dev/vg00/rtemp01.dbf
lrwxrwxrwx 1 oracle oinstall 24 Dec 4 11:09 undotbs01.dbf -> /dev/vg00/rundotbs01.dbf
lrwxrwxrwx 1 oracle oinstall 24 Dec 4 11:09 undotbs02.dbf -> /dev/vg00/rundotbs02.dbf
lrwxrwxrwx 1 oracle oinstall 22 Dec 4 11:09 users01.dbf -> /dev/vg00/rusers01.dbf
根据提示选择数据库名(oracle),sys密码(和主机名一样),选择control,datafile,redofile以及spfile的路径
15 把数据库变为归档模式
sqlplus 下执行:
alter system set log_archive_start= TRUE scope=spfile;
alter system set log_archive_dest_1="LOCATION=/archive" scope=spfile;
shutdown immediate;
alter database archivelog;
alter database open ;
show parameter archive;
测试:
alter system switch logfile;
/
/
/
到/archive 目录下查看是否已经归档
16 用客户端和网页或者第三方软件连接oracle
测试成功!
finish!
archive log list;
shutdown immediate;
startup mount;
alter database archivelog;
alter database open
alter system set LOG_ARCHIVE_DEST_1='LOCATION=/oracle/oradata/express/archive';
shutdown immediate;
startup
如果是oracle9i,还需要更改如下参数:
alter system set log_archive_start=true scope=spfile;
但是如果在10g中也更改这些参数,数据库重启时会有如下提示:
ORA-32004: obsolete and/or deprecated parameter(s) specified
alter system set log_archive_format='%t_%s.dbf' scope=spfile;
但是如果在10g中也更改这些参数,数据库会不能启动,如下提示:
ORA-32004: obsolete and/or deprecated parameter(s) specified
ORA-19905: log_archive_format must contain %s, %t and %r
posted on 2010-12-03 20:45
xzc 阅读(1106)
评论(0) 编辑 收藏 所属分类:
Oracle 、
linux/unix