登录  
 加关注
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

欢迎光临我的博客

 
 
 

日志

 
 

rman 停库备份与恢复  

2013-10-22 08:22:36|  分类: 数据库 |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |

AIX Version 7
Copyright IBM Corporation, 1982, 2012.
login: root
root's Password: 
*******************************************************************************
*                                                                             *
*                                                                             *
*  Welcome to AIX Version 7.1!                                                *
*                                                                             *
*                                                                             *
*  Please see the README file in /usr/lpp/bos for information pertinent to    *
*  this release of the AIX Operating System.                                  *
*                                                                             *
*                                                                             *
*******************************************************************************
Last unsuccessful login: Fri Aug 30 17:13:18 BEIST 2013 on /dev/dtlogin/_0
Last login: Fri Oct 11 13:50:25 BEIST 2013 on /dev/pts/0 from 172.16.10.1

root@easdb1:/#
root@easdb1:/#su - oracle
oracle@easdb1:/home/oracle#rman target /

Recovery Manager: Release 10.2.0.5.0 - Production on Fri Oct 11 13:56:27 2013

Copyright (c) 1982, 2007, Oracle.  All rights reserved.

connected to target database: EASDB (DBID=795314350, not open)

RMAN> run{
2> backup database format '/backup/db_%s_%d.bak';
3> backup current controlfile format '/backup/ctl_%s_%d.bak';
4> }

Starting backup at 11-OCT-13
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=1623 instance=easdb1 devtype=DISK
RMAN-03009: failure of backup command on ORA_DISK_1 channel at 10/11/2013 13:58:35
ORA-01138: database must either be open in this instance or not at all
continuing other job steps, job failed will not be re-run
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03009: failure of backup command on ORA_DISK_1 channel at 10/11/2013 13:58:35
ORA-01138: database must either be open in this instance or not at all


MAN> 

RMAN> run {
2> backup database format '/backup/db_%s_%d.bak';
3> backup current controlfile format '/backup/ctl_%s_%d.bak';
4> }

Starting backup at 11-OCT-13
using channel ORA_DISK_1
channel ORA_DISK_1: starting compressed full datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
input datafile fno=00008 name=+DATA/easdb/datafile/easoa_data.dbf
input datafile fno=00009 name=+DATA/easdb/datafile/eas_d_cfhv_standard.dbf
input datafile fno=00010 name=+DATA/easdb/datafile/firstframe_data.dbf
input datafile fno=00011 name=+DATA/easdb/datafile/webim.dbf
input datafile fno=00012 name=+DATA/easdb/datafile/eas_d_rbkeas_standard.dbf
input datafile fno=00006 name=+DATA/easdb/datafile/eas_t_ceshi_standard.dbf
input datafile fno=00007 name=+DATA/easdb/datafile/eas_d_ceshi_standard.dbf
input datafile fno=00013 name=+DATA/easdb/datafile/user02.dbf
input datafile fno=00003 name=+DATA/easdb/datafile/sysaux.257.817443321
input datafile fno=00001 name=+DATA/easdb/datafile/system.256.817443321
input datafile fno=00005 name=+DATA/easdb/datafile/undotbs2.265.817443399
input datafile fno=00014 name=+DATA/easdb/datafile/eas_d_test_standard.dbf
input datafile fno=00015 name=+DATA/easdb/datafile/eas_t_test_standard.dbf
input datafile fno=00016 name=+DATA/easdb/datafile/eas_t_tt_standard
input datafile fno=00017 name=+DATA/easdb/datafile/eas_d_tt_standard
input datafile fno=00018 name=+DATA/easdb/datafile/easoa_data1.dbf
input datafile fno=00019 name=+DATA/easdb/datafile/webim1.dbf
input datafile fno=00002 name=+DATA/easdb/datafile/undotbs1.258.817443321
input datafile fno=00004 name=+DATA/easdb/datafile/users.259.817443323
channel ORA_DISK_1: starting piece 1 at 11-OCT-13

channel ORA_DISK_1: finished piece 1 at 11-OCT-13
piece handle=/backup/db_958_EASDB.bak tag=TAG20131011T140210 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:03:15
channel ORA_DISK_1: starting compressed full datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
including current control file in backupset
including current SPFILE in backupset
channel ORA_DISK_1: starting piece 1 at 11-OCT-13
channel ORA_DISK_1: finished piece 1 at 11-OCT-13
piece handle=/backup/db_959_EASDB.bak tag=TAG20131011T140210 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:02
Finished backup at 11-OCT-13

Starting backup at 11-OCT-13
using channel ORA_DISK_1
channel ORA_DISK_1: starting compressed full datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
including current control file in backupset
channel ORA_DISK_1: starting piece 1 at 11-OCT-13
channel ORA_DISK_1: finished piece 1 at 11-OCT-13
piece handle=/backup/ctl_960_EASDB.bak tag=TAG20131011T140529 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 11-OCT-13

RMAN> 
RMAN> exit


Recovery Manager complete.
oracle@easdb1:/home/oracle#  
oracle@easdb1:/home/oracle#sqlplus / as sysdba

SQL*Plus: Release 10.2.0.5.0 - Production on Fri Oct 11 14:10:55 2013

Copyright (c) 1982, 2010, Oracle.  All Rights Reserved.


Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production
With the Partitioning, Real Application Clusters, OLAP, Data Mining
and Real Application Testing options

SQL> alter database open;

Database altered.

SQL> select status from v$instance;

STATUS
------------
OPEN

SQL> 
SQL> select status from v$instance;
select status from v$instance
*
ERROR at line 1:
ORA-03135: connection lost contact


SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production
With the Partitioning, Real Application Clusters, OLAP, Data Mining
and Real Application Testing options
oracle@easdb1:/home/oracle#cd /backup
oracle@easdb1:/backup#ls
CTL_EASDB_acoegn0c_1_1_20130711.BKP  DB_EASDB_srolmbob_1_1_20131006.BKP   DB_EASDB_tdolu8sb_1_1_20131009.BKP   DB_EASDB_tqom3hm2_1_1_20131011.BKP   ctl_960_EASDB.bak
CTL_EASDB_tbolrkou_1_1_20131008.BKP  DB_EASDB_stolmbq3_1_1_20131006.BKP   DB_EASDB_teolu8u2_1_1_20131009.BKP   DB_EASDB_trom3hm3_1_1_20131011.BKP   db_958_EASDB.bak
CTL_EASDB_tholu95s_1_1_20131009.BKP  DB_EASDB_t0olp04a_1_1_20131007.BKP   DB_EASDB_tfolu8u4_1_1_20131009.BKP   arch_EASDB_920.bak                   db_959_EASDB.bak
CTL_EASDB_tnom0ths_1_1_20131010.BKP  DB_EASDB_t1olp04b_1_1_20131007.BKP   DB_EASDB_tiom0t8b_1_1_20131010.BKP   arch_EASDB_926.bak                   lost+found
CTL_EASDB_ttom3hts_1_1_20131011.BKP  DB_EASDB_t3olp063_1_1_20131007.BKP   DB_EASDB_tjom0t8b_1_1_20131010.BKP   arch_EASDB_932.bak                   rman_log
DB_EASDB_skoljncb_1_1_20131005.BKP   DB_EASDB_t6olrkga_1_1_20131008.BKP   DB_EASDB_tkom0ta2_1_1_20131010.BKP   arch_EASDB_938.bak
DB_EASDB_sloljncb_1_1_20131005.BKP   DB_EASDB_t7olrkgb_1_1_20131008.BKP   DB_EASDB_tlom0ta4_1_1_20131010.BKP   arch_EASDB_944.bak
DB_EASDB_snoljne4_1_1_20131005.BKP   DB_EASDB_t9olrki3_1_1_20131008.BKP   DB_EASDB_toom3hka_1_1_20131011.BKP   arch_EASDB_950.bak
DB_EASDB_sqolmboa_1_1_20131006.BKP   DB_EASDB_tcolu8sb_1_1_20131009.BKP   DB_EASDB_tpom3hkb_1_1_20131011.BKP   arch_EASDB_956.bak
oracle@easdb1:/backup#rman target 

Argument     Value          Description
-----------------------------------------------------------------------------
target       quoted-string  connect-string for target database
catalog      quoted-string  connect-string for recovery catalog
nocatalog    none           if specified, then no recovery catalog
cmdfile      quoted-string  name of input command file
log          quoted-string  name of output message log file
trace        quoted-string  name of output debugging message log file
append       none           if specified, log is opened in append mode
debug        optional-args  activate debugging
msgno        none           show RMAN-nnnn prefix for all messages
send         quoted-string  send a command to the media manager
pipe         string         building block for pipe names
timeout      integer        number of seconds to wait for pipe input
checksyntax  none           check the command file for syntax errors
-----------------------------------------------------------------------------
Both single and double quotes (' or ") are accepted for a quoted-string.
Quotes are not required unless the string contains embedded white-space.

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-00552: syntax error in command line arguments
RMAN-01009: syntax error: found "end-of-file": expecting one of: "double-quoted-string, equal, identifier, single-quoted-string"
RMAN-01007: at line 0 column 0 file: command line arguments
oracle@easdb1:/backup#/rman target /
ksh: /rman:  not found.
oracle@easdb1:/backup#rman target /

Recovery Manager: Release 10.2.0.5.0 - Production on Fri Oct 11 14:20:08 2013

Copyright (c) 1982, 2007, Oracle.  All rights reserved.

connected to target database: easdb (not mounted)

RMAN> restore controlfile from '/backup/ctl_960_EASDB.bak';                                                           

Starting restore at 11-OCT-13
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=1626 instance=easdb1 devtype=DISK

channel ORA_DISK_1: restoring control file
channel ORA_DISK_1: restore complete, elapsed time: 00:00:09
output filename=+DATA/easdb/controlfile/current.260.817443375
Finished restore at 11-OCT-13

RMAN> restore database;

Starting restore at 11-OCT-13
using channel ORA_DISK_1
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of restore command at 10/11/2013 14:23:35
ORA-01507: database not mounted

RMAN> alter database mount
2> ;

database mounted
released channel: ORA_DISK_1

RMAN> restore database;

Starting restore at 11-OCT-13
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=1626 instance=easdb1 devtype=DISK

channel ORA_DISK_1: starting datafile backupset restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
restoring datafile 00001 to +DATA/easdb/datafile/system.256.817443321
restoring datafile 00002 to +DATA/easdb/datafile/undotbs1.258.817443321
restoring datafile 00003 to +DATA/easdb/datafile/sysaux.257.817443321
restoring datafile 00004 to +DATA/easdb/datafile/users.259.817443323
restoring datafile 00005 to +DATA/easdb/datafile/undotbs2.265.817443399
restoring datafile 00006 to +DATA/easdb/datafile/eas_t_ceshi_standard.dbf
restoring datafile 00007 to +DATA/easdb/datafile/eas_d_ceshi_standard.dbf
restoring datafile 00008 to +DATA/easdb/datafile/easoa_data.dbf
restoring datafile 00009 to +DATA/easdb/datafile/eas_d_cfhv_standard.dbf
restoring datafile 00010 to +DATA/easdb/datafile/firstframe_data.dbf
restoring datafile 00011 to +DATA/easdb/datafile/webim.dbf
restoring datafile 00012 to +DATA/easdb/datafile/eas_d_rbkeas_standard.dbf
restoring datafile 00013 to +DATA/easdb/datafile/user02.dbf
restoring datafile 00014 to +DATA/easdb/datafile/eas_d_test_standard.dbf
restoring datafile 00015 to +DATA/easdb/datafile/eas_t_test_standard.dbf
restoring datafile 00016 to +DATA/easdb/datafile/eas_t_tt_standard
restoring datafile 00017 to +DATA/easdb/datafile/eas_d_tt_standard
restoring datafile 00018 to +DATA/easdb/datafile/easoa_data1.dbf
restoring datafile 00019 to +DATA/easdb/datafile/webim1.dbf
channel ORA_DISK_1: reading from backup piece /backup/db_958_EASDB.bak
^[channel ORA_DISK_1: restored backup piece 1
piece handle=/backup/db_958_EASDB.bak tag=TAG20131011T140210
channel ORA_DISK_1: restore complete, elapsed time: 00:07:46
Finished restore at 11-OCT-13

RMAN> 

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-00558: error encountered while parsing input commands
RMAN-01006: error signalled during parse
RMAN-02003: unrecognized character: 

MAN> 

RMAN> 

RMAN> alter database open;

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of alter db command at 10/11/2013 14:33:45
ORA-01589: must use RESETLOGS or NORESETLOGS option for database open

RMAN> alter database open resetlogs;

database opened

RMAN> 
  评论这张
 
阅读(1101)| 评论(0)

历史上的今天

评论

<#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#-- 网易新闻广告 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2018