Chinaunix首页 | 论坛 | 博客
  • 博客访问: 20565
  • 博文数量: 6
  • 博客积分: 45
  • 博客等级: 民兵
  • 技术积分: 20
  • 用 户 组: 普通用户
  • 注册时间: 2012-07-26 14:02
文章分类

全部博文(6)

文章存档

2016年(1)

2015年(4)

2012年(1)

我的朋友

分类: 系统运维

2015-04-29 08:34:02

原文地址:AIX下安装11GR2 作者:hxl

环境:
OS:AIX 5.3
DB:11.2.0.1
 
------------------------------安装数据库软件部分------------------------
1.安装前检查
查看物理内存大小
#/usr/sbin/lsattr -E -l sys0 -a realmem
realmem 2031616 Amount of usable physical memory in Kbytes False
 
查看swap space,交换空间通常情况下是物理内存的2倍,通常采用如下公式计算交换空间的大小512M + (物理内存大小(单位M) - 256M) * 1.25
#lsps -a
Page Space      Physical Volume   Volume Group    Size %Used Active  Auto  Type
hd6             hdisk0            rootvg         512MB     1   yes   yes    lv

查看系统结构,AIX下安装ORACLE需要是64位的系统
# getconf HARDWARE_BITMODE
64
或者
# bootinfo -K
64
 
检查OS版本,11GR2需要5300-09以上的版本
# oslevel -s
5300-10-00-0000
 
检查如下包是否已经安装,没有的话需要smit install进行安装
lslpp -l bos.adt.base
lslpp -l bos.adt.lib
lslpp -l bos.adt.libm
lslpp -l bos.perf.perfstat
lslpp -l bos.perf.libperfstat
lslpp -l bos.perf.proctools
lslpp -l rsct.basic.rte (这个包官方文档没有提及,不安装的情况下检查通不过)

2.调整相应参数
 
调整maxuproc(系统最大进程数)
smitty chgsys
或是
#chdev -l sys0 -a maxuproc=16384
sys0 changed
 
调整ncargs(系统块大小)
#chdev -l sys0 -a ncargs=128
sys0 changed
 
调整异步io
#smitty aio
修改完后需要重启动,可以使用如下命令查看aio server的进程数
$pstat -a|grep aios
 
修改/etc/security/limits文件
#vi /etc/security/limits
在文件中修改default参数:
default:
fsize = -1
core = -1
cpu = -1
data = -1
rss = -1
stack = -1
nofiles = -1

修改完毕后,需重起系统生效.
 
优化虚拟内存管理
vmo -p -o minperm%=3
vmo -p -o maxperm%=90
vmo -p -o maxclient%=90
vmo -p -o lru_file_repage=0
vmo -p -o strict_maxclient=1
vmo -p -o strict_maxperm=0

调整网络参数

no -r -o ipqmaxlen=512
no -p -o rfc1323=1
no -p -o sb_max=131072 //2*65536
no -p -o tcp_recvspace=65536
no -p -o tcp_sendspace=65536
no -p -o udp_recvspace=655360
no -p -o udp_sendspace=65536

3.获取安装软件

从oracle官网下载如下两个zip文件
aix.ppc64_11gR2_database_1of2.zip
aix.ppc64_11gR2_database_2of2.zip

同时将这两个文件上传到目录/soft下,同时解压缩这两个文件.默认情况下,aix是没有安装unzip的,这个需要自己安装,具体可以参考http://blog.chinaunix.net/uid-77311-id-3318868.html.安装完成后就可以解压缩了,如下:

unzip aix.ppc64_11gR2_database_1of2.zip
unzip aix.ppc64_11gR2_database_2of2.zip

4.创建文件系统目录

我们需要创建一个文件系统,用于存放oracle安装的目录,如下所示:

smitty crfs

Volumn group name 选择rootvg,因为我的系统只有这个rootvg,有其他vg的话可以选择其他的vg.

Unit Size 选择Gigabytes
Number of Units选择10,这里划分10g给/u01
MOUNT POINT 输入/u01
MOUNT AUTOMATICALLY AS SYSTEM RESTART? 选择yes,系统启动的时候自动加载

 

创建完成后,需要加载该文件系统

mount  /u01

 

5.创建用户和组

 

smitty mkgroup

Dba

这里Group Name输入dba,其他默认.

oinstall组

这里Group Name输入oinstall,其他默认.

创建oracle用户

Primary GROUP 选择oinstall,Group SET选择DBA,其他选项保持默认.

 

同时修改oracle用户的能力

[hxl/root]#chuser capabilities=CAP_NUMA_ATTACH,CAP_BYPASS_RAC_VMM,CAP_PROPAGATE oracle
[hxl/root]#lsuser -a capabilities oracle
oracle capabilities=CAP_NUMA_ATTACH,CAP_BYPASS_RAC_VMM,CAP_PROPAGATE

创建完用户后,修改oracle用户密码
# passwd oracle
Changing password for "oracle"
oracle's New password:
Enter the new password again:

6.添加环境变量

使用oracle用户登录后,按照如下添加环境变量

cd ~
vi .profile

添加如下内容
export PS1='['`hostname`':$LOGIN:$PWD]$'
export EDITOR=vi
export ORACLE_SID=oracl
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib
export PATH=$ORACLE_HOME/bin:/usr/bin:/usr/sbin:/usr/X11R6/bin:/bin:/sbin
export NLS_DATE_FORMAT="YYYY-MM-DD HH24:MI:SS"
export TMPDIR=/tmp

小插曲,以上变量定义好后,发现使用xmanager登陆后,环境变量并没有生效,但通过telnet登陆是生效的,原因是CDC登陆的的时候是使用的.dtprofile文件,修改该文件将最后一行的注释去掉.

#DTSOURCEPROFILE=true

修改为

DTSOURCEPROFILE=true

这样重新使用xmanager登陆后,环境变量即可生效.

 

创建环境变量里定义的文件目录

[hxl/oracle]$echo $ORACLE_BASE

/u01/app/oracle

[hxl/oracle]$mkdir -p $ORACLE_BASE

[hxl/oracle]$mkdir -p $ORACLE_BASE/product/11.2.0/db_1

 

oracle软件存放的目录和安装目录的属主修改为oralce

$su

# chown -R oracle:oinstall /soft

# chown -R oracle:oinstall /u01

 

7.开始安装数据库软件

进入到安装文件存放目录/database,首先在root用户下执行rootpre.sh

[hxl/oracle]#./rootpre.sh

./rootpre.sh output will be logged in /tmp/rootpre.out_12-08-20.21:18:00

Saving the original files in /etc/ora_save_12-08-20.21:18:00....

Copying new kernel extension to /etc....

Loading the kernel extension from /etc

 

 Oracle Kernel Extension Loader for AIX

       Copyright (c) 1998,1999 Oracle Corporation

 

  Successfully loaded /etc/pw-syscall.64bit_kernel with kmid: 0x3fa3700

 Successfully configured /etc/pw-syscall.64bit_kernel with kmid: 0x3fa3700

The kernel extension was successfuly loaded.

 

Configuring Asynchronous I/O....

 

Configuring POSIX Asynchronous I/O....

 

Checking if group services should be configured....

Nothing to configure.

 

测试图形界面是否正常,因为安装oracle软件是在图形界面下完成的.

[hxl/oracle]$su

root's Password:

[hxl/oracle]$xhost +

access control disabled, clients can connect from any host

[hxl/oracle]$xclock

[hxl/oracle]$

 

没有问题的话,就可以按照图形界面安装了

 

[hxl/oracle]$./runInstaller

********************************************************************************

 

Your platform requires the root user to perform certain pre-installation

OS preparation.  The root user should run the shell script 'rootpre.sh' before

you proceed with Oracle installation.  rootpre.sh can be found at the top level

of the CD or the stage area.

 

Answer 'y' if root has run 'rootpre.sh' so you can proceed with Oracle

installation.

Answer 'n' to abort installation and then ask root to run 'rootpre.sh'.

 

********************************************************************************

 

Has 'rootpre.sh' been run by root? [y/n] (n)

y

 

Starting Oracle Universal Installer...

 

Checking temp space: 124 MB available, 190 MB required.    Failed <<<<

Checking swap space: must be greater than 150 MB.   Actual 512 MB    Passed

Checking monitor: must be configured to display at least 256 colors.    Actual 16777216    Passed

 

Some requirement checks failed. You must fulfill these requirements before

 

continuing with the installation,

 

Continue? (y/n) [n] n

 

这里提示/tmp目录太小导致检查无法通过.

 

smitty chfs 添加空间到200m

File System name 选择 /tmp
Unit Size 选择Megabytes
Number of Units选择200,这里划分200m给/tmp
 

重新执行

$./runInstaller

1.这里可以输入相应的信息,不想输入的话就直接next吧.

 

2.这里只安装软件

 

3.选择单实例安装

 

4.选择语言

 

5.选择企业版安装

 

6.指定安装目录

 

Next报如下错误:

 

原因是权限的问题,发现/u01归属于root用户,将该目录修改为oracle用户即可

Chown –R oracle:oinstall.

 

7.指定安装目录

 

8.选择系统组

 

9.安装检查

 

发现检查失败的项.

 

问题1:交换空间太小

解决办法:

查看当前交换空间大小

[hxl/oracle]$lsps -a

Page Space      Physical Volume   Volume Group    Size %Used Active  Auto  Type

hd6             hdisk0            rootvg         512MB     1   yes   yes    lv

 

添加交换空间

smitty chps

Number of additional logical partitions:16

其他保持默认.

 

问题2./tmp 空间太小

解决办法

smitty chfs

这里将/tmp增加到了2G

 

问题3

提示没有安装rsct.basic.rte

smitty install 将该包安装即可,该包在光盘介质中可以找得到.

 

问题4 没有打如下补丁

If you are using the minimum operating system TL level for AIX 5L
listed above, then install all AIX 5L 5.3 Authorized Problem Analysis
Reports (APARs) for AIX 5L v. 5.3 ML06, and the following AIX fixes:
IZ42940
IZ49516
IZ52331

 

[hxl/oracle]$instfix -i -kIZ42940

    There was no data for IZ42940 in the fix database.

[hxl/oracle]$instfix -i -kIZ49516

    There was no data for IZ49516 in the fix database.

[hxl/oracle]$instfix -i -kIZ52331

There was no data for IZ52331 in the fix database.

5.3.10已经安装这三个补丁了的,不知道为什么这里还需要这三个包,先不管它,忽略之.

 

10.开始安装

 

快安装完成的时候报如下错误:

 

产生这个问题的原意是下载安装包的过程中或将安装包上传到服务器的过程中出现了问题.

检查如下两个安装包

cksum aix.ppc64_11gR2_database_1of2.zip
cksum aix.ppc64_11gR2_database_2of2.zip

若得到值跟oracle官网的不一致说明是有问题的,需要重新下载和上传.

oracle官网的chsum值如下:

Oracle Database 11g Release 2 (11.2.0.1.0) for AIX (PPC64) 
aix.ppc64_11gR2_database_1of2.zip (1,564,425,851 bytes) (cksum - 1915658395)
aix.ppc64_11gR2_database_2of2.zip (1,007,010,341 bytes) (cksum - 1152318705)

 

11.安装完成后需要在root用户下执行如下两个脚本

 

执行完这两个脚本后,数据库软件安装完毕.下面可以使用dbca创建数据库,创建过程跟在其他平台创建是一样的,这里具体过程省略.

 

配置oracle随着OS自启动.

自启动配置

1.编写自启动脚本,命名为dbcontrol.sh,内容如下:

#!/bin/ksh
#chkconfig: 2345
#description:oracle_orcl
#
# /etc/rc.d/init.d/db_control.sh
# auto start database orcl instance

#set oracle env
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1
export PATH=$PATH:$ORACLE_HOME/bin
export ORACLE_SID=oracl
export ORACLE_USER=oracle
#start or stop script
case $1 in
start)
su - "$ORACLE_USER"<lsnrctl start LISTENER
sqlplus /nolog<connect /as sysdba
startup
EOS
EOO
;;

stop)
su - "$ORACLE_USER"<lsnrctl stop LISTENER
sqlplus /nolog<connect /as sysdba
shutdown immediate
EOS
EOO
;;

*)
echo "Usage: $0 {start|stop}"
;;
esac

 

2.在etc目录下创建启动如下脚本

[hxl/oracle]more /etc/rc.startdb
/u01/myscript/dbcontrol.sh start #startOracleDB

 

3.在/etc/inittab最后一行添加如下内容

$vi /etc/inittab
startdb:2:wait:/etc/rc.startdb>/home/oracle/log 2>&1

 

自动关闭数据库配置

1.创建/etc/rc.shutdown文件

默认情况下,安装好系统后,不会自动创建rc.shutdown文件,需要自己创建.将要关闭数据的脚本添加到该文件中.

内容如下:

[hxl/oracle]more /etc/rc.shutdown
#!/bin/ksh
/u01/myscript/dbcontrol.sh stop>/home/oracle/logdown

 

这样系统shutdown后,数据库也会自动关闭,但系统reboot情况下,数据库不会自动关闭,这个问题先留着,后续跟进.

 

若要使用ASM磁盘管理数据,需要安装GRID,安装步骤如下:

------------------------------安装GRID部分------------------------

1.创建group

查看当前的group

[hxl/oracle]$cat /etc/group|grep oracle

dba:!:201:oracle

oinstall:!:202:oracle

 

创建group

mkgroup -A id=203 asmadmin

mkgroup -A id=204 asmdba

mkgroup -A id=205 asmoper

 

2.创建grid用户

[hxl/oracle]$mkuser pgrp='oinstall' groups='asmadmin,asmdba,asmoper' home='/home/grid' grid

[hxl/oracle]$passwd grid

Changing password for "grid"

grid's New password:

Enter the new password again

 

3.修改grid的环境变量

使用grid用户登录,并编辑.profile,添加如下内容:

export PS1=[`hostname`/`whoami`]$

export EDITOR=vi

export ORACLE_SID=+ASM

export ORACLE_BASE=/u01/app/oracle

export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/grid

export PATH=$ORACLE_HOME/bin:/usr/bin:/usr/sbin:/usr/X11R6/bin:/bin:/sbin

export NLS_DATE_FORMAT="YYYY-MM-DD HH24:MI:SS"

export TMPDIR=/tmp

 

要使CDE登录后环境变量生效,需要修改.dtprofile文件,将如下的注释去掉

#DTSOURCEPROFILE=true

修改为

DTSOURCEPROFILE=true

 

4.创建grid用户环境变量中定义的目录

[hxl/root]#mkdir -p /u01/app/oracle/product/11.2.0/grid

[hxl/root]#chown -R grid:oinstall /u01/app/oracle/product/11.2.0/grid

 

5.创建放置grid软件的目录,并将压缩包解压到该目录下

[hxl/root]#mkidr gridsoft

[hxl/root]#chown -R grid:oinstall ./gridsoft

[hxl/grid]$pwd

/soft/gridsoft

[hxl/grid]$unzip aix.ppc64_11gR2_grid.zip

 

6.准备安装grid

进入到gridsoft目录,root用户下执行如下脚本

Su – root

[hxl/grid]#./rootpre.sh

./rootpre.sh output will be logged in /tmp/rootpre.out_12-09-01.22:12:41

Kernel extension /etc/pw-syscall.64bit_kernel is loaded.

Unloading the existing extension: /etc/pw-syscall.64bit_kernel....

 

 Oracle Kernel Extension Loader for AIX

       Copyright (c) 1998,1999 Oracle Corporation

 

 

 Unconfigured the kernel extension successfully

 Unloaded the kernel extension successfully

Saving the original files in /etc/ora_save_12-09-01.22:12:41....

Copying new kernel extension to /etc....

Loading the kernel extension from /etc

 

 Oracle Kernel Extension Loader for AIX

       Copyright (c) 1998,1999 Oracle Corporation

 

 

 Successfully loaded /etc/pw-syscall.64bit_kernel with kmid: 0x40b1200

 Successfully configured /etc/pw-syscall.64bit_kernel with kmid: 0x40b1200

The kernel extension was successfuly loaded.

 

Configuring Asynchronous I/O....

Asynchronous I/O is already defined

 

Configuring POSIX Asynchronous I/O....

Posix Asynchronous I/O is already defined

 

Checking if group services should be configured....

Nothing to configure.

 

7.执行运行脚本

 

 

 

 

-- The End --

 

 

 

 

阅读(987) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~