----要查询数据库在归档模式下
SQL> archive log list
Database log mode Archive Mode
Automatic archival Enabled
Archive destination /u01/app/oracle/product/11.2.0/dbhome_1/dbs/arch
Oldest online log sequence 15
Next log sequence to archive 17
Current log sequence 17
SQL>
----查看rman参数
RMAN> show all;
using target database control file instead of recovery catalog
RMAN configuration parameters for database with db_unique_name ORA 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_ORA.f'; # default
RMAN>
----rman参数修改
RMAN> CONFIGURE CONTROLFILE AUTOBACKUP on;---打开控制文件和参数文件的自动备份
----通过rman备份system表空间
RMAN> BACKUP AS BACKUPSET FORMAT '/home/oracle/ts_system_%U' TABLESPACE
2> system;
Starting backup at 15-DEC-16
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=18 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/ORA/system01.dbf
channel ORA_DISK_1: starting piece 1 at 15-DEC-16
channel ORA_DISK_1: finished piece 1 at 15-DEC-16
piece handle=/home/oracle/ts_system_09rnhd8r_1_1 tag=TAG20161215T115923 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:25
Finished backup at 15-DEC-16
Starting Control File and SPFILE Autobackup at 15-DEC-16
piece handle=/home/oracle/ks/ORA/autobackup/2016_12_15/o1_mf_s_930657588_d5459nvv_.bkp comment=NONE
Finished Control File and SPFILE Autobackup at 15-DEC-16
--(查看拷贝的文件)
----list backup of tablespace system
------- ---- -- ---------- ----------- ------------ ---------------
8 Full 646.34M DISK 00:00:25 15-DEC-16
BP Key: 8 Status: AVAILABLE Compressed: NO Tag: TAG20161215T115923
Piece Name: /home/oracle/ts_system_09rnhd8r_1_1
List of Datafiles in backup set 8
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- --------- ----
1 Full 1274398 15-DEC-16 /u01/app/oracle/oradata/ORA/system01.dbf
RMAN>
---查看备份的文件
----拷贝的system的文件
[oracle@zh ~]$ ll
total 662512
drwxr-xr-x 3 oracle oinstall 4096 Dec 14 19:48 ks
-rw-r----- 1 oracle oinstall 677740544 Dec 15 11:59 ts_system_09rnhd8r_1_1
[oracle@zh ~]$
----拷贝的控制文件和参数文件
[oracle@zh 2016_12_15]$ pwd
/home/oracle/ks/ORA/autobackup/2016_12_15
[oracle@zh 2016_12_15]$ ll
total 9616
-rw-r----- 1 oracle oinstall 9830400 Dec 15 11:59 o1_mf_s_930657588_d5459nvv_.bkp
[oracle@zh 2016_12_15]$
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/31399171/viewspace-2130652/
,如需转载,请注明出处,否则将追究法律责任。