Restore an Oracle database to a point in time or to an SCN

Source: Internet
Author: User

Alter session set nls_date_format= ' Yyyymmdd hh24:mi:ss ';

Select Sysdate from dual;

Conn dbauser/123456; Just a single user, and then delete one of the tables for testing.

drop table test;

Rman target/

startup Mount;

Restore database; Restoring a data file

SQL ' alter session set nls_date_format= "YYYYMMDD hh24:mi:ss"; Because it executes in Rman, SQL "is required;

Recover database until time ' 20110414 11:33:56 '; Recover data to this time, after execution need to regenerate redo log file

SQL ' ALTER DATABASE open resetlogs ';

The SCN refers to the system change number, which is used by the Oracle database to record the state and trajectory of the database in the past time

Conn/as SYSDBA

Select Dbms_flashback.get_system_chage_number from dual;

Select To_char (Scn_to_timestamp (963959), ' Yyyy-mm-dd HH24:MI:SS ') from dual; Convert SCN to TIME

SELECT * FROM (select TIME_DP,SCN to Smon_scn_time ORDER by time_dp Desc) where rownum<10; Find the appropriate SCN number based on the user's time to delete data

Rman target/

startup Mount;

Restore database; Restoring a data file

Recover database until SCN 963915;

SQL ' ALTER DATABASE open resetlogs '; Regenerate redo log files

Restore an Oracle database to a point in time or to an SCN

Related Article

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.