查看原文
其他

AIX6下安装oracle11G全纪录

1. 检查物理内存,swap空间以及tmp空间。

# /usr/sbin/lsattr –E –l sys0 –a realmem 检查内存 至少1G

# /usr/sbin/lsps -a 检查swap空间    (oracle建议如果物理内存在1~2G swap为1.5RAM,物理内存为2~8G swap=RAM;物理内存大于8G,swap=3/4RAM) --根据实际可做适当调整。

# df -g /tmp 看下tmp目录大小,oracle建议在150m~200m。(aix6.1默认为2g,所以足以,不用调整。)

增加 swap的方法 #chps –s hd6 2 增加2个512M 

#chps –d hd6 2 减少2个512M 然后重启。

增加/tmp 方法:#smitty fs 增加大小。


2、检查安装所需要的包

# lslpp -l bos.adt.base bos.adt.lib bos.adt.libm bos.perf.perfstat bos.perf.libperfstat bos.perf.proctools

如果没有 smitty 安装 在AIX6.1第一张安装盘里。

在oracle安装的时候会提示有那几个包没有安装,xlC.aix50.rte 这个包没有找到就没有安装。


3.   创建用户以及组

#smit mkgroup 创建用户组 如:oinstall(创建2次,oinstall和dba2个组)

#smit mkuser 创建用户 如:oracle 选择属性分别为oinstall 和dba

useradd -m -g   oracle 

mkgroup -'A' id='400' users='oracle' oinstall 

mkgroup -'A' id='401' users='shoracle' dba 

usermod -g dba -G oinstall oracle

将oracle用户的的Soft FILE size、Soft CPU time、soft DATA segment和soft STACK size设为-1(备注:-1即为不限制)

另一种方式是直接 vi /etc/security/limits文件,在下面添加如下信息:

oracle:

        fsize = -1

        cpu=-1

        data = -1

        stack = -1

(limits文件一定要先改,才能传db软件到server,因为11g单个文件超过1G了)

设置oracle口令,如下:

# passwd oracle


4. 创建安装目录以及授权

# mkdir -p /u01/oracle/products/11.1/db

# chown -R oracle:oinstall /u01/oracle/products

# chmod -R 775 /u01/oracle/products/

Chown -R oracle:dba /u01/oracle/products/11.1/db

chown -R oracle:dba /u01

chown -R oracle:dba /u01/oracle

chmod -R 775 /u01

chmod -R 775 /u01/oracle

另外:注意安装目录的空间大小 如:# df -g /opt

Enterprise Edition 安装至少需要3.82G (建议直接搞个10G 数据文件反正是存储上,^_^)


5. 设置环境变量

# cd /home/oracle

# vi .profile 

PATH=$PATH:$HOME/bin

export PATH

unset USERNAME

export ORACLE_BASE=/opt/oracle/products/

export ORACLE_HOME=$ORACLE_BASE/11.1/db

export ORACLE_TERM=xterm

export NLS_LANG NLS_LANG=american_america.zhs16cgb231280

export ORA_NLS33=$ORACLE_HOME/ocommon/nls/admin/data 

LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib

LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib

export LD_LIBRARY_PATH

export PATH=$PATH:$ORACLE_HOME/bin

export AIXTHREAD_SCOPE=S

umask 022


6.   vi /etc/hosts

备注:可以先more一下,保证IP后面的主机名跟hostname后的主机名一致。

(这次因为这个问题,到最后db软件装好了,patch也打好了,最后建库居然报错,我日了,无语)


7. 解压db软件

# jar -xvf aix.*.zip

# jar -xvf p*.zip


8. 安装软件

本人是用xmangeer连的,操作如下:

以root登陆,然后 # xhost + ,接着su - oracle # DISPLAY=172.11.1.74:0.0;export DISPLAY (注意export是你本机的IP,不是server的IP),然后

# env|grep DISPLAY 看下是否OK。

最后开始安装

# ./runInstaller

以下参考oracle11g安装.pdf

在创建数据库到98%的时候会出现以下提示:


在AIX6.1下安装ORACLE11G,需要打的包基本和10G一致,而且AIX系统不需要更改内核参数。

前面的安装过程就省略了。

在使用DBCA建库后,到了98%时出现了如下错误: 


1.根据提示使用emca命令进行手工配置dbconsole

$ emca -config dbcontrol db

STARTED EMCA at Nov 26, 2008 5:48:59 PM

EM Configuration Assistant, Version 11.1.0.5.0 Production

Copyright (c) 2003, 2005, Oracle.  All rights reserved.

Enter the following information:

Database SID: orcl

Listener port number: 1521

Password for SYS user: 

Password for DBSNMP user: 

Password for SYSMAN user: 

Password for SYSMAN user: Email address for notifications (optional):

Outgoing Mail (SMTP) server for notifications (optional): @163.com

-----------------------------------------------------------------

You have specified the following settings

Database ORACLE_HOME ................ /oracle/oracle11g

Local hostname ................ A01

Listener port number ................ 1521

Database SID ................ orcl

Email address for notifications ...............

Outgoing Mail (SMTP) server for notifications ............... @163.com

-----------------------------------------------------------------

Do you wish to continue? [yes(Y)/no(N)]: yes

Nov 26, 2008 5:50:26 PM oracle.sysman.emcp.EMConfig perform

INFO: This operation is being logged at /oracle/cfgtoollogs/emca/orcl/emca_2008_11_26_17_48_59.log.

Nov 26, 2008 5:50:30 PM oracle.sysman.emcp.EMReposConfig uploadConfigDataToRepository

INFO: Uploading configuration data to EM repository (this may take a while) ...

Nov 26, 2008 5:52:36 PM oracle.sysman.emcp.EMReposConfig invoke

INFO: Uploaded configuration data successfully

Nov 26, 2008 5:52:56 PM oracle.sysman.emcp.util.DBControlUtil configureSoftwareLib

INFO: Software library configured successfully.

Nov 26, 2008 5:52:56 PM oracle.sysman.emcp.EMDBPostConfig configureSoftwareLibrary

INFO: Deploying Provisioning archives ...

Nov 26, 2008 5:53:19 PM oracle.sysman.emcp.EMDBPostConfig configureSoftwareLibrary

INFO: Provisioning archives deployed successfully.

Nov 26, 2008 5:53:20 PM oracle.sysman.emcp.util.DBControlUtil secureDBConsole

INFO: Securing Database Control (this may take a while) ...

Nov 26, 2008 5:53:41 PM oracle.sysman.emcp.util.DBControlUtil secureDBConsole

INFO: Database Control secured successfully.

Nov 26, 2008 5:53:41 PM oracle.sysman.emcp.util.DBControlUtil startOMS

INFO: Starting Database Control (this may take a while) ...

Nov 26, 2008 5:54:17 PM oracle.sysman.emcp.EMDBPostConfig performConfiguration

INFO: Database Control started successfully

Nov 26, 2008 5:54:17 PM oracle.sysman.emcp.EMDBPostConfig performConfiguration

INFO: >>>>>>>>>>> The Database Control URL ishttps://A01:1158/em<<<<<<<<<<<

Nov 26, 2008 5:54:24 PM oracle.sysman.emcp.EMDBPostConfig invoke

WARNING:

************************  WARNING  ************************

Management Repository has been placed in secure mode wherein Enterprise Manager data will be encrypted.  The encryption key has been placed in the file: /oracle/oracle11g/A01_orcl/sysman/config/emkey.ora.   Please ensure this file is backed up as the encrypted data will become unusable if this file is lost.

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

Enterprise Manager configuration completed successfully

FINISHED EMCA at Nov 26, 2008 5:54:24 PM

这样就手工把em启动了

2.用如下命令检查em状态

$ emctl start dbconsole

Oracle Enterprise Manager 11g Database Control Release 11.1.0.6.0

Copyright (c) 1996, 2007 Oracle Corporation.  All rights reserved.

https://A01:1158/em/console/aboutApplication

 - An instance of Oracle Enterprise Manager 11g Database Control is already running.

发现em已经启动了。

这时候还有问题的话,按以下方法解决——

是时区设置的问题,metalink上有解决方法:

$export TZ=GMT-9

$cd $ORACLE_HOME/bin

$./emctl resetTZ agent

根据提示用sys/sysman执行相关语句

$emctl start dbconsole


方案:如果上述描述的错误所在栈可以被修复,则修复并继续运行;否则,请联系Oracle客服。当然,那是Oracle官方的解决办法。我曾经记得有个高手总结了关于ORA-00604/ORA-04031问题的解决:


修改INIT.ora

添加


_db_handles_cached = 0

并重新启动数据库。

vi pfiledssdata.ora

sqlplus /nolog

conn / as sysdba;

create spfile from pfile=’pfiledssdata.ora’;

修改最大游标数

alter system set open_cursors=1500 scope=both;

alter system set session_cached_cursors=1000 scope=spfile;

create pfile=’pfiledssdata2.ora’ from spfile;

shutdown immediate;

create spfile from pfile=’pfiledssdata2.ora’

startup;

show parameter open_cursors;

alter system set global_names=false scope=both;


以上资料来自社区会员分享

您也可以点击阅读原文到社区下载word文档(可能需要社区金币)


长按下图二维码关注

也可以直接搜索公众号名称“AIX专家俱乐部”或微信号“AIXChina”关注


您可能也对以下帖子感兴趣

文章有问题?点此查看未经处理的缓存