昨天朋友问我一个这样的问题,他现在想做一次rac到单实例恢复数据库的操作,参考我曾经写过的文档:
《oracle 11g r2 rac数据库备份通过rman恢复到单实例数据库实现》。但他告诉我说现在单机上只安装了
oracle软件,却没有创建任何实例。现在无法启动到nomount模式。
我告诉他,通过rman就可以,rman连接上去之后没有任何对应的参数文件也能够启动到nomount模式,官方
称这种为“dummy”。
那我们简单看下这个特性。
(这是我12c rac环境)当前没有任何数据库实例启动[oracle@12crac1 ~]$ srvctl status database -d luocs12cinstance luocs12c1 is not running on node 12crac1instance luocs12c2 is not running on node 12crac2oracle_sid指定不存在的实例[oracle@12crac1 ~]$ export oracle_sid=luocsrman连接,并且尝试启动到nomount模式:[oracle@12crac1 ~]$ rman target /recovery manager: release 12.1.0.1.0 - production on tue jul 2 15:22:52 2013copyright (c) 1982, 2013, oracle and/or its affiliates. all rights reserved.connected to target database (not started)rman> startup nomountstartup failed: ora-01078: failure in processing system parameterslrm-00109: could not open parameter file '/u01/app/oracle/product/12.1.0/dbhome_1/dbs/initluocs.ora'starting oracle instance without parameter file for retrieval of spfileoracle instance startedtotal system global area 1068937216 bytesfixed size 2296576 bytesvariable size 293602560 bytesdatabase buffers 767557632 bytesredo buffers 5480448 bytesrman> -- 可见这里能够正常启动。
然后我们通过sqlplus连接,并查看db_name,能够看到是dummy。
[oracle@12crac1 ~]$ sqlplus / as sysdbasql*plus: release 12.1.0.1.0 production on tue jul 2 15:23:37 2013copyright (c) 1982, 2013, oracle. all rights reserved.connected to:oracle database 12c enterprise edition release 12.1.0.1.0 - 64bit productionwith the partitioning, real application clusters, olap, advanced analyticsand real application testing optionsidle> show parameter db_namename type value------------------------------------ ----------- ------------------------------db_name string dummy
这个特性在恢复数据库的时候能够使用,也就是通过dummy启动到nomount,然后restore spfile等等。
朋友按照我说的去操作,但却遇到了问题,我远程看,启动的时候遇到了ora-4031。
当时我猜测这和参数配置有关。但因为快下班了而且晚上有约,跟朋友说急的话先手动建个初始化参数文件
并启动到nomount,这个问题明天帮他看看。
今天早上上班之后,在自己的测试机上操作了下,同样遇到了问题,如下:
(11.2.0.1版本数据库)
[oracle@localhost ~]$ export oracle_sid=xxx[oracle@localhost ~]$ rman target / nocatalogrecovery manager: release 11.2.0.1.0 - production on tue jul 2 08:50:58 2013copyright (c) 1982, 2009, oracle and/or its affiliates. all rights reserved.connected to target database (not started)rman> startup nomountstartup failed: ora-01078: failure in processing system parameterslrm-00109: could not open parameter file '/u01/app/oracle/product/11.2.0.1/dbhome_1/dbs/initxxx.ora'starting oracle instance without parameter file for retrieval of spfilerman-00571: ===========================================================rman-00569: =============== error message stack follows ===============rman-00571: ===========================================================rman-03002: failure of startup command at 07/02/2013 08:51:29rman-04014: startup failed: ora-04031: unable to allocate 524304 bytes of shared memory (shared pool,unknown object,sga heap(1,0),row cache)
这在10201版本数据库上同样报错:
[oracle@localhost ~]$ /u01/app/oracle/product/10.2.0.1/dbhome_1/bin/rman target /recovery manager: release 10.2.0.1.0 - production on tue jul 2 09:03:03 2013copyright (c) 1982, 2005, oracle. all rights reserved.connected to target database (not started)rman> startup nomountstartup failed: ora-01078: failure in processing system parameterslrm-00109: could not open parameter file '/u01/app/oracle/product/10.2.0.1/dbhome_1/dbs/initxxx.ora'starting oracle instance without parameter file for retrival of spfilerman-00571: ===========================================================rman-00569: =============== error message stack follows ===============rman-00571: ===========================================================rman-03002: failure of startup command at 07/02/2013 09:03:11rman-04014: startup failed: ora-12853: insufficient memory for px buffers: current 0k, max needed 1008kora-04031: unable to allocate 21492 bytes of shared memory (large pool,unknown object,large pool,px msg pool)
我就查了一下,从mos上找到了ora-4031 during startup nomount using rman without parameter file
(pfile) [id 1176443.1]
原文如下:
applies to: oracle database - enterprise edition - version 11.2.0.1 and laterinformation in this document applies to any platform.***checked for relevance on 08-may-2013*** symptomsrman startup nomount failed with ora-4031 customer was testing rman backup/restore in exadata. customer firstly backup the database to tape and then remove all the datafiles, spfile, controlfiles for testing. then during the recover, customer connected rman with nocatalog and try to startup nomount, then ora-4031 occured.==================== log ========================oracle@hkfop011db01:/home/oracle$ export oracle_sid=testoracle@test011db01:/home/oracle$ rman target / nocatalogrecovery manager: release 11.2.0.1.0 - production on thu jul 8 20:45:10 2010copyright (c) 1982, 2009, oracle and/or its affiliates. all rights reserved.connected to target database (not started)rman> startup nomountstartup failed: ora-01078: failure in processing system parameterslrm-00109: could not open parameter file '/oracle/product/11.2.0/db_1/dbs/inittest.ora'starting oracle instance without parameter file for retrieval of spfilerman-00571: ===========================================================rman-00569: =============== error message stack follows ===============rman-00571: ===========================================================rman-03002: failure of startup command at 07/08/2010 20:45:19rman-04014: startup failed: ora-04031: unable to allocate 111264 bytes of shared memory (shared pool,unknown object,sga heap(1,0),kews sesstat values)causerman has failed to start a dummy instance without pfile.default values used for the dummy instance are not enough to start the instance up.this is reported in bug 9680987 - rman cannot start database without parameter filesolutionthere are two possible solutions:1- create temporary init.ora file (/oracle/product/11.2.0/db_1/dbs/inittest.ora) with the following parameters:? db_name=? large_pool_size=100m? shared_pool_size=250m? db_cache_size=10m2- set environment variable? ora_rman_sga_target before executing rman. for example:? $ export ora_rman_sga_target=350
这原来和bug相关,但它说影响11201以上版本,这应该有问题,我看bug 9680987也是11107版本:
problem:--------starting an instance via rman and referencing to a none-existent spfile fails with ora-4031rman target ********/********;recovery manager: release 11.1.0.7.0 - production on fri feb 5 10:29:59 2010copyright (c) 1982, 2007, oracle.? all rights reserved.connected to target database (not started)rman> set dbid=575862064;executing command: set dbidrman> startup force nomount;startup failed: ora-1078: failure in processing system parametersora-1565: error in identifying file '/u02/oradata/infr/rstd/rstd/spfilerstd.ora'ora-27037: unable to obtain file statussvr4 error: 2: no such file or directoryadditional information: 3starting oracle instance without parameter file for retrieval of spfilerman-571: ===========================================================rman-569: =============== error message stack follows ===============rman-571: ===========================================================rman-3002: failure of startup command at 02/05/2010 10:06:16rman-4014: startup failed: ora-4031: unable to allocate 84672 bytes of shared memory (shared pool,unknown object,sga heap(1,0),ksuloi: long op statistics array)
先不管了,mos的文章里提供了解决方法,第一就是创建初始化文件、第二就是配置ora_rman_sga_target环
境变量。
经过测试,问题得以解决:
[oracle@localhost ~]$ export oracle_sid=xxx[oracle@localhost ~]$ export ora_rman_sga_target=350[oracle@localhost ~]$ rman target /recovery manager: release 11.2.0.1.0 - production on tue jul 2 09:07:50 2013copyright (c) 1982, 2009, oracle and/or its affiliates. all rights reserved.connected to target database (not started)rman> startup nomountstartup failed: ora-01078: failure in processing system parameterslrm-00109: could not open parameter file '/u01/app/oracle/product/11.2.0.1/dbhome_1/dbs/initxxx.ora'starting oracle instance without parameter file for retrieval of spfileoracle instance startedtotal system global area 368263168 bytesfixed size 1336596 bytesvariable size 117443308 bytesdatabase buffers 239075328 bytesredo buffers 10407936 bytes
ok,到这里。
原文地址:rman dummy启动报ora-04031问题解决一例, 感谢原作者分享。