安装前环境检测:
1.查看内存,需要至少1G:
# /usr/sbin/lsattr -E -l sys0 -a realmem
realmem 4194304 Amount of usable physical memory in Kbytes False
2.查看swap分区,不能小于内存大小:
# /usr/sbin/lsps -a
Page Space Physical Volume Volume Group Size %Used Active Auto Type Chksum
hd6 hdisk0 rootvg 5632MB 1 yes yes lv 0
3.查看/tmp目录,不能小于400M:
# df -m /tmp
Filesystem MB blocks Free %Used Iused %Iused Mounted on
/dev/hd3 5120.00 4878.07 5% 967 1% /tmp
4.查看硬件平台:
# /usr/bin/getconf HARDWARE_BITMODE
64
5.查看操作系统版本:
# oslevel -r
6100-06
6.检查相关软件是否安装:
# lslpp -l bos.adt.base bos.adt.lib bos.adt.libm bos.perf.perfstat \
bos.perf.libperfstat bos.perf.proctools>
Fileset Level State Description
----------------------------------------------------------------------------
Path: /usr/lib/objrepos
bos.adt.base 6.1.6.16 COMMITTED Base Application Development
Toolkit
bos.adt.lib 6.1.2.0 COMMITTED Base Application Development
Libraries
bos.adt.libm 6.1.6.0 COMMITTED Base Application Development
Math Library
bos.perf.libperfstat 6.1.6.16 COMMITTED Performance Statistics Library
Interface
bos.perf.perfstat 6.1.6.16 COMMITTED Performance Statistics
Interface
bos.perf.proctools 6.1.6.16 COMMITTED Proc Filesystem Tools
Path: /etc/objrepos
bos.adt.base 6.1.6.16 COMMITTED Base Application Development
Toolkit
bos.perf.libperfstat 6.1.6.16 COMMITTED Performance Statistics Library
Interface
bos.perf.perfstat 6.1.1.0 COMMITTED Performance Statistics
Interface
7.检测APAR是否安装(这个可以忽略):
# /usr/sbin/instfix -i -k "IY63133 IY64978 IY63366 IY64691 IY65001 IY64737 \
IY64361 IY65305 IY58350 IY63533">
There was no data for IY63133 in the fix database.
There was no data for IY64978 in the fix database.
There was no data for IY63366 in the fix database.
There was no data for IY64691 in the fix database.
There was no data for IY65001 in the fix database.
There was no data for IY64737 in the fix database.
There was no data for IY64361 in the fix database.
There was no data for IY65305 in the fix database.
There was no data for IY58350 in the fix database.
There was no data for IY63533 in the fix database.
8.检查网络环境-主机名:
# hostname
aix201
9.检查网络环境-/etc/hosts主机名和ip映射关系:
cat /etc/hosts
127.0.0.1 loopback localhost # loopback (lo0) name/address
192.168.1.201 aix201
10.查看系统中是否已经存在oinstall组:
# more /etc/oraInst.loc
inventory_loc=/oracle13/app/oraInventory
inst_group=oinstall
如果有这个文件,就删掉。否则OUI无法安装。
# ls -l /etc/oraI*
-rw-r--r-- 1 root system 61 Aug 09 11:33 /etc/oraInst.loc
查看有没有oinstall组和dba组,oracle用户:
# cat /etc/group |grep oinstall
oinstall:!:2203:oracle1,oracle03,oracle01,oracle2,oracle8,oracle13
# cat /etc/group |grep dba
dba:!:2201:oracle1,oracle03,oracle01,oracle2,oracle8,oracle13
11.创建oinstall组、dba组、oracle用户(如果已经存在oinstall和dba组直接使用,只创建新用户指向这两个组):
smitty security
以创建oracle用户为例,创建完后如下:
# id oracle
uid=3003(oracle) gid=2203(oinstall) groups=2201(dba)
创建完后需要修改oracle用户的密码:
passwd oracle(oracle用户登录的时候还要修改一次密码)
12.配置shell limit和system limit:
a.配置shell limit
smitty chuser (输入oracle用户然后将soft的选项全选成-1)配置完后查看会显示如下:
# ulimit -a
time(seconds) unlimited
file(blocks) unlimited
data(kbytes) unlimited
stack(kbytes) 4194304
memory(kbytes) unlimited
coredump(blocks) unlimited
nofiles(descriptors) unlimited
threads(per process) unlimited
processes(per user) unlimited
b.配置system limit
smitty chgsys(将Maximum number of PROCESSES allowed per user [16384] 项设置至少2048)
13.创建相关的目录:
ORACLE_BASE(必须指出的,格式/mount_point/app/oracle_sw_owner,只安装软件大小至少3G,同时放数据库则至少4G)
ORACLE_HOME(可以不用创建,指出ORACLE_BASE后OUI会自动创建)
oracle_base/oraInventory(不用创建,指出ORACLE_BASE后OUI会自动创建然后赋予相关权限)
在/etc/oraInst.loc文件中可以看出系统中的oracle_base目录。通常,10g的oraInventory目录在oracle_base。
$ cat /etc/oraInst.loc
inventory_loc=/oracle13/app/oraInventory
inst_group=oinstall
在/etc/oratab文件中可以看出安装的数据库的所有ORACLE_HOME目录。
$ more /etc/oratab
cinsm:/u01/app/oracle01/product/11.2.0/dbhome_1:N
orcl13:/oracle13/app/oracle/product/10.2/db_1:N
在创建oracle_base目录前先创建一个独立的vg(生产系统直接安装在rootvg)ora10gvg并创建lv ora10glv和文件系统:
smitty mkvg
smitty mklv
smitty crfs
创建完成之后:
# lsvg -l ora10gvg
ora10gvg:
LV NAME TYPE LPs PPs PVs LV STATE MOUNT POINT
ora10glv jfs2 70 70 1 closed/syncd /oracle
loglv05 jfs2log 1 1 1 closed/syncd N/A
挂载上文件系统:
# mount /oracle
# mount | grep oracle
/dev/ora10glv /oracle jfs2 Aug 09 17:37 rw,log=/dev/loglv05
#
创建oracle_base目录:
mkdir -p /oracle/app/oracle
chown -R oracle:oinstall /oracle/app/oracle
chmod -R 755 /oracle/app/oracle
创建完查看时下面这样:
# ls -ld /oracle/app/oracle
drwxr-xr-x 2 oracle oinstall 256 Aug 09 17:41 /oracle/app/oracle
14.登录oracle用户设置环境变量:
su - oracle
vi .profile --添加以下内容(ORACLE_HOME安装时再指定)
export ORACLE_BASE=/oracle/app/oracle
export ORACLE_SID=orcl
export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/OPatch:$PATH
. ./.profile生效环境变量。
15.上传安装介质并解压:
root上传完安装介质如下:
# ls -l
total 2477704
-rw-r--r-- 1 root system 1268576110 Aug 09 18:09 10gr2_aix5l64_database.cpio.gz
root将安装介质(在/software下)属主给oracle,权限设置755:
# chown -R oracle:oinstall /software
# chmod -R 755 /software
# ls -l /software
total 2477696
-rwxr-xr-x 1 oracle oinstall 1268576110 Aug 09 18:09 10gr2_aix5l64_database.cpio.gz
# ls -ld /software
drwxr-xr-x 2 oracle oinstall 256 Aug 09 18:07 /software
切换oracle用户解压安装介质:
gunzip 10gr2_aix5l64_database.cpio.gz
解压完事这样的:
$ ls -l
total 2580312
-rwxr-xr-x 1 oracle oinstall 1321110528 Aug 09 18:09 10gr2_aix5l64_database.cpio
继续解压:
$ cpio -idcmv < 10gr2_aix5l64_database.cpio
解压后使下面这样:
$ ls -l
total 2580312
-rwxr-xr-x 1 oracle oinstall 1321110528 Aug 09 18:09 10gr2_aix5l64_database.cpio
drwxr-xr-x 7 oracle oinstall 256 Aug 09 18:25 Disk1
16.oracle用户登录图形界面进行安装:
登录图形界面后先修改/home/oracle/.dtprofile文件成下面这样:
. /etc/profile
DTSOURCEPROFILE=true
然后重新登录图形界面,否则oracle的.profile文件默认不会被读取,无法获得环境变量。
$ pwd
/software/Disk1
$ ls -l
total 48
drwxr-xr-x 9 oracle oinstall 4096 Aug 09 18:25 doc
drwxr-xr-x 5 oracle oinstall 4096 Aug 09 18:24 install
drwxr-xr-x 2 oracle oinstall 256 Aug 09 18:24 response
drwxr-xr-x 3 oracle oinstall 256 Aug 09 18:24 rootpre
-rwxr-xr-x 1 oracle oinstall 2601 Aug 26 2005 runInstaller
drwxr-xr-x 9 oracle oinstall 4096 Aug 09 18:25 stage
-rw-r--r-- 1 oracle oinstall 5283 Aug 26 2005 welcome.html
运行./runInstaller安装。
提示是否运行rootpre.sh,root运行脚本rootpre.sh:
$ pwd
/software/Disk1/rootpre
$ ls -l
total 168
drwxr-xr-x 5 oracle oinstall 256 Aug 09 18:24 ORCLcluster
-rwxr-xr-x 1 oracle oinstall 15850 Aug 26 2005 loadext
-rwxr-xr-x 1 oracle oinstall 12632 Aug 26 2005 pw-syscall
-rwxr-xr-x 1 oracle oinstall 13285 Aug 26 2005 pw-syscall32
-rwxr-xr-x 1 oracle oinstall 13821 Aug 26 2005 pw-syscall64
-rwxr-xr-x 1 oracle oinstall 20461 Aug 26 2005 rootpre.sh
# ./rootpre.sh
./rootpre.sh output will be logged in /tmp/rootpre.out_14-08-09.18:34:18
Saving the original files in /etc/ora_save_14-08-09.18:34:18....
...
...
...
'smit aio' or rerun the Oracle root installation procedure.
Checking if group services should be configured....
Nothing to configure.
运行完毕,继续安装。选择advanced安装。这个步骤如果之前有/etc/oraInst.loc文件没有被删除就会报错。然后删除此文件,重新登录oracle
用户安装。
期间提示10g在AIX6上不支持可忽略。
只安装软件不建库。
期间会提示root运行两个脚本。
安装完成后系统默认的ORACLE_HOME目录为/oracle/app/oracle/OraHome_1,将此目录加入/home/oracle/.profile文件中如下:
export ORACLE_BASE=/oracle/app/oracle
export ORACLE_HOME=$ORACLE_BASE/OraHome_1
export ORACLE_SID=orcl
export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/OPatch:$PATH
. ./.profile生效一下OK了。
能进入sqlplus说明环境变量配置成功:
$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.1.0 - Production on Sat Aug 9 19:36:17 2014
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to an idle instance.
SQL>
至此,oracle 10g数据库软件再AIX 6平台安装成功。下面使用裸设备创建数据库。
17.创建裸设备
由于只有一块盘可用,裸设备就还创建在原来的vg上。创建脚本如下:
mklv -y orad_system01 -T O -w n -t raw -s n -r n ora10gvg 10
mklv -y orad_sysaux01 -T O -w n -t raw -s n -r n ora10gvg 8
mklv -y orad_undotbs01 -T O -w n -t raw -s n -r n ora10gvg 1
mklv -y orad_temp01 -T O -w n -t raw -s n -r n ora10gvg 1
mklv -y orad_users01 -T O -w n -t raw -s n -r n ora10gvg 1
mklv -y orad_redo01 -T O -w n -t raw -s n -r n ora10gvg 1
mklv -y orad_redo02 -T O -w n -t raw -s n -r n ora10gvg 1
mklv -y orad_redo03 -T O -w n -t raw -s n -r n ora10gvg 1
mklv -y orad_control01 -T O -w n -t raw -s n -r n ora10gvg 1
mklv -y orad_control02 -T O -w n -t raw -s n -r n ora10gvg 1
mklv -y orad_control03 -T O -w n -t raw -s n -r n ora10gvg 1
mklv -y orad_spfile -T O -w n -t raw -s n -r n ora10gvg 1
创建完后显示如下:
# lsvg -l ora10gvg
ora10gvg:
LV NAME TYPE LPs PPs PVs LV STATE MOUNT POINT
ora10glv jfs2 70 70 1 open/syncd /oracle
loglv05 jfs2log 1 1 1 open/syncd N/A
orad_system01 raw 10 10 1 closed/syncd N/A
orad_sysaux01 raw 8 8 1 closed/syncd N/A
orad_undotbs01 raw 1 1 1 closed/syncd N/A
orad_temp01 raw 1 1 1 closed/syncd N/A
orad_users01 raw 1 1 1 closed/syncd N/A
orad_redo01 raw 1 1 1 closed/syncd N/A
orad_redo02 raw 1 1 1 closed/syncd N/A
orad_redo03 raw 1 1 1 closed/syncd N/A
orad_control01 raw 1 1 1 closed/syncd N/A
orad_control02 raw 1 1 1 closed/syncd N/A
orad_control03 raw 1 1 1 closed/syncd N/A
orad_spfile raw 1 1 1 closed/syncd N/A
# ls -l /dev/orad_*
brw-rw---- 1 root system 46, 11 Aug 10 10:02 /dev/orad_control01
brw-rw---- 1 root system 46, 12 Aug 10 10:02 /dev/orad_control02
brw-rw---- 1 root system 46, 13 Aug 10 10:02 /dev/orad_control03
brw-rw---- 1 root system 46, 8 Aug 10 10:02 /dev/orad_redo01
brw-rw---- 1 root system 46, 9 Aug 10 10:02 /dev/orad_redo02
brw-rw---- 1 root system 46, 10 Aug 10 10:02 /dev/orad_redo03
brw-rw---- 1 root system 46, 14 Aug 10 10:03 /dev/orad_spfile
brw-rw---- 1 root system 46, 4 Aug 10 10:02 /dev/orad_sysaux01
brw-rw---- 1 root system 46, 3 Aug 10 10:02 /dev/orad_system01
brw-rw---- 1 root system 46, 6 Aug 10 10:02 /dev/orad_temp01
brw-rw---- 1 root system 46, 5 Aug 10 10:02 /dev/orad_undotbs01
brw-rw---- 1 root system 46, 7 Aug 10 10:02 /dev/orad_users01
# ls -l /dev/rorad_*
crw-rw---- 1 root system 46, 11 Aug 10 10:02 /dev/rorad_control01
crw-rw---- 1 root system 46, 12 Aug 10 10:02 /dev/rorad_control02
crw-rw---- 1 root system 46, 13 Aug 10 10:02 /dev/rorad_control03
crw-rw---- 1 root system 46, 8 Aug 10 10:02 /dev/rorad_redo01
crw-rw---- 1 root system 46, 9 Aug 10 10:02 /dev/rorad_redo02
crw-rw---- 1 root system 46, 10 Aug 10 10:02 /dev/rorad_redo03
crw-rw---- 1 root system 46, 14 Aug 10 10:03 /dev/rorad_spfile
crw-rw---- 1 root system 46, 4 Aug 10 10:02 /dev/rorad_sysaux01
crw-rw---- 1 root system 46, 3 Aug 10 10:02 /dev/rorad_system01
crw-rw---- 1 root system 46, 6 Aug 10 10:02 /dev/rorad_temp01
crw-rw---- 1 root system 46, 5 Aug 10 10:02 /dev/rorad_undotbs01
crw-rw---- 1 root system 46, 7 Aug 10 10:02 /dev/rorad_users01
18.改变裸设备对应的属主,组及权限:
chown -R oracle:oinstall /dev/rorad_*
chmod -R 660 /dev/rorad_*
改变之后查看如下:
# ls -l /dev/rorad_*
crw-rw---- 1 oracle oinstall 46, 11 Aug 10 10:02 /dev/rorad_control01
crw-rw---- 1 oracle oinstall 46, 12 Aug 10 10:02 /dev/rorad_control02
crw-rw---- 1 oracle oinstall 46, 13 Aug 10 10:02 /dev/rorad_control03
crw-rw---- 1 oracle oinstall 46, 8 Aug 10 10:02 /dev/rorad_redo01
crw-rw---- 1 oracle oinstall 46, 9 Aug 10 10:02 /dev/rorad_redo02
crw-rw---- 1 oracle oinstall 46, 10 Aug 10 10:02 /dev/rorad_redo03
crw-rw---- 1 oracle oinstall 46, 14 Aug 10 10:03 /dev/rorad_spfile
crw-rw---- 1 oracle oinstall 46, 4 Aug 10 10:02 /dev/rorad_sysaux01
crw-rw---- 1 oracle oinstall 46, 3 Aug 10 10:02 /dev/rorad_system01
crw-rw---- 1 oracle oinstall 46, 6 Aug 10 10:02 /dev/rorad_temp01
crw-rw---- 1 oracle oinstall 46, 5 Aug 10 10:02 /dev/rorad_undotbs01
crw-rw---- 1 oracle oinstall 46, 7 Aug 10 10:02 /dev/rorad_users01
19.oracle用户图形界面登录然后dbca建库:
裸设备映射可以在OUI创建的时候一个一个选对应的裸设备,也可以先编辑裸设备映射文件,直接选中映射文件就可以了。我们选择后者。
oracle用户vi /home/oracle/OracleRawMap写入以下内容:
system=/dev/rorad_system01
sysaux=/dev/rorad_sysaux01
undotbs1=/dev/rorad_undotbs01
temp=/dev/rorad_temp01
users=/dev/rorad_users01
redo1_1=/dev/rorad_redo01
redo1_2=/dev/rorad_redo02
redo1_3=/dev/rorad_redo03
control1=/dev/rorad_control01
control2=/dev/rorad_control02
control3=/dev/rorad_control03
spfile=/dev/rorad_spfile
然后oracle图形界面登录,执行dbca,custom database,实例名和数据库名为orcl,不选EM,密码输入oracle,RAW DEVICE并指出裸设备映射文件路径,
不开闪回,不安装任何组件,字符集选AL32UTF。其他默认。
如果不选择映射裸设备文件,就在选择oralce存储的那一步挨个指定裸设备文件也可以。
期间提示orad_undotbs01只有128M,至少需要200M,smitty lv调整orad_undotbs01为两个lp(一个lp设置了128M)就满足条件了。
保存个创建脚本:$ORACLE_BASE/admin/orcl/scripts
$ cd $ORACLE_BASE/admin/orcl/scripts
$ ls -l
total 56
-rw-r----- 1 oracle oinstall 1045 Aug 10 10:42 CreateDB.sql
-rw-r----- 1 oracle oinstall 684 Aug 10 10:42 CreateDBCatalog.sql
-rw-r----- 1 oracle oinstall 355 Aug 10 10:42 CreateDBFiles.sql
-rw-r----- 1 oracle oinstall 2171 Aug 10 10:42 init.ora
-rwxr-xr-x 1 oracle oinstall 560 Aug 10 10:42 orcl.sh
-rwxr-xr-x 1 oracle oinstall 606 Aug 10 10:42 orcl.sql
-rw-r----- 1 oracle oinstall 994 Aug 10 10:42 postDBCreation.sql
建库完成后连接查看如下:
$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.1.0 - Production on Sun Aug 10 10:54:20 2014
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to an idle instance.
SQL> startup
ORACLE instance started.
Total System Global Area 1258291200 bytes
Fixed Size 2020552 bytes
Variable Size 318769976 bytes
Database Buffers 922746880 bytes
Redo Buffers 14753792 bytes
Database mounted.
Database opened.
SQL>
SQL> show parameter control
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
control_file_record_keep_time integer 7
control_files string /dev/rorad_control01, /dev/ror
ad_control02, /dev/rorad_contr
ol03
SQL> select file_name from dba_data_files;
FILE_NAME
--------------------------------------------------------------------------------
/dev/rorad_system01
/dev/rorad_undotbs01
/dev/rorad_sysaux01
/dev/rorad_users01
SQL> show parameter spfile
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
spfile string /dev/rorad_spfile
SQL> show parameter undo
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
undo_management string AUTO
undo_retention integer 900
undo_tablespace string UNDOTBS1
SQL> SELECT * FROM V$VERSION;
BANNER
----------------------------------------------------------------
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bi
PL/SQL Release 10.2.0.1.0 - Production
CORE 10.2.0.1.0 Production
TNS for IBM/AIX RISC System/6000: Version 10.2.0.1.0 - Productio
NLSRTL Version 10.2.0.1.0 - Production
SQL>
# lsvg -l ora10gvg
ora10gvg:
LV NAME TYPE LPs PPs PVs LV STATE MOUNT POINT
ora10glv jfs2 70 70 1 open/syncd /oracle
loglv05 jfs2log 1 1 1 open/syncd N/A
orad_system01 raw 10 10 1 open/syncd N/A
orad_sysaux01 raw 8 8 1 open/syncd N/A
orad_undotbs01 raw 3 3 1 open/syncd N/A
orad_temp01 raw 1 1 1 open/syncd N/A
orad_users01 raw 1 1 1 open/syncd N/A
orad_redo01 raw 1 1 1 open/syncd N/A
orad_redo02 raw 1 1 1 open/syncd N/A
orad_redo03 raw 1 1 1 open/syncd N/A
orad_control01 raw 1 1 1 open/syncd N/A
orad_control02 raw 1 1 1 open/syncd N/A
orad_control03 raw 1 1 1 open/syncd N/A
orad_spfile raw 1 1 1 closed/syncd N/A
# ps -ef |grep smon
root 8257654 2031692 0 11:18:30 pts/0 0:00 grep smon
oracle 8650768 1 0 11:17:44 - 0:00 ora_smon_orcl
# ps -ef |grep orcl
oracle 6488114 1 0 11:17:44 - 0:00 ora_dbw0_orcl
oracle 6619380 1 0 11:17:44 - 0:00 ora_mman_orcl
oracle 6750232 1 0 11:18:00 - 0:00 ora_q000_orcl
oracle 6815876 1 0 11:17:44 - 0:00 ora_psp0_orcl
oracle 6881524 1 0 11:17:44 - 0:00 ora_pmon_orcl
oracle 7209204 1 0 11:17:44 - 0:00 ora_lgwr_orcl
oracle 7340032 1 0 11:18:05 - 0:00 ora_q001_orcl
oracle 7405822 1 0 11:17:44 - 0:00 ora_mmnl_orcl
oracle 7864410 1 0 11:17:44 - 0:00 ora_cjq0_orcl
root 8257656 2031692 0 11:18:41 pts/0 0:00 grep orcl
oracle 8519694 1 0 11:17:44 - 0:00 ora_mmon_orcl
oracle 8650768 1 0 11:17:44 - 0:00 ora_smon_orcl
oracle 8716306 1 0 11:17:44 - 0:00 ora_ckpt_orcl
oracle 8781852 1 0 11:17:44 - 0:00 ora_reco_orcl
oracle 8847396 1 0 11:17:50 - 0:00 ora_qmnc_orcl
oracle 8912932 5898460 0 11:17:49 - 0:00 oracleorcl (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))
完毕。