ITPub博客

首页 > 数据库 > Oracle > AIX6.1安装ORACLE 11g(单机使用ASM)

AIX6.1安装ORACLE 11g(单机使用ASM)

原创 Oracle 作者:woshishui11211 时间:2014-03-15 22:49:17 0 删除 编辑

 

一、      环境描述:

AIX6104

ORACLE 11G R2

使用ASM(内置硬盘hdisk1

 

 

二、      安装X图形

#smitty installp

 

安装X11.Dt

再重启

 

环境 产品:rs6000,平台aix,机型all,软件版本v4 or later

问题 用户通过远程图形软件(如:Xmanager)登陆aix,用户无法登陆。如何解决该问题?

解答

1 在主控台执行

/usr/dt/bin/dtconfig -kill (关闭cde 进程)

/usr/dt/bin/dtconfig -d (下次启动机器不进cde界面)

/usr/lib/X11/xdm/xdmconf -e (打开xdm功能)

startsrc -s xdm (启动xdm)

ps -ef | grep xdm (检查xdm进程正在运行)

ps -ef | grep dtlogin cde 进程应该停止)

 

2 编辑Xservers 文件,

vi /usr/lib/X11/xdm/Xservers

 

把最后一行的#号去掉

 

# :0 Local local /usr/bin/X11/X -force

 

 

 

/usr/lib/X11/xdm/xdmconf -e

重启

 

# /usr/dt/bin/dtconfig -e

The CDE environment is now set as the default user interface.

This interface will appear on login for all users of the system.

To see this change take effect you must shutdown and restart your system.

# cd /etc

# rc.dt

Starting AIX Windows Desktop..............#

 

 

 

三、      检查系统包

# cat chk_pack.sh

#!/usr/bin/ksh

OSpackagesOK=true

if /usr/bin/test -x /usr/bin/lslpp

then

  for PACKAGE in "bos.adt.base" "bos.adt.lib" "bos.adt.libm" "bos.perf.perfstat" "bos.perf.libperfstat" "bos.perf.proctools"  "rsct.basic.rte" "rsct.compat.clients.rte" "xlC.aix61.rte"

  do

    if [ `/usr/bin/lslpp -l | /usr/bin/grep -c $PACKAGE` != 0 ]

    then

      STATE=`/usr/bin/lslpp -l | /usr/bin/grep $PACKAGE | /usr/bin/awk '{print $3}' | /usr/bin/sed '2,$d'`

      if [ $STATE != "COMMITTED" ]

      then

         if [ $STATE != "APPLIED" ]

         then

            /usr/bin/echo "$PACKAGE"  --NotApplied

            OSpackagesOK=false

         fi

      fi

    else

      /usr/bin/echo "$PACKAGE"  --NotInstalled

      OSpackagesOK=false

    fi

  done

else

  /usr/bin/echo "NoAccess"

  OSpackagesOK=false

fi

if [ $OSpackagesOK = true ]

then

   /usr/bin/echo "All required OS packages are installed"

fi

 

 

# set -o vi

# ./chk_pack.sh 

bos.adt.libm --NotInstalled

rsct.basic.rte --NotInstalled

rsct.compat.clients.rte –NotInstalled

 

将这些包安装上

 

 

四、      配置环境

# chfs -a size=4096M /usr

# chfs -a size=2048M /tmp

 

ps设置成10G

 

将最大进程数改成16384

smitty-> System Environments->  Change / Show Characteristics of Operating System

clip_image002

 

修改root用户的limit参数

clip_image004

 

 

#vi /etc/security/limits

default:

        fsize = -1

        core = -1

        cpu = -1

        data = -1

        rss = -1

        stack = -1     

        nofiles = -1

 

root:

        fsize = -1

        data = -1

        core = -1

        nofiles = -1

 

 

 

创建/oracle文件系统  //存放oracle安装软件

/dev/fslv00       35.00     34.99    1%        4     1% /oracle

 

创建/grid文件系统   //存放grid安装软件

/dev/fslv01       35.00     34.99    1%        4     1% /grid

 

 

# mkgroup -a id=300 dba

# mkgroup -a id=301 oinstall

创建oracle用户,主组设置成oisntall,管理组设置成dba

clip_image005

 

# chown -R oracle:oinstall /oracle

# chmod -R 775 /oracle

 

 

配置vmo参数

vmo -p -o minperm%=10

vmo -p -o maxclient%=20

vmo -p -o maxperm%=20

vmo -p -o lru_file_repage=0

 

 

 

$ cat .profile

 

 

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

 

export PATH

 

if [ -s "$MAIL" ]           # This is at Shell startup.  In normal

then echo "$MAILMSG"        # operation, the Shell checks

fi                          # periodically.

 

ORACLE_BASE=/oracle

ORACLE_SID=zydb

ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1

PATH=$PATH:$ORACLE_HOME/bin:.:/usr/local/bin

umask=022

export PATH ORACLE_BASE ORACLE_SID ORACLE_HOME

 

 

 

 

五、      安装ORACLE软件

先使用root用户执行rootpre.sh脚本

# sh rootpre.sh

rootpre.sh output will be logged in /tmp/rootpre.out_14-03-11.10:36:20

Saving the original files in /etc/ora_save_14-03-11.10:36: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

 

 

 Kernel Extension /etc/pw-syscall.64bit_kernel already loaded, unloading it

 Unconfigured the kernel extension successfully

 Unloaded the kernel extension successfully

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

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

The kernel extension was successfuly loaded.

 

Checking if group services should be configured....

Nothing to configure.

 

 

clip_image007 clip_image009 clip_image010

 

clip_image012 clip_image014 clip_image016 clip_image018 clip_image020 clip_image022 clip_image024 clip_image026 clip_image028

 

clip_image029

使用root用户执行:

# sh /oracle/oraInventory/orainstRoot.sh

Changing permissions of /oracle/oraInventory.

Adding read,write permissions for group.

Removing read,write,execute permissions for world.

 

Changing groupname of /oracle/oraInventory to oinstall.

The execution of the script is complete.

# sh /oracle/product/11.2.0/db_1/root.sh

Running Oracle 11g root.sh script...

 

The following environment variables are set as:

    ORACLE_OWNER= oracle

    ORACLE_HOME=  /oracle/product/11.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 ...

 

 

Creating /etc/oratab file...

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.

Finished product-specific root actions.

 

 

提示

clip_image031

 

补丁要求:

clip_image032

 

补丁说明:

IZ41855 U821811 bos.mp64 6.1.2.3

IZ51456 U828425 bos.rte.streams 6.1.3.1

IZ52319 U828354 bos.perf.libperfstat 6.1.2.4

 

这些补丁在6104 AIX上都是过时补丁,不用管,略过

 

 

如果安装过程中提示

clip_image033

 

2个压缩包没解压完全,需要将压缩包在AIX中使用unzip分别解压

 

 

 

 

 

 

 

 

六、      创建grid 用户等

使用内置硬盘hdisk1作为ASM磁盘

 

 

mkgroup -A id=503 oper

mkgroup -A id=504 asmadmin

mkgroup -A id=505 asmoper

mkgroup -A id=506 asmdba

mkuser pgrp=oinstall groups=asmadmin,asmdba,asmoper,dba grid

 

 

 

配置grid.profile文件

su – grid

$ cat .profile

 

 

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

 

export PATH

 

if [ -s "$MAIL" ]           # This is at Shell startup.  In normal

then echo "$MAILMSG"        # operation, the Shell checks

fi                          # periodically.

 

export ORACLE_BASE=/grid

export ORACLE_HOME=/grid/product/11.2.0/grid

export ORACLE_SID=+ASM

export PATH=$ORACLE_HOME/bin:/usr/bin:/etc:/usr/sbin:/usr/ucb:$HOME/bin:/usr/bin/X11:/sbin:.

export ORACLE_TERM=vt100

export NLS_LANG=AMERICAN_AMERICA.zhs16gbk

 

 

七、ASM准备磁盘  //使用hdisk1

# lspv

hdisk0          00c1e28b645aa82f                    rootvg          active

hdisk1          00c9161dd80ca8b2                    None 

 

修改磁盘属性

# chown grid:oinstall /dev/rhdisk1

# chdev -l hdisk1 -a pv=clear

hdisk1 changed

# lspv

hdisk0          00c1e28b645aa82f                    rootvg          active

hdisk1          none                                None 

# chmod 770 /dev/rhdisk1

 

修改解压缩安装文件属性

# chown -R grid:oinstall   xxx

# chmod -R 755 xxx

 

# chown -R grid:oinstall /grid

# chmod -R 755 /grid

 

八、安装grid软件

先执行rootpre.sh脚本

# sh rootpre.sh

rootpre.sh output will be logged in /tmp/rootpre.out_14-03-11.12:09:58

Saving the original files in /etc/ora_save_14-03-11.12:09:58....

Copying new kernel extension to /etc....

Loading the kernel extension from /etc

 

 Oracle Kernel Extension Loader for AIX

       Copyright (c) 1998,1999 Oracle Corporation

 

 

 Kernel Extension /etc/pw-syscall.64bit_kernel already loaded, unloading it

 Unconfigured the kernel extension successfully

 Unloaded the kernel extension successfully

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

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

The kernel extension was successfuly loaded.

 

Checking if group services should be configured....

Nothing to configure.

 

clip_image035

 

clip_image037 clip_image039

 

clip_image041

 

密码都配置成oracle

clip_image043 clip_image045

 

clip_image047

 

clip_image049 clip_image051

 clip_image053

clip_image055 clip_image057 clip_image059

 

clip_image060

 

# sh /grid/product/11.2.0/grid2/root.sh

Running Oracle 11g root.sh script...

 

The following environment variables are set as:

    ORACLE_OWNER= grid

    ORACLE_HOME=  /grid/product/11.2.0/grid2

 

Enter the full pathname of the local bin directory: [/usr/local/bin]:

The file "dbhome" already exists in /usr/local/bin.  Overwrite it? (y/n) [n]: y

   Copying dbhome to /usr/local/bin ...

The file "oraenv" already exists in /usr/local/bin.  Overwrite it? (y/n) [n]: y

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

The file "coraenv" already exists in /usr/local/bin.  Overwrite it? (y/n) [n]: y

   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.

2014-03-11 14:38:25: Checking for super user privileges

2014-03-11 14:38:25: User has super user privileges

2014-03-11 14:38:25: Parsing the host name

Using configuration parameter file: /grid/product/11.2.0/grid2/crs/install/crsconfig_params

Creating trace directory

LOCAL ADD MODE

Creating OCR keys for user 'grid', privgrp 'oinstall'..

Operation successful.

CRS-4664: Node kimo1 successfully pinned.

Adding daemon to inittab

CRS-4123: Oracle High Availability Services has been started.

ohasd is starting

 

kimo1     2014/03/11 14:39:24     /grid/product/11.2.0/grid2/cdata/kimo1/backup_20140311_143924.olr

Successfully configured Oracle Grid Infrastructure for a Standalone Server

Updating inventory properties for clusterware

Starting Oracle Universal Installer...

 

Checking swap space: must be greater than 500 MB.   Actual 10240 MB    Passed

The inventory pointer is located at /etc/oraInst.loc

The inventory is located at /oracle/oraInventory

'UpdateNodeList' was successful.

 

clip_image062

九、grid用户查看ASM磁盘组

 

Asmca

clip_image063

clip_image065

如果弹出的图过小,拉长即可全部显示

选择mount all

clip_image067

clip_image069clip_image071

 

clip_image073

//AIX重启后,等几分钟ASM实例会自动启动,无需手动启动ASM

手动启动ASM方法:

#Su – grid

$ srvctl start asm

 

检查ASM是否启动

# ps -ef|grep +ASM

    grid 205024      1   0 09:00:02      -  0:00 asm_pmon_+ASM

    grid 221404      1   0 09:00:04      -  0:00 asm_rbal_+ASM

    grid 225490      1   0 09:00:02      -  0:00 asm_gen0_+ASM

    grid 229588      1   0 09:00:03      -  0:00 asm_psp0_+ASM

    grid 233686      1   0 09:00:03      -  0:00 asm_mman_+ASM

    grid 237786      1   0 09:00:03      -  0:00 asm_lgwr_+ASM

    grid 241886      1   0 09:00:04      -  0:00 asm_smon_+ASM

    grid 250082      1   0 09:00:05      -  0:00 asm_mmnl_+ASM

    grid 282704      1   0 09:18:04      -  0:00 asm_asmb_+ASM

    root 286806 217578   0 09:18:35  pts/0  0:00 grep +ASM

    grid 303188      1   0 09:18:05      -  0:00 oracle+ASM_o000_+asm (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))

    grid  53702      1   0 09:00:03      -  0:00 asm_dia0_+ASM

    grid 180682      1   0 09:00:04      -  0:00 asm_gmon_+ASM

    grid 192798      1   0 09:00:04      -  0:00 asm_mmon_+ASM

    grid 197100      1   0 09:00:03      -  0:00 asm_diag_+ASM

    grid 200976      1   0 09:00:02      -  0:00 asm_vktm_+ASM

    grid 205272      1   0 09:00:03      -  0:00 asm_dbw0_+ASM

grid 209372      1   0 09:00:04      -  0:00 asm_ckpt_+ASM

 

$ crs_stat -t

Name           Type           Target    State     Host       

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

ora.DATA.dg    ora....up.type ONLINE    ONLINE    kimo1      

ora....ER.lsnr ora....er.type ONLINE    ONLINE    kimo1      

ora.asm        ora.asm.type   ONLINE    ONLINE    kimo1      

ora.cssd       ora.cssd.type  ONLINE    ONLINE    kimo1      

ora.diskmon    ora....on.type ONLINE    ONLINE    kimo1      

ora.sdzy3.db   ora....se.type ONLINE    ONLINE    kimo1 

 

 

十、使用oracle用户创建oracle实例,建立在ASM

$dbca

 

 

 

clip_image075

 

clip_image077clip_image079clip_image081clip_image083

 

密码均设置oracle

clip_image085clip_image087

 

 

clip_image089

//选择Browser,正常会弹出ASM列表,如果列表是空,是oracle用户没有归到asmdba组,将oracle用户归到asmdba

# smitty user->Change / Show Characteristics of a User->选择oracle用户

添加asmdba

clip_image091

 

正常如下:

clip_image093

 

clip_image095

 

输入asm密码oracle

clip_image097

 

开归档:

clip_image099clip_image101clip_image103clip_image105clip_image107clip_image109clip_image111clip_image113clip_image115

如果报错,可能是/dev/rhdisk1权限问题,修改磁盘权限

Chown grid:oinstall /dev/rhdisk1

Chmod 770 /dev/rhdisk1

 

安装完成

clip_image117

 

 

十一、       安装完后检查

# ps -ef|grep ora_

    grid 213086      1   0 09:51:21      -  0:00 ora_arc2_zydb

    grid 262192      1   0 09:51:10      -  0:01 ora_mmon_zydb

    grid 270432      1   0 09:52:36      -  0:00 ora_smco_zydb

    grid 290870      1   0 09:51:10      -  0:00 ora_rbal_zydb

    grid 299156      1   0 09:51:09      -  0:00 ora_smon_zydb

    root 303154 217578   0 10:04:24  pts/0  0:00 grep ora_

    grid 311412      1   0 09:51:09      -  0:00 ora_lgwr_zydb

    grid 323690      1   0 09:51:10      -  0:00 ora_mark_zydb

    grid 327782      1   0 09:51:08      -  0:00 ora_mman_zydb

    grid 344160      1   0 09:51:08      -  0:00 ora_psp0_zydb

    grid 356466      1   0 09:51:07      -  0:00 ora_diag_zydb

    grid 364750      1   0 09:52:39      -  0:00 ora_w000_zydb

    grid 422032      1   0 09:51:21      -  0:00 ora_arc3_zydb

    grid 438436      1   1 09:51:07      -  0:00 ora_vktm_zydb

    grid 446608      1   0 09:51:30      -  0:00 ora_cjq0_zydb

    grid 454786      1   0 09:51:19      -  0:00 ora_arc0_zydb

    grid 233794      1   0 09:51:13      -  0:00 ora_o000_zydb

    grid 237920      1   0 09:51:10      -  0:00 ora_mmnl_zydb

    grid 262476      1   0 09:51:11      -  0:00 ora_d000_zydb

    grid 266582      1   0 09:51:07      -  0:00 ora_gen0_zydb

    grid 270746      1   0 09:51:11      -  0:00 ora_s000_zydb

    grid 303456      1   0 09:51:08      -  0:00 ora_dbw0_zydb

    grid 307596      1   0 09:51:35      -  0:00 ora_q000_zydb

    grid 319846      1   0 09:51:10      -  0:00 ora_asmb_zydb

    grid 323974      1   0 09:51:08      -  0:00 ora_dbrm_zydb

    grid 332144      1   0 09:51:35      -  0:00 ora_q001_zydb

    grid 356700      1   0 09:51:07      -  0:00 ora_pmon_zydb

    grid 360774      1   0 09:51:20      -  0:00 ora_arc1_zydb

    grid 381338      1   0 09:51:08      -  0:00 ora_dia0_zydb

    grid 385396      1   0 09:51:09      -  0:00 ora_reco_zydb

    grid 410034      1   0 09:51:09      -  0:00 ora_ckpt_zydb

    grid 422322      1   0 09:51:25      -  0:00 ora_qmnc_zydb

SQL> select status from v$instance;

 

STATUS

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

OPEN

 

SQL> show parameter pfile;

 

NAME                                 TYPE        VALUE

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

spfile                               string      +DATA/zydb/spfilezydb.ora

 

SQL> select file_name,tablespace_name,bytes/1024/1024 M from dba_data_files;

 

FILE_NAME                                          TABLESPACE_NAME                         M

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

+DATA/zydb/datafile/users.263.842002951            USERS                                   5

+DATA/zydb/datafile/undotbs1.264.842002951         UNDOTBS1                               90

+DATA/zydb/datafile/sysaux.265.842002951           SYSAUX                                500

+DATA/zydb/datafile/system.260.842002951           SYSTEM                                680

SQL> select * from v$logfile;

 

   

    GROUP# STATUS  TYPE    MEMBER                                        IS_

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

         3         ONLINE  +DATA/zydb/onlinelog/group_3.266.842003111    NO

         3         ONLINE  +DATA/zydb/onlinelog/group_3.267.842003113    YES

         2         ONLINE  +DATA/zydb/onlinelog/group_2.257.842003109    NO

         2         ONLINE  +DATA/zydb/onlinelog/group_2.256.842003111    YES

         1         ONLINE  +DATA/zydb/onlinelog/group_1.259.842003107    NO

         1         ONLINE  +DATA/zydb/onlinelog/group_1.258.842003109    YES

 

6 rows selected.

 

SQL> show parameter control_files;

 

NAME                                 TYPE        VALUE

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

control_files                        string      +DATA/zydb/controlfile/current

                                                 .261.842003103, +DATA/zydb/con

                                                 trolfile/current.262.842003103

 

 

SQL> show parameter pga;

 

NAME                                 TYPE        VALUE

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

pga_aggregate_target                 big integer 0

SQL> archive log list;

Database log mode              Archive Mode

Automatic archival             Enabled

Archive destination            USE_DB_RECOVERY_FILE_DEST

Oldest online log sequence     5

Next log sequence to archive   7

Current log sequence           7

SQL> show parameter db_recovery_file_dest;

 

NAME                                 TYPE        VALUE

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

db_recovery_file_dest                string      +DATA

db_recovery_file_dest_size           big integer 3852M

 

 

SQL> show parameter memory_max_target;

 

NAME                                 TYPE        VALUE

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

memory_max_target                    big integer 3328M

SQL> show parameter sga;

 

NAME                                 TYPE        VALUE

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

lock_sga                             boolean     FALSE

pre_page_sga                         boolean     FALSE

sga_max_size                         big integer 3328M

sga_target                           big integer 0

SQL> show parameter pga_aggregate_target;

 

NAME                                 TYPE        VALUE

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

pga_aggregate_target                 big integer 0

SQL> select value/1024/1024||'M' M from v$pgastat where name like 'total PGA allocated';

 

M

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

189.767578125M

 

 

监听自动创建并启动

$ lsnrctl status

 

LSNRCTL for IBM/AIX RISC System/6000: Version 11.2.0.1.0 - Production on 12-MAR-2014 10:17:22

 

Copyright (c) 1991, 2009, Oracle.  All rights reserved.

 

Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))

STATUS of the LISTENER

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

Alias                     LISTENER

Version                   TNSLSNR for IBM/AIX RISC System/6000: Version 11.2.0.1.0 - Production

Start Date                12-MAR-2014 08:59:17

Uptime                    0 days 1 hr. 18 min. 6 sec

Trace Level               off

Security                  ON: Local OS Authentication

SNMP                      ON

Listener Parameter File   /grid/product/11.2.0/grid2/network/admin/listener.ora

Listener Log File         /grid/diag/tnslsnr/kimo1/listener/alert/log.xml

Listening Endpoints Summary...

  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))

  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=kimo1)(PORT=1521)))

Services Summary...

Service "+ASM" has 1 instance(s).

  Instance "+ASM", status READY, has 1 handler(s) for this service...

Service "zydb" has 1 instance(s).

  Instance "zydb", status READY, has 1 handler(s) for this service...

Service "zydbXDB" has 1 instance(s).

  Instance "zydb", status READY, has 1 handler(s) for this service...

The command completed successfully

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/26217983/viewspace-1122408/,如需转载,请注明出处,否则将追究法律责任。

上一篇: oracle asm命令
请登录后发表评论 登录
全部评论

注册时间:2014-03-15

  • 博文量
    39
  • 访问量
    270559