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