11g asm pfile & spfile

数据库安装完成,在ORACLE_HOME/dbs目录下并未发现ASM的pfile和spfile,手动创建pfile和pfile如下:

$ exit
# su - grid
$ srvctl config asm
ASM home: /oracle/app/product/11.2.0
ASM listener: LISTENER
Spfile: +DATADG/asm/asmparameterfile/registry.253.970045839   ##此文件并不存在
ASM diskgroup discovery string: 
$ 

$ cd $ORACLE_HOME/dbs
##目录下并没有ASM的pfile和spfile
$ ls
ab_+ASM.dat  hc_+ASM.dat  init.ora     orapw+ASM
$ 

##手动指定spfile 的路径
$srvctl modify asm -p /oracle/app/product/11.2.0/dbs/spfile+ASM.ora

$ srvctl config asm
ASM home: /oracle/app/product/11.2.0
ASM listener: LISTENER
Spfile: /oracle/app/product/11.2.0/dbs/spfile+ASM.ora
ASM diskgroup discovery string: 
$ sqlplus / as sysasm

sql*Plus: Release 11.2.0.4.0 Production on Fri Mar 16 08:50:26 2018

copyright (c) 1982,2013,Oracle.  All rights reserved.

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Automatic Storage Management option
##创建spfile
sql> create spfile from memory;

File created.

sql> 
##查看spfile 是否生成
sql> !ls -l
total 56
-rw-rw----    1 grid     oinstall       1676 Mar 07 10:02 ab_+ASM.dat
-rw-rw----    1 grid     oinstall       1544 Mar 16 08:44 hc_+ASM.dat
-rw-r--r--    1 grid     oinstall       2851 May 15 2009  init.ora
-rw-r-----    1 grid     oinstall       1536 Mar 06 09:10 orapw+ASM
-rw-r-----    1 grid     oinstall      11776 Mar 16 08:50 spfile+ASM.ora   ##文件生成

sql> 

$ which crsctl
/oracle/app/product/11.2.0/bin/crsctl
$ exit
##重启数据库
# /oracle/app/product/11.2.0/bin/crsctl stop has
CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on 'mng'
CRS-2673: Attempting to stop 'ora.mngdb.db' on 'mng'
CRS-2673: Attempting to stop 'ora.LISTENER.lsnr' on 'mng'
CRS-2677: Stop of 'ora.mngdb.db' on 'mng' succeeded
CRS-2673: Attempting to stop 'ora.DATA.dg' on 'mng'
CRS-2677: Stop of 'ora.DATA.dg' on 'mng' succeeded
CRS-2673: Attempting to stop 'ora.asm' on 'mng'
CRS-2677: Stop of 'ora.LISTENER.lsnr' on 'mng' succeeded
CRS-2677: Stop of 'ora.asm' on 'mng' succeeded
CRS-2673: Attempting to stop 'ora.cssd' on 'mng'
CRS-2677: Stop of 'ora.cssd' on 'mng' succeeded
CRS-2673: Attempting to stop 'ora.evmd' on 'mng'
CRS-2677: Stop of 'ora.evmd' on 'mng' succeeded
CRS-2793: Shutdown of Oracle High Availability Services-managed resources on 'mng' has completed
CRS-4133: Oracle High Availability Services has been stopped.
#  /oracle/app/product/11.2.0/bin/crsctl start has
CRS-4123: Oracle High Availability Services has been started.

# su - grid
$ srsqlplus / as sysdba

sql*Plus: Release 11.2.0.4.0 Production on Fri Mar 16 08:54:14 2018

copyright (c) 1982,Oracle.  All rights reserved.

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

##发现已经可以检测到spfile
sql> show parameter spfile;

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
spfile                               string      /oracle/app/product/11.2.0/dbs
                                                 /spfile+ASM.ora
sql> 
##创建pfile
sql> create pfile from spfile;

File created.

sql> exit
disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Automatic Storage Management option
$ cd $ORACLE_HOME/dbs
$ ls -l
##pfile已经发现
total 72
-rw-rw----    1 grid     oinstall       1676 Mar 16 08:53 ab_+ASM.dat
-rw-rw----    1 grid     oinstall       1544 Mar 16 08:53 hc_+ASM.dat
-rw-r--r--    1 grid     oinstall       5242 Mar 16 08:54 init+ASM.ora
-rw-r--r--    1 grid     oinstall       2851 May 15 2009  init.ora
-rw-r-----    1 grid     oinstall       1536 Mar 06 09:10 orapw+ASM
-rw-r-----    1 grid     oinstall      11776 Mar 16 08:50 spfile+ASM.ora
$ more init+ASM.ora   ##pfile读写
*._aggregation_optimization_settings=0
*._always_anti_join='CHOOSE'
*._always_semi_join='CHOOSE'
*._and_pruning_enabled=TRUE
...略..........................

相关文章

Java Oracle 结果集是Java语言中处理数据库查询结果的一种方...
Java AES和Oracle AES是现代加密技术中最常使用的两种AES加密...
Java是一种广泛应用的编程语言,具备可靠性、安全性、跨平台...
随着移动互联网的发展,抽奖活动成为了营销活动中不可或缺的...
Java和Oracle都是在计算机领域应用非常广泛的技术,他们经常...
Java 是一门非常流行的编程语言,它可以运行于各种操作系统上...