Create SPFILE Under ASM

-- Suppose that the database instance name is "osmdr"

-- In the database instance

When trying to create a new spfile from a pfile under sqlplus

SQL> create SPFILE='+DATA/osmdr/spfileosmdr.ora' from pfile='/home/oracle/osmdr.init';
File created.

SQL>create SPFILE='+DATA/osmdr/spfileosmdr.ora' from PFILE='/home/oracle/osmdr.init';

File created



UnderASM , the spileosmdr.ora is link to the wrong location under ASM

ASMCMD> ls -alr
Type Redund Striped Time Sys Name
N spfileosmdr.ora =>
+DATA/DB_UNKNOWN/PARAMETERFILE/SPFILE.272.613162051
ASMCMD>

Q. Why it will create +DATA/DB_UNKNOW instead of +DATA/osmdr ?

-- Considering the TESTCASE hereunder

The string "DB_UNKNOWN/PARAMETERFILE/SPFILE" is a generic system tag for the proxied spfile creation. This will be used in case the database instance has no open client session to the ASM instance at the time of the 'create spfile' command. That is, the ASM instance is not aware of the db name and therefore uses "DB_UNKNOWN".

Please see the TESTCASE section above that demonstrates two scenarios;

[A] where the DB_UNKNOWN directory structure gets created, and [B] where the spfile is created in the directory <diskgroup_name>/<db_name>/PARAMETERFILE.

TESTCASE

[A] No open database connection to the ASM instance

-- In the ASM instance

SQL> select * from v$asm_client;

no rows selected

-- In the database instance

SQL> show parameter db_name

NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
db_name string V1020

SQL> select * from v$asm_client;

no rows selected

SQL> create spfile='+DG1' from pfile;
File created.

-- In asmcmd
-- The DB_UNKNOWN directory structure gets created

ASMCMD> pwd
+dg1
ASMCMD> ls
DB_UNKNOWN/
V1020/
ASMCMD> ls DB_UNKNOWN/
PARAMETERFILE/
ASMCMD> ls DB_UNKNOWN/PARAMETERFILE/
SPFILE.259.613339345

-- Remove the parameter file from the ASM diskgroup

ASMCMD> rm DB_UNKNOWN/PARAMETERFILE/SPFILE.259.613339345

-- Now the DB_UNKNOWN directory structure gets automatically removed

[B]

-- In the database instance
-- Open a connection to the ASM instance by accessing a datafile in an ASM diskgro
-- In this example, a tablespace with a datafile in an ASM diskgroup is onlined

SQL> alter tablespace ts1 online;
Tablespace altered.

SQL> select * from v$asm_client;

GROUP_NUMBER INSTANCE_NAM DB_NAME STATUS SOFTWARE
------------ ------------ -------- ------------ -
1 +ASM V1020 CONNECTED 10.2.0.3.0 10.2.0.0.0

-- In the ASM instance

SQL> select * from v$asm_client;
GROUP_NUMBER INSTANCE_NAM DB_NAME STATUS SOFTW
------------ ------------ -------- -----------
1 V1020 V1020 CONNECTED 10.2.0.3.0 10.2.0.1.0

-- In the database instance

SQL> create spfile='+DG1' from pfile;
File created.

-- In asmcmd

ASMCMD> pwd
+dg1
ASMCMD> ls
V1020/
ASMCMD> ls V1020/
DATAFILE/
PARAMETERFILE/
ASMCMD> ls V1020/PARAMETERFILE/
spfile.259.613339813

-- Result:
- The spfile is located in the directory <diskgroup_name>/<db_name>/PARAMETERFILE
- No DB_UNKNOWN directory structure got created

From Oracle

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

Blog http://blog.csdn.net/tianlesoftware

Email: dvd.dba@gmail.com

DBA1 群:62697716(); DBA2 群:62697977() DBA3 群:62697850()

DBA 超级群:63306533(); DBA4 群: 83829929 DBA5群: 142216823

聊天 群:40132017 聊天2群:69087192

--加群需要在备注说明Oracle表空间和数据文件的关系,否则拒绝申请

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值