About database Cold backup vs. Hot backup

Source: Internet
Author: User

One, cold backup
  
A cold backup occurs when the database has been shut down properly and provides us with a complete database when it shuts down normally. Cold backup is a statement that copies critical files to another location. The fastest and safest method for backing up Oracle information for cold backups. The advantages of cold backup are:
  
1, is very fast backup method (just copy files)
2, easy to file (simple copy can)
3, easy to restore to a certain point in time (just copy the file back)
4, can combine with the archiving method, do the database "best state" recovery.
5, low maintenance, high security.
  
However, cold backup also has the following disadvantages:
  
1, when used alone, can only provide to "a point in time" recovery.
2, re-implementation of the whole process of backup, the database must be backed up and not be able to do other work. In other words, during a cold backup, the database must be off state.
3, if the disk space is limited, can only be copied to the tape and other external storage devices, the speed will be very slow.
4, can not be recovered by the table or by the user.
  
If possible (mainly for efficiency), you should back up the information to disk, then start the database (making the user work) and copy the backed up information to tape (the database will work at the same time as the copy). Files that must be copied in a 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 a cold backup must be done in the case of a database shutdown, and that performing a database file system backup is not valid when the database is in an open state.
  
Here is a complete example of a cold backup.
  
(1) Closing the database
Sqlplus/nolog
Sql>connect/as SYSDBA
Sql>shutdown Normal;
  
(2) use copy command to back up all time files, redo log files, control files, initialize parameter files
Sql>cp
  
(3) Restart Oracle database
Sql>startup
  
Second, hot backup
  
A hot backup is a method of backing up a database using the Archivelog mode mode in the case of a database run. So, if you have a cold backup last night and you have today's hot backup files, you can use this data to recover more information in the event of a problem. Hot backup requires the database to operate in Archivelog mode and requires a large amount of file space. Once the database is running in the Archivelog state, it can be backed up. The command file for a hot backup consists of three parts:
  
1. Data file a table space for a table space backup.
  
(1) Set table space as backup state
(2) Backing up table space data files
(3) The reply table space is the normal state
  
2. Backup Archive log file
  
(1) Temporarily stop the archive process
(2) Log those files in the archive Rede log target directory
(3) Restart the archive process
(4) Backing up the archived redo log file
  
3. The advantages of using the ALTER DATABASE Bachup controlfile command to back up the control file hot backup are:
  
1. Backup is available at the table space or database file level, and the backup time is short.
2. The database can still be used when backing up.
3. Can reach a second level of recovery (to a point in time).
4. Recover from virtually any database entity
5. Recovery is fast and in most cases the love database is still working when recovering.
  
The disadvantages of hot backup are:
  
1. No mistakes, or serious consequences.
2. If the hot backup is unsuccessful, the resulting results are not available for point-in-time recovery
3. Because it is difficult to maintain, so be careful carefully, do not promise "to fail."

About database Cold backup vs. Hot 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.