Oracle database Hot Backup and recovery (online Backup) sample

Source: Internet
Author: User
Oracle Database Hot backup (online backup) sample

Log must be placed as an archive
Sql>archive log list; --View the log archiving method.
Database log mode No Archive mode
Automatic Archival Disabled
Archive Destination Use_db_recovery_file_dest
Oldest online log sequence 106
Current log Sequence 108
Sql>alter system Set Log_archive_start=true scope=spfile--Enable automatic archiving
Sql>shutdown Immediate
Sql>startup Mount--Starts the database, opens the control file, does not open the data file
Sql>alter DB archivelog--switch database to archive mode
Sql>alter database open; --Open Database
Sql>archive log list;
Database Log Mode Archive mode
Automatic Archival Enabled
Archive Destination Use_db_recovery_file_dest
Oldest online log sequence 106
Next Log sequence to archive 108
Current log Sequence 108
Sql>alter tablespace TT begin backup; --TT table Space Backup.
Sql>alter tablespace TT end backup;
Sql>alter System archive Log current; --Archive The current online log and switch logs.
Sql>alter system switch logfile; --Switch Second log
Sql>alter system switch logfile; --Switch Third log
Sql>shutdown immediate;
If the tt.dbf file is corrupted.
Sql>startup
Ora-01157:cannot identify/lock data file 6-see DBWR trace file
Ora-01110:data file 6: ' C:\ORACLE\ORADATA\TEST\TT. DBF '
Sql>select * from V$recover_file;
file# ONLINE Online_error change# time
---------- ------- ------------------------- ----------- -------------
6 Online online FILE not FOUND 0
Sql>alter Database datafile 6 offline drop;
Sql>alter database open;
--Restores the backup file to the original path
Sql>recover DataFile 6;
Sql>alter database datafile 6 online;

Sql>alter database backup controlfile to trace; --Backup control file to \udmp\.
Sql>start C:\create_ctl.sql--Rebuild control file

--log file is missing
Sql>recover database until Cancel
Sql>alter Database Open Resetlogs

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.