Archive mode: Restores data files that are not backed up.

Source: Internet
Author: User
Scenario: 1. archive is enabled for the database; 2. All archived logs are online after the data file is created; 3. No backup is performed for the data file or tablespace, and no full database backup is performed for the database.

Scenario: 1. archive is enabled for the database; 2. All archived logs are online after the data file is created; 3. No backup is performed for the data file or tablespace, and no full database backup is performed for the database.

Scenario:

1. Open archiving for databases;

2. All archived logs after data files are created are online;

3. Data Files Or tablespaces have not been backed up, the database has not been backed up in full, and data files are abnormally lost;


Steps:

Create a tablespace for testing:
SQL> create tablespace bbb datafile '/opt/Oracle/oradata/R11203/bbb. dbf'size 100 m;

SQL> create table test_ B (id number (10) tablespace bbb;

SQL> insert into test_ B values (1 );

SQL> commit;
SQL> select name, file # from v $ datafile;

Name file #

--------------------------------------------------------------------------------
/Opt/oracle/oradata/R11203/aaa. dbf 10

/Opt/oracle/oradata/R11203/bbb. dbf 11

11 rows selected.


SQL> host

Delete data files, simulate abnormal loss

Bash-4.2 $ ls-al/opt/oracle/oradata/R11203/bbb. dbf

-Rw ---- 1 oracle dba 10493952 Apr 4/opt/oracle/oradata/R11203/bbb. dbf

Bash-4.2 $ mv/opt/oracle/oradata/R11203/bbb. dbf/opt/oracle/oradata/R11203/bbb. dbf. bak

Bash-4.2 $ sqlplus/as sysdba

SQL * Plus: Release 11.2.0.3.0 Production on Fri Apr 409: 55: 03 2014

Copyright (c) 1982,201 1, Oracle. All rights reserved.

Connected:

Oracle Database 11g Enterprise Edition Release 11.2.0.3.0-64bit Production

With the Partitioning, OLAP, Data Mining and Real
Application Testing options

SQL> alter tablespace bbb read only;

Alter tablespace bbb read only

*

ERROR at line 1:

ORA-01116: error in opening database file 11

ORA-01110: data file 11:
'/Opt/oracle/oradata/R11203/bbb. dbf'

ORA-27041: unable to open file

HPUX-ia64 Error: 2: No such file or directory

Additional information: 3

SQL> shutdown immediate;

ORA-01116: error in opening database file 11

ORA-01110: data file 11:
'/Opt/oracle/oradata/R11203/bbb. dbf'

ORA-27041: unable to open file

HPUX-ia64 Error: 2: No such file or directory

Additional information: 3

SQL> select status from v $ instance;

STATUS

------------

OPEN


SQL> alter system switch logfile;

System altered.

SQL>/

System altered.

SQL>/

System altered.

SQL>/

System altered.

SQL>/

System altered.

SQL>/

System altered.

SQL>

Shutdown

SQL> shutdown immediate;

ORA-01116: error in opening database file 11

ORA-01110: data file 11:
'/Opt/oracle/oradata/R11203/bbb. dbf'

ORA-27041: unable to open file

HPUX-ia64 Error: 2: No such file or directory

Additional information: 3

SQL> shutdown abort;

ORACLE instance shut down.

Start the database to the mount status.

SQL> startup mount;

ORACLE instance started.


Total System Global Area 329859072 bytes

FixedSize 2182336 bytes

VariableSize 285213504 bytes

DatabaseBuffers 37748736 bytes

RedoBuffers 4714496 bytes

Database mounted.

Use alter database create datafile <> as... to recreate the lost data file:

SQL> alter database create datafile 11;

Database altered.

Restore data files through archiving logs and redo logs

SQL> recover datafile 11;

Media recovery complete.

SQL> alter database open;

Database altered.

SQL> select * from test_ B;

ID

----------

1

Install Oracle 11gR2 (x64) in CentOS 6.4)

Steps for installing Oracle 11gR2 in vmwarevm

Install Oracle 11g XE R2 In Debian

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.