[Experiment-video process] oracle hot backup-entire database-backup and recovery operation demonstration

Source: Internet
Author: User

[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

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.