11gR2修改Grid软件ASM实例参数文件位置


相关文章:
《11gR2手动创建的ASM实例无法被Clusterware管理的问题的解决》: http://space.itpub.net/23135684/viewspace-743090

《11gR2手动创建ASM实例ORA-29786错误解决方法》:
http://space.itpub.net/23135684/viewspace-743018

1.Standalone环境。
cd /u01/app/11.2.0/grid/bin
# ./crsctl stat res -t
--------------------------------------------------------------------------------
NAME           TARGET  STATE        SERVER                   STATE_DETAILS       
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.DATA01.dg
               ONLINE  ONLINE       ncappweb2                                    
ora.LISTENER.lsnr
               ONLINE  ONLINE       ncappweb2                                    
ora.OCRVDISK.dg
               ONLINE  ONLINE       ncappweb2                                    
ora.asm
               ONLINE  ONLINE       ncappweb2                Started             
ora.ons
               OFFLINE OFFLINE      ncappweb2                                    
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.cssd
      1        ONLINE  ONLINE       ncappweb2                                    
ora.diskmon
      1        OFFLINE OFFLINE                                                   
ora.evmd
      1        ONLINE  ONLINE       ncappweb2                                    
ora.mtorcl.db
      1        ONLINE  ONLINE       ncappweb2                Open

        上面是使用默认方式创建好的Standalone单数据库环境,使用ASM作为存储方式,OCRVDISK存储了ASM实例的参数文件。

        如果想Standalone单实例数据库环境中不使用ASM作为ASM实例参数文件的存放方式,推荐的做法是先按照默认的要求,创建好ASM磁盘组,ASM实例的参数文件会存放到该ASM磁盘组中,例如上面的OCRVDISK磁盘组。之后再通过下面的方式将ASM实例的参数文件迁移到本地文件系统。

2.使用srvctl modify asm修改SPFILE位置。
# pwd
/u01/app/11.2.0/grid/bin
# ./srvctl modify asm -h

Modifies the configuration for ASM.

Usage: srvctl modify asm [-l ] [-p ] [-d ]
    -l           Listener name
    -p              Server parameter file path
    -d      ASM diskgroup discovery string
    -h                       Print usage
# ./srvctl config asm
ASM home: /u01/app/11.2.0/grid
ASM listener: LISTENER
Spfile: +OCRVDISK/asm/asmparameterfile/registry.253.793652513
ASM diskgroup discovery string: 
# su - grid
$ cd /u01/app/11.2.0/grid/dbs/
$ ls
ab_+ASM.dat  hc_+ASM.dat  init.ora     orapw+ASM

        当前并没有ASM实例的SPFILE参数文件。

$ srvctl modify asm -p /u01/app/11.2.0/grid/dbs/spfile+ASM.ora

        srvctl modify asm的操作必须在grid用户下完成。

3.重启Grid,检验modify效果。
# ./crsctl stop has
CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on 'ncappweb2'
CRS-2673: Attempting to stop 'ora.OCRVDISK.dg' on 'ncappweb2'
CRS-2673: Attempting to stop 'ora.mtorcl.db' on 'ncappweb2'
CRS-2673: Attempting to stop 'ora.LISTENER.lsnr' on 'ncappweb2'
CRS-2677: Stop of 'ora.mtorcl.db' on 'ncappweb2' succeeded
CRS-2673: Attempting to stop 'ora.DATA01.dg' on 'ncappweb2'
CRS-2677: Stop of 'ora.DATA01.dg' on 'ncappweb2' succeeded
CRS-2677: Stop of 'ora.LISTENER.lsnr' on 'ncappweb2' succeeded
CRS-2677: Stop of 'ora.OCRVDISK.dg' on 'ncappweb2' succeeded
CRS-2673: Attempting to stop 'ora.asm' on 'ncappweb2'
CRS-2677: Stop of 'ora.asm' on 'ncappweb2' succeeded
CRS-2673: Attempting to stop 'ora.cssd' on 'ncappweb2'
CRS-2677: Stop of 'ora.cssd' on 'ncappweb2' succeeded
CRS-2673: Attempting to stop 'ora.evmd' on 'ncappweb2'
CRS-2677: Stop of 'ora.evmd' on 'ncappweb2' succeeded
CRS-2793: Shutdown of Oracle High Availability Services-managed resources on 'ncappweb2' has completed
CRS-4133: Oracle High Availability Services has been stopped.
# ./crsctl start has
CRS-4123: Oracle High Availability Services has been started.
# ./crsctl stat res -t
--------------------------------------------------------------------------------
NAME           TARGET  STATE        SERVER                   STATE_DETAILS       
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.DATA01.dg
               ONLINE  ONLINE       ncappweb2                                    
ora.LISTENER.lsnr
               ONLINE  ONLINE       ncappweb2                                    
ora.OCRVDISK.dg
               ONLINE  ONLINE       ncappweb2                                    
ora.asm
               ONLINE  ONLINE       ncappweb2                Started             
ora.ons
               OFFLINE OFFLINE      ncappweb2                                    
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.cssd
      1        ONLINE  ONLINE       ncappweb2                                    
ora.diskmon
      1        OFFLINE OFFLINE                                                   
ora.evmd
      1        ONLINE  ONLINE       ncappweb2                                    
ora.mtorcl.db
      1        ONLINE  ONLINE       ncappweb2                Open                
# ./srvctl config asm
ASM home: /u01/app/11.2.0/grid
ASM listener: LISTENER
Spfile: /u01/app/11.2.0/grid/dbs/spfile+ASM.ora
ASM diskgroup discovery string: 
# su - grid
$ sqlplus / as sysasm

SQL*Plus: Release 11.2.0.3.0 Production on Tue Sep 11 09:50:55 2012

Copyright (c) 1982, 2011, Oracle.  All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Automatic Storage Management option

SQL> show parameter spfile

NAME                                 TYPE
------------------------------------ ----------------------
VALUE
------------------------------
spfile                               string

        连接到ASM实例,但是并看不到SPFILE参数被指定了值。

4.删除存储ASM实例参数文件的磁盘组。
# ./srvctl remove diskgroup -g ocrvdisk -f
$ sqlplus / as sysasm

SQL*Plus: Release 11.2.0.3.0 Production on Tue Sep 11 09:54:08 2012

Copyright (c) 1982, 2011, Oracle.  All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Automatic Storage Management option

SQL> drop diskgroup ocrvdisk including contents;

Diskgroup dropped.

        删除OCRVDISK磁盘组。

5.DROP OCRVDISK磁盘组之后观察Grid重启效果。
# ./crsctl stop has
CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on 'ncappweb2'
CRS-2673: Attempting to stop 'ora.mtorcl.db' on 'ncappweb2'
CRS-2673: Attempting to stop 'ora.LISTENER.lsnr' on 'ncappweb2'
CRS-2677: Stop of 'ora.mtorcl.db' on 'ncappweb2' succeeded
CRS-2673: Attempting to stop 'ora.DATA01.dg' on 'ncappweb2'
CRS-2677: Stop of 'ora.DATA01.dg' on 'ncappweb2' succeeded
CRS-2673: Attempting to stop 'ora.asm' on 'ncappweb2'
CRS-2677: Stop of 'ora.asm' on 'ncappweb2' succeeded
CRS-2673: Attempting to stop 'ora.cssd' on 'ncappweb2'
CRS-2677: Stop of 'ora.cssd' on 'ncappweb2' succeeded
CRS-5014: Agent "/u01/app/11.2.0/grid/bin/oraagent.bin" timed out starting process "/u01/app/11.2.0/grid/bin/lsnrctl" for action "stop": details at "(:CLSN00009:)" in "/u01/app/11.2.0/grid/log/ncappweb2/agent/ohasd/oraagent_grid/oraagent_grid.log"
CRS-5017: The resource action "ora.LISTENER.lsnr stop" encountered the following error: 
(:CLSN00009:)Utils:execCmd aborted. For details refer to "(:CLSN00108:)" in "/u01/app/11.2.0/grid/log/ncappweb2/agent/ohasd/oraagent_grid/oraagent_grid.log".

CRS-2677: Stop of 'ora.LISTENER.lsnr' on 'ncappweb2' succeeded
CRS-2679: Attempting to clean 'ora.LISTENER.lsnr' on 'ncappweb2'
CRS-2681: Clean of 'ora.LISTENER.lsnr' on 'ncappweb2' succeeded
CRS-2673: Attempting to stop 'ora.evmd' on 'ncappweb2'
CRS-2677: Stop of 'ora.evmd' on 'ncappweb2' succeeded
CRS-2793: Shutdown of Oracle High Availability Services-managed resources on 'ncappweb2' has completed
CRS-4133: Oracle High Availability Services has been stopped.
# ./crsctl start has
CRS-4123: Oracle High Availability Services has been started.
#./crsctl stat res -t
--------------------------------------------------------------------------------
NAME           TARGET  STATE        SERVER                   STATE_DETAILS       
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.DATA01.dg
               ONLINE  ONLINE       ncappweb2                                    
ora.LISTENER.lsnr
               ONLINE  ONLINE       ncappweb2                                    
ora.asm
               ONLINE  ONLINE       ncappweb2                Started             
ora.ons
               OFFLINE OFFLINE      ncappweb2                                    
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.cssd
      1        ONLINE  ONLINE       ncappweb2                                    
ora.diskmon
      1        OFFLINE OFFLINE                                                   
ora.evmd
      1        ONLINE  ONLINE       ncappweb2                                    
ora.mtorcl.db
      1        ONLINE  ONLINE       ncappweb2                Open                
        ASM实例正常启动。

$ cd $GRID_HOME/dbs
$ ls
ab_+ASM.dat  hc_+ASM.dat  init.ora     orapw+ASM

        从上面的输出可以看出,srvctl modify asm命令并不会创建实例的SPFILE参数文件,但是srvctl add asm命令会为ASM实例创建默认值的参数文件,这点是有差别的,所以我们还可以通过执行srvctl remove asm和srvctl add asm命令实现对ASM参数文件位置的修改,且还创建相应位置的参数文件。

        从上面的例子看出,即使没有ASM实例的参数文件,ASM实例依然可以正常启动,Oracle应该为ASM实例设定了默认的启动参数。
# su - grid
$ sqlplus / as sysasm

SQL*Plus: Release 11.2.0.3.0 Production on Tue Sep 11 09:57:49 2012

Copyright (c) 1982, 2011, Oracle.  All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Automatic Storage Management option

SQL> show parameter spfile

NAME                                 TYPE
------------------------------------ ----------------------
VALUE
------------------------------
spfile                               string

        SPFILE参数值依然不存在。

6.手动创建SPFILE文件。
SQL> create spfile from memory;

File created.

$ ls
ab_+ASM.dat     hc_+ASM.dat     init.ora        orapw+ASM       spfile+ASM.ora
$ strings spfile*.ora
*.__large_pool_size=12M
*._aggregation_optimization_settings=0
*._always_anti_join='CHOOSE'
*._always_semi_join='CHOOSE'
*._and_pruning_enabled=TRUE
*._b_tree_bitmap_plans=TRUE
*._bloom_filter_enabled=TRUE
*._bloom_folding_enabled=TRUE
*._bloom_pruning_enabled=TRUE
*._complex_view_merging=TRUE
*._compression_compatibility='11.2.0'
*._connect_by_use_union_all='TRUE'
*._convert_set_to_join=FALSE
*._cost_equality_semi_join=TRUE
*._cpu_to_io=0
*._dimension_skip_null=TRUE
*._eliminate_com
mon_subexpr=TRUE
......

7.重启Grid。
# ./crsctl stop has
CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on 'ncappweb2'
CRS-2673: Attempting to stop 'ora.mtorcl.db' on 'ncappweb2'
CRS-2673: Attempting to stop 'ora.LISTENER.lsnr' on 'ncappweb2'
CRS-2677: Stop of 'ora.mtorcl.db' on 'ncappweb2' succeeded
CRS-2673: Attempting to stop 'ora.DATA01.dg' on 'ncappweb2'
CRS-2677: Stop of 'ora.DATA01.dg' on 'ncappweb2' succeeded
CRS-2673: Attempting to stop 'ora.asm' on 'ncappweb2'
CRS-2677: Stop of 'ora.asm' on 'ncappweb2' succeeded
CRS-2673: Attempting to stop 'ora.cssd' on 'ncappweb2'
CRS-2677: Stop of 'ora.cssd' on 'ncappweb2' succeeded
CRS-5014: Agent "/u01/app/11.2.0/grid/bin/oraagent.bin" timed out starting process "/u01/app/11.2.0/grid/bin/lsnrctl" for action "stop": details at "(:CLSN00009:)" in "/u01/app/11.2.0/grid/log/ncappweb2/agent/ohasd/oraagent_grid/oraagent_grid.log"
CRS-5017: The resource action "ora.LISTENER.lsnr stop" encountered the following error: 
(:CLSN00009:)Utils:execCmd aborted. For details refer to "(:CLSN00108:)" in "/u01/app/11.2.0/grid/log/ncappweb2/agent/ohasd/oraagent_grid/oraagent_grid.log".

CRS-2677: Stop of 'ora.LISTENER.lsnr' on 'ncappweb2' succeeded
CRS-2679: Attempting to clean 'ora.LISTENER.lsnr' on 'ncappweb2'
CRS-2681: Clean of 'ora.LISTENER.lsnr' on 'ncappweb2' succeeded
CRS-2673: Attempting to stop 'ora.evmd' on 'ncappweb2'
CRS-2677: Stop of 'ora.evmd' on 'ncappweb2' succeeded
CRS-2793: Shutdown of Oracle High Availability Services-managed resources on 'ncappweb2' has completed
CRS-4133: Oracle High Availability Services has been stopped.
# ./crsctl start has
CRS-4123: Oracle High Availability Services has been started.
# ./crsctl stat res -t
--------------------------------------------------------------------------------
NAME           TARGET  STATE        SERVER                   STATE_DETAILS       
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.DATA01.dg
               ONLINE  ONLINE       ncappweb2                                    
ora.LISTENER.lsnr
               ONLINE  ONLINE       ncappweb2                                    
ora.asm
               ONLINE  ONLINE       ncappweb2                Started             
ora.ons
               OFFLINE OFFLINE      ncappweb2                                    
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.cssd
      1        ONLINE  ONLINE       ncappweb2                                    
ora.diskmon
      1        OFFLINE OFFLINE                                                   
ora.evmd
      1        ONLINE  ONLINE       ncappweb2                                    
ora.mtorcl.db
      1        ONLINE  ONLINE       ncappweb2                Open                
# su - grid
$ sqlplus / as sysasm

SQL*Plus: Release 11.2.0.3.0 Production on Tue Sep 11 10:06:20 2012

Copyright (c) 1982, 2011, Oracle.  All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Automatic Storage Management option

SQL> show parameter spfile

NAME                                 TYPE
------------------------------------ ----------------------
VALUE
------------------------------
spfile                               string
/u01/app/11.2.0/grid/dbs/spfil
e+ASM.ora
SQL> show parameter disk

NAME                                 TYPE
------------------------------------ ----------------------
VALUE
------------------------------
asm_diskgroups                       string
DATA01
asm_diskstring                       string

SQL> alter system set asm_diskstring='/dev/rhdisk*';

System altered.

SQL> show parameter disk

NAME                                 TYPE
------------------------------------ ----------------------
VALUE
------------------------------
asm_diskgroups                       string
DATA01
asm_diskstring                       string
/dev/rhdisk*
        从这个例子可以看出,修改现存环境的ASM参数文件位置,首先是创建新位置的SPFILE文件,之后使用srvctl modify asm命令调整SPFILE的位置,最后重启Grid软件以验证ASM参数位置修改效果。

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

转载于:http://blog.itpub.net/23135684/viewspace-743664/

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值