Oracle uses RMAN for automatic backup

Source: Internet
Author: User
1. Log On As an Oracle user. 2. Write an automatic backup script and clear the archived logs $ vihomeoraclebacks. sh #! Binshsourcehomeoracle. bash_profi

1. Log On As an Oracle user. 2. Write an automatic backup script and clear the archived logs $ vi/home/oracle/backs. sh #! /Bin/shsource/home/oracle/. bash_profi

Homepage → Database Technology

Background:

Read News

Oracle uses RMAN for automatic backup

[Date: 2012-01-04] Source: Linux Author: chen3888015 [Font:]

1. Log On As an Oracle user

2. Compile an automatic backup script and clear the archived logs.

$ Vi/home/oracle/backs. sh

#! /Bin/sh
Source/home/oracle/. bash_profile
Cd $ ORACLE_HOME/bin
Rman target/nocatalog msglog =/home/oracle/rman_bk _ 'date' + % Y % m % d % H % M % s'. log < Run {
Report obsolete;
DELETE force noprompt obsolete;
Allocate channel c1 type disk;
Allocate channel c2 type disk;
Allocate channel c3 type disk;
Backup incremental level = 0 database tag 'level0' format'/home/oracle/dblevel0 _ % s _ % T ';
Backup current controlfile tag 'ctl 'format'/home/oracle/ctl _ % s _ % p _ % T ';
SQL 'alter system archive log current ';
Crosscheck archivelog all;
Backup filesperset 3 archivelog all tag 'arch 'format'/home/oracle/oarch _ % u _ % s _ % P' delete input;
Release channel c1;
Release channel c2;
Release channel c3;
}
Exit;
EOF

Note:

The last format of the log file name is bk _ year, month, hour, minute, second. log

Rman_bk_20120102101501.log
ID of the % s backup set
% T backup set Timestamp
% T year month day format (YYYYMMDD)
3. Set RMAN to automatically run the script for saving the database

Vi/home/oracle/runback. sh

#! /Bin/sh
Source/home/oracle/backs. sh

4. Set the script execution time for automatic RMAN backup. The time here is every day.

Crontab-e

3 10 ***/home/oracle/runback. sh

  • 0
  • ORA-16014: log 4 sequence #1 not archived Solution

    Oracle Execution Plan notes

    Oracle Basics

    Image Information

    View All comments in this article (0)

    Comments

    Latest Information

    Popular this week

    Introduction to Linux community-advertisement service-website map-help Info-contact us
    The articles published on this site (LinuxIDC) do not mean that they agree with the statement or description. They only provide more information and do not constitute any suggestions.


    Copyright©2006-2011 Linux community All rights reserved Zhejiang ICP backup No. 06018118

    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.