oracle10g_rman_语法测试_6

bash-3.00$ rman target sys/system@ora10g catalog rman/system@newly

Recovery Manager: Release 10.2.0.2.0 - Production on Tue Sep 22 06:46:21 2009

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

connected to target database: ORA10G (DBID=4016423416)
connected to recovery catalog database

RMAN> delete script. backup_db; ---删除rman catalog中的脚本,如本地target无,就在catalog中找,有就删除掉它

deleted script. backup_db

RMAN> backup device type disk datafile 3; --backup在中间可以指定device type选项

Starting backup at 22-SEP-09
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=140 devtype=DISK
channel ORA_DISK_1: starting compressed full datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
input datafile fno=00003 name=/oracle/oradata/ora10g/sysaux01.dbf
channel ORA_DISK_1: starting piece 1 at 22-SEP-09
channel ORA_DISK_1: finished piece 1 at 22-SEP-09
piece handle=/oracle/auto/backup_3tkps28n_1_1 tag=TAG20090922T064750 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:28
Finished backup at 22-SEP-09

Starting Control File and SPFILE Autobackup at 22-SEP-09
piece handle=/oracle/c-4016423416-20090922-00 comment=NONE
Finished Control File and SPFILE Autobackup at 22-SEP-09

RMAN> restore device type disk archivelog all; --为restore归档日志指定device type

Starting restore at 22-SEP-09
released channel: ORA_DISK_1
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=140 devtype=DISK

archive log thread 1 sequence 2 is already on disk as file /oracle/flash_recovery_area/ORA10G/archivelog/2009_09_14/o1_mf_1_2_5bvk77qx_.arc
archive log thread 1 sequence 3 is already on disk as file /oracle/flash_recovery_area/ORA10G/archivelog/2009_09_14/o1_mf_1_3_5bvkt5lf_.arc
archive log thread 1 sequence 4 is already on disk as file /oracle/flash_recovery_area/ORA10G/archivelog/2009_09_14/o1_mf_1_4_5bvl5n25_.arc
archive log thread 1 sequence 5 is already on disk as file /oracle/flash_recovery_area/ORA10G/archivelog/2009_09_14/o1_mf_1_5_5bvpm10h_.arc
archive log thread 1 sequence 6 is already on disk as file /oracle/flash_recovery_area/ORA10G/archivelog/2009_09_15/o1_mf_1_6_5bxlsqto_.arc
archive log thread 1 sequence 12 is already on disk as file /oracle/flash_recovery_area/ORA10G/archivelog/2009_09_18/o1_mf_1_12_5c5y4j19_.arc
archive log thread 1 sequence 13 is already on disk as file /oracle/flash_recovery_area/ORA10G/archivelog/2009_09_18/o1_mf_1_13_5c5z02yj_.arc
archive log thread 1 sequence 14 is already on disk as file /oracle/flash_recovery_area/ORA10G/archivelog/2009_09_19/o1_mf_1_14_5c8rtgb9_.arc
archive log thread 1 sequence 15 is already on disk as file /oracle/flash_recovery_area/ORA10G/archivelog/2009_09_19/o1_mf_1_15_5c8xhg2z_.arc
archive log thread 1 sequence 16 is already on disk as file /oracle/flash_recovery_area/ORA10G/archivelog/2009_09_19/o1_mf_1_16_5c8xlw31_.arc
archive log thread 1 sequence 17 is already on disk as file /oracle/flash_recovery_area/ORA10G/archivelog/2009_09_19/o1_mf_1_17_5c8zv15h_.arc
archive log thread 1 sequence 18 is already on disk as file /oracle/flash_recovery_area/ORA10G/archivelog/2009_09_19/o1_mf_1_18_5c8zywfm_.arc
archive log thread 1 sequence 19 is already on disk as file /oracle/flash_recovery_area/ORA10G/archivelog/2009_09_22/o1_mf_1_19_5chy59gp_.arc
channel ORA_DISK_1: starting archive log restore to default destination
channel ORA_DISK_1: restoring archive log
archive log thread=1 sequence=11
channel ORA_DISK_1: reading from backup piece /oracle/arch_2kkpbfpo_1_1
channel ORA_DISK_1: restored backup piece 1
piece handle=/oracle/arch_2kkpbfpo_1_1 tag=TAG20090915T235431
channel ORA_DISK_1: restore complete, elapsed time: 00:00:02
Finished restore at 22-SEP-09

RMAN> drop catalog;--如果你没有catalog的备份,在rman catalog中存储的目标库的备份信息就完完了,呵呵。

recovery catalog owner is RMAN
enter DROP CATALOG command again to confirm catalog removal

RMAN> drop catalog;--drop catalog系统要你再确认输入一次,就删除掉了

recovery catalog dropped

RMAN> create catalog;--必须连接到catalog,然后创建catalog

recovery catalog created

RMAN>

RMAN> backup as copy db_file_name_convert=('/oracle','/oracle/newly') tablespace zxy;  ---db_file_name_convert放中间,且报错,在恢复目录中找不到目标库

Starting backup at 22-SEP-09
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of backup command at 09/22/2009 15:09:49
RMAN-03014: implicit resync of recovery catalog failed
RMAN-06004: ORACLE error from recovery catalog database: RMAN-20001: target database not found in recovery catalog

RMAN> register database; --为了处理以上错误,在恢复目录中注册数据库

database registered in recovery catalog
starting full resync of recovery catalog
full resync complete



RMAN> backup as copy db_file_name_convert=('/oracle','/oracle/newly') tablespace zxy;--搞个数据库表空间拷贝(利用此参数作个存储位置的转换)

Starting backup at 22-SEP-09
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=150 devtype=DISK
channel ORA_DISK_1: starting datafile copy
input datafile fno=00005 name=/oracle/zxy.dbf
output filename=/oracle/newly/zxy.dbf tag=TAG20090922T151027 recid=9 stamp=698253042
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:16
Finished backup at 22-SEP-09

Starting Control File and SPFILE Autobackup at 22-SEP-09
piece handle=/oracle/c-4016423416-20090922-01 comment=NONE
Finished Control File and SPFILE Autobackup at 22-SEP-09

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

转载于:http://blog.itpub.net/9240380/viewspace-615195/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值