Various Oracle backup terms, Oracle backup terms

Source: Internet
Author: User

Various Oracle backup terms, Oracle backup terms

Terms
Full database backup: includes all data files and at least one control file (remember that all control files in the database are the same)

Partial database backup: It may include zero or multiple tablespaces, zero or multiple data files, or control files.

Full backup: Creates a copy of each data block in the file that contains the data and is located in the file to be backed up.

Incremental Backup:
Creates copies for all data blocks that have changed since a previous backup. Oracle DB supports two levels of Incremental Backup (0 and 1 ). One-level Incremental Backup can be one of two types: "cumulative" or "differential ". A cumulative backup is used to back up all changes that have occurred since the last backup of level 0. Differential backup is used to back up all changes that have occurred since the last Incremental Backup (which can be level 0 or Level 1 backup ).


Offline backup (also known as "cold" backup or "consistent" backup ):
Indicates the backup performed when the database is not opened. Consistent backup is called because the system change number (SCN) in the data file header matches the SCN in the control file during Backup.

Online backup (also known as "hot" backup or "inconsistent" backup ):
Indicates the backup performed when the database is opened. This is called a non-consistent backup because data files and control files cannot be synchronized when the database is opened. Non-consistent backup must be used after recovery.

Image copy: Refers to a copy of data or archived log files (similar to copying files using only operating system commands ).


Backup set:
A collection of one or more binary files, including one or more data files, control files, server parameter files, or archive log files. When a backup set is used, no empty data blocks are stored, so the backup set occupies less space on disk or tape. By compressing backup sets, You can further reduce the backup space requirements.


The image copy must be backed up to the disk. A backup set can be sent to a disk or directly to a tape.


The advantage of storing backups as image copies is that it can improve the granularity of restoration operations. When using image copies, you only need to retrieve files from the backup location. When using the backup set, you must first retrieve the entire backup set from the backup location before extracting the required files.
The advantage of storing backups as backup sets is that space can be used better. In most databases, 20% or more data blocks are empty. The image copy backs up each data block, even if the data block is empty. Backup sets can significantly reduce the space required for backup. In most systems, the advantage of backup sets is greater than that of image copies.


Oracle backup and recovery

Backup: (run in cmd)
Exp fdais/fdais file = bakdb20100902.dmp directory = D: \ baksql
Path for saving the file name generated after the user name and password are backed up

Create the same tablespace, username, and password on another machine as before.
(You can run the create database Command to regenerate the DATABASE structure)

Restore: (execute the following command under cmd to re-import the backed up database)
Imp fdais/fdais file = bakdb20100902.dmp directory = D: \ baksql log = bakdb20100902.log
Log generated automatically after the backup of the user name and password
Note that the D: \ baksql directory contains the bakdb20100902.dmp and bakdb20100902.log files.

In addition, you can use the select * from user_all_tables statement to query the table space.

The above backup and recovery process does not need to stop the database.

Taking oracle as an example, what is the main means of system backup?

Oracle hot backup and cold backup

Cold backup occurs when the database is shut down normally. When the database is shut down normally, it will provide us with a complete database. This article describes how to copy key files to another location during cold backup. The fastest and safest way to back up Oracle information during cold backup. Advantages of cold backup:

1. It is a very fast backup method (just copy files)
2. Easy to archive (simple copy)
3. It is easy to restore to a certain point in time (you only need to copy the file back)
4. It can be combined with the archiving method to restore the database in the "best state.
5. Low maintenance and high security.

However, cold backup also has the following shortcomings:

1. When used separately, only recovery at a certain time point can be provided.
2. During the whole backup process, the database must be backed up instead of other work. That is to say, in the cold backup process, the database must be closed.
3. If the disk space is limited, it can only be copied to tape and other external storage devices, and the speed will be very slow.
4. data cannot be restored by table or by user.

If possible (mainly for efficiency), back up the information to the disk, start the database (allowing the user to work), and copy the backup information to the tape, the database can also work ). Files that must be copied in cold backup include:

1. All data files
2. All control files
3. All online redo log files
4. Init. ora file (optional)

It is worth noting that cold backup must be performed when the database is closed. When the database is turned on, the execution of database file system backup is invalid.

The following is a complete example of cold backup.

(1) shut down the database
Sqlplus/nolog
SQL> connect/as sysdba
SQL> shutdown normal;

(2) Use the Copy command to back up all the time files, redo log files, control files, and initialize parameter files.
SQL> cp

(3) restart the Oracle database
SQL> startup

Ii. Hot Backup

Hot Backup is used to back up the database in archivelog mode when the database is running. Therefore, if you have a cold backup file last night and a hot backup file today, you can use this data to restore more information when a problem occurs. Hot Backup requires that the database be operated in Archivelog mode and requires a large amount of archive space. Once the database is running in the archivelog state, you can back up the database. The Hot Backup command file consists of three parts:

1. Backup of one tablespace and one tablespace in a data file.

(1) set the tablespace to the backup state.
(2) back up the data files in the tablespace
(3) restore the tablespace to the normal state.

2. Back up archive log files

(1) temporarily stop the archiving process
(2) files in the archive rede log target directory under log
(3) restart the archive Process
(4) back up the archived redo log file

3. Use the alter database bachup controlfile command to back up and control files. The advantages of Hot Backup are:

1. Data can be backed up at the tablespace or database file level. The backup time is short.
2. The database is still available during Backup.
3. It can be restored in seconds (to a specific point in time ).
4. Restore almost all database entities
5. Recovery is fast. In most cases, apsaradb recovers when it is still working.

Hot Backup is insufficient:

1. No error is allowed; otherwise, the consequences are serious.
2. If the Hot Backup fails, the result cannot be used for restoration at a time point.
3. Because it is difficult to maintain, you must be careful not to "end with failure ".... Remaining full text>

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.