RECOVER information for data files, finding the logs needed for recovery

Source: Internet
Author: User
Through this script, you can see the information of the data file, find the log to recover the need, etc.
COL file# FORMAT 999
COL STATUS FORMAT 999
COL ERROR FORMAT A10
COL tablespace_name FORMAT A10
COL datafile FORMAT A40
COL NAME FORMAT A30
Set PageSize 200
Set Linesize 180
Set Pause off
Set Serveroutput on
Set feedback on
Set echo on
Set Numformat 999999999999999
Column Today New_val DT
Select To_char (sysdate, ' Yyyy-mm-dd-hh24-mi ') today from dual;
Spool D:\recovery_info_&dt.log
SELECT group#,bytes,archived,first_change#,sequence#,status from V$log;
Select file#, status,checkpoint_change#,last_change# from V$datafile;
Select file#, recover, Fuzzy, checkpoint_change# from V$datafile_header;
Select Group#,substr (member,1,60) from V$logfile;
SELECT * from V$recover_file;
Select checkpoint_change#,resetlogs_change#,controlfile_change# from V$database;
Select distinct status from V$backup;
Select Hxfil Filenumber,fhsta status,fhscn scn,fhrba_seq SEQUENCE from X$KCVFH;
SELECT * from V$recovery_log;
SELECT recid,sequence#,first_change#,next_change# from V$log_history;
SELECT DISTINCT (fuzzy) from V$datafile_header;
SELECT file#, STATUS, ERROR, RECOVER, Tablespace_name, NAME
From V$datafile_header
WHERE RECOVER = ' YES ' OR (RECOVER is null and ERROR are NOT null);
Select File#,status$,crscnbas from file$;
Select Name, Scnbas from ts$;
Spool off

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.