Oracle Rman Backup and restore scenario

Source: Internet
Author: User

1, modify the Rman configuration, can recover to 7 days of any point in time
Su-oracle
Rman Target/
Configure retention policy to recovery windows of 7 days;
Show All;

2. Create backup database and archive log Rman script Online_database_archivelog.rman
#创建备份目录
Mkdir-pv/backup/oraclebk/database
Mkdir-pv/backup/oraclebk/archivelog
Chown-r Oracle.oinstall
Su-oracle
mkdir scripts
CD scripts
Vim Online_database_archivelog.rman
#rman脚本内容
Run {
Allocate channel T1 type disk;
Allocate channel T2 type disk;
Backup as compressed backupset database format '/backup/oraclebk/database/database.%t.%u.rman ';
Backup as compressed backupset archivelog all Delete all input format '/backup/oraclebk/archivelog/archivelog.%t.%u.rman ‘;
}
Delete NoPrompt obsolete;
#delete noprompt obsolete; Delete an invalid or outdated backup set

3. Create a backup shell script
Su-oracle
mkdir scripts
CD scripts
Vim rman_backup.sh
#shell脚本内容
#!/bin/bash
SOURCE ~/.bash_profile
Rman target/@/home/oracle/scripts/online_database_archivelog.rman >/home/oracle/scripts/backup.log

4. Add Scheduled Tasks daily 04:00 backup
Su-oracle
Crontab-e
XX * sh/home/oracle/scripts/rman_backup.sh >/dev/null 2>&1

5. Perform incomplete recovery based on point in time (requires archive log and redo log complete, RAC environment needs to close another instance)
Run {
Shutdown immediate;
startup Mount;
Set until Time = "to_date (' 02-02-18 16:20:00 ', ' dd-mm-yy hh24:mi:ss ')";
Restore database;
Recover database;
ALTER DATABASE open resetlogs;
}

Oracle Rman Backup and restore scenario

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.