ITPUB论坛-中国最专业的IT技术社区

 
 注册
热搜:
查看: 169|回复: 0

[笔记] rman简单使用

[复制链接]
认证徽章
论坛徽章:
0
跳转到指定楼层
1#
发表于 2017-12-21 22:35 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@localhost PROD]$ rman target /

Recovery Manager: Release 11.2.0.1.0 - Production on Thu Dec 21 22:26:53 2017

Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.

connected to target database: PROD (DBID=374247884)

RMAN> backup database;

Starting backup at 21-DEC-17
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=42 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/PROD/system01.dbf
input datafile file number=00002 name=/u01/app/oracle/oradata/PROD/sysaux01.dbf
input datafile file number=00003 name=/u01/app/oracle/oradata/PROD/undotbs01.dbf
input datafile file number=00005 name=/u01/app/oracle/oradata/PROD/DB_DATA.DBF
input datafile file number=00004 name=/u01/app/oracle/oradata/PROD/users01.dbf
channel ORA_DISK_1: starting piece 1 at 21-DEC-17
channel ORA_DISK_1: finished piece 1 at 21-DEC-17
piece handle=/u01/app/oracle/flash_recovery_area/PROD/backupset/2017_12_21/o1_mf_nnndf_TAG20171221T222703_f3qk5r7o_.bkp tag=TAG20171221T222703 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:45
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
including current SPFILE in backup set
channel ORA_DISK_1: starting piece 1 at 21-DEC-17
channel ORA_DISK_1: finished piece 1 at 21-DEC-17
piece handle=/u01/app/oracle/flash_recovery_area/PROD/backupset/2017_12_21/o1_mf_ncsnf_TAG20171221T222703_f3qk76nk_.bkp tag=TAG20171221T222703 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 21-DEC-17

RMAN> list backup ;


List of Backup Sets
===================


BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
1       Full    969.36M    DISK        00:00:38     21-DEC-17      
        BP Key: 1   Status: AVAILABLE  Compressed: NO  Tag: TAG20171221T222703
        Piece Name: /u01/app/oracle/flash_recovery_area/PROD/backupset/2017_12_21/o1_mf_nnndf_TAG20171221T222703_f3qk5r7o_.bkp
  List of Datafiles in backup set 1
  File LV Type Ckp SCN    Ckp Time  Name
  ---- -- ---- ---------- --------- ----
  1       Full 1028608    21-DEC-17 /u01/app/oracle/oradata/PROD/system01.dbf
  2       Full 1028608    21-DEC-17 /u01/app/oracle/oradata/PROD/sysaux01.dbf
  3       Full 1028608    21-DEC-17 /u01/app/oracle/oradata/PROD/undotbs01.dbf
  4       Full 1028608    21-DEC-17 /u01/app/oracle/oradata/PROD/users01.dbf
  5       Full 1028608    21-DEC-17 /u01/app/oracle/oradata/PROD/DB_DATA.DBF

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
2       Full    9.36M      DISK        00:00:01     21-DEC-17      
        BP Key: 2   Status: AVAILABLE  Compressed: NO  Tag: TAG20171221T222703
        Piece Name: /u01/app/oracle/flash_recovery_area/PROD/backupset/2017_12_21/o1_mf_ncsnf_TAG20171221T222703_f3qk76nk_.bkp
  SPFILE Included: Modification time: 21-DEC-17
  SPFILE db_unique_name: PROD
  Control File Included: Ckp SCN: 1028628      Ckp time: 21-DEC-17

RMAN> backup database format '/u01/app/oracle/rbak/bak_%U';

Starting backup at 21-DEC-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/PROD/system01.dbf
input datafile file number=00002 name=/u01/app/oracle/oradata/PROD/sysaux01.dbf
input datafile file number=00003 name=/u01/app/oracle/oradata/PROD/undotbs01.dbf
input datafile file number=00005 name=/u01/app/oracle/oradata/PROD/DB_DATA.DBF
input datafile file number=00004 name=/u01/app/oracle/oradata/PROD/users01.dbf
channel ORA_DISK_1: starting piece 1 at 21-DEC-17
channel ORA_DISK_1: finished piece 1 at 21-DEC-17
piece handle=/u01/app/oracle/rbak/bak_03smn81d_1_1 tag=TAG20171221T223109 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:45
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
including current SPFILE in backup set
channel ORA_DISK_1: starting piece 1 at 21-DEC-17
channel ORA_DISK_1: finished piece 1 at 21-DEC-17
piece handle=/u01/app/oracle/rbak/bak_04smn82q_1_1 tag=TAG20171221T223109 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 21-DEC-17

RMAN> list backup;


List of Backup Sets
===================


BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
1       Full    969.36M    DISK        00:00:38     21-DEC-17      
        BP Key: 1   Status: AVAILABLE  Compressed: NO  Tag: TAG20171221T222703
        Piece Name: /u01/app/oracle/flash_recovery_area/PROD/backupset/2017_12_21/o1_mf_nnndf_TAG20171221T222703_f3qk5r7o_.bkp
  List of Datafiles in backup set 1
  File LV Type Ckp SCN    Ckp Time  Name
  ---- -- ---- ---------- --------- ----
  1       Full 1028608    21-DEC-17 /u01/app/oracle/oradata/PROD/system01.dbf
  2       Full 1028608    21-DEC-17 /u01/app/oracle/oradata/PROD/sysaux01.dbf
  3       Full 1028608    21-DEC-17 /u01/app/oracle/oradata/PROD/undotbs01.dbf
  4       Full 1028608    21-DEC-17 /u01/app/oracle/oradata/PROD/users01.dbf
  5       Full 1028608    21-DEC-17 /u01/app/oracle/oradata/PROD/DB_DATA.DBF

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
2       Full    9.36M      DISK        00:00:01     21-DEC-17      
        BP Key: 2   Status: AVAILABLE  Compressed: NO  Tag: TAG20171221T222703
        Piece Name: /u01/app/oracle/flash_recovery_area/PROD/backupset/2017_12_21/o1_mf_ncsnf_TAG20171221T222703_f3qk76nk_.bkp
  SPFILE Included: Modification time: 21-DEC-17
  SPFILE db_unique_name: PROD
  Control File Included: Ckp SCN: 1028628      Ckp time: 21-DEC-17

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
3       Full    969.40M    DISK        00:00:39     21-DEC-17      
        BP Key: 3   Status: AVAILABLE  Compressed: NO  Tag: TAG20171221T223109
        Piece Name: /u01/app/oracle/rbak/bak_03smn81d_1_1
  List of Datafiles in backup set 3
  File LV Type Ckp SCN    Ckp Time  Name
  ---- -- ---- ---------- --------- ----
  1       Full 1028788    21-DEC-17 /u01/app/oracle/oradata/PROD/system01.dbf
  2       Full 1028788    21-DEC-17 /u01/app/oracle/oradata/PROD/sysaux01.dbf
  3       Full 1028788    21-DEC-17 /u01/app/oracle/oradata/PROD/undotbs01.dbf
  4       Full 1028788    21-DEC-17 /u01/app/oracle/oradata/PROD/users01.dbf
  5       Full 1028788    21-DEC-17 /u01/app/oracle/oradata/PROD/DB_DATA.DBF

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
4       Full    9.36M      DISK        00:00:02     21-DEC-17      
        BP Key: 4   Status: AVAILABLE  Compressed: NO  Tag: TAG20171221T223109
        Piece Name: /u01/app/oracle/rbak/bak_04smn82q_1_1
  SPFILE Included: Modification time: 21-DEC-17
  SPFILE db_unique_name: PROD
  Control File Included: Ckp SCN: 1029031      Ckp time: 21-DEC-17

RMAN> backup tablespace DB_DATA
2> ;

Starting backup at 21-DEC-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=00005 name=/u01/app/oracle/oradata/PROD/DB_DATA.DBF
channel ORA_DISK_1: starting piece 1 at 21-DEC-17
channel ORA_DISK_1: finished piece 1 at 21-DEC-17
piece handle=/u01/app/oracle/flash_recovery_area/PROD/backupset/2017_12_21/o1_mf_nnndf_TAG20171221T223333_f3qkkxd4_.bkp tag=TAG20171221T223333 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 21-DEC-17

RMAN> list backup of tablespace DB_DATA;


List of Backup Sets
===================


BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
1       Full    969.36M    DISK        00:00:38     21-DEC-17      
        BP Key: 1   Status: AVAILABLE  Compressed: NO  Tag: TAG20171221T222703
        Piece Name: /u01/app/oracle/flash_recovery_area/PROD/backupset/2017_12_21/o1_mf_nnndf_TAG20171221T222703_f3qk5r7o_.bkp
  List of Datafiles in backup set 1
  File LV Type Ckp SCN    Ckp Time  Name
  ---- -- ---- ---------- --------- ----
  5       Full 1028608    21-DEC-17 /u01/app/oracle/oradata/PROD/DB_DATA.DBF

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
3       Full    969.40M    DISK        00:00:39     21-DEC-17      
        BP Key: 3   Status: AVAILABLE  Compressed: NO  Tag: TAG20171221T223109
        Piece Name: /u01/app/oracle/rbak/bak_03smn81d_1_1
  List of Datafiles in backup set 3
  File LV Type Ckp SCN    Ckp Time  Name
  ---- -- ---- ---------- --------- ----
  5       Full 1028788    21-DEC-17 /u01/app/oracle/oradata/PROD/DB_DATA.DBF

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
5       Full    1.10M      DISK        00:00:00     21-DEC-17      
        BP Key: 5   Status: AVAILABLE  Compressed: NO  Tag: TAG20171221T223333
        Piece Name: /u01/app/oracle/flash_recovery_area/PROD/backupset/2017_12_21/o1_mf_nnndf_TAG20171221T223333_f3qkkxd4_.bkp
  List of Datafiles in backup set 5
  File LV Type Ckp SCN    Ckp Time  Name
  ---- -- ---- ---------- --------- ----
  5       Full 1029090    21-DEC-17 /u01/app/oracle/oradata/PROD/DB_DATA.DBF



RMAN> delete backupset 3;

using channel ORA_DISK_1

List of Backup Pieces
BP Key  BS Key  Pc# Cp# Status      Device Type Piece Name
------- ------- --- --- ----------- ----------- ----------
3       3       1   1   AVAILABLE   DISK        /u01/app/oracle/rbak/bak_03smn81d_1_1

Do you really want to delete the above objects (enter YES or NO)? yes
deleted backup piece
backup piece handle=/u01/app/oracle/rbak/bak_03smn81d_1_1 RECID=3 STAMP=963354669
Deleted 1 objects


RMAN> list backup;


List of Backup Sets
===================


BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
1       Full    969.36M    DISK        00:00:38     21-DEC-17      
        BP Key: 1   Status: AVAILABLE  Compressed: NO  Tag: TAG20171221T222703
        Piece Name: /u01/app/oracle/flash_recovery_area/PROD/backupset/2017_12_21/o1_mf_nnndf_TAG20171221T222703_f3qk5r7o_.bkp
  List of Datafiles in backup set 1
  File LV Type Ckp SCN    Ckp Time  Name
  ---- -- ---- ---------- --------- ----
  1       Full 1028608    21-DEC-17 /u01/app/oracle/oradata/PROD/system01.dbf
  2       Full 1028608    21-DEC-17 /u01/app/oracle/oradata/PROD/sysaux01.dbf
  3       Full 1028608    21-DEC-17 /u01/app/oracle/oradata/PROD/undotbs01.dbf
  4       Full 1028608    21-DEC-17 /u01/app/oracle/oradata/PROD/users01.dbf
  5       Full 1028608    21-DEC-17 /u01/app/oracle/oradata/PROD/DB_DATA.DBF

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
2       Full    9.36M      DISK        00:00:01     21-DEC-17      
        BP Key: 2   Status: AVAILABLE  Compressed: NO  Tag: TAG20171221T222703
        Piece Name: /u01/app/oracle/flash_recovery_area/PROD/backupset/2017_12_21/o1_mf_ncsnf_TAG20171221T222703_f3qk76nk_.bkp
  SPFILE Included: Modification time: 21-DEC-17
  SPFILE db_unique_name: PROD
  Control File Included: Ckp SCN: 1028628      Ckp time: 21-DEC-17

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
4       Full    9.36M      DISK        00:00:02     21-DEC-17      
        BP Key: 4   Status: AVAILABLE  Compressed: NO  Tag: TAG20171221T223109
        Piece Name: /u01/app/oracle/rbak/bak_04smn82q_1_1
  SPFILE Included: Modification time: 21-DEC-17
  SPFILE db_unique_name: PROD
  Control File Included: Ckp SCN: 1029031      Ckp time: 21-DEC-17

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
5       Full    1.10M      DISK        00:00:00     21-DEC-17      
        BP Key: 5   Status: AVAILABLE  Compressed: NO  Tag: TAG20171221T223333
        Piece Name: /u01/app/oracle/flash_recovery_area/PROD/backupset/2017_12_21/o1_mf_nnndf_TAG20171221T223333_f3qkkxd4_.bkp
  List of Datafiles in backup set 5
  File LV Type Ckp SCN    Ckp Time  Name
  ---- -- ---- ---------- --------- ----
  5       Full 1029090    21-DEC-17 /u01/app/oracle/oradata/PROD/DB_DATA.DBF

RMAN>


您需要登录后才可以回帖 登录 | 注册

本版积分规则

DTCC2018购票6.8折优惠进行时

中国数据库技术大会是国内数据库及大数据领域规模最大、最受欢迎的技术交流盛会。 2018年5月10-12日,第九届中国数据库技术大会将如约而至。本届大会以“数领先机•智赢未来”为主题,设定2大主会场及20个技术专场,邀请来自国内外互联网、金融、教育等行业百余位技术专家,共同探讨Oracle、MySQL、NoSQL、大数据等领域的前瞻性热点话题与技术。
----------------------------------------
优惠时间:2018年2月13日前

TOP技术积分榜 社区积分榜 徽章 团队 统计 知识索引树 积分竞拍 文本模式 帮助
  ITPUB首页 | ITPUB论坛 | 数据库技术 | 企业信息化 | 开发技术 | 微软技术 | 软件工程与项目管理 | IBM技术园地 | 行业纵向讨论 | IT招聘 | IT文档 |
  | | |
CopyRight 1999-2011 itpub.net All Right Reserved. 北京盛拓优讯信息技术有限公司版权所有 联系我们 网站律师 隐私政策 知识产权声明
 北京市公安局海淀分局网监中心备案编号:11010802021510 广播电视节目制作经营许可证:编号(京)字第1149号
  
快速回复 返回顶部 返回列表
北京赛车pk10 申博官网 北京赛车pk10 六台宝典现场开奖 北京赛车pk10历史记录 北京赛车开奖 北京赛车预测 949494开奖结果今晚 威尼斯人线上娱乐 手机投注平台 幸运28投注技巧 pk10助赢软件 北京pk10百度鼎盛彩票网 北京赛车聚彩 北京pk10如何稳杀3码 pk10稳赢方法 pk10定位计划 pk10包赢计划群