热门标签 | HotTags
当前位置:  开发笔记 > 数据库 > 正文

RMANDUMMY启动报ORA-04031问题解决一例

昨天朋友问我一个这样的问题,他现在想做一次RAC到单实例恢复数据库的操作,参考我曾经写过的文档:《Oracle11gR2RAC数据库备份通过RMAN恢复到单实例数据库实现》。但他告诉我说现在单机上只安装了Oracle软件,却没有创建任何实例。现在无法启动到nomou

昨天朋友问我一个这样的问题,他现在想做一次RAC到单实例恢复数据库的操作,参考我曾经写过的文档: 《Oracle 11g R2 RAC数据库备份通过RMAN恢复到单实例数据库实现》。但他告诉我说现在单机上只安装了 Oracle软件,却没有创建任何实例。现在无法启动到nomou

昨天朋友问我一个这样的问题,他现在想做一次RAC到单实例恢复数据库的操作,参考我曾经写过的文档:

《Oracle 11g R2 RAC数据库备份通过RMAN恢复到单实例数据库实现》。但他告诉我说现在单机上只安装了

Oracle软件,却没有创建任何实例。现在无法启动到nomount模式。

我告诉他,通过RMAN就可以,RMAN连接上去之后没有任何对应的参数文件也能够启动到nomount模式,官方

称这种为“dummy”。

那我们简单看下这个特性。

(这是我12c RAC环境)
当前没有任何数据库实例启动
[oracle@12crac1 ~]$ srvctl status database -d luocs12c
Instance luocs12c1 is not running on node 12crac1
Instance luocs12c2 is not running on node 12crac2
ORACLE_SID指定不存在的实例
[oracle@12crac1 ~]$ export ORACLE_SID=luocs
rman连接,并且尝试启动到nomount模式:
[oracle@12crac1 ~]$ rman target /
Recovery Manager: Release 12.1.0.1.0 - Production on Tue Jul 2 15:22:52 2013
Copyright (c) 1982, 2013, Oracle and/or its affiliates.  All rights reserved.
connected to target database (not started)
RMAN> startup nomount
startup failed: ORA-01078: failure in processing system parameters
LRM-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 spfile
Oracle instance started
Total System Global Area    1068937216 bytes
Fixed Size                     2296576 bytes
Variable Size                293602560 bytes
Database Buffers             767557632 bytes
Redo Buffers                   5480448 bytes
RMAN> 
-- 可见这里能够正常启动。

然后我们通过sqlplus连接,并查看db_name,能够看到是dummy。

[oracle@12crac1 ~]$ sqlplus / as sysdba
SQL*Plus: Release 12.1.0.1.0 Production on Tue Jul 2 15:23:37 2013
Copyright (c) 1982, 2013, Oracle.  All rights reserved.
Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
With the Partitioning, Real Application Clusters, OLAP, Advanced Analytics
and Real Application Testing options
idle> show parameter db_name
NAME                                 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 / nocatalog
Recovery Manager: Release 11.2.0.1.0 - Production on Tue Jul 2 08:50:58 2013
Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.
connected to target database (not started)
RMAN> startup nomount
startup failed: ORA-01078: failure in processing system parameters
LRM-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 spfile
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of startup command at 07/02/2013 08:51:29
RMAN-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 2013
Copyright (c) 1982, 2005, Oracle.  All rights reserved.
connected to target database (not started)
RMAN> startup nomount
startup failed: ORA-01078: failure in processing system parameters
LRM-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 spfile
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of startup command at 07/02/2013 09:03:11
RMAN-04014: startup failed: ORA-12853: insufficient memory for PX buffers: current 0K, max needed 1008K
ORA-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 later
Information in this document applies to any platform.
***Checked for relevance on 08-May-2013*** 
Symptoms
RMAN 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=TEST
oracle@test011db01:/home/oracle
$ rman target / nocatalog
Recovery Manager: Release 11.2.0.1.0 - Production on Thu Jul 8 20:45:10 2010
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
connected to target database (not started)
RMAN> startup nomount
startup failed: ORA-01078: failure in processing system parameters
LRM-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 spfile
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of startup command at 07/08/2010 20:45:19
RMAN-04014: startup failed: ORA-04031: unable to allocate 111264 bytes of shared memory ("shared pool","unknown object","sga heap(1,0)","KEWS sesstat values")
Cause
RMAN 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 FILE
Solution
There 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=10m
2- 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-4031
rman target ********/********;
Recovery Manager: Release 11.1.0.7.0 - Production on Fri Feb 5 10:29:59 2010
Copyright (c) 1982, 2007, Oracle.? All rights reserved.
connected to target database (not started)
RMAN> set DBID=575862064;
executing command: SET DBID
RMAN> startup force nomount;
startup failed: ORA-1078: failure in processing system parameters
ORA-1565: error in identifying file 
'/u02/oradata/INFR/RSTD/RSTD/spfileRSTD.ora'
ORA-27037: unable to obtain file status
SVR4 Error: 2: No such file or directory
Additional information: 3
starting Oracle instance without parameter file for retrieval of spfile
RMAN-571: ===========================================================
RMAN-569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-571: ===========================================================
RMAN-3002: failure of startup command at 02/05/2010 10:06:16
RMAN-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 2013
Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.
connected to target database (not started)
RMAN> startup nomount
startup failed: ORA-01078: failure in processing system parameters
LRM-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 spfile
Oracle instance started
Total System Global Area     368263168 bytes
Fixed Size                     1336596 bytes
Variable Size                117443308 bytes
Database Buffers             239075328 bytes
Redo Buffers                  10407936 bytes

OK,到这里。

推荐阅读
  • 本文介绍了如何在MySQL中将零值替换为先前的非零值的方法,包括使用内联查询和更新查询。同时还提供了选择正确值的方法。 ... [详细]
  • 本文介绍了如何使用Power Design(PD)和SQL Server进行数据库反向工程的方法。通过创建数据源、选择要反向工程的数据表,PD可以生成物理模型,进而生成所需的概念模型。该方法适用于SQL Server数据库,对于其他数据库是否适用尚不确定。详细步骤和操作说明可参考本文内容。 ... [详细]
  • 使用Ubuntu中的Python获取浏览器历史记录原文: ... [详细]
  • 本文由编程笔记小编整理,介绍了PHP中的MySQL函数库及其常用函数,包括mysql_connect、mysql_error、mysql_select_db、mysql_query、mysql_affected_row、mysql_close等。希望对读者有一定的参考价值。 ... [详细]
  • 本文介绍了Oracle数据库中tnsnames.ora文件的作用和配置方法。tnsnames.ora文件在数据库启动过程中会被读取,用于解析LOCAL_LISTENER,并且与侦听无关。文章还提供了配置LOCAL_LISTENER和1522端口的示例,并展示了listener.ora文件的内容。 ... [详细]
  • Spring特性实现接口多类的动态调用详解
    本文详细介绍了如何使用Spring特性实现接口多类的动态调用。通过对Spring IoC容器的基础类BeanFactory和ApplicationContext的介绍,以及getBeansOfType方法的应用,解决了在实际工作中遇到的接口及多个实现类的问题。同时,文章还提到了SPI使用的不便之处,并介绍了借助ApplicationContext实现需求的方法。阅读本文,你将了解到Spring特性的实现原理和实际应用方式。 ... [详细]
  • Java String与StringBuffer的区别及其应用场景
    本文主要介绍了Java中String和StringBuffer的区别,String是不可变的,而StringBuffer是可变的。StringBuffer在进行字符串处理时不生成新的对象,内存使用上要优于String类。因此,在需要频繁对字符串进行修改的情况下,使用StringBuffer更加适合。同时,文章还介绍了String和StringBuffer的应用场景。 ... [详细]
  • Oracle分析函数first_value()和last_value()的用法及原理
    本文介绍了Oracle分析函数first_value()和last_value()的用法和原理,以及在查询销售记录日期和部门中的应用。通过示例和解释,详细说明了first_value()和last_value()的功能和不同之处。同时,对于last_value()的结果出现不一样的情况进行了解释,并提供了理解last_value()默认统计范围的方法。该文对于使用Oracle分析函数的开发人员和数据库管理员具有参考价值。 ... [详细]
  • MyBatis错题分析解析及注意事项
    本文对MyBatis的错题进行了分析和解析,同时介绍了使用MyBatis时需要注意的一些事项,如resultMap的使用、SqlSession和SqlSessionFactory的获取方式、动态SQL中的else元素和when元素的使用、resource属性和url属性的配置方式、typeAliases的使用方法等。同时还指出了在属性名与查询字段名不一致时需要使用resultMap进行结果映射,而不能使用resultType。 ... [详细]
  • 本文详细介绍了在ASP.NET中获取插入记录的ID的几种方法,包括使用SCOPE_IDENTITY()和IDENT_CURRENT()函数,以及通过ExecuteReader方法执行SQL语句获取ID的步骤。同时,还提供了使用这些方法的示例代码和注意事项。对于需要获取表中最后一个插入操作所产生的ID或马上使用刚插入的新记录ID的开发者来说,本文提供了一些有用的技巧和建议。 ... [详细]
  • 本文介绍了一个在线急等问题解决方法,即如何统计数据库中某个字段下的所有数据,并将结果显示在文本框里。作者提到了自己是一个菜鸟,希望能够得到帮助。作者使用的是ACCESS数据库,并且给出了一个例子,希望得到的结果是560。作者还提到自己已经尝试了使用"select sum(字段2) from 表名"的语句,得到的结果是650,但不知道如何得到560。希望能够得到解决方案。 ... [详细]
  • 本文详细介绍了Spring的JdbcTemplate的使用方法,包括执行存储过程、存储函数的call()方法,执行任何SQL语句的execute()方法,单个更新和批量更新的update()和batchUpdate()方法,以及单查和列表查询的query()和queryForXXX()方法。提供了经过测试的API供使用。 ... [详细]
  • 高质量SQL书写的30条建议
    本文提供了30条关于优化SQL的建议,包括避免使用select *,使用具体字段,以及使用limit 1等。这些建议是基于实际开发经验总结出来的,旨在帮助读者优化SQL查询。 ... [详细]
  • 本文介绍了通过mysql命令查看mysql的安装路径的方法,提供了相应的sql语句,并希望对读者有参考价值。 ... [详细]
  • 本文讨论了在数据库打开和关闭状态下,重新命名或移动数据文件和日志文件的情况。针对性能和维护原因,需要将数据库文件移动到不同的磁盘上或重新分配到新的磁盘上的情况,以及在操作系统级别移动或重命名数据文件但未在数据库层进行重命名导致报错的情况。通过三个方面进行讨论。 ... [详细]
author-avatar
唐旭阳一一一滴泪15
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有