本篇文章给大家分享的是有关11gR2如何修改Grid软件ASM的参数文件位置,小编觉得挺实用的,因此分享给大家学习,希望大家阅读完这篇文章后可以有所收获,话不多说,跟着小编一起来看看吧。
成都创新互联成立于2013年,先为图们等服务建站,图们等地企业,进行企业商务咨询服务。为图们企业网站制作PC+手机+微官网三网同步一站式服务解决您的所有建站问题。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
-l
-p
-d
-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参数位置修改效果。
以上就是11gR2如何修改Grid软件ASM的参数文件位置,小编相信有部分知识点可能是我们日常工作会见到或用到的。希望你能通过这篇文章学到更多知识。更多详情敬请关注创新互联-成都网站建设公司行业资讯频道。
本文题目:11gR2如何修改Grid软件ASM的参数文件位置-创新互联
文章起源:http://scgulin.cn/article/hghhi.html