AIX下安装Oracle10g1、检查硬件环境1)内存空间至少1024M# /usr/sbin/lsattr -E -l sys0 -a realmem2)Swap交换区:内存空间>1024 MB 并且<= 2048, Swap=1.5 * 内存空间;内存空间>2048 MB 并且<= 8192, Swap=内存空间;内存空间>8192MB, Swap=0.75 * 内存空间;# /usr/sbin/lsps –a3)Oracle目录空间>10G, /tmp表空间>400M#df -g4)操作系统应该为64位# /usr/bin/getconf HARDWARE_BITMODE642、查看磁盘情况并做调整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 hdisk12)新建/oracle文件系统:# crfs –v jfs2 –m /oracle –d /dev/oraclelv3)挂载逻辑卷# mkdir /oracle# chown -R oracle.oinstall /oracle#chmod -R 755 /oracle#mount /dev/oraclelv /oracle4)建立用户组oinstall,dba# mkgroup -A dba# mkgroup -A oinstall5)建立用户oracle,主目录一般设置为:/oracle# # mkuser pgrp=’oinstall’ groups=’dba’ home=’/oracle’ oracle# passwd oracleChanging password for \"oracle\"oracle\'s New password:Re-enter oracle\'s new password:6)修改用户oracle的属性#smitty userSoft FILE size 为:-1(文件大小)Soft CPU time 为:-1 (cpu使用时间Soft DATA segment 为:-1(数据块大小)Soft STACK size 为: -1以上-1 代表使用该用户时参数的内容无限制4、修改环境变量# vi /oracle/.profilePATH=/usr/bin:/etc:/usr/sbin:/usr/ucb:$HOME/bin:/usr/bin/X11:/sbin:.export PATHDISPLAY=192.168.1.251:0.0; export DISPLAYORACLE_TERM=vt100; export ORACLE_TERMexport TMP=/tmpexport TMPDIR=$TMPexport ORACLE_BASE=/oracleexport ORACLE_HOME=$ORACLE_BASE/app/product/10.2.0export ORACLE_SID=orclexport ORACLE_TERM=xtermexport PATH=$ORACLE_HOME/bin:$PATHexport CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlibumask 022if [ -s "$MAIL" ] # This is at Shell startup. In normalthen echo "$MAILMSG" # operation, the Shell checksfi # periodically.注意:DISPLAY=192.168.1.251;此处的IP地址是将图形界面显示在IP上,如小机本地IP为127.0.0.1;如通过Xmanager安装的,此处填写的IP为你机器的IP5、安装Oracle1)安装前检查检查安装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.gzgunzip 10gr2_aix5l64_database.cpio.gzcpio -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:20Saving the original files in /etc/ora_save_07-08-28.05:56:20....Copying new kernel extension to /etc....Loading the kernel extension from /etcOracle Kernel Extension Loader for AIXCopyright (c) 1998,1999 Oracle CorporationSuccessfully loaded /etc/pw-syscall.64bit_kernel with kmid: 0x3f0c100Successfully configured /etc/pw-syscall.64bit_kernel with kmid: 0x3f0c100The 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$ ./runInstallerYour platform requires the root user to perform certain pre-installationOS preparation. The root user should run the shell script \'rootpre.sh\' beforeyou 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 Oracleinstallation.Answer \'n\' to abort installation and then ask root to run \'rootpre.sh\'.**************************************************************************Has \'rootpre.sh\' been run by root? [y/n] (n)yStarting 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.shChanging 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.shRunning Oracle10 root.sh script...The following environment variables are set as:ORACLE_OWNER= oracleORACLE_HOME= /opt/oracle/product/10.2.0/db_1Enter 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 byDatabase Configuration Assistant when a database is createdFinished running generic part of root.sh script.Now product-specific root actions will be performed.修正dbstart启动错误。默认安装好后Oracle的启动脚本dbstart会报一个错误监听,咱们先搞定它。如下:$ dbstartFailed to auto-start Oracle Net Listene using /ade/vikrkuma_new/oracle/bin/tnslsnrvi `which dbstart`将ORACLE_HOME_LISTNER=/ade/vikrkuma_new/oracle修改为ORACLE_HOME_LISTNER=$ORACLE_HOME再执行dbstart。6、oracle的常用启动与关闭A、启动isqlplus服务 端口:5560isqlplusctl start //启动isqlplusctl stop //停止B、启动数据库dbstartdbshutC、开启企业管理器 端口:1158emctl start dbconsoleemctl stop dbconsoleD、启动监听lsnrctl startlsnrctl stopE、开启代理emctl start agentemctl stop agentF、启动实例sqlplus /nologconn / as sysdbastartup //启动实例shutdown immediate //关闭实例G、tnsping 10.162.12.97 //测试Oracle数据库是否通H、http://10.162.12.97:5560/isqlplus/dba //isQL*Plus DBA URLI、http://10.162.12.97:1158/em //Enterprise Manager 10g Database Control URL7、安装结束后任务1)通过dbca建库,通过netca配置网络具体见附录二DBCA建库。安装完数据库后,一定要用NETCA创建监听,否则,其他客户端是无法访问该服务器的。2)修改oratab文件中启动选项把最后一个N改为YOrcl:/oracle/product/10.2.0/db_1:Y3)创建服务参数文件(SPFILE)如果安装后,直接进入:$>sqlplus /nologSql>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>startup8、设置ORACLE自启动在ORACLE安装完成后,如果系统重新启动时,ORACLE是不会自己启动的,这时,需要手工启动,或者编写自动启动的脚本来完成这个任务。1)在 /home/oracle目录下,建立startdb文件,文件内容如下:echo "begin to start oracle"lsnrctl startsqlplus /nolog <chmod 775 /home/oracle/startdb2)在/etc下建立文件rc.startdb,脚本如下:su - oracle "-c /oracle/startdb" #启动oracle给文件执行权限$>chmod 775 /etc/rc.startdb3)把启动信息放到/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 改为 Y3)# mkitab "oradb:2:wait:/bin/su oracle -c|/$ORACLE_HOMES/bin/dbstart" 加入 dbstart 脚本到 /etc/inittab 文件中,在系统启动的时候用 oracle 用户执行dbstart 脚本4)也可以利用同样的命令把 启动listener 加到 /etc/inittab 中去9、设置系统重起自动关闭ORACLE1)在 /home/oracle目录下,建立stopdb文件,文件内容如下:echo "begin to shutdown oracle"sqlplus /nolog <chmod 775 /home/oracle/stopdb2)在/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并执行,系统可以自动关闭oracle10g10、附录附录一: 以下是安装界面截图:1、Oracle欢迎界面,选择Advanced Installation2、选择安装类型,我们一般都选择Custom3、选择安装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/product2、 手工删除其他文件Rm /etc/oratabRm /etc/oraInst.locRm /usr/local/bin/*.*附录四、AIX 上的数据库的自动关闭在 root 用户下建立一个脚本 shut, 调用 dbshut 和 /etc/shutdown# cd /etccat > shut << EOF? su oracle_owner -c /usr/oracle/bin/dbshut? /etc/shutdown $* ? [Ctrl-D]# chmod u+x shut用下面的命令来关闭数据库和系统# /etc/shut -h now
「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。




