Show All Of Rman

Show All Of Rman 
1)change date format.
1@@@@
[oracle@station60 ~]$ vim .bash_profile 
@@@add this line
export NLS_DATE_FORMAT='yyyy-mm-dd hh24:mi:ss'
[oracle@station60 ~]$ . .bash_profile
 
 
2)retention policy of rman.
1@@@@keep one copy of backup always.
@@@little people use this way.
RMAN> show all; 
CONFIGURE RETENTION POLICY TO REDUNDANCY 1; # default
 
2@@@@assure exist backupset recovery database to 24 hours before.
RMAN> show all;
CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 1 DAYS;
RMAN> report need backup days 1;
RMAN> report need backup
RMAN> report obsolete recovery window of 2 days; 
RMAN> report obsolete;
 
 
@@@you must backup file to sbt and you must in the catalog. 
@@@you could retain forever or a time.
RMAN> change backupset 463 keep forever logs;
RMAN> change backupset 463 keep until time 'sysdate+6' logs;
 
@@@Note:you should keep the recovery window time period less than 
@@@or equal to the value of the control file parameter
@@@CONTROL_FILE_RECORD_KEEP_TIME to prevent the record of
@@@older backups from being overwritten in the control file.
@@@recovery window of x days,x <= control_file_record_keep_time.
SQL> show parameter control
NAME                                 TYPE        VALUE
------------------------------------ ----------- 
control_file_record_keep_time        integer     7
 
@@@the v$session_longops record the long query.
SQL> select * from  v$session_longops
SQL> desc v$session_longops
 Name                                      Null?    Type
 ----------------------------------------- --------
 SID                                                NUMBER
 SERIAL#                                            NUMBER
 OPNAME                                             VARCHAR2(64)
.......................
 
@@@there must always exist one backup which satisfies 
@@@the following condition:
@@@SYSDATE - checkpoint_time <= recovery_window(1 day= 24 hours)
SQL> select checkpoint_time,file# from v$datafile;
CHECKPOINT_TIME          FILE#
------------------- ----------
2011-12-19 10:21:37          1
2011-12-19 10:21:37          2
2011-12-19 10:21:37          3
2011-12-19 11:12:05          4 @@@TEMP
2011-12-19 10:21:37          5
2011-12-19 10:21:37          6
 
SQL> select sysdate from dual; 
SYSDATE
-------------------
2011-12-19 12:44:13
 
 
3)show others
1@@@@
RMAN> SHOW CONTROLFILE AUTOBACKUP FORMAT;
RMAN> SHOW EXCLUDE;
RMAN> SHOW ALL;
@@@reset to default setting.
RMAN> CONFIGURE BACKUP OPTIMIZATION CLEAR;
RMAN> CONFIGURE MAXSETSIZE CLEAR;
RMAN> CONFIGURE DEFAULT DEVICE TYPE CLEAR;
 
 
4)autobackup controlfile.
1@@@@
@@@"%F" is the default crontrol file name.
@@@This variableformat translates into c-IIIIIIIIII-YYYYMMDD-QQ,
@@@where:
@@@IIIIIIIIII stands for the DBID
@@@YYYYMMDD is a time stamp of the day the backup is generated
@@@QQ is the hex sequence that starts with 00 and has a maximum of FF
RMAN> show all; 
RMAN> CONFIGURE CONTROLFILE AUTOBACKUP ON;
RMAN> CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE
      DISK TO '/u01/oradata/cf_ORCL_auto_%F';
@@@
@@@Note:recovery database using autobackup crontrolfile =>
@@@incomplete recovery,it would reset logfiles.
 
 
5)parallelism 
1@@@@
@@@parallelism > number of datafile.
@@@the backupset would independent with each other.
RMAN> show all; 
RMAN> CONFIGURE DEVICE TYPE DISK PARALLELISM 10;
RMAN> CONFIGURE CHANNEL DEVICE TYPE DISK
2>    MAXPIECESIZE 2G;
@@@
RMAN> run{
2> allocate channel c1 device type sbt;
3> allocate channel c2 device type sbt;
4> allocate channel c3 device type sbt;
5> backup incremental level 0
6> (datafile 1,4,5 channel c1)
7> (datafile 2 channel c2)
8> (datafile 3 channel c3);
9> release channel c1;     @@@not necessary.
10> release channel c2; 
11> release channel c3; 
12> }
 
 
6)compress backup.
1@@@@
@@@tape driver already compressed the file.
@@@if you compressed again,
@@@it cost 3 times time to uncompress than before.
@@@so less people to compresss backupset.
RMAN> BACKUP AS COMPRESSED BACKUPSET DATABASE;
RMAN> CONFIGURE DEVICE TYPE DISK PARALLELISM 2
2>    BACKUP TYPE TO COMPRESSED BACKUPSET;
 
 
7)optimization
1@@@@
@@@if tablespace offline,then process would do not backup it.
@@@less usage.Just for save the disk space.
RMAN> CONFIGURE BACKUP OPTIMIZATION on ; 
 
 
8)maxsize and piecesize 
1@@@@
@@@maxsize always nochange.
RMAN> show all;
CONFIGURE MAXSETSIZE TO  UNLIMITED;
@@@
@@@make backup to pieces for record backup to cdrom.
RMAN> run{
2> allocate channel c1 device type disk maxpiecesize 100M; 
3> backup tablespace users; 
4> release channel c1; 
5> }
 
 
9)exclude tablespace
1@@@@
@@@if you exclude some tablespace,backup database would exclude it.
@@@but if you backup it directly,it allow.
RMAN> configure exclude for tablespace users;
RMAN> show all;
CONFIGURE EXCLUDE FOR TABLESPACE 'USERS';
RMAN> show exclude; 
RMAN configuration parameters are:
CONFIGURE EXCLUDE FOR TABLESPACE 'USERS';
@@@cancel 
RMAN> configure exclude for tablespace users clear; 

你可能感兴趣的:(rman,configure)