设为首页 收藏本站
查看: 470|回复: 0

[经验分享] oracle asm spfie丢失

[复制链接]

尚未签到

发表于 2018-9-11 07:48:08 | 显示全部楼层 |阅读模式
  ORA-1078 ORA-1565 Errors while starting database with SPFILE on ASM
  I was getting following error’s while starting a database using spfile on ASM. Actually this was a cloned RAC environment.
SQL> create SPFILE='+ASM_GROUP/PORTALDB/spfileportaldb.ora' from pfile;  
File created.
  
SQL> shut immediate;
  
ORA-01109: database not open
  
Database dismounted.
  
ORACLE instance shut down.
  
SQL> exit
  
SQL> startup mount
  
ORA-01078: failure in processing system parameters
  
ORA-01565: error in identifying file '+ASM_GROUP/PORTALDB/spfileportaldb.ora'
  
ORA-17503: ksfdopn:2 Failed to open file +ASM_GROUP/PORTALDB/spfileportaldb.ora
  
ORA-01000: maximum open cursors exceeded

  Error first states that it has failed to process the parameter. Second states that it has failed to>  Problem here was that I had started the database with pfile from non-default location and pfile located in $ORACLE_HOME/dbs had following entries
SPFILE='+ASM_GROUP/PORTALDB/spfileportaldb.ora'  In this case spfile too was created with same contents. Correct method is to specify the non-default pfile location in ‘create spfile’ syntax.
SQL> CREATE SPFILE='+ASM_GROUP/PORTALDB/spfileportaldb.ora' from pfile=\'/home/oracle/portaldb.ora\';  

  
File created.
  

  
SQL> shut immediate;
  
ORA-01109: database not open
  

  
Database dismounted.
  
ORACLE instance shut down.
  
SQL> exit
  
SQL> sqlplus \"/ as sysdba\"
  
Connected to an idle instance.
  

  
SQL> startup mount
  
ORACLE instance started.
  

  
Total System Global Area 3674210304 bytes
  
Fixed Size                  2088384 bytes
  
Variable Size            2197815872 bytes
  
Database Buffers         1459617792 bytes
  
Redo Buffers               14688256 bytes
  
Database mounted.
  
SQL> alter database open;
Move SPFILE from ASM to File System
  The following is an example of how to move your SPFILE from ASM to your file system or vice versa
  ASM to File System
  In this case, we have our spfile in the +DATA diskgroup and we want to move it to the default location on our file system. The default location will be in our $ORACLE_HOME/dbs directory. In order to accomplish this, we need to create a pfile from our existing spfile and then create the new spfile from this temporary pfile. Afterwords, we bounce the database instance for the change to take effect.
SQL> show parameter spfile  

  
NAME                                 TYPE        VALUE
  
------------------------------------ ----------- ------------------------------
  
spfile                               string      +DATA/orcl/spfileorcl.ora
  

  
SQL> create pfile='/tmp/orcl.pfile' from spfile;
  

  
File created.
  

  
SQL> create spfile='/u01/app/oracle/product/10.2.0/db_1/dbs/spfileorcl.ora'
  
from pfile='/tmp/orcl.pfile';
  

  
File created.
  

  
SQL> startup force
  
ORACLE instance started.
  
...
  
Database mounted.
  
Database opened.
  

  

  
SQL> show parameter spfile
  

  
NAME                                 TYPE        VALUE
  
------------------------------------ ----------- ------------------------------
  
spfile                               string      /u01/app/oracle/product/10.2.0
  
                                                /db_1/dbs/spfileorcl.ora
Cleaning up the old ASM spfile

  At this point you may want to clean up the old spfile within ASM. To do that, use the asmcmd utility to remove the file. The file system spfile will take precedence over the ASM spfile, but it’s not a bad>$ . oraenv  
ORACLE_SID= [orcl] ? +ASM
  
$ asmcmd
  
ASMCMD> cd DATA/orcl
  
ASMCMD> rm spfileorcl.ora
  
ASMCMD> exit
File System to ASM
  The reverse procedure is similar. However, because Oracle will use the file system spfile first if it sees one, we need to remove or rename that file system spfile before bouncing the database instance.
SQL> show parameter spfile  

  
NAME                                 TYPE        VALUE
  
------------------------------------ ----------- ------------------------------
  
spfile                               string      /u01/app/oracle/product/10.2.0
  
                                                /db_1/dbs/spfileorcl.ora
  

  

  
SQL> create pfile='/tmp/orcl.pfile' from spfile;
  

  
File created.
  

  
SQL> create spfile='+DATA/orcl/spfileorcl.ora'
  
from pfile='/tmp/orcl.pfile';
  

  
File created.
  

  
$ cd $ORACLE_HOME/dbs
  
$ mv spfileorcl.ora old_spfileorcl.ora
  

  

  
SQL> startup force
  
ORACLE instance started.
  
...
  
Database mounted.
  
Database opened.
  

  

  
SQL> show parameter spfile
  
NAME                                 TYPE        VALUE
  
------------------------------------ ----------- ------------------------------
  
spfile                               string      +DATA/orcl/spfileorcl.ora
Fixing an OMF spfile name
  One common error you may run into is if you didn’t provide a full path to the spfile within your ASM diskgroup (i.e., you created the spfile as ‘+DATA’ instead of ‘+DATA/orcl/spfileorcl.ora’). If that happens, then Oracle is going to assign an Oracle Managed File (OMF) name to your spfile and all you need to do is create an alias for it using the asmcmd tool.
SQL> create pfile='/tmp/orcl.pfile' from spfile;  
File created.
  

  
SQL> create spfile='+DATA'
  
from pfile='/tmp/orcl.pfile';
  
File created.
  

  
$ cd $ORACLE_HOME/dbs
  
$ mv spfileorcl.ora old_spfileorcl.ora
  

  
SQL> startup force
  
ORA-01078: failure in processing system parameters
  
ORA-01565: error in identifying file '+DATA/orcl/spfileorcl.ora'
  
ORA-17503: ksfdopn:2 Failed to open file +DATA/orcl/spfileorcl.ora
  
ORA-15056: additional error message
  
ORA-17503: ksfdopn:DGOpenFile05 Failed to open file +DATA/orcl/spfileorcl.ora
  
ORA-17503: ksfdopn:2 Failed to open file +DATA/orcl/spfileorcl.ora
  
ORA-15173: entry 'spfileorcl.ora' does not exist in directory 'orcl'
  
ORA-06512: at line 4
  

  
$ . oraenv
  
ORACLE_SID= [orcl] ? +ASM
  
$ asmcmd
  
ASMCMD> cd DATA/orcl/
  
ASMCMD> ls PARAMETERFILE
  
spfile.277.756994081
  
ASMCMD> mkalias +DATA/orcl/parameterfile/spfile.277.756994081
  
+DATA/orcl/spfileorcl.ora
  
ASMCMD> exit
  

  
SQL> startup force
  
ORACLE instance started.
  
...
  
Database mounted.
  
Database opened.
  

  

  
SQL> show parameter spfile
  
NAME                                 TYPE        VALUE
  
------------------------------------ ----------- ------------------------------
  
spfile                               string      +DATA/orcl/spfileorcl.ora
  This code was tested on an Oracle 10g Standard Edition database.
  ORA-01565: error in>

  When we’re going to create pfile from spfile while spfile running on ASM instance, We can>  SQL> create pfile=’/u01/inittest.ora’ from spfile;
  create pfile=’/u01/inittest.ora’ from spfile
  *
  ERROR at line 1:

  ORA-01565: error in>  ORA-27037: unable to obtain file status
  Linux Error: 2: No such file or directory
  Additional information: 3
  Solution :
  We need to give ASM path of SPFILE.
  SQL>  create pfile=’/u01/inittest.ora’ from spfile=’+DATA/dbasm/spfiledbasm.ora';
  File created.



运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.iyunv.com/thread-571697-1-1.html 上篇帖子: ORACLE学习笔记(三)​ 下篇帖子: oracle内存结构(二)
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表