概要:
数据库版本:11.2.0.4
系统:centos7.5
设置控制文件自动备份:
RMAN> show all;
using target database control file instead of recovery catalog
RMAN configuration parameters for database with db_unique_name ORCL are:
CONFIGURE RETENTION POLICY TO REDUNDANCY 1; # default
CONFIGURE BACKUP OPTIMIZATION OFF; # default
CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default
CONFIGURE CONTROLFILE AUTOBACKUP ON;
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '%F'; # default
CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET; # default
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE MAXSETSIZE TO UNLIMITED; # default
CONFIGURE ENCRYPTION FOR DATABASE OFF; # default
CONFIGURE ENCRYPTION ALGORITHM 'AES128'; # default
CONFIGURE COMPRESSION ALGORITHM 'BASIC' AS OF RELEASE 'DEFAULT' OPTIMIZE FOR LOAD TRUE ; # default
CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default
CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/u01/app/oracle/product/11.2.0/db_1/dbs/snapcf_orcl.f'; # default
1.备份(使用本次备份实验):
[oracle@oracle11g backup]$ rman target /
Recovery Manager: Release 11.2.0.4.0 - Production on Tue Mar 30 22:57:06 2021
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
connected to target database: ORCL (DBID=1589281755)
RMAN> backup database;
Starting backup at 30-MAR-21
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=38 device type=DISK
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00001 name=/u01/app/oracle/oradata/orcl/system01.dbf
input datafile file number=00002 name=/u01/app/oracle/oradata/orcl/sysaux01.dbf
input datafile file number=00003 name=/u01/app/oracle/oradata/orcl/undotbs01.dbf
input datafile file number=00004 name=/u01/app/oracle/oradata/orcl/users01.dbf
channel ORA_DISK_1: starting piece 1 at 30-MAR-21
channel ORA_DISK_1: finished piece 1 at 30-MAR-21
piece handle=/u01/app/oracle/fast_recovery_area/ORCL/backupset/2021_03_30/o1_mf_nnndf_TAG20210330T225845_j66h57w0_.bkp tag=TAG20210330T225845 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:57
Finished backup at 30-MAR-21
Starting Control File and SPFILE Autobackup at 30-MAR-21
piece handle=/u01/app/oracle/fast_recovery_area/ORCL/autobackup/2021_03_30/o1_mf_s_1068591583_j66h6zrt_.bkp comment=NONE
Finished Control File and SPFILE Autobackup at 30-MAR-21
RMAN> exit
后滚恢复
1.创建测试表test0330(时间点30 23:00:50 2021)
[oracle@oracle11g ~]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.4.0 Production on Tue Mar 30 23:00:50 2021
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> create table test0330 as select * from v$datafile;
Table created.
2.rman基于时间点恢复数据库
不过这次在本机恢复至22:30:00 2021,备份时间为Mar 30 22:57:06 2021(恢复后肯定是不会出现表test0330的,首先时间就不对)
重启至nomount状态