首页 数据库 mysql教程 spfile 和pfile 在数据库open和shutdown 的两种情况下的恢复成功

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

Jun 07, 2016 pm 05:08 PM

本实验室做当数据库在 open 和shutdown 的两种情况下spfile 和pfile 丢失的情况下的恢复。oracle@aoracle dbs]$ rman target rma

本实验室做当数据库在 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;

于 2011 年 12 月 8 日开始恢复
使用目标数据库控制文件而不是恢复目录
分配的通道:ORA_DISK_1
通道 ORA_DISK_1:sid=36 devtype=DISK

RMAN-00571:=============================================== ================
RMAN-00569: =============== 错误消息堆栈如下 ======== =======
RMAN-00571:======================================== =======================
RMAN-03002:在 12/08/2011 20:06:44
RMAN- 恢复命令失败06495:必须使用 SET DBID 命令显式指定 DBID

RMAN>设置 dbid 4046377924

执行命令:SET DBID

RMAN>从自动备份恢复spfile;

于 2011 年 12 月 8 日开始恢复
使用通道 ORA_DISK_1

频道 ORA_DISK_1:寻找当天的自动备份:20111208
频道 ORA_DISK_1:寻找当天的自动备份:20111207
频道 ORA_DISK_1:寻找当天的自动备份:20111206
频道 ORA_DISK_1:寻找当天的自动备份:20111205
通道 ORA_DISK_1:正在寻找自动备份日期:20111204
通道 ORA_DISK_1:正在寻找自动备份日期:20111203
通道 ORA_DISK_1:正在寻找自动备份日期:20111202
通道 ORA_DISK_1:否自动备份在发现 7 天
RMAN-00571:============================================ ===================
RMAN-00569: =============== 错误消息堆栈如下 ===== ==========
RMAN-00571: =================================== ==========================
RMAN-03002:在 12/08/2011 20:07:18 时恢复命令失败
RMAN-06172:找不到自动备份或指定的句柄不是有效的副本或片段

RMAN>从 '/u02/rman/ctl_c-4046377924-20111208-00' 恢复 spfile;

于 2011 年 12 月 8 日开始恢复
使用通道 ORA_DISK_1

通道 ORA_DISK_1:找到自动备份:/u02/rman/ctl_c-4046377924-20111208-00
通道 ORA_DISK_1:从自动备份恢复 SPFILE 已完成
已于 2011 年 12 月 8 日完成恢复

RMAN>

pfile从spfile创建就可以了。

========
总结: spfile 和 pfile 在数据库打开和关闭的两种情况下的成功恢复。

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

本站声明
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn

热AI工具

Undresser.AI Undress

Undresser.AI Undress

人工智能驱动的应用程序,用于创建逼真的裸体照片

AI Clothes Remover

AI Clothes Remover

用于从照片中去除衣服的在线人工智能工具。

Undress AI Tool

Undress AI Tool

免费脱衣服图片

Clothoff.io

Clothoff.io

AI脱衣机

AI Hentai Generator

AI Hentai Generator

免费生成ai无尽的。

热门文章

R.E.P.O.能量晶体解释及其做什么(黄色晶体)
1 个月前 By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O.最佳图形设置
1 个月前 By 尊渡假赌尊渡假赌尊渡假赌
威尔R.E.P.O.有交叉游戏吗?
1 个月前 By 尊渡假赌尊渡假赌尊渡假赌

热工具

记事本++7.3.1

记事本++7.3.1

好用且免费的代码编辑器

SublimeText3汉化版

SublimeText3汉化版

中文版,非常好用

禅工作室 13.0.1

禅工作室 13.0.1

功能强大的PHP集成开发环境

Dreamweaver CS6

Dreamweaver CS6

视觉化网页开发工具

SublimeText3 Mac版

SublimeText3 Mac版

神级代码编辑软件(SublimeText3)

说明InnoDB全文搜索功能。 说明InnoDB全文搜索功能。 Apr 02, 2025 pm 06:09 PM

InnoDB的全文搜索功能非常强大,能够显着提高数据库查询效率和处理大量文本数据的能力。 1)InnoDB通过倒排索引实现全文搜索,支持基本和高级搜索查询。 2)使用MATCH和AGAINST关键字进行搜索,支持布尔模式和短语搜索。 3)优化方法包括使用分词技术、定期重建索引和调整缓存大小,以提升性能和准确性。

如何使用Alter Table语句在MySQL中更改表? 如何使用Alter Table语句在MySQL中更改表? Mar 19, 2025 pm 03:51 PM

本文讨论了使用MySQL的Alter Table语句修改表,包括添加/删除列,重命名表/列以及更改列数据类型。

与MySQL中使用索引相比,全表扫描何时可以更快? 与MySQL中使用索引相比,全表扫描何时可以更快? Apr 09, 2025 am 12:05 AM

全表扫描在MySQL中可能比使用索引更快,具体情况包括:1)数据量较小时;2)查询返回大量数据时;3)索引列不具备高选择性时;4)复杂查询时。通过分析查询计划、优化索引、避免过度索引和定期维护表,可以在实际应用中做出最优选择。

可以在 Windows 7 上安装 mysql 吗 可以在 Windows 7 上安装 mysql 吗 Apr 08, 2025 pm 03:21 PM

是的,可以在 Windows 7 上安装 MySQL,虽然微软已停止支持 Windows 7,但 MySQL 仍兼容它。不过,安装过程中需要注意以下几点:下载适用于 Windows 的 MySQL 安装程序。选择合适的 MySQL 版本(社区版或企业版)。安装过程中选择适当的安装目录和字符集。设置 root 用户密码,并妥善保管。连接数据库进行测试。注意 Windows 7 上的兼容性问题和安全性问题,建议升级到受支持的操作系统。

如何为MySQL连接配置SSL/TLS加密? 如何为MySQL连接配置SSL/TLS加密? Mar 18, 2025 pm 12:01 PM

文章讨论了为MySQL配置SSL/TLS加密,包括证书生成和验证。主要问题是使用自签名证书的安全含义。[角色计数:159]

哪些流行的MySQL GUI工具(例如MySQL Workbench,PhpMyAdmin)是什么? 哪些流行的MySQL GUI工具(例如MySQL Workbench,PhpMyAdmin)是什么? Mar 21, 2025 pm 06:28 PM

文章讨论了流行的MySQL GUI工具,例如MySQL Workbench和PhpMyAdmin,比较了它们对初学者和高级用户的功能和适合性。[159个字符]

InnoDB中的聚类索引和非簇索引(次级索引)之间的差异。 InnoDB中的聚类索引和非簇索引(次级索引)之间的差异。 Apr 02, 2025 pm 06:25 PM

聚集索引和非聚集索引的区别在于:1.聚集索引将数据行存储在索引结构中,适合按主键查询和范围查询。2.非聚集索引存储索引键值和数据行的指针,适用于非主键列查询。

您如何处理MySQL中的大型数据集? 您如何处理MySQL中的大型数据集? Mar 21, 2025 pm 12:15 PM

文章讨论了处理MySQL中大型数据集的策略,包括分区,碎片,索引和查询优化。

See all articles