Oracle -- easily graffiti on rman (tips and backup)

Source: Internet
Author: User

The concept and advantages of rman are not copied or pasted. If you are interested, You can google it. This article mainly describes how readers think during the experiment.

The following rman files are based on nocatalog. In short, the use of nocatalog replaces the use of controlfile to record the backup information of rman.

First, the practical commands of rman are as follows:
1. In rman, you can directly start up and shutdown [abort/transaction/immediate]

2. host. After rman is logged on, you can enter the OS prompt after entering the host. If you want to return to rman, you can try again.

3. SQL 'alter system ********************** '. In this way, you can execute SQL statements in rman. (Using the select statement in rman is ineffective. Most of them are configuration items, such as 'alter database open)

Rman Configuration:
1. show all. You should know this even if it's a little white ...... Shows all the current configuration of rman. If # default is followed when the configuration information is displayed, it indicates that this is the initial configuration of rman and has not been changed.

2. The configure command is used to change the configuration of rman. It should also be a very common command. The configuration determines the specific action during Backup!
Here I did an experiment: by default
Configure retention policy to redundancy 1; # default
I typed the following command:
Configure retention policy to redundancy 1; (it seems meaningless)
Later, show all will display:
Configure retention policy to redundancy 1;
Although the configuration is the same, # default does not exist ......, What should I do if I want to restore the default value?
The answer is: configure retention policy clear;
In addition, the redundancy POLICY can be set TO the number OF backups (as shown above) or the time-based: configure retention policy to recovery window of 3 DAYS;
Another thing to mention about the redundancy policy is that if we use the same nocatalog as the author, the backup information will be stored in the control file ,. The parameter CONTROL_FILE_RECORD_KEEP_TIME indicates the minimum storage time of the record in the control file. The default value is 7 days. That is to say, if the space is insufficient, overwrite the record, some information may be overwritten, And the redundancy policy will be affected. Therefore, set this parameter as needed. For example, if the redundancy policy is based on time, we recommend that the value of CONTROL_FILE_RECORD_KEEP_TIME be greater than the time value of the redundancy policy.

Rman backup operations:
1. list
To view the backup information, you can view the backup information, or the image copy information (I will explain about backup and copy later), including list the backups that have been expired. (For more information about expired)
For example:
List backup [of database/tablespace name/datafile number];
List copies
List expired backup

2. report
This is a legacy problem in the ocp era. Why do we have to separate the report and list? Okay, just remember it. Reports are commonly used in combination with need backp and obsolete.
For example:
Report obsolete
Report need backup [days 7/days = 7/redundancy 2] need backup reports based on the redundancy policy by default. Of course, you can also manually specify it.

3. crosscheck
Command for checking backup set information. It mainly checks whether the rman backup set information exists on the hard disk. If it does not exist, it indicates that the backup set is marked as expired, indicating that the backup is lost or damaged. Normally available
(We can see that the expired indicates that the backup is physically unavailable, damaged, or lost, while the obsolete indicates that rman uses the redundancy policy to determine which backups are redundant, note that expired is used with list, while obsolete is used with report)
For example:
Crosscheck backup [of database/tablespace name/datafile number];

4. delete
Delete.
For example:
Delete obsolete;
Delete expired backup;
Delete backup of tablespace users;

5. noprompt
This command is also very practical. It is equivalent to the-f parameter used in combination with rm in linux. this parameter is often added during the delete operation when writing a script. Otherwise, yes/no is required, that is, silent.

Rman backup:
The basic operations will not be demonstrated, and g will be everywhere. I mainly record my thoughts after the experiment.

1. backup and copy
Backup is called backup. The backup made by rman is suffixed with bkp, and copy, that is, image copy is suffixed with dbf, that is, data files, simply put, copy is an OS-level copy and paste, which is no different from hot backup. I feel that backup should be used a little more.

2. Incremental Backup
Incremental Backup:
Two types: DIFFERENTIAL Incremental Backup (DIFFERENTIAL) and CUMULATIVE incremental backup (CUMULATIVE), each of which has a level of 0 1 2.
Differential Incremental Backup recognizes backup at the same level as your own (level 1 backup is based on the last level 1 Incremental backup, if Level 1 is the last one ), cumulative Incremental backup is not recognized (level 1 backup is based on the last level 0 instead of level 1 backup, even if there is Level 1 backup ). If the type is not specified, incremental differential backup is used by default.
For example:
Backup incremental level = 2 cumulative database;

3. Archive backup
The first is my own experience, which is related to the Environment Parameter NLS_LANG. Specifically, the author executes backup archivelog all in case of database mount. After the database is opened (open), the same statement fails to be executed. The error message is database not set, after investigation, the NLS_LANG must be set in the same form as the database, and then backed up. I broke the casserole and changed the NLS_LANG. rman could not be logged in, and then changed to null. rman successfully logged in and backed up ...... So far, this magical experience is unknown. Anyway, I remember to set NLS_LANG as a database ......

Then the author, as a little white, was funny to execute the delete all input ...... Later I realized that I had to put it in a backup statement, and put it behind the backup statement ...... Generally, backup archivelog all delete all input can be deleted during backup archiving. If you use delete all input for common data files, an error is returned.

4. duplex backup
I thought this was just a simple number of copies for the backup piece. I didn't expect many things to be shared with you during my experiments.
1. the command should be run {}, and its scope is its own code block, without affecting the execution of other code, if you enter this statement directly at the rman> prompt, an error is returned.
2. there are more copies and redundancy and copies. One backup only generates a backup, but stores it in different names or places. That is to say, this statement has nothing to do with redundancy.
3. in this case, you must specify the name or directory of the backup part. If you back up the backup tablespace users directly, it is usually backed up directly to the recovery area, but after copies is specified, an error is reported, ORA-19806: cannot make duplex backups in recovery area, if you only specify the name (backup format '% U',' % U' tablespace users ), then the backup will be put under $ ORACLE_HOME/dbs.

I think: I have been writing this article for a long time without knowing it. I want to write the restoration into it. Let's take a look at the article. In fact, it is not very difficult to use rman, however, there are still many channels in rman that can be studied in depth, such as backup optimization and compression backup. Here I am just a bit familiar with rman, which is the most basic use, wait until you have time to study it.
This article is from the "oracle journey forward" blog

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.