Oracle两种备份方式

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/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/29439655/viewspace-1988549/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值