[Experiment-video process] oracle hot backup-entire database-backup and recovery operation demonstration
[Experiment-video process] oracle hot backup-entire database-backup and recovery operation demonstration
First, check the data version and location of the data file.
Supports hot backup of entire tablespace in version 10g or above
select * from v$version;select name from v$datafiles;
Confirm whether the archive mode is used
Archive log list; view
If the archive mode is not changed
shutdown immediate;startup mount;alter database archivelog;alter system set log_archive_start=true scope=spfile;
One tablespace backup is as follows:
Start backing up data files
alter tablespace system begin backup;host cp /u01/app/oracle/oradata/orcl/system01.dbf /home/backup/xuejiayue/;alter tablespace system end backup;
End backup
Backup Control File
Back up as a binary file
alter database backup controlfile to '/home/backup/xuejiayue/controlfile.bin';
Backup as an ascii file
alter database backup controlfile to trace;
Force log switching and Archiving
alter system archive log current;
OK. The operation starts and the entire database performs hot backup.
Back up the entire database
alter database begin backup;select name from v$datafile;
The following statement is very practical and can be directly copied and executed in shell.
----select 'host cp '||name||' /home/backup/xuejiayue/' from v$datafile;
host cp /u01/app/oracle/oradata/orcl/*.dbf /home/backup/xuejiayue/alter database end backup;
Force log switching and Archiving
alter system switch logfile;
View Current Time
select to_char(sysdate,'yyyy-mm-dd:hh24:mi:ss') from dual;
View All system tablespaces
select * from v$tablespace;
Simulate the absence of deleting system tablespace files
host rm -rf /u01/app/oracle/oradata/orcl/system01.dbf
Delete tablespace ()
drop tablesapce aa including contents and datafiles;
Disable analog power-down
shutdown abort;
-Restore start
Start to mount status
startup mount;
Restore Files
-Restore
host cp /home/backup/xuejiayue/*.dbf /u01/app/oracle/oradata/orcl/
Database recovery
recover database auto;
If you know the time, you can directly restore it to the time.
recover database until time '2015-10-18:20:32:26';
Start Database
alter database open
Or
alter database open resetlogs;
Recovery completed
Video:
Http://v.youku.com/v_show/id_XMTM2MzE5ODQ1Ng==.html? From = y1.7-1.2