spfile 和pfile 在数据库open和shutdown 的两种情况下的恢复成功。

2023-11-29 13:18

本文主要是介绍spfile 和pfile 在数据库open和shutdown 的两种情况下的恢复成功。,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

本实验室做当数据库在 open 和shutdown 的两种情况下spfile 和pfile 丢失的情况下的恢复。

oracle@aoracle dbs]$ rman target rman_user/rman_user;

Recovery Manager: Release 10.2.0.1.0 - Production on Thu Dec 8 19:21:38 2011

Copyright (c) 1982, 2005, Oracle.  All rights reserved.

connected to target database: EZHOU (DBID=4046377924, not open)

RMAN> restore spfile;

Starting restore at 08-DEC-11
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=149 devtype=DISK

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of restore command at 12/08/2011 19:21:56
RMAN-06564: must use the TO clause when the instance is started with SPFILE

RMAN> restore spfile to '/u02/rman/spfile.ora' from autobackup;

Starting restore at 08-DEC-11
using channel ORA_DISK_1

channel ORA_DISK_1: looking for autobackup on day: 20111208
channel ORA_DISK_1: autobackup found: /u02/rman/ctl_c-4046377924-20111208-00
channel ORA_DISK_1: SPFILE restore from autobackup complete
Finished restore at 08-DEC-11

RMAN>

把spfile 拷贝到$ORACLE_HOME/dbs下就可以了。

===================

下面进行:数据库处于关闭状态,丢失spfile,pfile

[oracle@aoracle dbs]$ mv spfileezhou.ora spfileezhou.ora_b
[oracle@aoracle dbs]$ mv initezhou.ora initezhou.ora_b

[oracle@aoracle dbs]$ ls -l *ezhou*.ora*
-rw-r--r-- 1 oracle oinstall  986 Dec  6 19:27 initezhou.ora_b
-rw-r----- 1 oracle oinstall 2560 Dec  8 19:38 spfileezhou.ora_b

SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL>

[oracle@aoracle admin]$ sqlplus / as sysdba

SQL*Plus: Release 10.2.0.1.0 - Production on Thu Dec 8 20:01:33 2011

Copyright (c) 1982, 2005, Oracle.  All rights reserved.

Connected to an idle instance.

SQL> startup;
ORA-01078: failure in processing system parameters
LRM-00109: could not open parameter file '/u01/pp/oracle/product/10.2/db_1/dbs/initezhou.ora'
SQL> startup nomount;
ORA-01078: failure in processing system parameters
LRM-00109: could not open parameter file '/u01/pp/oracle/product/10.2/db_1/dbs/initezhou.ora'
SQL> startup force nomount;
ORA-01078: failure in processing system parameters
LRM-00109: could not open parameter file '/u01/pp/oracle/product/10.2/db_1/dbs/initezhou.ora'
SQL> !
[oracle@aoracle admin]$ rman target /

Recovery Manager: Release 10.2.0.1.0 - Production on Thu Dec 8 20:04:10 2011

Copyright (c) 1982, 2005, Oracle.  All rights reserved.

connected to target database (not started)

RMAN> restore spfile from '/u02/rman/ctl_c-4046377924-20111208-00'
2> ;

Starting restore at 08-DEC-11
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of restore command at 12/08/2011 20:05:29
RMAN-12010: automatic channel allocation initialization failed
RMAN-06403: could not obtain a fully authorized session
ORA-01034: ORACLE not available
ORA-27101: shared memory realm does not exist
Linux Error: 2: No such file or directory

RMAN> startup force nomount;

startup failed: ORA-01078: failure in processing system parameters
LRM-00109: could not open parameter file '/u01/pp/oracle/product/10.2/db_1/dbs/initezhou.ora'

starting Oracle instance without parameter file for retrival of spfile
Oracle instance started

Total System Global Area     159383552 bytes

Fixed Size                     1218268 bytes
Variable Size                 54528292 bytes
Database Buffers             100663296 bytes
Redo Buffers                   2973696 bytes

RMAN> restore spfile from autobackup;

Starting restore at 08-DEC-11
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=36 devtype=DISK

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of restore command at 12/08/2011 20:06:44
RMAN-06495: must explicitly specify DBID with SET DBID command

RMAN> set dbid 4046377924

executing command: SET DBID

RMAN> restore spfile from autobackup;

Starting restore at 08-DEC-11
using channel ORA_DISK_1

channel ORA_DISK_1: looking for autobackup on day: 20111208
channel ORA_DISK_1: looking for autobackup on day: 20111207
channel ORA_DISK_1: looking for autobackup on day: 20111206
channel ORA_DISK_1: looking for autobackup on day: 20111205
channel ORA_DISK_1: looking for autobackup on day: 20111204
channel ORA_DISK_1: looking for autobackup on day: 20111203
channel ORA_DISK_1: looking for autobackup on day: 20111202
channel ORA_DISK_1: no autobackup in 7 days found
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of restore command at 12/08/2011 20:07:18
RMAN-06172: no autobackup found or specified handle is not a valid copy or piece

RMAN> restore spfile from '/u02/rman/ctl_c-4046377924-20111208-00';

Starting restore at 08-DEC-11
using channel ORA_DISK_1

channel ORA_DISK_1: autobackup found: /u02/rman/ctl_c-4046377924-20111208-00
channel ORA_DISK_1: SPFILE restore from autobackup complete
Finished restore at 08-DEC-11

RMAN>

pfile 从spfile create 就可以了。

========
总结: spfile 和pfile 在数据库open和shutdown 的两种情况下的恢复成功。

 

这篇关于spfile 和pfile 在数据库open和shutdown 的两种情况下的恢复成功。的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/432964

相关文章

详谈redis跟数据库的数据同步问题

《详谈redis跟数据库的数据同步问题》文章讨论了在Redis和数据库数据一致性问题上的解决方案,主要比较了先更新Redis缓存再更新数据库和先更新数据库再更新Redis缓存两种方案,文章指出,删除R... 目录一、Redis 数据库数据一致性的解决方案1.1、更新Redis缓存、删除Redis缓存的区别二

oracle数据库索引失效的问题及解决

《oracle数据库索引失效的问题及解决》本文总结了在Oracle数据库中索引失效的一些常见场景,包括使用isnull、isnotnull、!=、、、函数处理、like前置%查询以及范围索引和等值索引... 目录oracle数据库索引失效问题场景环境索引失效情况及验证结论一结论二结论三结论四结论五总结ora

C#实现文件读写到SQLite数据库

《C#实现文件读写到SQLite数据库》这篇文章主要为大家详细介绍了使用C#将文件读写到SQLite数据库的几种方法,文中的示例代码讲解详细,感兴趣的小伙伴可以参考一下... 目录1. 使用 BLOB 存储文件2. 存储文件路径3. 分块存储文件《文件读写到SQLite数据库China编程的方法》博客中,介绍了文

Android数据库Room的实际使用过程总结

《Android数据库Room的实际使用过程总结》这篇文章主要给大家介绍了关于Android数据库Room的实际使用过程,详细介绍了如何创建实体类、数据访问对象(DAO)和数据库抽象类,需要的朋友可以... 目录前言一、Room的基本使用1.项目配置2.创建实体类(Entity)3.创建数据访问对象(DAO

SQL Server数据库磁盘满了的解决办法

《SQLServer数据库磁盘满了的解决办法》系统再正常运行,我还在操作中,突然发现接口报错,后续所有接口都报错了,一查日志发现说是数据库磁盘满了,所以本文记录了SQLServer数据库磁盘满了的解... 目录问题解决方法删除数据库日志设置数据库日志大小问题今http://www.chinasem.cn天发

Python读取TIF文件的两种方法实现

《Python读取TIF文件的两种方法实现》本文主要介绍了Python读取TIF文件的两种方法实现,包括使用tifffile库和Pillow库逐帧读取TIFF文件,具有一定的参考价值,感兴趣的可以了解... 目录方法 1:使用 tifffile 逐帧读取安装 tifffile:逐帧读取代码:方法 2:使用

Oracle数据库执行计划的查看与分析技巧

《Oracle数据库执行计划的查看与分析技巧》在Oracle数据库中,执行计划能够帮助我们深入了解SQL语句在数据库内部的执行细节,进而优化查询性能、提升系统效率,执行计划是Oracle数据库优化器为... 目录一、什么是执行计划二、查看执行计划的方法(一)使用 EXPLAIN PLAN 命令(二)通过 S

Spring Security基于数据库验证流程详解

Spring Security 校验流程图 相关解释说明(认真看哦) AbstractAuthenticationProcessingFilter 抽象类 /*** 调用 #requiresAuthentication(HttpServletRequest, HttpServletResponse) 决定是否需要进行验证操作。* 如果需要验证,则会调用 #attemptAuthentica

使用SecondaryNameNode恢复NameNode的数据

1)需求: NameNode进程挂了并且存储的数据也丢失了,如何恢复NameNode 此种方式恢复的数据可能存在小部分数据的丢失。 2)故障模拟 (1)kill -9 NameNode进程 [lytfly@hadoop102 current]$ kill -9 19886 (2)删除NameNode存储的数据(/opt/module/hadoop-3.1.4/data/tmp/dfs/na

MySQL数据库宕机,启动不起来,教你一招搞定!

作者介绍:老苏,10余年DBA工作运维经验,擅长Oracle、MySQL、PG、Mongodb数据库运维(如安装迁移,性能优化、故障应急处理等)公众号:老苏畅谈运维欢迎关注本人公众号,更多精彩与您分享。 MySQL数据库宕机,数据页损坏问题,启动不起来,该如何排查和解决,本文将为你说明具体的排查过程。 查看MySQL error日志 查看 MySQL error日志,排查哪个表(表空间