Learn about Oracle OS backup

Source: Internet
Author: User

Oracle OS backup is a common backup method. The following describes two Oracle OS backup methods: Cold backup and Hot backup ).

Oracle OS backup:

There are two types of Oracle OS backup: Cold backup and Hot backup. The operating system backup is essentially different from the above logical backup. Logical backup extracts data from the database without backing up physical data blocks. Operating system backup copies the entire data file.

I. Cold backup

The database must be completely closed before file-level backup starts. The shutdown operation must be performed with the normal, immediate, and transaction options. Every file used by the database is backed up. These files include:
☆All data files
☆All Control Files
☆All online redo log files
☆Init. ORA file (optional)
The general steps for cold backup are as follows:
A. Shut down the instance to be backed up normally );
B. Back up the entire database to a directory
C. Start the database
For example
SVRMGRL> connect internal
SVRMGRL> shutdown immediate
SVRMGRL>! Cp & lt; file> & lt; backup directory>
Or
SVRMGRL>! Tar cvf/dev/rmt/0/u01/oradata/prod
SVRMGRL> startup

Note: If you use a script to perform a cold backup of the database, you must perform a logical check on the command to close the database. If the command to close the database is not executed properly and the database is not shut down normally, all cold backups will be invalid.

Ii. Hot Backup

Hot Backup is an OS-level data backup that is enabled for the database and valid to the user. Hot Backup can only be used for databases in ARCHIVELOG mode. Before backing up a data file, the corresponding TABLESPACE must use alter tablespace ...... Begin backup is stored as a BACKUP. Then, the data files that make up the tablespace can be copied using commands similar to cold backup. After the data file is copied using an operating system command, use alter tablespace ...... The end backup command disconnects the tablespace from the hot BACKUP mode.
There is no need to back up online logs for hot backup, but it must be archived. Archive logs may be used when the instance is restored. Currently, online logs must be protected or in the mirror state. The current online logs are damaged, which is a huge damage to the database. You can only recover the database with data loss.

Temporary tablespace stores temporary information. In hot backup, you can also avoid backup. If the temporary file fails, you can delete the data file and tablespace and recreate a temporary tablespace. The advantages of Hot Backup are obvious.
---- A. It can be backed up at the tablespace or data file level. The backup time is short.
---- B. The database is still available during Backup.
---- C. The data can be restored to a certain point in time within seconds ).
---- D. Restore almost all database entities.
---- E. Recovery is fast, and recovery is usually performed when the database is still working.

The general steps for hot backup of the operating system are as follows:

① Connect to the database SVRMGRL> connect internal;
② Set the tablespace to be backed up, such as User) to the backup mode SVRMGRL> Alter tablespace User begin backup;
③ Copy the data file SVRMGRL>! Cp/u01/oradata/prod/user01.ora/backup/prod/user01.ora Or $ cp/u01/oradata/prod/user01.ora/backup/prod/user01.ora
④ After the data file is copied, The tablespace is dragged to the backup mode SVRMGRL> Alter tablespace User end backup;
⑤ All tablespaces to be backed up must be repeated for 2, 3, and 4
6. Run the following command to back up the control file alter databse ...... BACKUP CONTROLFILE

For example, backup to a binary file alter database backup controlfile to 'new fielname ';

Backup to text file alter database backup controlfile to trace;

Because the user is still operating the database during hot backup, it is recommended that each tablespace be in the backup state for the shortest time, so that the backup of one tablespace and one tablespace is required, do not make the tablespace in the backup state together and copy data files at the same time.

Note: If the database is interrupted during hot backup, such as power failure, the database will prompt that data files need to be restored when the database is restarted, you need to use alter tablespace to copy the data file in the backup state when the power is being powered off ...... End backup mode. Which data file or tablespace is in the backup state can be obtained through v $ backup and v $ datafile.
 

Importance of Oracle Database Backup

How to Implement ORACLE backup

Oracle backup command to use instances

Oracle single row date functions

Introduction to Oracle bitand () Functions

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.