首页 热点资讯 义务教育 高等教育 出国留学 考研考公
您的当前位置:首页正文

适用测试版适用测试版

来源:华拓网
1、检查硬件环境

1)内存空间至少1024M

# /usr/sbin/lsattr -E -l sys0 -a realmem 2)Swap交换区:

内存空间>1024 MB 并且<= 2048, Swap=1.5 * 内存空间; 内存空间>2048 MB 并且<=8192, Swap=内存空间; 内存空间>8192MB, Swap=0.75 * 内存空间; # /usr/sbin/lsps –a

3)Oracle目录空间>10G, /tmp表空间>400M #df -g

4)操作系统应该为64位

# /usr/bin/getconf HARDWARE_BITMODE 64

2、查看磁盘情况并做调整

1)查看磁盘情况

#lsvg –l rootvg查看磁盘使用状态、文件系统类型

#df –g查看磁盘使用情况

查看/usr /var /tmp /home 的容量,如不够需要做以下调整 /usr 4g /var 2g /tmp 4g /home 4g

修改命令为: # smitty jfs2

选择需要调整的jfs2

旁边有+号的选项可以用F4选择。

修改Number of units 上面可以看到Unit Size 大小为512bytes

如:4G Number of units=4*1024*1024*1024/512=8388608(注意1G=1024M) 查看交换页面大小并做修改

使用smitty chgsys修改系统配置参数

Maximum number of PROCESSES allowed per user=2048(最小2048,可以大于2048) 3、创建Oracle用户和组

Oracle用户主目录应当安装在独立的文件系统,大小至少为10g。 1)新建逻辑卷oraclelv:

# mklv –t jfs2 –s n –r n –c 2 -y oraclelv rootvg 10G hdisk0 hdisk1 2)新建/oracle文件系统:

# crfs –v jfs2 –m /oracle –d /dev/oraclelv 3)挂载逻辑卷 # mkdir /oracle

# chown -R oracle.oinstall /oracle #chmod -R 755 /oracle #mount /dev/oraclelv /oracle 4)建立用户组oinstall,dba # mkgroup -A dba # mkgroup-A oinstall

5)建立用户oracle,主目录一般设置为:/oracle

# # mkuser pgrp=’oinstall’ groups=’dba’ home=’/oracle’ oracle # passwd oracle

Changing password for \\\"oracle\\\" oracle\\'s New password: Re-enter oracle\\'s new password: 6)修改用户oracle的属性 #smitty user

Soft FILE size 为:-1(文件大小) Soft CPU time 为:-1 (cpu使用时间 Soft DATA segment 为:-1(数据块大小) Soft STACK size 为: -1

以上-1 代表使用该用户时参数的内容无限制

4、修改环境变量 # vi /oracle/.profile

PATH=/usr/bin:/etc:/usr/sbin:/usr/ucb:$HOME/bin:/usr/bin/X11:/sbin:.: /usr/java14/jre

export PATH

DISPLAY=192.168.1.251:0.0; export DISPLAY ORACLE_TERM=vt100; export ORACLE_TERM export TMP=/tmp export TMPDIR=$TMP

export ORACLE_BASE=/oracle

export ORACLE_HOME=$ORACLE_BASE/app/product/10.2.0 export ORACLE_SID=orcl export ORACLE_TERM=xterm

export PATH=$ORACLE_HOME/bin:$PATH exportCLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib

umask 022

if [ -s \"$MAIL\" ] # This is at Shell startup. In normal then echo \"$MAILMSG\" # operation, the Shell checks fi # periodically. 注意:

DISPLAY=192.168.1.251;此处的IP地址是将图形界面显示在IP上,如小机本地IP为127.0.0.1;如通过Xmanager安装的,此处填写的IP为你机器的IP

5、安装Oracle 1)安装前检查

检查安装Oracle时系统需要安装的文件

lslpp -l bos.adt.base bos.adt.lib bos.adt.libm bos.perf.perfstat bos.perf.libperfstat bos.perf.proctools bos.adt.prof bos.cifs_fs.rte

如果缺少软件,插入AIX的第一张光盘进行安装。

2)调用图形界面进行安装

如oracle安装文件没有解压,请先解压,参考命令如下: 文件:10gr2_aix5l64_database.cpio.gz gunzip 10gr2_aix5l64_database.cpio.gz cpio -idcmv <10gr2_aix5l64_database.cpio

# cd /oralce/database/rootpre #./rootpre.sh

./rootpre.sh output will be logged in /tmp/rootpre.out_07-08-28.05:56:20 Saving the original files in /etc/ora_save_07-08-28.05:56:20....

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: 0x3f0c100 Successfully configured /etc/pw-syscall.64bit_kernel with kmid: 0x3f0c100 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. # xhost +

# su –oracle $xclock

执行xclock命令,确认系统X可以启动

$ cd /database $ ./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 toplevelof 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...

No pre-requisite checks found in oraparam.ini, no system pre-requisite checks will be executed. Preparing to launch Oracle Universal Installer from /tmp/OraInstall2007-08-28_05-58-51AM. Please wait ...$ Aug 28, 2007 5:59:24 AM

选择自定义安装,语言支持选中英文和简体中文。 安装过程:

点击“Next”。

选择”Enterprise Edition(3.40GB)”,点击”next”。

“name”项输入”oracle10”, “Path”项输入”/oracle/app/product/10.2.0” (此项默认值)

Oracle对操作系统的依赖库文件检查,必须Status要全部都是“Succeeded”,如果有失败的情况必须找出缺少哪个系统库文件,退出安装程序重新安装所需的操作系统库文件。

选择

只安装数据库软件”Install database Software only”。

点击”Install”开始安装。

安装完成后,用root用户执行”/oracle/app/product/10.2.0/root.sh”脚本程序

安装成功,按”Exit”退出。 安装完成后

以root,新开窗口。执行

# /opt/oracle/oraInventory/orainstRoot.sh

Changing permissions of /opt/oracle/oraInventory to 775. Changing groupname of /opt/oracle/oraInventory to oinstall. The execution of the script is complete

# /opt/oracle/product/10.2.0/db_1/root.sh Running Oracle10 root.sh script...

The following environment variables are set as: ORACLE_OWNER= oracle

ORACLE_HOME= /opt/oracle/product/10.2.0/db_1

Enter the full pathname of the local bin directory: [/usr/local/bin]: 回车 Creating /usr/local/bin directory... Copying dbhome to /usr/local/bin ...

Copying oraenv to /usr/local/bin ... Copying coraenv to /usr/local/bin ...

Entries will be added to the /etc/oratab file as needed by Database Configuration Assistant when a database is created Finished running generic part of root.sh script. Now product-specific root actions will be performed. 修正dbstart启动错误。

默认安装好后Oracle的启动脚本dbstart会报一个错误监听,咱们先搞定它。如下: $ dbstart

Failed to auto-start Oracle Net Listene using /ade/vikrkuma_new/oracle/bin/tnslsnr vi `which dbstart` 将

ORACLE_HOME_LISTNER=/ade/vikrkuma_new/oracle 修改为

ORACLE_HOME_LISTNER=$ORACLE_HOME 再执行dbstart。

6、oracle的常用启动与关闭 A、启动isqlplus服务端口:5560 isqlplusctl start //启动 isqlplusctl stop //停止

B、启动数据库

dbstart dbshut

C、开启企业管理器端口:1158 emctl start dbconsole emctl stop dbconsole

D、启动监听 lsnrctl start lsnrctl stop

E、开启代理 emctl start agent emctl stop agent

F、启动实例 sqlplus /nolog

conn / as sysdba startup //启动实例

shutdown immediate //关闭实例

G、tnsping 10.162.12.97 //测试Oracle数据库是否通

H、http://10.162.12.97:5560/isqlplus/dba //isQL*Plus DBA URL

I、http://10.162.12.97:1158/em //Enterprise Manager 10g Database Control URL

7、安装结束后任务

1)通过dbca建库,通过netca配置网络具体见附录二 DBCA建库。

安装完数据库后,一定要用NETCA创建监听,否则,其他客户端是无法访问该服务器的。 2)修改oratab文件中启动选项 把最后一个N改为Y

Orcl:/oracle/product/10.2.0/db_1:Y 3)创建服务参数文件(SPFILE) 如果安装后,直接进入: $>sqlplus /nolog Sql>startup

会报/oracle/product/10.2.0/db_1/dbs/initdatabase.ora文件找不到的错误。这时,通过以下命令进行创建:

Sql>create spfile from pfile=’/oracle/admin/orcl/pfile/init.ora.192003215317’; 后面这个数字是时间戳,这个可能与你的不一样。 这样,就可以启动ORACLE了。 Sql>startup

8、设置ORACLE自启动

在ORACLE安装完成后,如果系统重新启动时,ORACLE是不会自己启动的,这时,需要

手工启动,或者编写自动启动的脚本来完成这个任务。 1)在 /home/oracle目录下,建立startdb文件,文件内容如下: echo \"begin to start oracle\" lsnrctl start

sqlplus /nolog <echo \"oracle have started\" 给startdb执行权限

$>chmod 775 /home/oracle/startdb 2)在/etc下建立文件rc.startdb, 脚本如下:

su - oracle \"-c /oracle/startdb\" #启动oracle 给文件执行权限

$>chmod 775 /etc/rc.startdb 3)把启动信息放到/etc/inittab中 使用如下命令即可:

mkitab \"startdb:2:wait:/etc/rc.startdb\"

当然,也可以使用dbstart命令来启动ORACLE,下面是这个方法: 1)在 root 下编辑 /etc/oratab 中的

ORACLE_SID:ORACLE_HOME:{Y|N} 在 RAC 环境中 DB_NAME:ORACLE_HOME:{Y|N}

Y 或者 N 表示你是否愿意用 dbstart 和dbshut 脚本来启动和关闭数据库 2)把每一个你要用脚本启动的 ORACLE_SID:ORACLE_HOME:{Y|N} 中的 N 改为 Y

3)# mkitab \"oradb:2:wait:/bin/su oracle -c|/$ORACLE_HOMES/bin/dbstart\" 加入 dbstart 脚本到 /etc/inittab 文件中,在系统启动的时候用 oracle 用户执行dbstart 脚本

4)也可以利用同样的命令把启动listener 加到 /etc/inittab 中去 9、设置系统重起自动关闭ORACLE

1)在 /home/oracle目录下,建立stopdb文件,文件内容如下: echo \"begin to shutdown oracle\" sqlplus /nolog <$>chmod 775 /home/oracle/stopdb 2)在/etc下建立文件rc.stopdb, 脚本如下:

su - oracle \"-c /oracle/stopdb\" #关闭oracle 给文件执行权限

$>chmod 775 /etc/rc.stopdb

由于5L中安装完成后没有/etc/rc.shutdown文件,需要手工创建一个内容如下: #!/bin/ksh rc.stopdb 给执行权限

$>chmod 775 /etc/rc.stopdb

这样当系统关机时会自动寻找rc.shutdown并执行,系统可以自动关闭oracle10g 10、附录 附录一:

以下是安装界面截图: 1、Oracle欢迎界面,选择 Advanced Installation

2、选择安装类型,我们一般都选择Custom 3、选择安装Destination: 4、选择安装组件:

5、INSTALLER自动确认环境是否符合最低安装要求:

6、设置操作系统组,我一般都只用DBA一个组:

7、询问是否创建数据库,选择不创建;数据库我们都建议单独创建: 8、SUMMARY报告: 9、开始安装:

10、大约Link 98%的时候按提示执行root.sh(按提示另开窗口以root用户执行root.sh): 11、开始配置网络和iSQL*PLUS(默认典型配置),以后需要可以手工改: 12、结束安装报告: 附录二、 1、通过dbca建库 2、通过netca配置网络: 附录三、删除ORACLE的安装 1、手工删除oracle安装目录 Rm –f –R /oracle/product 2、手工删除其他文件 Rm /etc/oratab Rm /etc/oraInst.loc Rm /usr/local/bin/*.*

附录四、AIX 上的数据库的自动关闭

在 root 用户下建立一个脚本 shut, 调用 dbshut 和 /etc/shutdown # cd /etc

cat > shut << EOF

? su oracle_owner -c /usr/oracle/bin/dbshut ? /etc/shutdown $* ? [Ctrl-D] # chmod u+x shut

用下面的命令来关闭数据库和系统 # /etc/shut -h now

因篇幅问题不能全部显示,请点此查看更多更全内容