Oracle data Implementation online database backup method

Source: Internet
Author: User

Online database backup

Once the database runs in Archivelog mode, it can be backed up when it is open and available to the user. This feature allows the continuous operation of the database to be archived and to ensure its recoverability. Online hot backup should be scheduled for the minimum user activity time period.

Online hot backup consists of three processes, that is, table-space backup of data files, backup archive redo log files, and backup control files.

1. Backing up data files by table space

This process can be divided into four steps, that is, the query table space includes which data files, set the table space for backup status, backup table space data files, restore the table space to the normal state.
(1) What data files are included in the query table space
Execute command Select Tablespace_name,file_name from Dba_data_files to get all the data files in the system and the tablespace in which they belong.
(2) Set table space to backup state
Execute command ALTER TABLESPACE TABLESPACE_NAME begin backup to set table space Tablespace_name to backup state.
(3) Data files for the backup table space

Perform the operating system's file backup command to back up the data files in the tablespace.
(4) Restore the tablespace to its normal state
The Execute command ALTER TABLESPACE Tablespace_name end Backup restores the tablespace tablespace_name to its normal state.

2. Backup Archive Redo log file

This process can be divided into three steps, that is, to suspend the archive process arch, backup archive redo log files.
(1) Suspend the archive process arch
Execute Command archive log stop suspend archive process arch.
(2) record the list of archived log files in the target directory
You can query the V$log dynamic dictionary view. If the log is fully archived, the V$log archived column will contain a Yes value. You can select the highest archive log (using the sequence# column) from V$log and use it as the basis for the backup file manifest. For example, if V$log indicates that sequence#2334 is the last archived log file, you can successfully back up files in the archive redo log target directory with all the numbers below 2334. If you attempt to back up 2335, you can make a successful backup at the operating system level, but since this file is not fully archived, the backup may be written in half and therefore cannot be useful during the recovery operation.
(3) Restart the archive process arch
Execute Command archive log start to launch the archive process arch.
(4) Backup archive redo log file
Perform the operating system file backup command Backup archive redo log file.
(5) Delete archived log files that have been backed up from the archive target directory

3. Backing up control files

Execute command ALTER DATABASE backup Controlfile to Destinantion/control.bak for online backup control files. You can also execute ALTER DATABASE backup Controlfile to trace writes the command for create Controlfile to the trace file in the database


How to open a database after an online hot backup failure

Because the table space is still in hot backup state.
  
Simulation Phenomena and Solutions:
  
First set the database to archive mode
  

  code is as follows copy code
C:>SVRMGRL   
Svrmgrl>connect Internal
svrmgrl>alter tablespace table space name begin backup;

-The table space hot standby mode shuts down the database forcibly, causing errors
Svrmgrl>shutdown abort

Svrmgrl>startup Mount

-Empty This table   The data file between is set to end backup mode
Svrmgrl>alter database datafile ' table space data file name ';
  
-or perform tablespace media recovery
svrmgrl>recover tablespace table space name;

Svrmgrl>alter database open;
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.