Implementation history of Oracle Database automatic backup

Source: Internet
Author: User
Problem description: Implementation of Oracle automatic backup script. Error 1: MessagefileRMAN. msbnotfoundVerifythatOracle_HOMEissetproperly ...... Cause of error: the automatically executed commands cannot identify the corresponding commands. You must explicitly declare the Oracle environment variables in the automatic backup script. Error 2:

Problem description: Implementation of Oracle automatic backup script. Error 1: Message file RMAN. msb not found Verify that Oracle_HOME is set properly ...... Cause of error: the automatically executed commands cannot identify the corresponding commands. You must explicitly declare the Oracle environment variables in the automatic backup script. Error 2:

Problem description:

Oracle automatic backup script implementation.

Error 1:

Message file RMAN. msb not found

Verify that Oracle_HOME is set properly

......

Error cause:

Automatically executed commands cannot be identified. You must explicitly declare the Oracle environment variables in the automatic backup script.

Error 2:

Standard in must be a tty

......

Error cause:

You cannot use su or MPs queues in cron. You must move the su command to the shell script.

Error 3:

Argument Value Description
-----------------------------------------------------------------------------
Target quoted-string connect-string for target database
Catalog quoted-string connect-string for recovery catalog
Nocatalog none if specified, then no recovery catalog
Invalid file quoted-string name of input command file
Log quoted-string name of output message log file
Trace quoted-string name of output debugging message log file
Append none if specified, log is opened in append mode
Debug optional-args activate debugging
Msgno none show RMAN-nnnn prefix for all messages
Send quoted-string send a command to the media manager
Pipe string building block for pipe names
Timeout integer number of seconds to wait for pipe input
Checksyntax none check the command file for syntax errors
-----------------------------------------------------------------------------
Both single and double quotes ('or ") are accepted for a quoted-string.
Quotes are not required unless the string contains embedded white-space.
RMAN-00571: ========================================================== ==============================
RMAN-00569: ==================== error message stack follows ==========================
RMAN-00571: ========================================================== ==============================
RMAN-00556: cocould not open into file "backup_ar.rcv"
......

Error cause:

You must specify the absolute path in the upload file. You cannot directly use the file name or directly use the file name because the external file called by the shell script is in the same directory ./

Correct sample code:

1. # cron File

0 ****/home/Oracle/bak_sh/backup_ar.sh

# Indicates that a full backup is performed on the database archiving day at every day.

2. Enter the shell file with the file name backup_ar.sh.

Export Oracle_HOME =/home/u01/app/Oracle/product/10.2.0/db_1
Export Oracle_SID = test
Export LANG = en_US.UTF-8
/Home/u01/app/Oracle/product/10.2.0/db_1/bin/rman partition file = backup_ar.rcv

3. rman backup script

Connect target/
Connect catalog rman/rman @ rman
Run {
Allocate channel d1 device type disk;
SQL 'alter system archive log current ';
Backup archivelog all delete input
Format '/opt/rmanback/full _ % u _ % p _ % c. AC' filesperset = 3;
Release channel d1;
}

Solution:

1. Two Methods

First, use the root crontab, */2 ***** a. sh -- "su-Oracle-c a. sh

First, add the Oracle environment to a. sh.

2. cron test:

Instance:

Vi/etc/cron. minly/new. sh

Content:

Su-Oracle-c "/home/Oracle/mginfo. sh"

Vi/home/Oracle/mginfo. sh

Content:

Exp mginfotech/mginfotech file = mginfotech. dmp log = mginfotech. log

Vi/etc/crontab

Content:

59 23 *** root run-parts/etc/cron. minly

Run at every night

Cron cannot read environment variables

Export environment variable displayed in shell

Export Oracle_HOME =/opt/ora9/product/9.2

Export Oracle_SID = Oracle

Export NLS_LANG = xxxxx

Then try again

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.