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