修改RMAN默认备份路径;
RMAN> show all; RMAN configuration parameters for database with db_unique_name CENTOS 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/dbhome_1/dbs/snapcf_centos.f'; # default RMAN> configure channel device type disk format'/u01/app/oracle/flash/centos_db%U.rman'; new RMAN configuration parameters: CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT '/u01/app/oracle/flash/centos_db%U.rman'; new RMAN configuration parameters are successfully stored released channel: ORA_DISK_1 RMAN> show all; RMAN configuration parameters for database with db_unique_name CENTOS 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 CHANNEL DEVICE TYPE DISK FORMAT '/u01/app/oracle/flash/centos_db%U.rman'; 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/dbhome_1/dbs/snapcf_centos.f'; # default RMAN>
RMAN全库备份(在mount状态下备份);
centos@SYS> shutdown immediate Database closed. Database dismounted. ORACLE instance shut down. centos@SYS> startup mount ORACLE instance started. Total System Global Area 830930944 bytes Fixed Size 2257800 bytes Variable Size 587205752 bytes Database Buffers 239075328 bytes Redo Buffers 2392064 bytes Database mounted. centos@SYS>
[oracle@centos ~]$ rman target / Recovery Manager: Release 11.2.0.4.0 - Production on Mon Mar 27 15:25:30 2017 Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved. connected to target database: CENTOS (DBID=3235228290, not open) RMAN> backup as backupset database include current controlfile plus archivelog format '/u01/app/oracle/flash/centos_db%U.rman'; Starting backup at 27-MAR-17 using target database control file instead of recovery catalog allocated channel: ORA_DISK_1 channel ORA_DISK_1: SID=20 device type=DISK channel ORA_DISK_1: starting archived log backup set channel ORA_DISK_1: specifying archived log(s) in backup set input archived log thread=1 sequence=11 RECID=2 STAMP=939479870 input archived log thread=1 sequence=12 RECID=14 STAMP=939489582 input archived log thread=1 sequence=13 RECID=12 STAMP=939489582 input archived log thread=1 sequence=14 RECID=13 STAMP=939489582 channel ORA_DISK_1: starting piece 1 at 27-MAR-17 channel ORA_DISK_1: finished piece 1 at 27-MAR-17 piece handle=/u01/app/oracle/flash/centos_db0gs06kuf_1_1.rman tag=TAG20170327T152919 comment=NONE channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01 channel ORA_DISK_1: starting archived log backup set channel ORA_DISK_1: specifying archived log(s) in backup set input archived log thread=1 sequence=1 RECID=19 STAMP=939575132 input archived log thread=1 sequence=2 RECID=20 STAMP=939575132 channel ORA_DISK_1: starting piece 1 at 27-MAR-17 channel ORA_DISK_1: finished piece 1 at 27-MAR-17 piece handle=/u01/app/oracle/flash/centos_db0hs06kuh_1_1.rman tag=TAG20170327T152919 comment=NONE channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01 channel ORA_DISK_1: starting archived log backup set channel ORA_DISK_1: specifying archived log(s) in backup set input archived log thread=1 sequence=1 RECID=21 STAMP=939643390 input archived log thread=1 sequence=2 RECID=22 STAMP=939730648 channel ORA_DISK_1: starting piece 1 at 27-MAR-17 channel ORA_DISK_1: finished piece 1 at 27-MAR-17 piece handle=/u01/app/oracle/flash/centos_db0is06kui_1_1.rman tag=TAG20170327T152919 comment=NONE channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01 Finished backup at 27-MAR-17 Starting backup at 27-MAR-17 using channel ORA_DISK_1 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/centos/system01.dbf input datafile file number=00002 name=/u01/app/oracle/oradata/centos/sysaux01.dbf input datafile file number=00005 name=/u01/app/oracle/oradata/centos/example01.dbf input datafile file number=00003 name=/u01/app/oracle/oradata/centos/undotbs01.dbf input datafile file number=00006 name=/u01/app/oracle/oradata/centos/t1.dbf input datafile file number=00007 name=/u01/app/oracle/oradata/centos/t2.dbf input datafile file number=00004 name=/u01/app/oracle/oradata/centos/users01.dbf channel ORA_DISK_1: starting piece 1 at 27-MAR-17 channel ORA_DISK_1: finished piece 1 at 27-MAR-17 piece handle=/u01/app/oracle/flash/centos_db0js06kuj_1_1.rman tag=TAG20170327T152923 comment=NONE channel ORA_DISK_1: backup set complete, elapsed time: 00:00:07 channel ORA_DISK_1: starting full datafile backup set channel ORA_DISK_1: specifying datafile(s) in backup set including current control file in backup set channel ORA_DISK_1: starting piece 1 at 27-MAR-17 channel ORA_DISK_1: finished piece 1 at 27-MAR-17 piece handle=/u01/app/oracle/flash/centos_db0ks06kuq_1_1.rman tag=TAG20170327T152923 comment=NONE channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01 Finished backup at 27-MAR-17 Starting backup at 27-MAR-17 using channel ORA_DISK_1 specification does not match any archived log in the repository backup cancelled because there are no files to backup Finished backup at 27-MAR-17 Starting Control File and SPFILE Autobackup at 27-MAR-17 piece handle=/u01/app/oracle/flash/CENTOS/autobackup/2017_03_27/o1_mf_s_939741898_dfkhtwsg_.bkp comment=NONE Finished Control File and SPFILE Autobackup at 27-MAR-17 RMAN>
[oracle@centos ~]$ cd /u01/app/oracle/flash/ [oracle@centos flash]$ ls CENTOS centos_db0is06kui_1_1.rman redoa1.log centos_db0gs06kuf_1_1.rman centos_db0js06kuj_1_1.rman redob2.log centos_db0hs06kuh_1_1.rman centos_db0ks06kuq_1_1.rman redoc3.log [oracle@centos flash]$ ll total 1450764 drwxr-x---. 6 oracle oinstall 4096 Mar 27 14:55 CENTOS -rw-r-----. 1 oracle oinstall 31782912 Mar 27 15:29 centos_db0gs06kuf_1_1.rman -rw-r-----. 1 oracle oinstall 30154240 Mar 27 15:29 centos_db0hs06kuh_1_1.rman -rw-r-----. 1 oracle oinstall 43504640 Mar 27 15:29 centos_db0is06kui_1_1.rman -rw-r-----. 1 oracle oinstall 1213030400 Mar 27 15:29 centos_db0js06kuj_1_1.rman -rw-r-----. 1 oracle oinstall 9797632 Mar 27 15:29 centos_db0ks06kuq_1_1.rman -rw-r-----. 1 oracle oinstall 52429312 Mar 27 12:30 redoa1.log -rw-r-----. 1 oracle oinstall 52429312 Mar 27 12:31 redob2.log -rw-r-----. 1 oracle oinstall 52429312 Mar 27 12:31 redoc3.log [oracle@centos flash]$