RAC+ASM在单机上恢复的过程

IT168技术文档】
网上也有类似的例子,但不尽详细,也没多花心思解释流程及原因,可能对初试者不太解惑。有感于此,故认真整理了恢复步骤即操作流程,望有助于同行朋友。

环境:正式环境是IBM4+IBM5(RAC),测试环境是IBM1,两环境的OS,ORACLE等软件一样。
都是 ORACLE10203, AIX(5300-07), 备份操作放在IBM4上执行。

一 背景介绍:

1 RAC环境的备份策略

每天作两次备份,0点和12点,备份脚本一样,只是中午12点的备份,输出的msglog=backup_ccdb_inc_0_12_$today.log,以别于0点的操作。
IBM4 ->crontab -l
0 0 * * * /orabak/script/rmandbbackup.sh>/dev/null 2>&1
0 12 * * * /orabak/script/rmandbbackup_12.sh>/dev/null 2>&1

IBM4 ->more /orabak/script/rmandbbackup.sh
export ORACLE_HOME=/oracle/product/10.2.0/db_1
export ORACLE_SID=ccdb1
export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK
today=`date +%Y%m%d`
weekday=`date +%w`
backuppath=/orabak
$ORACLE_HOME/bin/rman cmdfile=$backuppath/script/backup_ccdb_inc_0.script msglog=$backuppath/rmanbacktrace/backup_ccdb_inc_0_$today.log
if test $? -ne 0; then
touch $backuppath/rmanbacktrace/"ccdb incremental level 0 backup failed! Date: $today"
$ORACLE_HOME/bin/sqlplus -S "/ as sysdba" @$backuppath/script/insertsms.sql
fi;

IBM4 ->more $backuppath/script/backup_ccdb_inc_0.script
/script/backup_ccdb_inc_0.script: No such file or directory
IBM4 ->more /orabak/script/backup_ccdb_inc_0.script
connect target /
connect catalog rman/xxxxxxxx@bi
run
{
allocate channel d1 type disk maxpiecesize 4000m ;
backup as compressed backupset incremental level = 0 database
format '/orabak/databackup/db_%d_%s_%p_%T'
plus archivelog skip inaccessible delete all input
format '/orabak/logbackup/log_%d_%s_%p_%T';
sql 'alter system archive log current';
release channel d1;
}
run
{ crosscheck backup;
delete noprompt expired backup;
delete noprompt obsolete recovery window of 7 days;
}
exit;
IBM4 ->

2 恢复前,需要将在IBM4上的备份拷贝到IBM1。由于IBM4的上备份集的保存路径为/ORABAK,而IBM1上只有/ORADATA,
拷贝过来的备份集将存在此目录下,故,恢复数据库前,需要告诉RMAN备份集的路径(步骤6)。

二 准备工作,把备份集拷贝到IBM1下
如下:备份集已经拷贝到IBM1的/oradata目录下
ibm1 ->pwd
/oradata
ibm1 ->cd orabak
ibm1 ->ls -lrt
total 0
drwxr-xr-x 2 oracle oinstall 256 Jun 20 15:12 logbackup
drwxr-xr-x 2 oracle oinstall 256 Jun 20 15:13 rmanspctlback
drwxr-xr-x 2 oracle oinstall 256 Jun 20 16:37 databackup
ibm1 ->cd rman*
ibm1 ->pwd
/oradata/orabak/rmanspctlback
ibm1 ->ls -lrt
total 23104
-rw-r----- 1 oracle oinstall 11829248 Jun 20 15:12 c-3276392049-20080620-01 -- 参数文件,控制文件的备份集
ibm1 ->cd ../databackup
ibm1 ->pwd
/oradata/orabak/databackup
ibm1 ->ls -lrt
total 769264
-rw-r----- 1 oracle oinstall 393863168 Jun 20 16:38 db_CCDB_900_1_20080620 -- 数据文件的备份集
ibm1 ->cd ../logbackup
ibm1 ->pwd
/oradata/orabak/logbackup
ibm1 ->ls -lrt
total 3320
-rw-r----- 1 oracle oinstall 1699328 Jun 20 15:12 log_CCDB_901_1_20080620 -- 备份完数据库后,备份归档日志的备份集

三 操作步骤

1 修改IBM1上的ORACLE的配置文件,只需要修改ORACLE_SID即可。
vi /oracle/.profile oracle_sid=ccdb1

2 进入RMAN,强行启动数据库(会报没有参数文件)后,恢复参数文件。
rman target /
startup nomount
restore spfile from '/oradata/orabak/rmanspctlback/c-3276392049-20080620-01';

3 根据spfile, 恢复出pfile, 编辑pfile, 去掉与rac设置相关的参数, 再将pfile转换成spfile
create pfile from spfile;
shutdown abort;
vi initccdb1.ora -- 去掉与rac设置相关的参数,同时注意参数里指定的各目录是否存在。
create spfile from pfile;

4 使用新创建的spfile 启动数据库,恢复出控制文件。
startup nomount;
restore controlfile from '/oradata/orabak/rmanspctlback/c-3276392049-20080620-01';
alter database mount;

5 由于正式环境使用了ASM,数据文件,在线日志都存在ASM里,而测试环境没有ASM,故需要将文件转换,存放到文件系统下,
进入SQLPLUS, 找出该库的归档日志,重新指定在线日志的路径。
sqlplus / as sysdba
select * from v$logfile;
alter database rename file '+ASMDISK/ccdb/onlinelog/group_3.267.648572919' to '/oradata/ccdb/redo0302.log';
alter database rename file '+ASMDISK/ccdb/onlinelog/group_2.264.648572917' to '/oradata/ccdb/redo0201.log';
alter database rename file '+ASMDISK/ccdb/onlinelog/group_2.265.648572919' to '/oradata/ccdb/redo0202.log';
alter database rename file '+ASMDISK/ccdb/onlinelog/group_1.262.648572915' to '/oradata/ccdb/redo0101.log';
alter database rename file '+ASMDISK/ccdb/onlinelog/group_1.263.648572917' to '/oradata/ccdb/redo0102.log';
alter database rename file '+ASMDISK/ccdb/onlinelog/group_4.270.648573025' to '/oradata/ccdb/redo0401.log';
alter database rename file '+ASMDISK/ccdb/onlinelog/group_4.271.648573025' to '/oradata/ccdb/redo0402.log';
alter database rename file '+ASMDISK/ccdb/onlinelog/group_5.272.648573025' to '/oradata/ccdb/redo0501.log';
alter database rename file '+ASMDISK/ccdb/onlinelog/group_5.273.648573027' to '/oradata/ccdb/redo0502.log';
alter database rename file '+ASMDISK/ccdb/onlinelog/group_6.274.648573027' to '/oradata/ccdb/redo0601.log';
alter database rename file '+ASMDISK/ccdb/onlinelog/group_6.275.648573027' to '/oradata/ccdb/redo0602.log';

6 由于在IBM4上记录的数据库,归档日志的备份集的存放路径与IBM1上的不一样,故,需要说明在IBM1上这些备份集的路径,以便RMAN知晓。
catalog backuppiece '/oradata/orabak/databackup/db_CCDB_900_1_20080620';
catalog backuppiece '/oradata/orabak/logbackup/log_CCDB_901_1_20080620';

7 检查备份集的存在状况,删除多余的备份集信息
crosscheck backup;
delete noprompt expired backup;

8 检查全库恢复时的,需要哪些数据文件备份集,归档日志文件的备份集。
restore database preview summary;

9 找出库的数据文件。
RMAN> report schema;

RMAN-06139: WARNING: control file is not current for REPORT SCHEMA
Report of database schema

List of Permanent Datafiles
===========================
File Size(MB) Tablespace RB segs Datafile Name
---- -------- -------------------- ------- ------------------------
1 0 SYSTEM *** +ASMDISK/ccdb/datafile/system.256.648572847
2 0 UNDOTBS1 *** +ASMDISK/ccdb/datafile/undotbs1.258.648572847
3 0 SYSAUX *** +ASMDISK/ccdb/datafile/sysaux.257.648572847
4 0 USERS *** +ASMDISK/ccdb/datafile/users.259.648572847
5 0 UNDOTBS2 *** +ASMDISK/ccdb/datafile/undotbs2.269.648572973
6 0 UNICALL2X *** +ASMDISK/ccdb/datafile/unicall2x.279.648578659
7 0 UNICALL2X_IDX *** +ASMDISK/ccdb/datafile/unicall2x_idx.280.648578725

List of Temporary Files
=======================
File Size(MB) Tablespace Maxsize(MB) Tempfile Name
---- -------- -------------------- ----------- --------------------
1 0 TEMP 32767 +ASMDISK/ccdb/tempfile/temp.268.648572939


10 写恢复脚本来恢复库,其中重新指定恢复时,数据文件的存放路径,由ASM到文件系统。
run
{allocate channel d1 type disk;
set newname for datafile 1 to '/oradata/ccdb/system.dbf';
set newname for datafile 2 to '/oradata/ccdb/undotbs1.dbf';
set newname for datafile 3 to '/oradata/ccdb/sysaux.dbf';
set newname for datafile 4 to '/oradata/ccdb/users.dbf';
set newname for datafile 5 to '/oradata/ccdb/undotbs2.dbf';
set newname for datafile 6 to '/oradata/ccdb/unicall2x.dbf';
set newname for datafile 7 to '/oradata/ccdb/unicall2x_idx.dbf';
restore database;
switch datafile all;
release channel d1;
}

13 recover database,注意恢复完成后,系统提示需要的日志文件及SCN好。
recover database;
14 罗列出归档日志的备份集,和上面的RECOVER DATABASE 信息作比较,以确定是否已经用完备份集里的归档日志。
list backup of archivelog all;

15 alter database open resetlogs;

四 下面是恢复操作过程,其中,"辅助窗口" 执行恢复过程中起辅助作用的操作, "RMAN窗口" 执行正式操作,绝大部分操作都在此窗口完成。

--辅助窗口
--由于之前曾成功恢复了数据库,现需要删除之。
ibm1 ->sqlplus

SQL*Plus: Release 10.2.0.3.0 - Production on Thu Jun 26 14:49:39 2008

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

Enter user-name: / as sysdba

Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options

SQL> show parameter instance;

NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
active_instance_count integer
cluster_database_instances integer 1
instance_groups string
instance_name string ccdb1
instance_number integer 0
instance_type string RDBMS
open_links_per_instance integer 4
parallel_instance_group string
parallel_server_instances integer 1
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount restrict;
ORACLE instance started.

Total System Global Area 3221225472 bytes
Fixed Size 2076312 bytes
Variable Size 1996489064 bytes
Database Buffers 1207959552 bytes
Redo Buffers 14700544 bytes
Database mounted.
SQL> drop database;

Database dropped.

Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options
SQL> exit

-- 删除参数文件
ibm1 ->cd /oracle/product/10.2/dbs
ibm1 ->ls -lrt
total 58552
-rw-rw---- 1 oracle oinstall 24 Jun 5 21:54 lkMARKET
-rw-r----- 1 oracle oinstall 12697600 Jun 8 10:08 snapcf_market.f
-rw-r----- 1 oracle oinstall 4608 Jun 11 16:40 spfilemarket.ora.bak
-rw-rw---- 1 oracle oinstall 24 Jun 20 16:23 lkCCDB
-rw-rw---- 1 oracle oinstall 24 Jun 24 11:10 lkTESTDB
-rw-r----- 1 oracle oinstall 1536 Jun 24 11:10 orapwtestdb
-rw-rw---- 1 oracle oinstall 1552 Jun 24 15:54 hc_market.dat
-rw-r----- 1 oracle oinstall 2560 Jun 25 10:22 spfiletestdb.ora
-rw-r----- 1 oracle oinstall 5488640 Jun 25 10:24 snapcf_testdb.f
-rw-rw---- 1 oracle oinstall 1552 Jun 25 23:36 hc_testdb.dat
-rw-r--r-- 1 oracle oinstall 796 Jun 26 10:25 initccdb1.ora
-rw-r----- 1 oracle oinstall 11747328 Jun 26 11:13 snapcf_ccdb1.f
-rw-rw---- 1 oracle oinstall 1552 Jun 26 14:51 hc_ccdb1.dat
ibm1 ->rm hc_ccdb1.dat initccdb1.ora snapcf_ccdb1.f
ibm1 ->ls -lrt
total 35592
-rw-rw---- 1 oracle oinstall 24 Jun 5 21:54 lkMARKET
-rw-r----- 1 oracle oinstall 12697600 Jun 8 10:08 snapcf_market.f
-rw-r----- 1 oracle oinstall 4608 Jun 11 16:40 spfilemarket.ora.bak
-rw-rw---- 1 oracle oinstall 24 Jun 20 16:23 lkCCDB
-rw-rw---- 1 oracle oinstall 24 Jun 24 11:10 lkTESTDB
-rw-r----- 1 oracle oinstall 1536 Jun 24 11:10 orapwtestdb
-rw-rw---- 1 oracle oinstall 1552 Jun 24 15:54 hc_market.dat
-rw-r----- 1 oracle oinstall 2560 Jun 25 10:22 spfiletestdb.ora
-rw-r----- 1 oracle oinstall 5488640 Jun 25 10:24 snapcf_testdb.f
-rw-rw---- 1 oracle oinstall 1552 Jun 25 23:36 hc_testdb.dat
ibm1 ->

--RMAN窗口
--强行启动数据库,使用指定的备份集,恢复参数文件,并创建参数文件的pfile。
ibm1 ->rman target /

Recovery Manager: Release 10.2.0.3.0 - Production on Thu Jun 26 15:04:52 2008

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 '/oracle/product/10.2/dbs/initccdb1.ora'

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

Total System Global Area 159383552 bytes

Fixed Size 2071296 bytes
Variable Size 67110144 bytes
Database Buffers 83886080 bytes
Redo Buffers 6316032 bytes

RMAN> restore spfile from '/oradata/orabak/rmanspctlback/c-3276392049-20080620-01';

Starting restore at 2008-06-26 15:05:05
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: /oradata/orabak/rmanspctlback/c-3276392049-20080620-01
channel ORA_DISK_1: SPFILE restore from autobackup complete
Finished restore at 2008-06-26 15:05:07

RMAN> host;

ibm1 ->sqlplus

SQL*Plus: Release 10.2.0.3.0 - Production on Thu Jun 26 15:05:17 2008

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

Enter user-name: / as sysdba

Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options

SQL> create pfile from spfile;

File created.

SQL> shutdown abort;
ORACLE instance shut down.
SQL>


-- 辅助窗口
-- 删除pfile 文件中与RAC相关的参数

-- 原始参数
ibm1 ->cat initccdb1.ora
ccdb2.__db_cache_size=503316480
ccdb1.__db_cache_size=1140850688
ccdb2.__java_pool_size=16777216
ccdb1.__java_pool_size=16777216
ccdb2.__large_pool_size=16777216
ccdb1.__large_pool_size=16777216
ccdb2.__shared_pool_size=1056964608
ccdb1.__shared_pool_size=1996488704
ccdb2.__streams_pool_size=0
ccdb1.__streams_pool_size=33554432
*.audit_file_dest='/oracle/admin/ccdb/adump'
*.background_dump_dest='/oracle/admin/ccdb/bdump'
*.cluster_database_instances=2
*.cluster_database=true
*.compatible='10.2.0.3.0'
*.control_files='+ASMDISK/ccdb/controlfile/current.261.648572913','+ASMDISK/ccdb/controlfile/current.260.648572913'
*.core_dump_dest='/oracle/admin/ccdb/cdump'
*.db_block_size=8192
*.db_create_file_dest='+ASMDISK'
*.db_domain=''
*.db_file_multiblock_read_count=16
*.db_name='ccdb'
*.db_recovery_file_dest='+ASMDISK'
*.db_recovery_file_dest_size=10737418240
*.dispatchers=''
ccdb1.instance_number=1
ccdb2.instance_number=2
*.job_queue_processes=10
ccdb2.local_listener='LISTENERS_CCDB2'
ccdb1.local_listener='LISTENERS_CCDB1'
*.log_archive_dest_1='LOCATION=+ASMDISK/ccdb/'
*.log_archive_dest_2='LOCATION=/oralog/ccdb/'
ccdb2.log_archive_dest_2='LOCATION=/oralog/ccdb2/'
ccdb1.log_archive_dest_2='LOCATION=/oralog/ccdb1/'
*.log_archive_format='%t_%s_%r.dbf'
*.log_archive_local_first=TRUE
*.log_archive_min_succeed_dest=2
*.open_cursors=300
*.pga_aggregate_target=1029701632
*.processes=1000
*.recyclebin='OFF'
*.remote_listener='LISTENERS_CCDB'
*.remote_login_passwordfile='exclusive'
*.sessions=1105
*.sga_max_size=3221225472
*.sga_target=1610612736
ccdb1.sga_target=3221225472
ccdb2.thread=2
ccdb1.thread=1
*.undo_management='AUTO'
ccdb2.undo_tablespace='UNDOTBS2'
ccdb1.undo_tablespace='UNDOTBS1'
*.user_dump_dest='/oracle/admin/ccdb/udump'
ibm1 ->

-- 修改后的参数
ibm1 ->cat initccdb1.ora
*.audit_file_dest='/oracle/admin/ccdb/adump'
*.background_dump_dest='/oracle/admin/ccdb/bdump'
*.compatible='10.2.0.3.0'
*.control_files='/oradata/ccdb/control01.dbf'
*.core_dump_dest='/oracle/admin/ccdb/cdump'
*.db_block_size=8192
*.db_domain=''
*.db_file_multiblock_read_count=16
*.db_name='ccdb'
*.db_recovery_file_dest_size=10737418240
*.dispatchers=''
*.job_queue_processes=10
*.log_archive_dest_2='LOCATION=/oralog/ccdb/'
*.log_archive_format='%t_%s_%r.dbf'
*.log_archive_local_first=TRUE
*.open_cursors=300
*.pga_aggregate_target=1029701632
*.processes=1000
*.recyclebin='OFF'
*.remote_login_passwordfile='exclusive'
*.sessions=1105
*.sga_max_size=3221225472
*.sga_target=1610612736
*.undo_management='AUTO'
*.user_dump_dest='/oracle/admin/ccdb/udump'


-- 根据pfile 创建spfile, 并 startup nomount.
ibm1 ->sqlplus

SQL*Plus: Release 10.2.0.3.0 - Production on Thu Jun 26 15:13:43 2008

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

Enter user-name: / as sysdba
Connected to an idle instance.

SQL> create spfile from pfile;

File created.

SQL> startup nomount;
ORACLE instance started.

Total System Global Area 3221225472 bytes
Fixed Size 2076312 bytes
Variable Size 1996489064 bytes
Database Buffers 1207959552 bytes
Redo Buffers 14700544 bytes
SQL>

-- RMAN窗口
-- 使用指定的备份集,恢复控制文件。
SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options
ibm1 ->rman target /

Recovery Manager: Release 10.2.0.3.0 - Production on Thu Jun 26 15:14:26 2008

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

connected to target database: ccdb (not mounted)

RMAN> restore controlfile from '/oradata/orabak/rmanspctlback/c-3276392049-20080620-01';

Starting restore at 2008-06-26 15:14:45
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=1090 devtype=DISK

channel ORA_DISK_1: restoring control file
channel ORA_DISK_1: restore complete, elapsed time: 00:00:02
output filename=/oradata/ccdb/control01.dbf
Finished restore at 2008-06-26 15:14:48

RMAN> alter database mount;

database mounted
released channel: ORA_DISK_1

RMAN>


-- 辅助窗口
-- 由于正式环境使用了ASM, 测试环境没有,因此需要找出该库的归档日志,重新指定在线日志的路径。

SQL> col member for a60;
SQL> set line 999;
SQL> set pagesize 203
SQL> select * from v$logfile;

GROUP# STATUS TYPE MEMBER IS_
---------- ------- ------- ------------------------------------------------------------ ---
3 ONLINE +ASMDISK/ccdb/onlinelog/group_3.266.648572919 NO
3 ONLINE +ASMDISK/ccdb/onlinelog/group_3.267.648572919 YES
2 ONLINE +ASMDISK/ccdb/onlinelog/group_2.264.648572917 NO
2 ONLINE +ASMDISK/ccdb/onlinelog/group_2.265.648572919 YES
1 ONLINE +ASMDISK/ccdb/onlinelog/group_1.262.648572915 NO
1 ONLINE +ASMDISK/ccdb/onlinelog/group_1.263.648572917 YES
4 ONLINE +ASMDISK/ccdb/onlinelog/group_4.270.648573025 NO
4 ONLINE +ASMDISK/ccdb/onlinelog/group_4.271.648573025 YES
5 ONLINE +ASMDISK/ccdb/onlinelog/group_5.272.648573025 NO
5 ONLINE +ASMDISK/ccdb/onlinelog/group_5.273.648573027 YES
6 ONLINE +ASMDISK/ccdb/onlinelog/group_6.274.648573027 NO
6 ONLINE +ASMDISK/ccdb/onlinelog/group_6.275.648573027 YES

12 rows selected.

SQL> alter database rename file '+ASMDISK/ccdb/onlinelog/group_3.266.648572919' to '/oradata/ccdb/redo0301.log';
alter database rename file '+ASMDISK/ccdb/onlinelog/group_3.267.648572919' to '/oradata/ccdb/redo0302.log';
alter database rename file '+ASMDISK/ccdb/onlinelog/group_2.264.648572917' to '/oradata/ccdb/redo0201.log';
alter database rename file '+ASMDISK/ccdb/onlinelog/group_2.265.648572919' to '/oradata/ccdb/redo0202.log';
alter database rename file '+ASMDISK/ccdb/onlinelog/group_1.262.648572915' to '/oradata/ccdb/redo0101.log';
alter database rename file '+ASMDISK/ccdb/onlinelog/group_1.263.648572917' to '/oradata/ccdb/redo0102.log';
alter database rename file '+ASMDISK/ccdb/onlinelog/group_4.270.648573025' to '/oradata/ccdb/redo0401.log';
alter database rename file '+ASMDISK/ccdb/onlinelog/group_4.271.648573025' to '/oradata/ccdb/redo0402.log';
alter database rename file '+ASMDISK/ccdb/onlinelog/group_5.272.648573025' to '/oradata/ccdb/redo0501.log';
alter database rename file '+ASMDISK/ccdb/onlinelog/group_5.273.648573027' to '/oradata/ccdb/redo0502.log';
alter database renam
Database altered.

eSQL> file '+ASMDI
Database altered.

SQL>
Database altered.

SQL>
Database altered.

SQL> SK/ccdb/onlinelo
Database altered.

SQL>
Database altered.

SQL>
Database altered.

SQL>
Database altered.

SQL>
Database altered.

SQL>
Database altered.

SQL> g/group_6.274.648573027' to '/oradata/ccdb/redo0601.log';
alter data
Database altered.

SQL> base rename file '+ASMDISK/ccdb/onlinelog/group_6.275.648573027' to '/oradata/ccdb/redo0602.log';

Database altered.

SQL> select * from v$logfile;

GROUP# STATUS TYPE MEMBER IS_
---------- ------- ------- ------------------------------------------------------------ ---
3 ONLINE /oradata/ccdb/redo0301.log NO
3 ONLINE /oradata/ccdb/redo0302.log NO
2 ONLINE /oradata/ccdb/redo0201.log NO
2 ONLINE /oradata/ccdb/redo0202.log NO
1 ONLINE /oradata/ccdb/redo0101.log NO
1 ONLINE /oradata/ccdb/redo0102.log NO
4 ONLINE /oradata/ccdb/redo0401.log NO
4 ONLINE /oradata/ccdb/redo0402.log NO
5 ONLINE /oradata/ccdb/redo0501.log NO
5 ONLINE /oradata/ccdb/redo0502.log NO
6 ONLINE /oradata/ccdb/redo0601.log NO
6 ONLINE /oradata/ccdb/redo0602.log NO

12 rows selected.

SQL>

-- RMAN窗口
-- IBM4上数据库,归档日志的备份集的存放路径与IBM1上的不一样,需要在RMAN里说明在IBM1上这些备份集的路径,以便RMAN知晓。

RMAN> catalog backuppiece '/oradata/orabak/databackup/db_CCDB_900_1_20080620';
catalog backuppiece '/oradata/orabak/logbackup/
log_CCDB_901_1_20080620';
cataloged backuppiece
backup piece handle=/oradata/orabak/databackup/db_CCDB_900_1_20080620 recid=900 stamp=658423188

RMAN>
cataloged backuppiece
backup piece handle=/oradata/orabak/logbackup/log_CCDB_901_1_20080620 recid=901 stamp=658423189

-- 检查备份集。
RMAN> crosscheck backup;

allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=1090 devtype=DISK
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/orabak/databackup/db_CCDB_840_1_20080613 recid=838 stamp=657244831
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/orabak/logbackup/log_CCDB_841_1_20080613 recid=839 stamp=657244954
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/orabak/rmanspctlback/c-3276392049-20080613-00 recid=840 stamp=657244957
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/orabak/logbackup/log_CCDB_843_1_20080613 recid=841 stamp=657288012
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/orabak/databackup/db_CCDB_844_1_20080613 recid=842 stamp=657288028
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/orabak/logbackup/log_CCDB_845_1_20080613 recid=843 stamp=657288153
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/orabak/rmanspctlback/c-3276392049-20080613-01 recid=844 stamp=657288156
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/orabak/logbackup/log_CCDB_847_1_20080614 recid=845 stamp=657331217
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/orabak/databackup/db_CCDB_848_1_20080614 recid=846 stamp=657331233
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/orabak/logbackup/log_CCDB_849_1_20080614 recid=847 stamp=657331373
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/orabak/rmanspctlback/c-3276392049-20080614-00 recid=848 stamp=657331377
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/orabak/logbackup/log_CCDB_851_1_20080614 recid=849 stamp=657374419
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/orabak/databackup/db_CCDB_852_1_20080614 recid=850 stamp=657374441
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/orabak/logbackup/log_CCDB_853_1_20080614 recid=851 stamp=657374578
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/orabak/rmanspctlback/c-3276392049-20080614-01 recid=852 stamp=657374581
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/orabak/logbackup/log_CCDB_855_1_20080615 recid=853 stamp=657417634
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/orabak/databackup/db_CCDB_856_1_20080615 recid=854 stamp=657417650
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/orabak/logbackup/log_CCDB_857_1_20080615 recid=855 stamp=657417775
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/orabak/rmanspctlback/c-3276392049-20080615-00 recid=856 stamp=657417778
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/orabak/logbackup/log_CCDB_859_1_20080615 recid=857 stamp=657460812
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/orabak/databackup/db_CCDB_860_1_20080615 recid=858 stamp=657460828
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/orabak/logbackup/log_CCDB_861_1_20080615 recid=859 stamp=657460963
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/orabak/rmanspctlback/c-3276392049-20080615-01 recid=860 stamp=657460966
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/orabak/logbackup/log_CCDB_863_1_20080616 recid=861 stamp=657504024
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/orabak/databackup/db_CCDB_864_1_20080616 recid=862 stamp=657504032
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/orabak/logbackup/log_CCDB_865_1_20080616 recid=863 stamp=657504154
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/orabak/rmanspctlback/c-3276392049-20080616-00 recid=864 stamp=657504157
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/orabak/logbackup/log_CCDB_867_1_20080616 recid=865 stamp=657547221
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/orabak/databackup/db_CCDB_868_1_20080616 recid=866 stamp=657547237
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/orabak/logbackup/log_CCDB_869_1_20080616 recid=867 stamp=657547384
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/orabak/rmanspctlback/c-3276392049-20080616-01 recid=868 stamp=657547387
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/orabak/logbackup/log_CCDB_871_1_20080617 recid=869 stamp=657590420
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/orabak/databackup/db_CCDB_872_1_20080617 recid=870 stamp=657590436
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/orabak/logbackup/log_CCDB_873_1_20080617 recid=871 stamp=657590569
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/orabak/rmanspctlback/c-3276392049-20080617-00 recid=872 stamp=657590572
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/orabak/logbackup/log_CCDB_875_1_20080617 recid=873 stamp=657633618
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/orabak/databackup/db_CCDB_876_1_20080617 recid=874 stamp=657633634
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/orabak/logbackup/log_CCDB_877_1_20080617 recid=875 stamp=657633767
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/orabak/rmanspctlback/c-3276392049-20080617-01 recid=876 stamp=657633770
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/orabak/logbackup/log_CCDB_879_1_20080618 recid=877 stamp=657676819
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/orabak/databackup/db_CCDB_880_1_20080618 recid=878 stamp=657676835
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/orabak/logbackup/log_CCDB_881_1_20080618 recid=879 stamp=657676969
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/orabak/rmanspctlback/c-3276392049-20080618-00 recid=880 stamp=657676972
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/orabak/logbackup/log_CCDB_883_1_20080618 recid=881 stamp=657720016
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/orabak/databackup/db_CCDB_884_1_20080618 recid=882 stamp=657720032
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/orabak/logbackup/log_CCDB_885_1_20080618 recid=883 stamp=657720166
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/orabak/rmanspctlback/c-3276392049-20080618-01 recid=884 stamp=657720169
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/orabak/logbackup/log_CCDB_887_1_20080619 recid=885 stamp=657763217
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/orabak/databackup/db_CCDB_888_1_20080619 recid=886 stamp=657763245
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/orabak/logbackup/log_CCDB_889_1_20080619 recid=887 stamp=657763385
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/orabak/rmanspctlback/c-3276392049-20080619-00 recid=888 stamp=657763388
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/orabak/logbackup/log_CCDB_891_1_20080619 recid=889 stamp=657806417
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/orabak/databackup/db_CCDB_892_1_20080619 recid=890 stamp=657806433
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/orabak/logbackup/log_CCDB_893_1_20080619 recid=891 stamp=657806567
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/orabak/rmanspctlback/c-3276392049-20080619-01 recid=892 stamp=657806570
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/orabak/logbackup/log_CCDB_895_1_20080620 recid=893 stamp=657849624
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/orabak/databackup/db_CCDB_896_1_20080620 recid=894 stamp=657849650
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/orabak/logbackup/log_CCDB_897_1_20080620 recid=895 stamp=657849783
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/orabak/rmanspctlback/c-3276392049-20080620-00 recid=896 stamp=657849786
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/orabak/logbackup/log_CCDB_899_1_20080620 recid=897 stamp=657892819
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/orabak/databackup/db_CCDB_900_1_20080620 recid=898 stamp=657892837
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/oradata/orabak/databackup/db_CCDB_900_1_20080620 recid=900 stamp=658423188
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/orabak/logbackup/log_CCDB_901_1_20080620 recid=899 stamp=657892970
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/oradata/orabak/logbackup/log_CCDB_901_1_20080620 recid=901 stamp=658423189
Crosschecked 64 objects

-- 删除不存在的备份集(其实这一步可要可不要,看个人习惯)
RMAN> delete noprompt expired backup;

using channel ORA_DISK_1

List of Backup Pieces
BP Key BS Key Pc# Cp# Status Device Type Piece Name
------- ------- --- --- ----------- ----------- ----------
838 838 1 1 EXPIRED DISK /orabak/databackup/db_CCDB_840_1_20080613
839 839 1 1 EXPIRED DISK /orabak/logbackup/log_CCDB_841_1_20080613
840 840 1 1 EXPIRED DISK /orabak/rmanspctlback/c-3276392049-20080613-00
841 841 1 1 EXPIRED DISK /orabak/logbackup/log_CCDB_843_1_20080613
842 842 1 1 EXPIRED DISK /orabak/databackup/db_CCDB_844_1_20080613
843 843 1 1 EXPIRED DISK /orabak/logbackup/log_CCDB_845_1_20080613
844 844 1 1 EXPIRED DISK /orabak/rmanspctlback/c-3276392049-20080613-01
845 845 1 1 EXPIRED DISK /orabak/logbackup/log_CCDB_847_1_20080614
846 846 1 1 EXPIRED DISK /orabak/databackup/db_CCDB_848_1_20080614
847 847 1 1 EXPIRED DISK /orabak/logbackup/log_CCDB_849_1_20080614
848 848 1 1 EXPIRED DISK /orabak/rmanspctlback/c-3276392049-20080614-00
849 849 1 1 EXPIRED DISK /orabak/logbackup/log_CCDB_851_1_20080614
850 850 1 1 EXPIRED DISK /orabak/databackup/db_CCDB_852_1_20080614
851 851 1 1 EXPIRED DISK /orabak/logbackup/log_CCDB_853_1_20080614
852 852 1 1 EXPIRED DISK /orabak/rmanspctlback/c-3276392049-20080614-01
853 853 1 1 EXPIRED DISK /orabak/logbackup/log_CCDB_855_1_20080615
854 854 1 1 EXPIRED DISK /orabak/databackup/db_CCDB_856_1_20080615
855 855 1 1 EXPIRED DISK /orabak/logbackup/log_CCDB_857_1_20080615
856 856 1 1 EXPIRED DISK /orabak/rmanspctlback/c-3276392049-20080615-00
857 857 1 1 EXPIRED DISK /orabak/logbackup/log_CCDB_859_1_20080615
858 858 1 1 EXPIRED DISK /orabak/databackup/db_CCDB_860_1_20080615
859 859 1 1 EXPIRED DISK /orabak/logbackup/log_CCDB_861_1_20080615
860 860 1 1 EXPIRED DISK /orabak/rmanspctlback/c-3276392049-20080615-01
861 861 1 1 EXPIRED DISK /orabak/logbackup/log_CCDB_863_1_20080616
862 862 1 1 EXPIRED DISK /orabak/databackup/db_CCDB_864_1_20080616
863 863 1 1 EXPIRED DISK /orabak/logbackup/log_CCDB_865_1_20080616
864 864 1 1 EXPIRED DISK /orabak/rmanspctlback/c-3276392049-20080616-00
865 865 1 1 EXPIRED DISK /orabak/logbackup/log_CCDB_867_1_20080616
866 866 1 1 EXPIRED DISK /orabak/databackup/db_CCDB_868_1_20080616
867 867 1 1 EXPIRED DISK /orabak/logbackup/log_CCDB_869_1_20080616
868 868 1 1 EXPIRED DISK /orabak/rmanspctlback/c-3276392049-20080616-01
869 869 1 1 EXPIRED DISK /orabak/logbackup/log_CCDB_871_1_20080617
870 870 1 1 EXPIRED DISK /orabak/databackup/db_CCDB_872_1_20080617
871 871 1 1 EXPIRED DISK /orabak/logbackup/log_CCDB_873_1_20080617
872 872 1 1 EXPIRED DISK /orabak/rmanspctlback/c-3276392049-20080617-00
873 873 1 1 EXPIRED DISK /orabak/logbackup/log_CCDB_875_1_20080617
874 874 1 1 EXPIRED DISK /orabak/databackup/db_CCDB_876_1_20080617
875 875 1 1 EXPIRED DISK /orabak/logbackup/log_CCDB_877_1_20080617
876 876 1 1 EXPIRED DISK /orabak/rmanspctlback/c-3276392049-20080617-01
877 877 1 1 EXPIRED DISK /orabak/logbackup/log_CCDB_879_1_20080618
878 878 1 1 EXPIRED DISK /orabak/databackup/db_CCDB_880_1_20080618
879 879 1 1 EXPIRED DISK /orabak/logbackup/log_CCDB_881_1_20080618
880 880 1 1 EXPIRED DISK /orabak/rmanspctlback/c-3276392049-20080618-00
881 881 1 1 EXPIRED DISK /orabak/logbackup/log_CCDB_883_1_20080618
882 882 1 1 EXPIRED DISK /orabak/databackup/db_CCDB_884_1_20080618
883 883 1 1 EXPIRED DISK /orabak/logbackup/log_CCDB_885_1_20080618
884 884 1 1 EXPIRED DISK /orabak/rmanspctlback/c-3276392049-20080618-01
885 885 1 1 EXPIRED DISK /orabak/logbackup/log_CCDB_887_1_20080619
886 886 1 1 EXPIRED DISK /orabak/databackup/db_CCDB_888_1_20080619
887 887 1 1 EXPIRED DISK /orabak/logbackup/log_CCDB_889_1_20080619
888 888 1 1 EXPIRED DISK /orabak/rmanspctlback/c-3276392049-20080619-00
889 889 1 1 EXPIRED DISK /orabak/logbackup/log_CCDB_891_1_20080619
890 890 1 1 EXPIRED DISK /orabak/databackup/db_CCDB_892_1_20080619
891 891 1 1 EXPIRED DISK /orabak/logbackup/log_CCDB_893_1_20080619
892 892 1 1 EXPIRED DISK /orabak/rmanspctlback/c-3276392049-20080619-01
893 893 1 1 EXPIRED DISK /orabak/logbackup/log_CCDB_895_1_20080620
894 894 1 1 EXPIRED DISK /orabak/databackup/db_CCDB_896_1_20080620
895 895 1 1 EXPIRED DISK /orabak/logbackup/log_CCDB_897_1_20080620
896 896 1 1 EXPIRED DISK /orabak/rmanspctlback/c-3276392049-20080620-00
897 897 1 1 EXPIRED DISK /orabak/logbackup/log_CCDB_899_1_20080620
898 898 1 1 EXPIRED DISK /orabak/databackup/db_CCDB_900_1_20080620
899 899 1 1 EXPIRED DISK /orabak/logbackup/log_CCDB_901_1_20080620
deleted backup piece
backup piece handle=/orabak/databackup/db_CCDB_840_1_20080613 recid=838 stamp=657244831
deleted backup piece
backup piece handle=/orabak/logbackup/log_CCDB_841_1_20080613 recid=839 stamp=657244954
deleted backup piece
backup piece handle=/orabak/rmanspctlback/c-3276392049-20080613-00 recid=840 stamp=657244957
deleted backup piece
backup piece handle=/orabak/logbackup/log_CCDB_843_1_20080613 recid=841 stamp=657288012
deleted backup piece
backup piece handle=/orabak/databackup/db_CCDB_844_1_20080613 recid=842 stamp=657288028
deleted backup piece
backup piece handle=/orabak/logbackup/log_CCDB_845_1_20080613 recid=843 stamp=657288153
deleted backup piece
backup piece handle=/orabak/rmanspctlback/c-3276392049-20080613-01 recid=844 stamp=657288156
deleted backup piece
backup piece handle=/orabak/logbackup/log_CCDB_847_1_20080614 recid=845 stamp=657331217
deleted backup piece
backup piece handle=/orabak/databackup/db_CCDB_848_1_20080614 recid=846 stamp=657331233
deleted backup piece
backup piece handle=/orabak/logbackup/log_CCDB_849_1_20080614 recid=847 stamp=657331373
deleted backup piece
backup piece handle=/orabak/rmanspctlback/c-3276392049-20080614-00 recid=848 stamp=657331377
deleted backup piece
backup piece handle=/orabak/logbackup/log_CCDB_851_1_20080614 recid=849 stamp=657374419
deleted backup piece
backup piece handle=/orabak/databackup/db_CCDB_852_1_20080614 recid=850 stamp=657374441
deleted backup piece
backup piece handle=/orabak/logbackup/log_CCDB_853_1_20080614 recid=851 stamp=657374578
deleted backup piece
backup piece handle=/orabak/rmanspctlback/c-3276392049-20080614-01 recid=852 stamp=657374581
deleted backup piece
backup piece handle=/orabak/logbackup/log_CCDB_855_1_20080615 recid=853 stamp=657417634
deleted backup piece
backup piece handle=/orabak/databackup/db_CCDB_856_1_20080615 recid=854 stamp=657417650
deleted backup piece
backup piece handle=/orabak/logbackup/log_CCDB_857_1_20080615 recid=855 stamp=657417775
deleted backup piece
backup piece handle=/orabak/rmanspctlback/c-3276392049-20080615-00 recid=856 stamp=657417778
deleted backup piece
backup piece handle=/orabak/logbackup/log_CCDB_859_1_20080615 recid=857 stamp=657460812
deleted backup piece
backup piece handle=/orabak/databackup/db_CCDB_860_1_20080615 recid=858 stamp=657460828
deleted backup piece
backup piece handle=/orabak/logbackup/log_CCDB_861_1_20080615 recid=859 stamp=657460963
deleted backup piece
backup piece handle=/orabak/rmanspctlback/c-3276392049-20080615-01 recid=860 stamp=657460966
deleted backup piece
backup piece handle=/orabak/logbackup/log_CCDB_863_1_20080616 recid=861 stamp=657504024
deleted backup piece
backup piece handle=/orabak/databackup/db_CCDB_864_1_20080616 recid=862 stamp=657504032
deleted backup piece
backup piece handle=/orabak/logbackup/log_CCDB_865_1_20080616 recid=863 stamp=657504154
deleted backup piece
backup piece handle=/orabak/rmanspctlback/c-3276392049-20080616-00 recid=864 stamp=657504157
deleted backup piece
backup piece handle=/orabak/logbackup/log_CCDB_867_1_20080616 recid=865 stamp=657547221
deleted backup piece
backup piece handle=/orabak/databackup/db_CCDB_868_1_20080616 recid=866 stamp=657547237
deleted backup piece
backup piece handle=/orabak/logbackup/log_CCDB_869_1_20080616 recid=867 stamp=657547384
deleted backup piece
backup piece handle=/orabak/rmanspctlback/c-3276392049-20080616-01 recid=868 stamp=657547387
deleted backup piece
backup piece handle=/orabak/logbackup/log_CCDB_871_1_20080617 recid=869 stamp=657590420
deleted backup piece
backup piece handle=/orabak/databackup/db_CCDB_872_1_20080617 recid=870 stamp=657590436
deleted backup piece
backup piece handle=/orabak/logbackup/log_CCDB_873_1_20080617 recid=871 stamp=657590569
deleted backup piece
backup piece handle=/orabak/rmanspctlback/c-3276392049-20080617-00 recid=872 stamp=657590572
deleted backup piece
backup piece handle=/orabak/logbackup/log_CCDB_875_1_20080617 recid=873 stamp=657633618
deleted backup piece
backup piece handle=/orabak/databackup/db_CCDB_876_1_20080617 recid=874 stamp=657633634
deleted backup piece
backup piece handle=/orabak/logbackup/log_CCDB_877_1_20080617 recid=875 stamp=657633767
deleted backup piece
backup piece handle=/orabak/rmanspctlback/c-3276392049-20080617-01 recid=876 stamp=657633770
deleted backup piece
backup piece handle=/orabak/logbackup/log_CCDB_879_1_20080618 recid=877 stamp=657676819
deleted backup piece
backup piece handle=/orabak/databackup/db_CCDB_880_1_20080618 recid=878 stamp=657676835
deleted backup piece
backup piece handle=/orabak/logbackup/log_CCDB_881_1_20080618 recid=879 stamp=657676969
deleted backup piece
backup piece handle=/orabak/rmanspctlback/c-3276392049-20080618-00 recid=880 stamp=657676972
deleted backup piece
backup piece handle=/orabak/logbackup/log_CCDB_883_1_20080618 recid=881 stamp=657720016
deleted backup piece
backup piece handle=/orabak/databackup/db_CCDB_884_1_20080618 recid=882 stamp=657720032
deleted backup piece
backup piece handle=/orabak/logbackup/log_CCDB_885_1_20080618 recid=883 stamp=657720166
deleted backup piece
backup piece handle=/orabak/rmanspctlback/c-3276392049-20080618-01 recid=884 stamp=657720169
deleted backup piece
backup piece handle=/orabak/logbackup/log_CCDB_887_1_20080619 recid=885 stamp=657763217
deleted backup piece
backup piece handle=/orabak/databackup/db_CCDB_888_1_20080619 recid=886 stamp=657763245
deleted backup piece
backup piece handle=/orabak/logbackup/log_CCDB_889_1_20080619 recid=887 stamp=657763385
deleted backup piece
backup piece handle=/orabak/rmanspctlback/c-3276392049-20080619-00 recid=888 stamp=657763388
deleted backup piece
backup piece handle=/orabak/logbackup/log_CCDB_891_1_20080619 recid=889 stamp=657806417
deleted backup piece
backup piece handle=/orabak/databackup/db_CCDB_892_1_20080619 recid=890 stamp=657806433
deleted backup piece
backup piece handle=/orabak/logbackup/log_CCDB_893_1_20080619 recid=891 stamp=657806567
deleted backup piece
backup piece handle=/orabak/rmanspctlback/c-3276392049-20080619-01 recid=892 stamp=657806570
deleted backup piece
backup piece handle=/orabak/logbackup/log_CCDB_895_1_20080620 recid=893 stamp=657849624
deleted backup piece
backup piece handle=/orabak/databackup/db_CCDB_896_1_20080620 recid=894 stamp=657849650
deleted backup piece
backup piece handle=/orabak/logbackup/log_CCDB_897_1_20080620 recid=895 stamp=657849783
deleted backup piece
backup piece handle=/orabak/rmanspctlback/c-3276392049-20080620-00 recid=896 stamp=657849786
deleted backup piece
backup piece handle=/orabak/logbackup/log_CCDB_899_1_20080620 recid=897 stamp=657892819
deleted backup piece
backup piece handle=/orabak/databackup/db_CCDB_900_1_20080620 recid=898 stamp=657892837
deleted backup piece
backup piece handle=/orabak/logbackup/log_CCDB_901_1_20080620 recid=899 stamp=657892970
Deleted 62 EXPIRED objects

-- 查看恢复数据库需要的备份集,日志信息
RMAN> restore database preview summary;

Starting restore at 2008-06-26 15:21:43
using channel ORA_DISK_1


List of Backups
===============
Key TY LV S Device Type Completion Time #Pieces #Copies Compressed Tag
------- -- -- - ----------- ------------------- ------- ------- ---------- ---
898 B 0 A DISK 2008-06-20 12:02:12 1 1 YES TAG20080620T120035


List of Backups
===============
Key TY LV S Device Type Completion Time #Pieces #Copies Compressed Tag
------- -- -- - ----------- ------------------- ------- ------- ---------- ---
899 B A A DISK 2008-06-20 12:02:50 1 1 YES TAG20080620T120249
Media recovery start SCN is 26818078494
Recovery must be done beyond SCN 26818078494 to clear data files fuzziness
Finished restore at 2008-06-26 15:21:45


-- 查看库的数据文件的路径。
RMAN> report schema;

RMAN-06139: WARNING: control file is not current for REPORT SCHEMA
Report of database schema

List of Permanent Datafiles
===========================
File Size(MB) Tablespace RB segs Datafile Name
---- -------- -------------------- ------- ------------------------
1 0 SYSTEM *** +ASMDISK/ccdb/datafile/system.256.648572847
2 0 UNDOTBS1 *** +ASMDISK/ccdb/datafile/undotbs1.258.648572847
3 0 SYSAUX *** +ASMDISK/ccdb/datafile/sysaux.257.648572847
4 0 USERS *** +ASMDISK/ccdb/datafile/users.259.648572847
5 0 UNDOTBS2 *** +ASMDISK/ccdb/datafile/undotbs2.269.648572973
6 0 UNICALL2X *** +ASMDISK/ccdb/datafile/unicall2x.279.648578659
7 0 UNICALL2X_IDX *** +ASMDISK/ccdb/datafile/unicall2x_idx.280.648578725

List of Temporary Files
=======================
File Size(MB) Tablespace Maxsize(MB) Tempfile Name
---- -------- -------------------- ----------- --------------------
1 0 TEMP 32767 +ASMDISK/ccdb/tempfile/temp.268.648572939


-- 恢复数据库,其中需要重新指定恢复时,数据文件的存放路径,由ASM到文件系统。
RMAN> run
{allocate2> channel d1 type disk;
set newname for datafile 1 to '/oradata/ccdb/system.dbf';
set newname for datafile 2 to '/oradata/ccdb/undotbs1.dbf';
set newname for 3> datafile 3 to '/oradata/ccdb/sysaux.dbf';
set newname for da4> 5> 6> tafile 4 to '/oradata/ccdb/users.dbf';
set newname for data7> file 5 to '/oradata/ccdb/undotbs2.dbf';
set newname for datafile 6 to '/orada8> ta/ccdb/unicall2x.dbf';
set newname for datafile 7 to9> '/oradata/ccdb/unicall2x_idx.dbf';
restore database;
switch d10> atafile 11> all;
release c12> hannel d1;
}13>

released channel: ORA_DISK_1
allocated channel: d1
channel d1: sid=1090 devtype=DISK

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

Starting restore at 2008-06-26 15:29:49

channel d1: starting datafile backupset restore
channel d1: specifying datafile(s) to restore from backup set
restoring datafile 00001 to /oradata/ccdb/system.dbf
restoring datafile 00002 to /oradata/ccdb/undotbs1.dbf
restoring datafile 00003 to /oradata/ccdb/sysaux.dbf
restoring datafile 00004 to /oradata/ccdb/users.dbf
restoring datafile 00005 to /oradata/ccdb/undotbs2.dbf
restoring datafile 00006 to /oradata/ccdb/unicall2x.dbf
restoring datafile 00007 to /oradata/ccdb/unicall2x_idx.dbf
channel d1: reading from backup piece /oradata/orabak/databackup/db_CCDB_900_1_20080620
channel d1: restored backup piece 1
piece handle=/oradata/orabak/databackup/db_CCDB_900_1_20080620 tag=TAG20080620T120035
channel d1: restore complete, elapsed time: 00:04:33
Finished restore at 2008-06-26 15:34:23

datafile 1 switched to datafile copy
input datafile copy recid=8 stamp=658424064 filename=/oradata/ccdb/system.dbf
datafile 2 switched to datafile copy
input datafile copy recid=9 stamp=658424064 filename=/oradata/ccdb/undotbs1.dbf
datafile 3 switched to datafile copy
input datafile copy recid=10 stamp=658424064 filename=/oradata/ccdb/sysaux.dbf
datafile 4 switched to datafile copy
input datafile copy recid=11 stamp=658424064 filename=/oradata/ccdb/users.dbf
datafile 5 switched to datafile copy
input datafile copy recid=12 stamp=658424064 filename=/oradata/ccdb/undotbs2.dbf
datafile 6 switched to datafile copy
input datafile copy recid=13 stamp=658424064 filename=/oradata/ccdb/unicall2x.dbf
datafile 7 switched to datafile copy
input datafile copy recid=14 stamp=658424064 filename=/oradata/ccdb/unicall2x_idx.dbf

released channel: d1

-- 作介质恢复,注意RMAN最后的提示信息,thread 2 seq 688 lowscn 26818080041。
RMAN> recover database;

Starting recover at 2008-06-26 15:38:07
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=1090 devtype=DISK

starting media recovery

channel ORA_DISK_1: starting archive log restore to default destination
channel ORA_DISK_1: restoring archive log
archive log thread=2 sequence=687
channel ORA_DISK_1: restoring archive log
archive log thread=1 sequence=695
channel ORA_DISK_1: reading from backup piece /oradata/orabak/logbackup/log_CCDB_901_1_20080620
channel ORA_DISK_1: restored backup piece 1
piece handle=/oradata/orabak/logbackup/log_CCDB_901_1_20080620 tag=TAG20080620T120249
channel ORA_DISK_1: restore complete, elapsed time: 00:00:03
archive log filename=/oralog/ccdb/1_695_648572915.dbf thread=1 sequence=695
archive log filename=/oralog/ccdb/2_687_648572915.dbf thread=2 sequence=687
unable to find archive log
archive log thread=2 sequence=688
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 06/26/2008 15:38:21
RMAN-06054: media recovery requesting unknown log: thread 2 seq 688 lowscn 26818080041

-- 而从库中归档日志的日志号,scn 号的情况,可以看出,归档日志只有thread 2 日志号为 687,该日志的最高scn 小于 26818080041
-- 故,可以断定,上面的介质恢复错误,是因为缺少归档日志的原因,由于上上步的restore database preview summary 已经说明:
-- 介质恢复需要超过 SCN 26818078494, 才能清除库的模糊信息,而上面的步骤要求的SCN 26818080041,已经超过26818078494,故:
RMAN> list backup of archivelog all;


List of Backup Sets
===================

BS Key Size Device Type Elapsed Time Completion Time
------- ---------- ----------- ------------ -------------------
899 1.62M DISK 00:00:01 2008-06-20 12:02:50
BP Key: 901 Status: AVAILABLE Compressed: YES Tag: TAG20080620T120249
Piece Name: /oradata/orabak/logbackup/log_CCDB_901_1_20080620

List of Archived Logs in backup set 899
Thrd Seq Low SCN Low Time Next SCN Next Time
---- ------- ---------- ------------------- ---------- ---------
1 695 26818077573 2008-06-20 12:00:05 26818080043 2008-06-20 12:02:40
2 687 26818077558 2008-06-20 11:59:51 26818080041 2008-06-20 12:02:27

-- 故:open resetlogs 操作肯定成功。

RMAN> alter database open resetlogs;

database opened

RMAN>

附,上面例子里,步骤5和步骤10分开执行,实际上步骤5可以放到步骤10中一块作恢复操作。

RMAN> run
2> {allocate channel d1 type disk;
set newname for datafile 1 to '/oradata/ccdb/system.dbf';
set newname for datafile 2 to '/oradata/ccdb/undotbs1.dbf';
set newname for datafile 3 to '/oradata/ccdb/sysaux.dbf';
set newna3> 4> 5> 6> me for datafile 4 to '/oradata/ccdb/users.dbf';
set newname for datafile 5 to '/oradata/ccdb/undotbs2.dbf';
set newname for datafile 6 to '/oradata/ccdb/unicall2x.dbf';
set newname for datafile 7 to '/oradata/ccdb/unicall2x_idx.dbf';
sql "alter database rename file ''+ASMDISK/ccdb/onlinelog/group_3.266.648572919'' to ''/oradata/ccdb/redo0301.log''";
sql "alter da7> 8> 9> 10> 11> tabase rename file ''+ASMDISK/ccdb/onlinelog/group_3.267.648572919'' to ''/oradata/ccdb/redo0302.log''";
sql "alter database rename file ''+ASMDISK/ccdb/onlinelog/group_2.264.64812> 572917'' to ''/oradata/ccdb/redo0201.log''";
sql "alter database rename file ''+ASMDISK/ccdb/onlinelog/group_2.265.648572919'' to ''/oradata/ccdb/redo0202.log''";
sql13> 14> "alter database rename file ''+ASMDISK/ccdb/onlinelog/group_1.262.648572915'' to ''/oradata/ccdb/redo0101.log''";
sql15> "alter database rename file ''+ASMDISK/ccdb/onlinelog/group_1.263.648572917'' to ''/oradata/ccdb/redo0102.log''";
s16> ql "alter database rename file ''+ASMDISK/ccdb/onlinelog/group_4.270.648573025'' to ''/oradata/ccdb/redo0401.log''";
17> sql "alter database rename file ''+ASMDISK/ccdb/onlinelog/group_4.271.648573025'' to ''/oradata/ccdb/redo0402.log''";
sql 18> "alter database rename file ''+ASMDISK/ccdb/onlinelog/group_5.272.648573025'' to ''/oradata/ccdb/redo0501.log''";
sql19> "alter database rename file ''+ASMDISK/ccdb/onlinelog/group_5.273.648573027'' to ''/oradata/ccdb/redo0502.log''";
20> sql "alter database rename file ''+ASMDISK/ccdb/onlinelog/group_6.274.648573027'' to ''/oradata/ccdb/redo0601.log''";
sq21> l "alter database rename file ''+ASMDISK/ccdb/onlinelog/group_6.275.648573027'' to ''/oradata/ccdb/redo0602.log''";
res22> tore database;
23> switch datafile all;
24> release channel d1;
}25>

released channel: ORA_DISK_1
allocated channel: d1
channel d1: sid=1091 devtype=DISK

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

sql statement: alter database rename file ''+ASMDISK/ccdb/onlinelog/group_3.266.648572919'' to ''/oradata/ccdb/redo0301.log''

sql statement: alter database rename file ''+ASMDISK/ccdb/onlinelog/group_3.267.648572919'' to ''/oradata/ccdb/redo0302.log''

sql statement: alter database rename file ''+ASMDISK/ccdb/onlinelog/group_2.264.648572917'' to ''/oradata/ccdb/redo0201.log''

sql statement: alter database rename file ''+ASMDISK/ccdb/onlinelog/group_2.265.648572919'' to ''/oradata/ccdb/redo0202.log''

sql statement: alter database rename file ''+ASMDISK/ccdb/onlinelog/group_1.262.648572915'' to ''/oradata/ccdb/redo0101.log''

sql statement: alter database rename file ''+ASMDISK/ccdb/onlinelog/group_1.263.648572917'' to ''/oradata/ccdb/redo0102.log''

sql statement: alter database rename file ''+ASMDISK/ccdb/onlinelog/group_4.270.648573025'' to ''/oradata/ccdb/redo0401.log''

sql statement: alter database rename file ''+ASMDISK/ccdb/onlinelog/group_4.271.648573025'' to ''/oradata/ccdb/redo0402.log''

sql statement: alter database rename file ''+ASMDISK/ccdb/onlinelog/group_5.272.648573025'' to ''/oradata/ccdb/redo0501.log''

sql statement: alter database rename file ''+ASMDISK/ccdb/onlinelog/group_5.273.648573027'' to ''/oradata/ccdb/redo0502.log''

sql statement: alter database rename file ''+ASMDISK/ccdb/onlinelog/group_6.274.648573027'' to ''/oradata/ccdb/redo0601.log''

sql statement: alter database rename file ''+ASMDISK/ccdb/onlinelog/group_6.275.648573027'' to ''/oradata/ccdb/redo0602.log''

Starting restore at 2008-06-27 16:22:24

channel d1: starting datafile backupset restore
channel d1: specifying datafile(s) to restore from backup set
restoring datafile 00001 to /oradata/ccdb/system.dbf
restoring datafile 00002 to /oradata/ccdb/undotbs1.dbf
restoring datafile 00003 to /oradata/ccdb/sysaux.dbf
restoring datafile 00004 to /oradata/ccdb/users.dbf
restoring datafile 00005 to /oradata/ccdb/undotbs2.dbf
restoring datafile 00006 to /oradata/ccdb/unicall2x.dbf
restoring datafile 00007 to /oradata/ccdb/unicall2x_idx.dbf
channel d1: reading from backup piece /oradata/orabak/databackup/db_CCDB_900_1_20080620
channel d1: restored backup piece 1
piece handle=/oradata/orabak/databackup/db_CCDB_900_1_20080620 tag=TAG20080620T120035
channel d1: restore complete, elapsed time: 00:04:53
Finished restore at 2008-06-27 16:27:19

datafile 1 switched to datafile copy
input datafile copy recid=8 stamp=658513641 filename=/oradata/ccdb/system.dbf
datafile 2 switched to datafile copy
input datafile copy recid=9 stamp=658513641 filename=/oradata/ccdb/undotbs1.dbf
datafile 3 switched to datafile copy
input datafile copy recid=10 stamp=658513641 filename=/oradata/ccdb/sysaux.dbf
datafile 4 switched to datafile copy
input datafile copy recid=11 stamp=658513641 filename=/oradata/ccdb/users.dbf
datafile 5 switched to datafile copy
input datafile copy recid=12 stamp=658513641 filename=/oradata/ccdb/undotbs2.dbf
datafile 6 switched to datafile copy
input datafile copy recid=13 stamp=658513641 filename=/oradata/ccdb/unicall2x.dbf
datafile 7 switched to datafile copy
input datafile copy recid=14 stamp=658513641 filename=/oradata/ccdb/unicall2x_idx.dbf

released channel: d1

RMAN> recover database;

Starting recover at 2008-06-27 16:31:50
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=1091 devtype=DISK

starting media recovery

channel ORA_DISK_1: starting archive log restore to default destination
channel ORA_DISK_1: restoring archive log
archive log thread=2 sequence=687
channel ORA_DISK_1: restoring archive log
archive log thread=1 sequence=695
channel ORA_DISK_1: reading from backup piece /oradata/orabak/logbackup/log_CCDB_901_1_20080620
channel ORA_DISK_1: restored backup piece 1
piece handle=/oradata/orabak/logbackup/log_CCDB_901_1_20080620 tag=TAG20080620T120249
channel ORA_DISK_1: restore complete, elapsed time: 00:00:02
archive log filename=/oralog/ccdb/1_695_648572915.dbf thread=1 sequence=695
archive log filename=/oralog/ccdb/2_687_648572915.dbf thread=2 sequence=687
unable to find archive log
archive log thread=2 sequence=688
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 06/27/2008 16:32:07
RMAN-06054: media recovery requesting unknown log: thread 2 seq 688 lowscn 26818080041

RMAN> alter database open resetlogs;

database opened

RMAN> list incarnation of database;


List of Database Incarnations
DB Key Inc Key DB Name DB ID STATUS Reset SCN Reset Time
------- ------- -------- ---------------- --- ---------- ----------
1 1 CCDB 3276392049 PARENT 1 2006-11-20 20:22:09
2 2 CCDB 3276392049 PARENT 561064 2008-03-05 15:08:35
3 3 CCDB 3276392049 CURRENT 26818080042 2008-06-27 16:32:25

RMAN>

 

转载于:https://www.cnblogs.com/weixun/p/3226658.html

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/360524.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

php event_base_new,php event拓展基本使用

php event拓展基本使用2019-02-04 22:02:28(527)1. 确定io复用类型(select/poll/epoll)php$cfg new EventConfig();$cfg->avoidMethod("select");$cfg->avoidMethod("epoll");$base new EventBase($cfg);$sig Event::signal($base, SIGTERM, func…

OSGi服务测试助手:ServiceRegistrationRule

OSGi服务测试可以有效避免与悬挂的服务引用有关的问题。 就像我在写简单服务贡献验证中所承诺的那样,这次我引入了一个JUnit规则 ,该规则有助于测试组件之间的交互。 OSGi服务测试组件交互 假设我们有一个服务,该服务通知根据whiteboard-pat…

php 在函数里打开链接,JavaScript中打开链接的几种方法介绍

如何使用JavaScript打开链接?本篇文章我们就来看看使用JavaScript打开链接的几种方法介绍。我们先来看一段代码使用Javascript实现打开链接,需要在location.href中替换要打开的链接的URL。location.href http://www.php.cn/blog.html;通过上述代码我们可…

三代基因组测序技术原理简介

考虑到cnblog不适合基因组领域这种类型的文章, 最终,我自己开通了公众号:碱基矿工,欢迎感兴趣的同学关注! 也可以关注我的知乎:https://www.zhihu.com/people/yellowtree/activities 2018年1月修改&#x…

Java并发教程–锁定:显式锁定

1.简介 在许多情况下,使用隐式锁定就足够了。 有时,我们将需要更复杂的功能。 在这种情况下, java.util.concurrent.locks包为我们提供了锁定对象。 当涉及到内存同步时,这些锁的内部机制与隐式锁相同。 区别在于显式锁提供了其他…

POJ 1422 Air Raid (最小路径覆盖)

题意 给定一个有向图&#xff0c;在这个图上的某些点上放伞兵&#xff0c;可以使伞兵可以走到图上所有的点。且每个点只被一个伞兵走一次。问至少放多少伞兵。 思路 裸的最小路径覆盖。 最小路径覆盖 【路径覆盖】在一个有向图G(V, E<u,v>)中&#xff0c;路径覆盖就是在图…

自编码网络粒子群matlab,粒子群算法优化BP

这是数据1999 1611 1746 1277 753 323 229 7.10561325 1064 1414 1026 430 191 153 24.54521125 839 1197 857 301 168 139 …

在非托管对象中使用Spring托管Bean

即使我们想使用现有的最佳和最新技术&#xff0c;我们也必须处理遗留代码。 想象一下&#xff0c;新代码是用Spring框架的最新技术编写的&#xff0c;而旧代码根本不是用Spring编写的。 然后在非托管Spring对象中使用Spring托管Bean是我们必须处理的模式之一。 遗留代码具有非托…

lda php,主题模型︱几款新主题模型——SentenceLDA、CopulaLDA、TWE简析与实现

[导读]百度最近开源了一个新的关于主题模型的项目。文档主题推断工具、语义匹配计算工具以及基于工业级语料训练的三种主题模型&#xff1a;LatentDirichlet Allocation(LDA)、SentenceLDA 和Topical Word Embedding(TWE)。一、Familia简介帮Familia&#xff0c;打个小广告~ F…

Spring项目中的Netflix Archaius属性

Archaius基础 Netflix Archaius是用于管理应用程序配置的库。 考虑一个属性文件“ sample.properties”&#xff0c;其中包含一个名为“ myprop”的属性&#xff1a; mypropmyprop_value_default这是使用Archaius加载文件的方式&#xff1a; ConfigurationManager.loadCascad…

linux进程之间传递句柄

参考网上的实现&#xff0c;进行了一点改进&#xff0c;本来想用FIFO实现的&#xff0c;后来发现不行&#xff0c;必须使用系统的sendmsg函数&#xff0c;代码格式有点乱&#xff0c;不过功能可以实现&#xff0c;改天有空整理一下~~ 讲究看哈~ #include <sys/types.h>#i…

php 中间代码,PHP内核中用户函数、内部函数和中间代码的转换

昨天和一朋友在邮件中讨论这样一个问题&#xff1a;zend_internal_function&#xff0c;zend_function&#xff0c;zend_op_array这三种结构是可以相互转化的&#xff0c;这三者的转化是如何进行的呢&#xff1f; 以此文&#xff0c;总结。在函数调用的执行代码中我们会看到这样…

Byteman –用于字节码操纵的瑞士军刀

我正在JBoss的许多社区中工作&#xff0c;有很多有趣的事情要谈论&#xff0c;以至于我自己无法将自己的每一分都缠住。 这就是为什么我非常感谢有机会不时地欢迎客座博客的主要原因。 今天是Jochen Mader&#xff0c;他是以代码为中心的书呆子群的一部分。 目前&#xff0c;他…

最短路径问题matlab作图,[MATLAB基础] matlab最短路径的输出问题,用了递归,但程序出错了,请大虾指点...

matlab最短路径的输出问题,用了递归,但程序出错了,请大虾指点 程序如下function shortestpath(w,p,q)c->;l;f;tsize(w);mt(1,1);azeros(m,m);vw;for k1:mfor i1:mfor j1:mb[w(i,j),w(i,k)w(k,j)];w(i,j)min(b);if w(i,j)~v(i,j)a(i,j)k;%a(i,j)10*a(i,j)k;vw;endendendendw;…

快速浏览JAX-RS请求与方法匹配

在本文中&#xff0c;我们来看一下JAX-RS中与资源方法匹配的HTTP请求 。 它是JAX-RS的最基本功能之一。 通常&#xff0c;使用JAX-RS API的开发人员不会接触&#xff08;或真正不需要知道&#xff09; 匹配过程的细节&#xff0c;请放心&#xff0c;由于我们的RESTful&#xff…

$stat php,php stat函数怎么用

php stat函数用于返回关于文件的信息&#xff0c;其语法是fstat(file)&#xff0c;参数file必需&#xff0c;指规定要检查的文件。php stat函数怎么用&#xff1f;定义和用法stat() 函数返回关于文件的信息。语法fstat(file)参数file必需。规定要检查的文件。说明获取由 file 指…

在Java中调用祖父母方法:您不能

在文章保护的重点中&#xff0c;我详细介绍了“受保护”如何扩展“包私有”访问。 我在那儿写道&#xff1a; 你能做的是 覆盖子类中的方法或 使用关键字super调用parent方法。 通常&#xff0c;这实际上是您可以使用受保护的方法完成的所有操作。 &#xff08;请注意&…

Handler(2)

andriod提供了Handler 和 Looper 来满足线程间的通信。Handler先进先出原则。Looper类用来管理特定线程内对象之间的消息交换(MessageExchange)。1)Looper: 一个线程可以产生一个Looper对象&#xff0c;由它来管理此线程里的MessageQueue(消息队列)。 2)Handler: 你可以构造Han…

OSGi服务测试助手:ServiceCollector

OSGi服务对于基于松耦合组件的系统开发非常有用。 但是&#xff0c;松散的耦合可能使得难以识别与悬挂服务引用有关的问题。 因此&#xff0c;我们通常运行集成测试以确保运行时服务组件的可用性。 为了减少此类测试所需的样板&#xff0c;我编写了一个简单的实用程序类来获取…

搭建struts2框架

struts是一个经典的MVC模式拦截器比过滤器拦截的力度更大 搭建struts2框架1.引入lib包 9个(2.3版本的)common-fileupload;common-io;common-lang3;common-logging;freemaker;javassistGA;ognl;struts2-core;xwork-core; 2. struts2.xml3. web.xml将所有的跳转都交给struts2处…