Archive

Archive for the ‘Utilities’ Category

Oracle: SQL*Plus displays “No errors.”

August 18th, 2011 Matthias Pölzinger No comments

Problem description:

Your are compiling an object, but it fails with an error. If you are trying to check the error message(s) for the compilation, SQL*Plus displays “No errors.”:

SQL> ALTER VIEW VIEWNAME compile;
 
Warning: VIEW altered WITH compilation errors.
 
SQL> SHOW errors
No errors.
SQL>

 
Problem resolution:

“show errors” only displays the last error message generated. In some cases (like above) no error messsage will be displayed. In order to force the display of error messages for a specific object, make use of the full functionality of “show errors” and specify the type and name of your object:

SQL> SHOW errors VIEW VIEWNAME
Errors FOR VIEW VIEWNAME:
 
LINE/COL ERROR
-------- -----------------------------------------------------------------
0/0      ORA-01730: invalid NUMBER OF COLUMN names specified
SQL>

 
You can also use this method to display errors for other objects and object types:

SHOW ERR[ORS] [{FUNCTION | PROCEDURE | PACKAGE | PACKAGE BODY | TRIGGER |
                VIEW | TYPE | TYPE BODY | DIMENSION | JAVA CLASS} [schema.]name]
Categories: Oracle, SQLPlus, Utilities Tags:

Oracle: How to compile strmmon (Streams Monitoring Utility) on UNIX systems

The Streams Monitoring Utility strmmon is a very useful utility for monitoring current Streams activity. You can use it to obtain the current figures for capture, propagation and apply activity in vmstat-style.

To obtain the latest version of the utility use the following link to download it in a zip-file format: strmmon.zip

Compilation on systems prior 10gR2:

  1. Download the latest version
  2. extract the version on your database server in a strmmon directory
  3. make sure that you have set ORACLE_HOME and LD_LIBRARY_PATH correctly
  4. compile the binary inside the directory strmmon using “make -f strmmon.mk strmmon”

Compilation on 10gR2 systems:

  1. Download the latest version
  2. extract the version on your database server in a strmmon directory
  3. copy the files strmmon.c and strmmon.html to your $ORACLE_HOME/rdbms/demo directory
  4. cd $ORACLE_HOME/rdbms/demo
  5. make -f rdbms_demo.mk strmmon

For Oracle Database systems version 11g onwards, strmmon has been replaced by Oracle Streams performance/diagnostic related dictionary views and the DBMS_STREAMS_ADVISOR_ADM PL/SQL Package.

Example on 10.2.0.1:

oracle@oracle01:~$ mkdir strmmon
oracle@oracle01:~$ cd strmmon/
oracle@oracle01:~/strmmon$ mv /tmp/strmmon.zip .
oracle@oracle01:~/strmmon$ unzip strmmon.zip
Archive:  strmmon.zip
inflating: strmmon.mk
inflating: strmmon.htm
inflating: strmmon.c
oracle@oracle01:~/strmmon$ cp strmmon.c $ORACLE_HOME/rdbms/demo
oracle@oracle01:~/strmmon$ cp strmmon.htm $ORACLE_HOME/rdbms/demo
oracle@oracle01:~/strmmon$ cd $ORACLE_HOME/rdbms/demo
oracle@oracle01:/u01/app/oracle/product/10.2.0/db_1/rdbms/demo$ make -f demo_rdbms.mk strmmon
make -f /u01/app/oracle/product/10.2.0/db_1/rdbms/demo/demo_rdbms.mk build EXE=strmmon OBJS=strmmon.o
make[1]: Entering directory `/u01/app/oracle/product/10.2.0/db_1/rdbms/demo'
/usr/bin/gcc -c -I/u01/app/oracle/product/10.2.0/db_1/rdbms/demo -I/u01/app/oracle/product/10.2.0/db_1/rdbms/public -I/u01/app/oracle/product/10.2.0/db_1/plsql/public -I/u01/app/oracle/product/10.2.0/db_1/network/public -I/u01/app/oracle/product/10.2.0/db_1/precomp/public strmmon.c
/usr/bin/gcc -L/u01/app/oracle/product/10.2.0/db_1/lib/ -L/u01/app/oracle/product/10.2.0/db_1/rdbms/lib/ -o strmmon strmmon.o -lclntsh   `cat /u01/app/oracle/product/10.2.0/db_1/lib/sysliblist` -ldl -lm
make[1]: Leaving directory `/u01/app/oracle/product/10.2.0/db_1/rdbms/demo'
oracle@oracle01:/u01/app/oracle/product/10.2.0/db_1/rdbms/demo$

Execution example:

oracle@oracle01:/u01/app/oracle/product/10.2.0/db_1/rdbms/demo$ ./strmmon
Usage: strmmon -interval <seconds> -count <number> [-user <user name>]
[-passw <password>] [-dbname <database name>] [-sysdba]
[-long]
 
oracle@oracle01:/u01/app/oracle/product/10.2.0/db_1/rdbms/demo$ ./strmmon -interval 1 -count 5 -user strmadmin -passw SOME_PW -dbname db.initso.at
 
STREAMS Monitor, v 2.6  Copyright Oracle Corp. 2002, 2005.
Interval = 1, Count=5
 
Logon=strmadmin@db.initso.at ORACLE 10.2.0.1.0
 
Streams Pool Size = 132M
 
NET: <client bytes per sec> <dblink bytes per sec>
Cxxx: <lcrs captured per sec> <lcrs enqueued per sec> <capture latency>
PRxx: <messages received per sec>
Qx  : <msgs enqueued per sec> <msgs spilled per sec>
PSxx: <lcrs propagated per sec> <bytes propaged per sec>
Axxx: <lcrs applied per sec> <txns applied per sec> <dequeue latency>
<F>: flow control in effect
<B>: potential bottleneck
AR: apply reader
AS(n): n number of apply server
<x%I x%F x%xx>: <idle wait events percentage> <flow control wait events percentage> <other wait event percentage and name>
xx->: database instance name
 
2009-01-15 16:14:18 || orcl-> |      |
2009-01-15 16:14:19 || orcl-> | NET 16K 0 | <B> C002 0 0 0sec <97%I 0%F ->  |  -  C001 6 0 0sec <97%I 0%F ->  | Q54516 0 0 | PS01 0 0 0 | Q53876 0 0 | PS02 0 0 0
2009-01-15 16:14:20 || orcl-> | NET 13K 0 | <B> C002 0 0 0sec <97%I 0%F ->  |  -  C001 0 0 0sec <97%I 0%F ->  | Q54516 0 0 | PS01 0 0 0 | Q53876 0 0 | PS02 0 0 0
2009-01-15 16:14:21 || orcl-> | NET 13K 0 |  -  C002 6 0 3sec <100%I 0%F ->  |  -  C001 0 0 0sec <97%I 0%F ->  | Q54516 0 0 | PS01 0 0 0 | Q53876 0 0 | PS02 0 0 0
2009-01-15 16:14:23 || orcl-> | NET 6K 0 |  -  C002 0 0 3sec <48%I 0%F ->  |  -  C001 0 0 0sec <48%I 0%F ->  | Q54516 0 0 | PS01 0 0 0 | Q53876 0 0 | PS02 0 0 0
oracle@oracle01:/u01/app/oracle/product/10.2.0/db_1/rdbms/demo$
Categories: Oracle, Streams, STRMMON, Utilities Tags:

Oracle: How to easily display the execution plan of a statement located in the shared pool (command line style)

Problem description:

You want to review the execution plan of a statement currently or previously executed by a session and Oracle Enterprise Manager is not use. Querying V$SQL_PLAN would give you the requested information, but not quiet comfortable.

 
Problem resolution:

As with “EXPLAIN PLAN” generated execution plans, you can use DBMS_XPLAN in order to display the execution plan for a statement in the shared pool. To be more specific, the function DISPLAY_CURSOR will provide you the information by passing the sql_id and cursor child number of the statement in concern:

DBMS_XPLAN.DISPLAY_CURSOR(
   sql_id        IN  VARCHAR2  DEFAULT  NULL,
   child_number  IN  NUMBER    DEFAULT  NULL, 
   format        IN  VARCHAR2  DEFAULT  'TYPICAL');

In addition DBMS_XPLAN.DISPLAY_CURSOR can provide you various plan statistics such as I/O, memory and timing by specifying the format:

  • BASIC: Displays the minimum information in the plan—the operation ID, the operation name and its option.
  • TYPICAL: This is the default. Displays the most relevant information in the plan (operation id, name and option, #rows, #bytes and optimizer cost). Pruning, parallel and predicate information are only displayed when applicable. Excludes only PROJECTION, ALIAS and REMOTE SQL information (see below).
  • SERIAL: Like TYPICAL except that the parallel information is not displayed, even if the plan executes in parallel.
  • ALL: Maximum user level. Includes information displayed with the TYPICAL level with additional information (PROJECTION, ALIAS and information about REMOTE SQL if the operation is distributed).

In addition following keywords can be added to above standard formats in order to customize the output. These keywords must be separated by a comma or a space:

  • ROWS – if relevant, shows the number of rows estimated by the optimizer
  • BYTES – if relevant, shows the number of bytes estimated by the optimizer
  • COST – if relevant, shows optimizer cost information
  • PARTITION – if relevant, shows partition pruning information
  • PARALLEL – if relevant, shows PX information (distribution method and table queue information)
  • PREDICATE – if relevant, shows the predicate section
  • PROJECTION -if relevant, shows the projection section
  • ALIAS – if relevant, shows the “Query Block Name / Object Alias” section
  • REMOTE – if relevant, shows the information for distributed query (for example, remote from serial distribution and remote SQL)
  • NOTE – if relevant, shows the note section of the explain plan
  • IOSTATS – assuming that basic plan statistics are collected when SQL statements are executed (either by using the gather_plan_statistics hint or by setting the parameter statistics_level to ALL), this format will show IO statistics for ALL (or only for the LAST as shown below) executions of the cursor.
  • MEMSTATS – Assuming that PGA memory management is enabled (that is, pga_aggregate_target parameter is set to a non 0 value), this format allows to display memory management statistics (for example, execution mode of the operator, how much memory was used, number of bytes spilled to disk, and so on). These statistics only apply to memory intensive operations like hash-joins, sort or some bitmap operators.
  • ALLSTATS – A shortcut for ‘IOSTATS MEMSTATS’
  • LAST – By default, plan statistics are shown for all executions of the cursor. The keyword LAST can be specified to see only the statistics for the last execution.

 
Examples:

  • Display the execution for your the last executed statement of your session

    SQL> SELECT * FROM TABLE(dbms_xplan.display_cursor);
     
    PLAN_TABLE_OUTPUT
    ------------------------------------------------------------------------------------------------------------------------------------------------------
    SQL_ID	dt0hqkzcdq5ny, child NUMBER 1
    -------------------------------------
    SELECT * FROM TABLE(dbms_xplan.display_cursor)
     
    Plan hash VALUE: 3713220770
     
    ----------------------------------------------------------------------------------------------------
    | Id  | Operation			  | Name	   | ROWS  | Bytes | Cost (%CPU)| TIME	   |
    ----------------------------------------------------------------------------------------------------
    |   0 | SELECT STATEMENT		  |		   |	   |	   |	24 (100)|	   |
    |   1 |  COLLECTION ITERATOR PICKLER FETCH| DISPLAY_CURSOR |	 4 |	 8 |	24   (0)| 00:00:01 |
    ----------------------------------------------------------------------------------------------------
     
    Note
    -----
       - cardinality feedback used FOR this statement
     
     
    17 ROWS selected.
     
    SQL>

     

  • Display the execution plan for a specific statement executed by another session:

    SQL> SELECT sid, sql_id, sql_child_number FROM v$session WHERE sid = 1934;
     
           SID SQL_ID	 SQL_CHILD_NUMBER
    ---------- ------------- ----------------
          1934 2rk5134pp7s3g		1
     
    SQL> 
    SQL> SELECT * FROM TABLE(dbms_xplan.display_cursor('2rk5134pp7s3g', 1));
     
    PLAN_TABLE_OUTPUT
    ------------------------------------------------------------------------------------------------------------------------------------
    SQL_ID	2rk5134pp7s3g, child NUMBER 1
    -------------------------------------
    UPDATE myschema.bycicle SET comment = :comment
    WHERE id = :id
     
    Plan hash VALUE: 960803932
     
    -------------------------------------------------------------------------------------
    | Id  | Operation	   | Name	    | ROWS  | Bytes | Cost (%CPU)| TIME     |
    -------------------------------------------------------------------------------------
    |   0 | UPDATE STATEMENT   |		    |	    |	    |	  1 (100)|	    |
    |   1 |  UPDATE 	   | BYCICLE	    |	    |	    |		 |	    |
    |*  2 |   INDEX UNIQUE SCAN| BYCICLE#ID     |	  1 |	167 |	  1   (0)| 00:00:01 |
    -------------------------------------------------------------------------------------
     
    Predicate Information (IDENTIFIED BY operation id):
    ---------------------------------------------------
     
       2 - access("ID"=:ID)
     
     
    20 ROWS selected.
     
    SQL>
  • Display execution plan for all children of a specific SQL_ID:

    SELECT * FROM TABLE(dbms_xplan.display_cursor('2rk5134pp7s3g'));

 
References:

Categories: Oracle, SQLPlus, Tuning Tags:

Oracle Character Scanner: csscan is 0 (zero) bytes in size on Solaris SPARC

Problem description:

You are trying to perform a character set scan on Solaris (SPARC), but the binary is exiting immediately:

oracle@ora01 $ cd $ORACLE_HOME/bin
oracle@ora01 $ ./csscan help=y
oracle@ora01 $ echo $?
0
oracle@ora01 $

 
When checking the executable, you’ll see a size of 0 bytes:

oracle@solaris01 $ ls -l /oracle/app/oracle/product/10.1.0/db_1/bin/csscan
-rwxr-xr-x   1 oracle   oinstall       0 Nov  9  2005 /oracle/app/oracle/product/10.1.0/db_1/bin/csscan
oracle@solaris01 $

 
Cause:

You are on Sun Solaris SPARC and have applied the Oracle Patch Set 10.1.0.5. Due to an internal unpublished Oracle bug (5051614), csscan related binaries are 0 bytes in size:

oracle@solaris01 $ cd $ORACLE_HOME/bin
oracle@solaris01 $ ls -l csscan lxchknlb lxegen lxinst
-rwxr-xr-x   1 oracle   oinstall       0 Nov  9  2005 csscan
-rwxr-xr-x   1 oracle   oinstall       0 Nov  9  2005 lxchknlb
-rwxr-xr-x   1 oracle   oinstall       0 Nov  9  2005 lxegen
-rwxr-xr-x   1 oracle   oinstall       0 Nov  9  2005 lxinst
oracle@solaris01 $

 
Problem resolution:

Download Oracle Patch 5051614 and copy/move the contained binaries (csscan, lxchknlb, lxegen and lxinst) to the $ORACLE_HOME/bin directory:

oracle@solaris01 $ pwd
/home/oracle/Patch5051614
oracle@solaris01 $ 
oracle@solaris01 $ unzip p5051614_10105_SOLARIS64.zip 
Archive:  p5051614_10105_SOLARIS64.zip
  inflating: csscan                  
  inflating: lxchknlb                
  inflating: lxegen                  
  inflating: lxinst                  
  inflating: README.txt              
oracle@solaris01 $ 
oracle@solaris01 $ ls -al
total 14838
drwxr-xr-x   2 oracle   oinstall     512 Jul 22 22:18 .
drwxr-xr-x  18 oracle   oinstall    1024 Jul 22 22:18 ..
-rw-rw-r--   1 oracle   oinstall  355952 Nov 29  2006 csscan
-rw-rw-r--   1 oracle   oinstall  940776 Nov 29  2006 lxchknlb
-rw-rw-r--   1 oracle   oinstall 1458272 Nov 29  2006 lxegen
-rwxrwxr-x   1 oracle   oinstall 2933984 Nov 14  2006 lxinst
-rw-r--r--   1 oracle   oinstall 1836231 Jul 22 22:18 p5051614_10105_SOLARIS64.zip
-rwxrwxr-x   1 oracle   oinstall     536 Nov 29  2006 README.txt
oracle@solaris01 $ 
oracle@solaris01 $ cp csscan $ORACLE_HOME/bin
oracle@solaris01 $ cp lxchknlb $ORACLE_HOME/bin
oracle@solaris01 $ cp lxegen $ORACLE_HOME/bin  
oracle@solaris01 $ cp lxinst $ORACLE_HOME/bin  
oracle@solaris01 $

 
After applying the functional binaries from Patch 5051614, you should be able to execute and use csscan:

oracle@solaris01 $ csscan help=y
 
 
Character Set Scanner v2.0 : Release 10.1.0.4.0 - Production on Fri Jul 22 22:48:55 2011
 
Copyright (c) 1982, 2005, Oracle.  All rights reserved.
 
 
You can let Scanner prompt you for parameters by entering the CSSCAN        
command followed by your username/password:                                 
 
  Example: CSSCAN SYSTEM/MANAGER                                            
 
Or, you can control how Scanner runs by entering the CSSCAN command         
followed by various parameters. To specify parameters, you use keywords:    
 
  Example: CSSCAN SYSTEM/MANAGER FULL=y TOCHAR=utf8 ARRAY=102400 PROCESS=3  
 
Keyword    Default Prompt Description                                       
---------- ------- ------ ------------------------------------------------- 
USERID             yes    username/password                                 
FULL       N       yes    scan entire database                              
USER               yes    owner of tables to be scanned                     
TABLE              yes    list of tables to scan                            
EXCLUDE                   list of tables to exclude from scan               
TOCHAR             yes    new database character set name                   
FROMCHAR                  current database character set name               
TONCHAR                   new national character set name                   
FROMNCHAR                 current national character set name               
ARRAY      102400  yes    size of array fetch buffer                        
PROCESS    1       yes    number of concurrent scan process                 
MAXBLOCKS                 split table if block size exceed MAXBLOCKS        
CAPTURE    N              capture convertible data                          
SUPPRESS                  maximum number of exceptions logged for each table
FEEDBACK                  report progress every N rows                      
BOUNDARIES                list of column size boundaries for summary report 
LASTRPT    N              generate report of the last database scan         
LOG        scan           base file name of report files                    
PARFILE                   parameter file name                               
PRESERVE   N              preserve existing scan results                    
LCSD       N       no     enable language and character set detection       
LCSDDATA   LOSSY   no     define the scope of the detection                 
HELP       N              show help screen (this screen)                    
---------- ------- ------ ------------------------------------------------- 
Scanner terminated successfully.
oracle@solaris01 $

Oracle: ORA-00245: control file backup operation failed when trying to perform an actively load balanced RMAN backup in Real Application Cluster

Problem description:

You are running an Oracle Real Application Cluster Version >= 11.2.0.1 and are trying to perform an actively load balanced backup operation on more than one database instance. The backup of the control file fails with the following error message:

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
 
RMAN-03009: failure of backup command on dev_0 channel at 06/24/2011 11:11:24
ORA-00245: control file backup operation failed

 
Complete output:

RMAN> run {
  allocate channel 'dev_0' type 'sbt_tape'
    parms 'SBT_LIBRARY=/opt/omni/lib/libob2oracle8_64bit.so,ENV=(OB2BARTYPE=Oracle8,OB2APPNAME=racdb,OB2BARLIST=VTL-ORA-racdb-rac-scan)'
    connect 'sys@racdb1';
  allocate channel 'dev_1' type 'sbt_tape'
    parms 'SBT_LIBRARY=/opt/omni/lib/libob2oracle8_64bit.so,ENV=(OB2BARTYPE=Oracle8,OB2APPNAME=racdb,OB2BARLIST=VTL-ORA-racdb-rac-scan)'
    connect 'sys@racdb2';
 
  send device type 'sbt_tape' 'OB2BARHOSTNAME=rac-scan.intern.initso.at';
  backup incremental level 0 format 'VTL-ORA-racdb-rac-scan<racdb_%s:%t:%p>.dbf' database;
  backup format 'VTL-ORA-racdb-rac-scan<racdb_%s:%t:%p>.dbf' archivelog all not backed up 2 times;
  backup format 'VTL-ORA-racdb-rac-scan<racdb_%s:%t:%p>.dbf' current controlfile;
 } 
 
using target database control file instead of recovery catalog
allocated channel: dev_0
channel dev_0: SID=51 instance=racdb1 device type=SBT_TAPE
channel dev_0: Data Protector A.06.11/PHSS_41802/PHSS_41803/DPSOL_00435/DPLNX_
 
allocated channel: dev_1
channel dev_1: SID=19 instance=racdb2 device type=SBT_TAPE
channel dev_1: Data Protector A.06.11/PHSS_41802/PHSS_41803/DPSOL_00435/DPLNX_
 
sent command to channel: dev_1
sent command to channel: dev_0
 
Starting backup at 24-JUN-11
channel dev_0: starting incremental level 0 datafile backup set
channel dev_0: specifying datafile(s) in backup set
input datafile file number=00002 name=+DATA01/racdb/datafile/sysaux.335.752504897
input datafile file number=00006 name=+DATA01/racdb/datafile/undotbs2.364.753481801
input datafile file number=00008 name=+DATA01/racdb/datafile/undotbs4.362.753482033
input datafile file number=00005 name=+DATA01/racdb/datafile/owbsys.402.753454499
input datafile file number=00010 name=+DATA01/racdb/datafile/undotbs6.360.753482663
channel dev_0: starting piece 1 at 24-JUN-11
channel dev_1: starting incremental level 0 datafile backup set
channel dev_1: specifying datafile(s) in backup set
input datafile file number=00004 name=+DATA01/racdb/datafile/users.332.752504905
input datafile file number=00001 name=+DATA01/racdb/datafile/system.336.752504891
input datafile file number=00003 name=+DATA01/racdb/datafile/undotbs1.334.752504899
input datafile file number=00007 name=+DATA01/racdb/datafile/undotbs3.363.753481931
input datafile file number=00009 name=+DATA01/racdb/datafile/undotbs5.361.753482293
channel dev_1: starting piece 1 at 24-JUN-11
channel dev_0: finished piece 1 at 24-JUN-11
piece handle=VTL-ORA-racdb-rac-scan<racdb_163:754485037:1>.dbf tag=TAG20110624T111037 comment=API Version 2.0,MMS Version 65.6.11.0
channel dev_0: backup set complete, elapsed time: 00:00:46
channel dev_0: starting incremental level 0 datafile backup set
channel dev_0: specifying datafile(s) in backup set
channel dev_1: finished piece 1 at 24-JUN-11
piece handle=VTL-ORA-racdb-rac-scan<racdb_164:754485038:1>.dbf tag=TAG20110624T111037 comment=API Version 2.0,MMS Version 65.6.11.0
channel dev_1: backup set complete, elapsed time: 00:00:45
channel dev_1: starting incremental level 0 datafile backup set
channel dev_1: specifying datafile(s) in backup set
including current SPFILE in backup set
channel dev_1: starting piece 1 at 24-JUN-11
RMAN-03009: failure of backup command on dev_0 channel at 06/24/2011 11:11:24
ORA-00245: control file backup operation failed
continuing other job steps, job failed will not be re-run
channel dev_1: finished piece 1 at 24-JUN-11
piece handle=VTL-ORA-racdb-rac-scan<racdb_166:754485083:1>.dbf tag=TAG20110624T111037 comment=API Version 2.0,MMS Version 65.6.11.0
channel dev_1: backup set complete, elapsed time: 00:00:04
released channel: dev_0
released channel: dev_1
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
 
RMAN-03009: failure of backup command on dev_0 channel at 06/24/2011 11:11:24
ORA-00245: control file backup operation failed
 
RMAN>

 
Cause:

Oracle changed the mechanism on how control file backups are performed. Until 11.2 Oracle requested a control file enqueue before performing the actual backup. Currently with 11.2.0.1 and 11.2.0.2, Oracle performs a control file backup without requesting a control file enqueue, but instead requires that during backup, the snapshot controlfile is shared between all instances. For non-RAC databases this does not change anything and neither it does for RAC databases if you always perform your backup on the same RAC-instance (without allocating any channel on another instance).

But if your are making use of distributing your backup load over several instances and your snapshot control file is located in you non-shared Oracle Home, you will end up with an “ORA-00245: control file backup operation failed”.

 
Problem resolution:

You have to configure your snapshot control file destination to a shared location accessible by all Oracle RAC instances. In our case, an ASM Cluster Filesystem was available due to the storage of external application data.

Change of snapshot controlfile destintation:

RMAN> CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/u01/acfs_app/snapcf/racdb/snapcf_racdb.f';
 
new RMAN configuration parameters:
CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/u01/acfs_app/snapcf/racdb/snapcf_racdb.f';
new RMAN configuration parameters are successfully stored
 
RMAN>

 
After changing the snapshot controlfile location to a directory located on ACFS, the backup did execute without any issues:

RMAN> run {
  allocate channel 'dev_0' type 'sbt_tape'
    parms 'SBT_LIBRARY=/opt/omni/lib/libob2oracle8_64bit.so,ENV=(OB2BARTYPE=Oracle8,OB2APPNAME=racdb,OB2BARLIST=VTL-ORA-racdb-rac-scan)'
    connect 'sys@racdb1';
  allocate channel 'dev_1' type 'sbt_tape'
    parms 'SBT_LIBRARY=/opt/omni/lib/libob2oracle8_64bit.so,ENV=(OB2BARTYPE=Oracle8,OB2APPNAME=racdb,OB2BARLIST=VTL-ORA-racdb-rac-scan)'
    connect 'sys@racdb2';
 
  send device type 'sbt_tape' 'OB2BARHOSTNAME=rac-scan.intern.initso.at';
  backup incremental level 0 format 'VTL-ORA-racdb-rac-scan<racdb_%s:%t:%p>.dbf' database;
  backup format 'VTL-ORA-racdb-rac-scan<racdb_%s:%t:%p>.dbf' archivelog all not backed up 2 times;
  backup format 'VTL-ORA-racdb-rac-scan<racdb_%s:%t:%p>.dbf' current controlfile;
 } 
using target database control file instead of recovery catalog
allocated channel: dev_0
channel dev_0: SID=19 instance=racdb1 device type=SBT_TAPE
channel dev_0: Data Protector A.06.11/PHSS_41802/PHSS_41803/DPSOL_00435/DPLNX_
 
allocated channel: dev_1
channel dev_1: SID=19 instance=racdb2 device type=SBT_TAPE
channel dev_1: Data Protector A.06.11/PHSS_41802/PHSS_41803/DPSOL_00435/DPLNX_
 
sent command to channel: dev_1
sent command to channel: dev_0
 
Starting backup at 24-JUN-11
channel dev_0: starting incremental level 0 datafile backup set
channel dev_0: specifying datafile(s) in backup set
input datafile file number=00002 name=+DATA01/racdb/datafile/sysaux.335.752504897
input datafile file number=00006 name=+DATA01/racdb/datafile/undotbs2.364.753481801
input datafile file number=00008 name=+DATA01/racdb/datafile/undotbs4.362.753482033
input datafile file number=00005 name=+DATA01/racdb/datafile/owbsys.402.753454499
input datafile file number=00010 name=+DATA01/racdb/datafile/undotbs6.360.753482663
channel dev_0: starting piece 1 at 24-JUN-11
channel dev_1: starting incremental level 0 datafile backup set
channel dev_1: specifying datafile(s) in backup set
input datafile file number=00004 name=+DATA01/racdb/datafile/users.332.752504905
input datafile file number=00001 name=+DATA01/racdb/datafile/system.336.752504891
input datafile file number=00003 name=+DATA01/racdb/datafile/undotbs1.334.752504899
input datafile file number=00007 name=+DATA01/racdb/datafile/undotbs3.363.753481931
input datafile file number=00009 name=+DATA01/racdb/datafile/undotbs5.361.753482293
channel dev_1: starting piece 1 at 24-JUN-11
channel dev_0: finished piece 1 at 24-JUN-11
piece handle=VTL-ORA-racdb-rac-scan<racdb_167:754485274:1>.dbf tag=TAG20110624T111433 comment=API Version 2.0,MMS Version 65.6.11.0
channel dev_0: backup set complete, elapsed time: 00:00:35
channel dev_0: starting incremental level 0 datafile backup set
channel dev_0: specifying datafile(s) in backup set
including current control file in backup set
channel dev_0: starting piece 1 at 24-JUN-11
channel dev_1: finished piece 1 at 24-JUN-11
piece handle=VTL-ORA-racdb-rac-scan<racdb_168:754485274:1>.dbf tag=TAG20110624T111433 comment=API Version 2.0,MMS Version 65.6.11.0
channel dev_1: backup set complete, elapsed time: 00:00:36
channel dev_1: starting incremental level 0 datafile backup set
channel dev_1: specifying datafile(s) in backup set
including current SPFILE in backup set
channel dev_1: starting piece 1 at 24-JUN-11
channel dev_0: finished piece 1 at 24-JUN-11
piece handle=VTL-ORA-racdb-rac-scan<racdb_169:754485309:1>.dbf tag=TAG20110624T111433 comment=API Version 2.0,MMS Version 65.6.11.0
channel dev_0: backup set complete, elapsed time: 00:00:07
channel dev_1: finished piece 1 at 24-JUN-11
piece handle=VTL-ORA-racdb-rac-scan<racdb_170:754485310:1>.dbf tag=TAG20110624T111433 comment=API Version 2.0,MMS Version 65.6.11.0
channel dev_1: backup set complete, elapsed time: 00:00:07
Finished backup at 24-JUN-11
 
Starting backup at 24-JUN-11
current log archived
skipping archived log file +FRA01/racdb/archivelog/2011_06_21/thread_2_seq_32.373.754437613; already backed up 2 time(s)
skipping archived log file +FRA01/racdb/archivelog/2011_06_21/thread_2_seq_33.388.754437685; already backed up 2 time(s)
skipping archived log file +FRA01/racdb/archivelog/2011_06_22/thread_2_seq_34.1310.754445543; already backed up 2 time(s)
skipping archived log file +FRA01/racdb/archivelog/2011_06_22/thread_2_seq_35.1319.754445549; already backed up 2 time(s)
skipping archived log file +FRA01/racdb/archivelog/2011_06_22/thread_2_seq_36.1323.754445553; already backed up 2 time(s)
skipping archived log file +FRA01/racdb/archivelog/2011_06_22/thread_2_seq_37.1326.754445557; already backed up 2 time(s)
skipping archived log file +FRA01/racdb/archivelog/2011_06_22/thread_2_seq_38.953.754462269; already backed up 2 time(s)
skipping archived log file +FRA01/racdb/archivelog/2011_06_22/thread_2_seq_39.479.754483331; already backed up 2 time(s)
skipping archived log file +FRA01/racdb/archivelog/2011_06_21/thread_3_seq_40.859.754427105; already backed up 2 time(s)
skipping archived log file +FRA01/racdb/archivelog/2011_06_22/thread_3_seq_41.1316.754445547; already backed up 2 time(s)
skipping archived log file +FRA01/racdb/archivelog/2011_06_22/thread_3_seq_42.1328.754445559; already backed up 2 time(s)
skipping archived log file +FRA01/racdb/archivelog/2011_06_22/thread_3_seq_43.1247.754462267; already backed up 2 time(s)
skipping archived log file +FRA01/racdb/archivelog/2011_06_22/thread_3_seq_44.972.754483331; already backed up 2 time(s)
skipping archived log file +FRA01/racdb/archivelog/2011_06_21/thread_4_seq_30.885.754434005; already backed up 2 time(s)
skipping archived log file +FRA01/racdb/archivelog/2011_06_22/thread_4_seq_31.1315.754445545; already backed up 2 time(s)
skipping archived log file +FRA01/racdb/archivelog/2011_06_22/thread_4_seq_32.1332.754445559; already backed up 2 time(s)
skipping archived log file +FRA01/racdb/archivelog/2011_06_22/thread_4_seq_33.791.754462267; already backed up 2 time(s)
skipping archived log file +FRA01/racdb/archivelog/2011_06_22/thread_4_seq_34.276.754483333; already backed up 2 time(s)
skipping archived log file +FRA01/racdb/archivelog/2011_06_21/thread_5_seq_29.1220.754434005; already backed up 2 time(s)
skipping archived log file +FRA01/racdb/archivelog/2011_06_22/thread_5_seq_30.1313.754445543; already backed up 2 time(s)
skipping archived log file +FRA01/racdb/archivelog/2011_06_22/thread_5_seq_31.1329.754445559; already backed up 2 time(s)
skipping archived log file +FRA01/racdb/archivelog/2011_06_22/thread_5_seq_32.723.754462267; already backed up 2 time(s)
skipping archived log file +FRA01/racdb/archivelog/2011_06_22/thread_5_seq_33.901.754483331; already backed up 2 time(s)
skipping archived log file +FRA01/racdb/archivelog/2011_06_21/thread_6_seq_26.386.754437615; already backed up 2 time(s)
skipping archived log file +FRA01/racdb/archivelog/2011_06_22/thread_6_seq_27.1322.754445551; already backed up 2 time(s)
skipping archived log file +FRA01/racdb/archivelog/2011_06_22/thread_6_seq_28.453.754462267; already backed up 2 time(s)
skipping archived log file +FRA01/racdb/archivelog/2011_06_22/thread_6_seq_29.889.754483333; already backed up 2 time(s)
channel dev_0: starting archived log backup set
channel dev_0: specifying archived log(s) in backup set
input archived log thread=2 sequence=40 RECID=212 STAMP=754483597
input archived log thread=3 sequence=45 RECID=208 STAMP=754483595
input archived log thread=5 sequence=34 RECID=209 STAMP=754483595
input archived log thread=6 sequence=30 RECID=210 STAMP=754483596
input archived log thread=4 sequence=35 RECID=211 STAMP=754483596
channel dev_0: starting piece 1 at 24-JUN-11
channel dev_1: starting archived log backup set
channel dev_1: specifying archived log(s) in backup set
input archived log thread=3 sequence=46 RECID=216 STAMP=754485320
input archived log thread=5 sequence=35 RECID=217 STAMP=754485321
input archived log thread=6 sequence=31 RECID=213 STAMP=754485319
channel dev_1: starting piece 1 at 24-JUN-11
channel dev_0: finished piece 1 at 24-JUN-11
piece handle=VTL-ORA-racdb-rac-scan<racdb_171:754485324:1>.dbf tag=TAG20110624T111523 comment=API Version 2.0,MMS Version 65.6.11.0
channel dev_0: backup set complete, elapsed time: 00:00:07
channel dev_0: starting archived log backup set
channel dev_0: specifying archived log(s) in backup set
input archived log thread=4 sequence=36 RECID=214 STAMP=754485319
input archived log thread=2 sequence=41 RECID=215 STAMP=754485320
channel dev_0: starting piece 1 at 24-JUN-11
channel dev_1: finished piece 1 at 24-JUN-11
piece handle=VTL-ORA-racdb-rac-scan<racdb_172:754485324:1>.dbf tag=TAG20110624T111523 comment=API Version 2.0,MMS Version 65.6.11.0
channel dev_1: backup set complete, elapsed time: 00:00:07
channel dev_0: finished piece 1 at 24-JUN-11
piece handle=VTL-ORA-racdb-rac-scan<racdb_173:754485331:1>.dbf tag=TAG20110624T111523 comment=API Version 2.0,MMS Version 65.6.11.0
channel dev_0: backup set complete, elapsed time: 00:00:07
Finished backup at 24-JUN-11
 
 
Starting backup at 24-JUN-11
channel dev_0: starting full datafile backup set
channel dev_0: specifying datafile(s) in backup set
including current control file in backup set
channel dev_0: starting piece 1 at 24-JUN-11
channel dev_0: finished piece 1 at 24-JUN-11
piece handle=VTL-ORA-racdb-rac-scan<racdb_174:754485339:1>.dbf tag=TAG20110624T111539 comment=API Version 2.0,MMS Version 65.6.11.0
channel dev_0: backup set complete, elapsed time: 00:00:07
Finished backup at 24-JUN-11
 
released channel: dev_0
 
released channel: dev_1
 
RMAN>

Oracle RMAN: Duplicate database fails with “RMAN-06457: UNTIL scn (4321) is ahead of last scn in archived logs (1234)” or provides an old image of the database

June 16th, 2011 Matthias Pölzinger 1 comment

Problem description:

You are trying to duplicate a database and you are always ending up with the same old image or you are receiving the following error message during restore:

Starting Duplicate Db at 05-JUN-2011 22:50:27
released channel: stb1
released channel: stb2
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure OF Duplicate Db command at 06/05/2009 22:51:26
RMAN-06457: UNTIL scn (4321) IS ahead OF LAST scn IN archived logs (1234)

 
Cause:

You are duplicating a RAC database with more than one redo log threads. If one of the threads is in “CLOSED”-state you will either receive above mentioned error message or end up with an old duplicated image (because duplicate database will use an scn <= the latest changes from the closed thread).

Example output from v$log:

SQL> SELECT thread#, STATUS, instance FROM v$thread ORDER BY 1;
 
   THREAD# STATUS INSTANCE
---------- ------ --------------------
	 1 OPEN   rac1
	 2 CLOSED rac2
	 3 OPEN   rac3
	 4 OPEN   rac4
 
SQL>

 
Problem resolution:

Either

  1. drop the closed thread if it is no longer needed.

    Example:

    SQL> ALTER DATABASE disable thread 2;
     
    DATABASE altered.
     
    SQL>
    SQL> ALTER DATABASE DROP logfile GROUP 201;
     
    DATABASE altered.
     
    SQL> ALTER DATABASE DROP logfile GROUP 202;
     
    DATABASE altered.
     
    SQL> ALTER DATABASE DROP logfile GROUP 203;
     
    DATABASE altered.
     
    SQL>

     
    v$thread will now no longer list the thread:

    SQL> SELECT thread#, STATUS, instance FROM v$thread ORDER BY 1;
     
       THREAD# STATUS INSTANCE
    ---------- ------ --------------------
    	 1 OPEN   rac1
    	 3 OPEN   rac3
    	 4 OPEN   rac4
     
    SQL>

     

  2. open the thread by starting the currently stopped RAC database instance and perform a log switch

    Example:

    [oracle@rac1 ~]$ srvctl start instance -d rac -i rac2
    [oracle@rac1 ~]$

     
    v$thread will now list the thread as open:

    SQL> SELECT thread#, STATUS, instance FROM v$thread ORDER BY 1;
     
       THREAD# STATUS INSTANCE
    ---------- ------ --------------------
    	 1 OPEN   rac1
     	 2 OPEN   rac2
    	 3 OPEN   rac3
    	 4 OPEN   rac4
     
    SQL>

     
    After archiving the redo logs, reperform your duplicate database.

Oracle: impdp raises ORA-39083: Object type PROCOBJ failed to create with error: ORA-01843: not a valid month

Problem description:

You are importing a data pump dumpfile and impdp raises the following error(s) when trying to create a job or schedule:

ORA-39083: Object TYPE PROCOBJ failed TO CREATE WITH error:
ORA-01843: NOT a valid MONTH
Failing SQL IS:
BEGIN
... dbms_scheduler commands ...
COMMIT;
END;

Cause:

The exporting data pump session used different NLS-settings than your currently importing one.

DBMS_SCHEDULER invokes your current NLS-settings when creating jobs/schedules. For instance, if your environment variable NLS_LANG was set to AMERICAN_AMERICA.WE8ISO8859P1 for your export, you should use the same setting during import. Otherwise creating scheduler jobs/schedules will raise above mentioned error messages.

Problem resolution:

You should use equivalent NLS_LANG settings in your environment when performing expdp and impdp. This will workaround the issue.

Categories: Data Pump, Database, Oracle, Utilities Tags: