Custom Search . . .

Monday, May 3, 2010

CRS diagnostic collection tool Mandatory argument 'crshome' is missing.




diagcollection.pl fails with mandatory argument 'crshome' is missing

# Usage:
# diagcollection --collect :: collects diagnostic information
#                --clean   :: cleans up diagnostic information archive
#                --coreanalyze   :: extracts diag info from core files

Run the diagcollection.pl script as the root user to collect diagnostic information from an Oracle Clusterware installation.

The additional information provides to oracle support services to resolve internal issues. When I try to collect crs logs using diagcollection.pl got the below error message.

diagcollection.pl fails with mandatory argument 'crshome' is missing



[root@linux1 bin]# ./diagcollection.pl collect
Production Copyright 2004, 2005, Oracle.  All rights reserved
Cluster Ready Services (CRS) diagnostic collection tool
diagcollection
    --collect
             [--crs] For collecting crs diag information
             [--oh]  For collecting oracle home diag information
             [--all] Default.For collecting all diag information.
             [--core] UNIX only. Does not package core files.
             [--afterdate] UNIX only. Collects archives from the specified date.
             [--crshome] Argument that specifies the CRS Home location
             NOTE:
             1. You can also do the following
                ./diagcollection.pl --collect --crs --oh
             2. ORACLE_HOME env variable needs to be set.

     --clean        cleans up the diagnosability
                    information gathered by this script

     --coreanalyze  UNIX only. Extracts information from core files
                    and stores it in a text file
[root@linux1 bin]# pwd
/u01/app/oracle/product/10.2.0/crs/bin

 [root@linux1 bin]# ./diagcollection.pl --collect
Production Copyright 2004, 2005, Oracle.  All rights reserved
Cluster Ready Services (CRS) diagnostic collection tool
Mandatory argument 'crshome' is missing.

As per oracle document this bug from 10.2.0.4 to 11.1.0.6. Tried the below workaround it was working fine.

 [root@linux1 bin]# pwd
/u01/app/oracle/product/10.2.0/crs/bin

 [root@linux1 bin]# export ORA_CRS_HOME=/u01/app/oracle/product/10.2.0/crs

 [root@linux1 bin]# ./diagcollection.pl --collect --crs --crshome $ORA_CRS_HOME

Production Copyright 2004, 2005, Oracle.  All rights reserved
Cluster Ready Services (CRS) diagnostic collection tool
The following CRS diagnostic archives will be created in the local directory.
crsData_linux1.tar.gz -> logs,traces and cores from CRS home. Note: core files will be packaged only with the -core option.
ocrData_linux1.tar.gz -> ocrdump, ocrcheck etc
coreData_linux1.tar.gz -> contents of CRS core files in text format

Collecting crs data
/bin/tar: Removing leading `/' from member names
Collecting OCR data
Collecting information from core files





[root@linux1 bin]# ./diagcollection.pl --clean --crs --crshome $ORA_CRS_HOME
Production Copyright 2004, 2005, Oracle.  All rights reserved
Cluster Ready Services (CRS) diagnostic collection tool
Cleaning up tar and gzip files
Done

Have a great day.. :)

Sunday, May 2, 2010

RMAN Incomplete Recovery


Take complete RMAN FULL backup

rman > backup database;

SQL> create table test (a int);

Table created.


SQL> begin
  2  for i in 1..50 loop
  3  insert into test values (i);
  4  end loop;
  5  commit;
  6  end;
  7  /

PL/SQL procedure successfully completed.

SQL> commit;

Commit complete.

SQL> select to_char(sysdate,'dd-mm-yy hh24:mi:ss') from dual;

TO_CHAR(SYSDATE,'
-----------------
01-05-10 16:25:00

SQL> delete from test;

50 rows deleted.

SQL> commit;

Commit complete.

SQL> select count(*) from test;

  COUNT(*)
----------
         0

RMAN> run
2> {
3> shutdown immediate
4> startup mount
5> allocate channel c1 type disk;
6> allocate channel c2 type disk;
7> set until time "to_date('01-05-2010 16:25:00','DD-MM-YYYY HH24:MI:SS')";
8> restore database;
9> recover database;
10> }

database dismounted
Oracle instance shut down

connected to target database (not started)
Oracle instance started
database mounted

Total System Global Area     209235968 bytes

Fixed Size                     1332188 bytes
Variable Size                138415140 bytes
Database Buffers              62914560 bytes
Redo Buffers                   6574080 bytes

allocated channel: c1
channel c1: SID=154 device type=DISK

allocated channel: c2
channel c2: SID=153 device type=DISK

executing command: SET until clause

Starting restore at 01-MAY-10

channel c1: starting datafile backup set restore
channel c1: specifying datafile(s) to restore from backup set
channel c1: restoring datafile 00003 to F:\ORACLE\PRODUCT\11.0.1\ORADATA\ORCL\DATA\UNDOTBS01.DBF
channel c1: restoring datafile 00004 to F:\ORACLE\PRODUCT\11.0.1\ORADATA\ORCL\DATA\USERS01.DBF
channel c1: reading from backup piece I:\BACKUP\ORCL\ORCL_20100501_0ILCJKUR_S18_P1
channel c2: starting datafile backup set restore
channel c2: specifying datafile(s) to restore from backup set
channel c2: restoring datafile 00001 to F:\ORACLE\PRODUCT\11.0.1\ORADATA\ORCL\DATA\SYSTEM01.DBF
channel c2: restoring datafile 00002 to F:\ORACLE\PRODUCT\11.0.1\ORADATA\ORCL\DATA\SYSAUX01.DBF
channel c2: restoring datafile 00005 to F:\ORACLE\PRODUCT\11.0.1\ORADATA\ORCL\DATA\TEST010_2.DBF
channel c2: reading from backup piece I:\BACKUP\ORCL\ORCL_20100501_0HLCJKUQ_S17_P1
channel c1: piece handle=I:\BACKUP\ORCL\ORCL_20100501_0ILCJKUR_S18_P1 tag=TAG20100501T162042
channel c1: restored backup piece 1
channel c1: restore complete, elapsed time: 00:00:45
channel c2: piece handle=I:\BACKUP\ORCL\ORCL_20100501_0HLCJKUQ_S17_P1 tag=TAG20100501T162042
channel c2: restored backup piece 1
channel c2: restore complete, elapsed time: 00:01:05
Finished restore at 01-MAY-10

Starting recover at 01-MAY-10

starting media recovery
media recovery complete, elapsed time: 00:00:02

Finished recover at 01-MAY-10
released channel: c1
released channel: c2

RMAN> alter database open resetlogs;

database opened

RMAN>

SQL> select count(*) from test;

  COUNT(*)
----------
        50

For recover single database objects not require go with RMAN. According to oracle document we should go with oracle utilities (export/import) or oracle flashback option.

For my scenario I don’t have logical backup as well as flashback option also not enabled.

Using RMAN incomplete recovery tried to recover single objects J

RMAN-06555: datafile 1 must be restored from backup created before 01-MAY-10

RMAN> recover database until time="TO_DATE('2010-05-01 1300:00','YYYY-MM-DD HH24:MI:SS')";


Starting recover at 01-MAY-10
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=150 device type=DISK
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 05/01/2010 15:19:10
RMAN-06555: datafile 1 must be restored from backup created before 01-MAY-10


The  above error got during database recover stage. Because of this i tried with different point in time


RMAN> shutdown immediate


database dismounted
Oracle instance shut down




RMAN>  run
2> {
3> startup mount
4> allocate channel c1 type disk;
5> allocate channel c2 type disk;
6> set until time="TO_DATE('2010-05-01 14:40:00','YYYY-MM-DD HH24:MI:SS')";
7> restore database;
8> recover database;
9> }


database is already started


allocated channel: c1
channel c1: SID=154 device type=DISK


allocated channel: c2
channel c2: SID=153 device type=DISK


executing command: SET until clause


Starting restore at 01-MAY-10


channel c1: starting datafile backup set restore
channel c1: specifying datafile(s) to restore from backup set
channel c1: restoring datafile 00003 to F:\ORACLE\PRODUCT\11.0.1\ORADATA\ORCL\DATA\UNDOTBS01.DBF
channel c1: restoring datafile 00004 to F:\ORACLE\PRODUCT\11.0.1\ORADATA\ORCL\DATA\USERS01.DBF
channel c1: reading from backup piece I:\BACKUP\ORCL\ORCL_20100501_04LCJA23_S4_P1
channel c2: starting datafile backup set restore
channel c2: specifying datafile(s) to restore from backup set
channel c2: restoring datafile 00001 to F:\ORACLE\PRODUCT\11.0.1\ORADATA\ORCL\DATA\SYSTEM01.DBF
channel c2: restoring datafile 00002 to F:\ORACLE\PRODUCT\11.0.1\ORADATA\ORCL\DATA\SYSAUX01.DBF
channel c2: restoring datafile 00005 to F:\ORACLE\PRODUCT\11.0.1\ORADATA\ORCL\DATA\TEST010_2.DBF
channel c2: reading from backup piece I:\BACKUP\ORCL\ORCL_20100501_03LCJA23_S3_P1
channel c1: piece handle=I:\BACKUP\ORCL\ORCL_20100501_04LCJA23_S4_P1 tag=TAG20100501T131443
channel c1: restored backup piece 1
channel c1: restore complete, elapsed time: 00:00:45
channel c2: piece handle=I:\BACKUP\ORCL\ORCL_20100501_03LCJA23_S3_P1 tag=TAG20100501T131443
channel c2: restored backup piece 1
channel c2: restore complete, elapsed time: 00:01:05
Finished restore at 01-MAY-10


Starting recover at 01-MAY-10


starting media recovery


channel c1: starting archived log restore to default destination
channel c1: restoring archived log
archived log thread=1 sequence=72
channel c1: reading from backup piece I:\BACKUP\ORCL\ORCL_ARCH_20100501_07LCJA81_S7_P1
channel c1: piece handle=I:\BACKUP\ORCL\ORCL_ARCH_20100501_07LCJA81_S7_P1 tag=TAG20100501T131550
channel c1: restored backup piece 1
channel c1: restore complete, elapsed time: 00:00:01
archived log file name=D:\ARCHIVELOG\ORCL\ORCL_ARC00072_0715935770.001 thread=1 sequence=72
unable to find archived log
archived log thread=1 sequence=73
released channel: c1
released channel: c2
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 05/01/2010 15:28:25
RMAN-06054: media recovery requesting unknown archived log for thread 1 with sequence 73 and starting SCN of 1178194

Even still i got different error message. The sequence 73 archive log file not in my archive log destination but still it's asking archive log file. 

I guess there is no way for medio recovery with this archive log. I just try to open the database with resetlog it's working fine. :)..

Share me with your feedback/suggestions. Thanks