不多说,直接上脚本。
RMAN> @validate_section.sql
RMAN> run
2> {
3> allocate channel c1 device type disk;
4> allocate channel c2 device type disk;
5> allocate channel c3 device type disk;
6> validate datafile 4 section size 1G;
7> release channel c1;
8> release channel c2;
9> release channel c3;
10> }
released channel: ORA_DISK_1
released channel: ORA_DISK_2
released channel: ORA_DISK_3
released channel: ORA_DISK_4
released channel: ORA_DISK_5
allocated channel: c1
channel c1: SID=138 device type=DISK
allocated channel: c2
channel c2: SID=199 device type=DISK
allocated channel: c3
channel c3: SID=73 device type=DISK
Starting validate at 2017-03-05 18:04:08
released channel: c1
released channel: c2
released channel: c3
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of validate command at 03/05/2017 18:04:08
RMAN-06808: SECTION SIZE cannot be used when piece limit is in effect
RMAN> **end-of-file**
RMAN> show all;
RMAN configuration parameters for database with db_unique_name ORCL2 are:
CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 7 DAYS;
CONFIGURE BACKUP OPTIMIZATION ON;
CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default
CONFIGURE CONTROLFILE AUTOBACKUP ON;
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '%F'; # default
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE SBT_TAPE TO '%F'; # default
CONFIGURE DEVICE TYPE DISK BACKUP TYPE TO COMPRESSED BACKUPSET PARALLELISM 5;
CONFIGURE DEVICE TYPE 'SBT_TAPE' PARALLELISM 3 BACKUP TYPE TO BACKUPSET;
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE SBT_TAPE TO 1; # default
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE SBT_TAPE TO 1; # default
CONFIGURE CHANNEL DEVICE TYPE DISK MAXPIECESIZE 5 G;
CONFIGURE MAXSETSIZE TO 5 G;
CONFIGURE ENCRYPTION FOR DATABASE OFF; # default
CONFIGURE ENCRYPTION ALGORITHM 'AES128'; # default
CONFIGURE COMPRESSION ALGORITHM 'BASIC' AS OF RELEASE 'DEFAULT' OPTIMIZE FOR LOAD TRUE ; # default
CONFIGURE ARCHIVELOG DELETION POLICY TO BACKED UP 2 TIMES TO DISK;
CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/home/oracle/app/oracle/product/11.2.0/dbhome_1/dbs/snapcf_orcl2.f'; # default
RMAN> configure channel device type disk clear;
old RMAN configuration parameters:
CONFIGURE CHANNEL DEVICE TYPE DISK MAXPIECESIZE 5 G;
old RMAN configuration parameters are successfully deleted
RMAN> show all;
RMAN configuration parameters for database with db_unique_name ORCL2 are:
CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 7 DAYS;
CONFIGURE BACKUP OPTIMIZATION ON;
CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default
CONFIGURE CONTROLFILE AUTOBACKUP ON;
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '%F'; # default
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE SBT_TAPE TO '%F'; # default
CONFIGURE DEVICE TYPE DISK BACKUP TYPE TO COMPRESSED BACKUPSET PARALLELISM 5;
CONFIGURE DEVICE TYPE 'SBT_TAPE' PARALLELISM 3 BACKUP TYPE TO BACKUPSET;
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE SBT_TAPE TO 1; # default
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE SBT_TAPE TO 1; # default
CONFIGURE MAXSETSIZE TO 5 G;
CONFIGURE ENCRYPTION FOR DATABASE OFF; # default
CONFIGURE ENCRYPTION ALGORITHM 'AES128'; # default
CONFIGURE COMPRESSION ALGORITHM 'BASIC' AS OF RELEASE 'DEFAULT' OPTIMIZE FOR LOAD TRUE ; # default
CONFIGURE ARCHIVELOG DELETION POLICY TO BACKED UP 2 TIMES TO DISK;
CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/home/oracle/app/oracle/product/11.2.0/dbhome_1/dbs/snapcf_orcl2.f'; # default
RMAN> @validate_section.sql
RMAN> run
2> {
3> allocate channel c1 device type disk;
4> allocate channel c2 device type disk;
5> allocate channel c3 device type disk;
6> validate datafile 4 section size 1G;
7> release channel c1;
8> release channel c2;
9> release channel c3;
10> }
allocated channel: c1
channel c1: SID=138 device type=DISK
allocated channel: c2
channel c2: SID=199 device type=DISK
allocated channel: c3
channel c3: SID=73 device type=DISK
Starting validate at 2017-03-05 18:05:01
released channel: c1
released channel: c2
released channel: c3
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of validate command at 03/05/2017 18:05:01
RMAN-06808: SECTION SIZE cannot be used when piece limit is in effect
RMAN> **end-of-file**
RMAN> exit
Recovery Manager complete.
[oracle@localhost scripts]$ rman target /
Recovery Manager: Release 11.2.0.4.0 - Production on Sun Mar 5 18:05:07 2017
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
connected to target database: ORCL2 (DBID=1411348214)
RMAN> @validate_section.sql
RMAN> run
2> {
3> allocate channel c1 device type disk;
4> allocate channel c2 device type disk;
5> allocate channel c3 device type disk;
6> validate datafile 4 section size 1G;
7> release channel c1;
8> release channel c2;
9> release channel c3;
10> }
using target database control file instead of recovery catalog
allocated channel: c1
channel c1: SID=136 device type=DISK
allocated channel: c2
channel c2: SID=199 device type=DISK
allocated channel: c3
channel c3: SID=71 device type=DISK
Starting validate at 2017-03-05 18:05:11
channel c1: starting validation of datafile
channel c1: specifying datafile(s) for validation
input datafile file number=00004 name=/home/oracle/app/oracle/oradata/orcl2/users01.dbf
validating blocks 1 through 131072
channel c2: starting validation of datafile
channel c2: specifying datafile(s) for validation
input datafile file number=00004 name=/home/oracle/app/oracle/oradata/orcl2/users01.dbf
validating blocks 131073 through 262144
channel c1: validation complete, elapsed time: 00:00:01
channel c2: validation complete, elapsed time: 00:00:01
List of Datafiles
=================
File Status Marked Corrupt Empty Blocks Blocks Examined High SCN
---- ------ -------------- ------------ --------------- ----------
4 OK 0 139 262170 103320276
File Name: /home/oracle/app/oracle/oradata/orcl2/users01.dbf
Block Type Blocks Failing Blocks Processed
---------- -------------- ----------------
Data 0 260580
Index 0 44
Other 0 1380
Finished validate at 2017-03-05 18:05:12
released channel: c1
released channel: c2
released channel: c3
RMAN> **end-of-file**
RMAN>