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

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

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 的两种情况下的恢复成功。

linux

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
How do you alter a table in MySQL using the ALTER TABLE statement?How do you alter a table in MySQL using the ALTER TABLE statement?Mar 19, 2025 pm 03:51 PM

The article discusses using MySQL's ALTER TABLE statement to modify tables, including adding/dropping columns, renaming tables/columns, and changing column data types.

How do I configure SSL/TLS encryption for MySQL connections?How do I configure SSL/TLS encryption for MySQL connections?Mar 18, 2025 pm 12:01 PM

Article discusses configuring SSL/TLS encryption for MySQL, including certificate generation and verification. Main issue is using self-signed certificates' security implications.[Character count: 159]

How do you handle large datasets in MySQL?How do you handle large datasets in MySQL?Mar 21, 2025 pm 12:15 PM

Article discusses strategies for handling large datasets in MySQL, including partitioning, sharding, indexing, and query optimization.

What are some popular MySQL GUI tools (e.g., MySQL Workbench, phpMyAdmin)?What are some popular MySQL GUI tools (e.g., MySQL Workbench, phpMyAdmin)?Mar 21, 2025 pm 06:28 PM

Article discusses popular MySQL GUI tools like MySQL Workbench and phpMyAdmin, comparing their features and suitability for beginners and advanced users.[159 characters]

How do you drop a table in MySQL using the DROP TABLE statement?How do you drop a table in MySQL using the DROP TABLE statement?Mar 19, 2025 pm 03:52 PM

The article discusses dropping tables in MySQL using the DROP TABLE statement, emphasizing precautions and risks. It highlights that the action is irreversible without backups, detailing recovery methods and potential production environment hazards.

How do you create indexes on JSON columns?How do you create indexes on JSON columns?Mar 21, 2025 pm 12:13 PM

The article discusses creating indexes on JSON columns in various databases like PostgreSQL, MySQL, and MongoDB to enhance query performance. It explains the syntax and benefits of indexing specific JSON paths, and lists supported database systems.

How do you represent relationships using foreign keys?How do you represent relationships using foreign keys?Mar 19, 2025 pm 03:48 PM

Article discusses using foreign keys to represent relationships in databases, focusing on best practices, data integrity, and common pitfalls to avoid.

How do I secure MySQL against common vulnerabilities (SQL injection, brute-force attacks)?How do I secure MySQL against common vulnerabilities (SQL injection, brute-force attacks)?Mar 18, 2025 pm 12:00 PM

Article discusses securing MySQL against SQL injection and brute-force attacks using prepared statements, input validation, and strong password policies.(159 characters)

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
2 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
2 weeks agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool

DVWA

DVWA

Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

SecLists

SecLists

SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

Safe Exam Browser

Safe Exam Browser

Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

MinGW - Minimalist GNU for Windows

MinGW - Minimalist GNU for Windows

This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.