User-managed backups (consistent backup, non-consistent backup, offline backup, online Backup) _ Database Other

Source: Internet
Author: User
1. backing up a database
Concept: A backup of all data files and control files for a database, as well as the backup of parameter files and password files
Note: Do not back up the redo log when you back up the database.
1.1 Consistent backup
Concept: Database Consistent backup refers to the method of shutting down all data files and control files for a database backup. When usingSHUTDOWNAfter the command closes the database properly, all database files are currentlyScnValues are exactly the same, so a closed database backup is called a database consistent backup or a cold backup.
Apply:Archivelog、Noarchivelog
Select name from v$datafile Union select name from V$controlfile;
Shutdown immediate;
CopyFile
Startup
1.2 non-consistent backup
Concept: Refers to theOPENThe method of backing up all data files and control files of the database in the state. Because inOPENState, the database content changes at any time, resulting in different database files of the currentScnValue is completely different, the database backup at open time is called a database non-conformance backup.
Apply:ArchivelogMode.
Select name from V$datafile;
ALTER DATABASE begin backup;
CopyFile
Alter database backup Controlfile to ';
ALTER DATABASE end backup;
Alter system archive log current;


2. Backup Table Space
Concept: Refers to the database inOPENThe method of backing up the data file when the state is used.
Apply:ArchivelogMode.
Note: You can back up all the data files for the tablespace, or you can back up a data file in the table space.
2.1 Offline Backup
Concept: Refers to when the table space isOFFLINEState, the process of backing up all data files or individual data files in a table space.
Apply:ArchivelogMode.
Advantages: Fewer redo logs will be generated.
Disadvantages: Business operations that affect the tablespace. (BecauseSYSTEMand are using theUNDOTable space cannot be taken offline)
Select file_name from Dba_data_files where tablespace_name= ' USERS ';
Alter TABLESPACE users offline;
CopyFile
Alter tablespace users online;
2.2 Online Backup
Concept: Refers to when the table space isONLINEState, the process of backing up all data files or individual data files in a table space.
Apply:Archivelog mode.
span> benefits: Does not affect the business operations on the table space.
span> disadvantage: Will generate more redo information and archive information.
S Elect file_name from Dba_data_files where tablespace_name= ' USERS ';
Alter TABLESPACE users begin backup;
Copy file
Alter tablespace users end backup;

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.