ITPub博客

首页 > 数据库 > Oracle > rman恢复测试1

rman恢复测试1

原创 Oracle 作者:cbso520 时间:2011-01-25 16:54:49 0 删除 编辑

RMAN> list backup;


RMAN> backup database plus archivelog format '/opt/oracle/app/oracle/data_bak/%d_full_backup';


Starting backup at 25-JAN-11
current log archived
using channel ORA_DISK_1
channel ORA_DISK_1: starting archive log backupset
channel ORA_DISK_1: specifying archive log(s) in backup set
input archive log thread=1 sequence=2 recid=1 stamp=741352074
input archive log thread=1 sequence=3 recid=2 stamp=741353773
input archive log thread=1 sequence=4 recid=3 stamp=741353829
input archive log thread=1 sequence=5 recid=4 stamp=741353918
channel ORA_DISK_1: starting piece 1 at 25-JAN-11
channel ORA_DISK_1: finished piece 1 at 25-JAN-11
piece handle=/opt/oracle/app/oracle/data_bak/OCP_full_backup tag=TAG20110125T113838 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:05
Finished backup at 25-JAN-11

Starting backup at 25-JAN-11
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
input datafile fno=00001 name=/opt/oracle/app/oracle/oradata/ocp/system01.dbf
input datafile fno=00003 name=/opt/oracle/app/oracle/oradata/ocp/sysaux01.dbf
input datafile fno=00005 name=/opt/oracle/app/oracle/oradata/ocp/example01.dbf
input datafile fno=00002 name=/opt/oracle/app/oracle/oradata/ocp/undotbs01.dbf
input datafile fno=00004 name=/opt/oracle/app/oracle/oradata/ocp/users01.dbf
channel ORA_DISK_1: starting piece 1 at 25-JAN-11
channel ORA_DISK_1: finished piece 1 at 25-JAN-11
piece handle=/opt/oracle/app/oracle/flash_recovery_area/OCP/backupset/2011_01_25/o1_mf_nnndf_TAG20110125T113843_6mwkg3px_.bkp tag=TAG20110125T113843 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:45
channel ORA_DISK_1: starting 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 25-JAN-11
channel ORA_DISK_1: finished piece 1 at 25-JAN-11
piece handle=/opt/oracle/app/oracle/flash_recovery_area/OCP/backupset/2011_01_25/o1_mf_ncsnf_TAG20110125T113843_6mwkhmv6_.bkp tag=TAG20110125T113843 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:04
Finished backup at 25-JAN-11

Starting backup at 25-JAN-11
current log archived
using channel ORA_DISK_1
channel ORA_DISK_1: starting archive log backupset
channel ORA_DISK_1: specifying archive log(s) in backup set
input archive log thread=1 sequence=6 recid=5 stamp=741353973
channel ORA_DISK_1: starting piece 1 at 25-JAN-11
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of backup plus archivelog command at 01/25/2011 11:39:34
ORA-19504: failed to create file "/opt/oracle/app/oracle/data_bak/OCP_full_backup"
ORA-27038: created file already exists
Additional information: 1

[oracle@jerry ~]$ export ORACLE_SID=test
[oracle@jerry ~]$ echo $ORACLE_SID
test
[oracle@jerry ~]$ rman target /

Recovery Manager: Release 10.2.0.1.0 - Production on Tue Jan 25 11:43:38 2011

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

connected to target database (not started)

RMAN> startup nomount;

startup failed: ORA-01078: failure in processing system parameters
LRM-00109: could not open parameter file '/opt/oracle/app/oracle/product/10.2.0/db_1/dbs/inittest.ora'

starting Oracle instance without parameter file for retrival of spfile
Oracle instance started

Total System Global Area 159383552 bytes

Fixed Size 1218268 bytes
Variable Size 54528292 bytes
Database Buffers 100663296 bytes
Redo Buffers 2973696 bytes

RMAN> restore spfile from '/opt/oracle/app/oracle/flash_recovery_area/OCP/backupset/2011_01_25/o1_mf_ncsnf_TAG20110125T113843_6mwkhmv6_.bkp';

Starting restore at 25-JAN-11
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=36 devtype=DISK

channel ORA_DISK_1: autobackup found: /opt/oracle/app/oracle/flash_recovery_area/OCP/backupset/2011_01_25/o1_mf_ncsnf_TAG20110125T113843_6mwkhmv6_.bkp
channel ORA_DISK_1: SPFILE restore from autobackup complete
Finished restore at 25-JAN-11

RMAN> shutdown immediate

Oracle instance shut down
RMAN> startup nomount;

connected to target database (not started)
Oracle instance started

Total System Global Area 167772160 bytes

Fixed Size 1218316 bytes
Variable Size 62916852 bytes
Database Buffers 100663296 bytes
Redo Buffers 2973696 bytes
SQL> show parameter spfile

NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
spfile string /opt/oracle/app/oracle/product
/10.2.0/db_1/dbs/spfiletest.or
a
SQL> show parameter control_file

NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
control_file_record_keep_time integer 7
control_files string /opt/oracle/app/oracle/oradata
/ocp/control01.ctl, /opt/oracl
e/app/oracle/oradata/ocp/contr
ol02.ctl, /opt/oracle/app/orac
le/oradata/ocp/control03.ctl
SQL> alter system set control_files='/opt/oracle/app/oracle/oradata/test/control01.ctl','/opt/oracle/app/oracle/oradata/test/control02.ctl' scope=spfile;

System altered.
SQL> shutdown immediate
ORA-01507: database not mounted


ORACLE instance shut down.
SQL> startup nomount;
ORACLE instance started.

Total System Global Area 167772160 bytes
Fixed Size 1218316 bytes
Variable Size 62916852 bytes
Database Buffers 100663296 bytes
Redo Buffers 2973696 bytes
SQL> show parameter control_files

NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
control_files string /opt/oracle/app/oracle/oradata
/test/control01.ctl, /opt/orac
le/app/oracle/oradata/test/con
trol02.ctl

[oracle@jerry ~]$ mkdir /opt/oracle/app/oracle/oradata/test
SQL> show parameter instance_name

NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
instance_name string test
SQL> show parameter db_name

NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
db_name string ocp
SQL> show parameter db_unique_name

NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
db_unique_name string ocp
SQL> alter system set db_name=test;
alter system set db_name=test
*
ERROR at line 1:
ORA-02095: specified initialization parameter cannot be modified


SQL> alter system set db_name=test scope=spfile;

System altered.

SQL> alter system set db_unique_name=test scope=spfile;

System altered.

SQL> shutdown immediate
SQL> startup nomount;
ORACLE instance started.

Total System Global Area 167772160 bytes
Fixed Size 1218316 bytes
Variable Size 62916852 bytes
Database Buffers 100663296 bytes
Redo Buffers 2973696 bytes
SQL> show parameter db_name

NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
db_name string TEST
SQL> show parameter db_unique

NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
db_unique_name string TEST
[oracle@jerry ~]$ echo $ORACLE_SID
test
[oracle@jerry ~]$ rman target /

Recovery Manager: Release 10.2.0.1.0 - Production on Tue Jan 25 12:06:28 2011

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

connected to target database: TEST (not mounted)

RMAN> restore controlfile from '/opt/oracle/app/oracle/flash_recovery_area/OCP/backupset/2011_01_25/o1_mf_ncsnf_TAG20110125T113843_6mwkhmv6_.bkp';

Starting restore at 25-JAN-11
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=155 devtype=DISK

channel ORA_DISK_1: restoring control file
channel ORA_DISK_1: restore complete, elapsed time: 00:00:02
output filename=/opt/oracle/app/oracle/oradata/test/control01.ctl
output filename=/opt/oracle/app/oracle/oradata/test/control02.ctl
Finished restore at 25-JAN-11

[@more@]r

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

上一篇: oracle常见错误
请登录后发表评论 登录
全部评论

注册时间:2008-11-12

  • 博文量
    72
  • 访问量
    312697