ITPub博客

首页 > 数据库 > Oracle > Oracle两种备份方式

Oracle两种备份方式

原创 Oracle 作者:abraham_dba_2013 时间:2016-02-14 16:46:03 0 删除 编辑
Oracle热备份的步骤:
[oracle@dbbackup ~]$ rman target/
Recovery Manager: Release 11.2.0.3.0 - Production on Sun Feb 14 16:34:15 2016
Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.
connected to target database: ORA11G (DBID=5034383)
RMAN> backup database plus archivelog delete input format '/home/oracle/backup/full_%U.bak';
Starting backup at 14-FEB-16
current log archived
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=141 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=6 RECID=1 STAMP=903801969
input archived log thread=1 sequence=7 RECID=2 STAMP=903803452
input archived log thread=1 sequence=8 RECID=3 STAMP=903803717
channel ORA_DISK_1: starting piece 1 at 14-FEB-16
channel ORA_DISK_1: finished piece 1 at 14-FEB-16
piece handle=/home/oracle/backup/full_01qttsq6_1_1.bak tag=TAG20160214T163518 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
channel ORA_DISK_1: deleting archived log(s)
archived log file name=/u01/app/oracle/fast_recovery_area/ORA11G/archivelog/2016_02_14/o1_mf_1_6_cd0fcknf_.arc RECID=1 STAMP=903801969
archived log file name=/u01/app/oracle/fast_recovery_area/ORA11G/archivelog/2016_02_14/o1_mf_1_7_cd0gswwg_.arc RECID=2 STAMP=903803452
archived log file name=/u01/app/oracle/fast_recovery_area/ORA11G/archivelog/2016_02_14/o1_mf_1_8_cd0h25o0_.arc RECID=3 STAMP=903803717
Finished backup at 14-FEB-16


Starting backup at 14-FEB-16
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/ora11g/system01.dbf
input datafile file number=00002 name=/u01/app/oracle/oradata/ora11g/sysaux01.dbf
input datafile file number=00003 name=/u01/app/oracle/oradata/ora11g/undotbs01.dbf
input datafile file number=00004 name=/u01/app/oracle/oradata/ora11g/users01.dbf
channel ORA_DISK_1: starting piece 1 at 14-FEB-16
channel ORA_DISK_1: finished piece 1 at 14-FEB-16
piece handle=/u01/app/oracle/fast_recovery_area/ORA11G/backupset/2016_02_14/o1_mf_nnndf_TAG20160214T163520_cd0h28kc_.bkp tag=TAG20160214T163520 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:26
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 14-FEB-16
channel ORA_DISK_1: finished piece 1 at 14-FEB-16
piece handle=/u01/app/oracle/fast_recovery_area/ORA11G/backupset/2016_02_14/o1_mf_ncsnf_TAG20160214T163520_cd0h340m_.bkp tag=TAG20160214T163520 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 14-FEB-16


Starting backup at 14-FEB-16
current log archived
using channel ORA_DISK_1
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=9 RECID=4 STAMP=903803749
channel ORA_DISK_1: starting piece 1 at 14-FEB-16
channel ORA_DISK_1: finished piece 1 at 14-FEB-16
piece handle=/home/oracle/backup/full_04qttsr5_1_1.bak tag=TAG20160214T163549 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
channel ORA_DISK_1: deleting archived log(s)
archived log file name=/u01/app/oracle/fast_recovery_area/ORA11G/archivelog/2016_02_14/o1_mf_1_9_cd0h3528_.arc RECID=4 STAMP=903803749
Finished backup at 14-FEB-16


Oracle冷备份的通常步骤:
1  正常关闭数据库
2  备份所有重要的文件到备份目录(数据文件、控制文件、重做日志文件等)
3  完成备份后启动数据库 
    用冷备份进行恢复时,只需要将所有文件恢复到原有位置,就可以启动数据库了 。

1  进入数据库
   #sqlplus "/as sysdba"
2  如果没有启动则要启动:
   SQL>startup
3  查询数据文件datafile的所在目录:
    SQL>SELECT name FROM v$datafile;
   NAME
    --------------------------------------------------------------------------------
    /u01/app/oracle/oradata/ora11g/system01.dbf
    /u01/app/oracle/oradata/ora11g/sysaux01.dbf
    /u01/app/oracle/oradata/ora11g/undotbs01.dbf
    /u01/app/oracle/oradata/ora11g/users01.dbf

    查询控制文件controlfile的所在目录:
    SQL>SELECT name FROM v$controlfile;
   NAME
    --------------------------------------------------------------------------------
    /u01/app/oracle/oradata/ora11g/control01.ctl
    /u01/app/oracle/fast_recovery_area/ora11g/control02.ctl

    查询重做日志文件的所在目录:
    SQL>SELECT member FROM v$logfile;
   MEMBER
    --------------------------------------------------------------------------------
    /u01/app/oracle/oradata/ora11g/redo03.log
    /u01/app/oracle/oradata/ora11g/redo02.log
    /u01/app/oracle/oradata/ora11g/redo01.log

4  关闭数据库
   SQL>shutdown immediate;
5  备份文件到备份的目录
    $ cp /u01/app/oracle/oradata/ora11g/*.dbf /home/oracle/backup/
    $ cp /u01/app/oracle/oradata/ora11g/*.log /home/oracle/backup/
    cp /u01/app/oracle/oradata/ora11g/control01.ctl /home/oracle/backup/
    $ cp /u01/app/oracle/fast_recovery_area/ora11g/control02.ctl /home/oracle/backup/
6  然后启动数据库
   #sqlplus "/as sysdba"
   SQL>startup
   冷备份完毕!!

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/29439655/viewspace-1988549/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2014-01-13

  • 博文量
    90
  • 访问量
    396015