Encountering ORA-01152 when implementing DataGuard

Working of a 2-node cluster hosting 11.1.0.7 on a Linux RH4 platform, and attempting to implement DataGuard on a single node with same OS and same DB version, and followed document http://www.oracle.com/technology/deploy/availability/pdf/dataguard11g_rac_maa.pdf
The "duplicate target " command works successfully, and having recreated the sp file on the standby node, when I attempt to startup the standby database I get the following error.
SQL> startup
ORACLE instance started.
Total System Global Area 534462464 bytes
Fixed Size 2161400 bytes
Variable Size 314574088 bytes
Database Buffers 209715200 bytes
Redo Buffers 8011776 bytes
Database mounted.
ORA-10458: standby database requires recovery
ORA-01152: file 1 was not restored from a sufficiently old backup
ORA-01110: data file 1: '+DATA/abcdg/datafile/system.258.697912407'
I have re-tried several times without success - any ideas anybody?

I've skimmed the PDF and I think what has happened is that you may have slightly diverged from the sequence shown by issuing "startup" instead of "startup mount", the difference being that "startup" tries to open the standby database in read only mode, which is when ORA-01152 is thrown.
I'm assuming here that the rman duplicate operation does not include a recovery phase, if that is true then the restored datafiles will need recovering to a consistent state before the database can be opened in read-only mode.
In short you probably just need to issue:
recover managed standby database disconnect;and let managed recovery run the archive logs in. Once it is consistent then subsequent "startup" commands should work without error.
If you don't actually want it open read-only then you can just leave it in a mount state and running managed recovery.

Similar Messages

  • ORA-01152 when restoring from RMAN backupset in NOARCHIVELOG mode

    Hi all,
    I got the error ORA-01152 when I tried restoring an Oracle 10g R1 database from an RMAN backupset into a new server. The error returned when it reached to the level of opening the database in resetlogs.
    The database runs on NOARCHIVELOG mode and on Windows 2003 Server SP2 32-bit.
    Following is what I did in RMAN:
    set ORACLE_HOME=D:\oracle\product\10.1.0\db_1
    set ORACLE_SID=DAWA
    set PATH=D:\oracle\product\10.1.0\db_1\bin;%PATH%
    cd %ORACLE_HOME%\bin
    rman target sys/mypassword
    Recovery Manager: Release 10.2.0.1.0 - Production on Tue Feb 13 00:36:55 2007
    Copyright (c) 1982, 2005, Oracle. All rights reserved.
    connected to target database (not started)
    RMAN> startup nomount pfile=X:\temp\DawaPFILE.ORA
    connected to target database (not started)
    Oracle instance started
    Total System Global Area 1048576000 bytes
    Fixed Size 792200 bytes
    Variable Size 551807352 bytes
    Database Buffers 494927872 bytes
    Redo Buffers 1048576 bytes
    RMAN> restore controlfile from
    'X:\temp\Flash_Rec\DAWA\AUTOBACKUP\2011_07_16\O1_
    MF_S_756655133_7226R018_.BKP';
    Starting restore at 19-JUL-11
    allocated channel: ORA_DISK_1
    channel ORA_DISK_1: sid=270 devtype=DISK
    channel ORA_DISK_1: restoring controlfile
    channel ORA_DISK_1: restore complete
    output filename=D:\ORACLE\ORADATA\DAWA\CONTROL01.CTL
    output filename=D:\ORACLE\ORADATA\DAWA\CONTROL02.CTL
    output filename=D:\ORACLE\ORADATA\DAWA\CONTROL03.CTL
    Finished restore at 17-AUG-11
    alter database mount;
    database mounted
    catalog backuppiece 'X:\temp\PUMHJATD_1_1';
    catalog backuppiece 'X:\temp\PTMHJ91Q_1_1';
    /* Rename the Redologfiles,so that they can be created in new locations
    the database is opened in resetlogs */
    SQL>conn sys as sysdba
    -- get registered files from SELECT * FROM V$LOGFILE
    SQL> alter database rename file
    'D:\ORACLE\PRODUCT\10.1.0\ORADATA\DAWA\REDO01.LOG' to
    'X:\oracle\oradata\dawa\REDO01.LOG';
    alter database rename file 'D:\ORACLE\PRODUCT\10.1.0\ORADATA\DAWA\REDO02.LOG'
    to 'X:\oracle\oradata\dawa\REDO02.LOG';
    alter database rename file 'D:\ORACLE\PRODUCT\10.1.0\ORADATA\DAWA\REDO03.LOG'
    to 'X:\oracle\oradata\dawa\REDO03.LOG';
    alter database rename file 'D:\ORACLE\PRODUCT\10.1.0\ORADATA\DAWA\REDO04.LOG'
    to 'X:\oracle\oradata\dawa\REDO04.LOG';
    alter database rename file 'D:\ORACLE\PRODUCT\10.1.0\ORADATA\DAWA\REDO05.LOG'
    to 'X:\oracle\oradata\dawa\REDO05.LOG';
    alter database rename file 'D:\ORACLE\PRODUCT\10.1.0\ORADATA\DAWA\REDO06.LOG'
    to 'X:\oracle\oradata\dawa\REDO06.LOG';
    alter database rename file 'D:\ORACLE\PRODUCT\10.1.0\ORADATA\DAWA\REDO07.LOG'
    to 'X:\oracle\oradata\dawa\REDO07.LOG';
    /* Now in RMAN: restore the datafiles
        to new locations and recover. */
    RMAN> run{
    set newname for datafile
    'E:\ORACLE\PRODUCT\10.1.0\ORADATA\DAWA\UNDOTBS201' TO
    'D:\oracle\oradata\dawa\UNDOTBS201';
    set newname for datafile
    'E:\ORACLE\PRODUCT\10.1.0\ORADATA\DAWA\UNDOTBS202' TO
    'D:\oracle\oradata\dawa\UNDOTBS202';
    restore database;
    switch datafile all;
    alter database open resetlogs;
    .../*  alter database open resetlogs returned the errors: */
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-03002: failure of alter db command at 08/18/2011 08:44:45
    ORA-01152: file 2 was not restored from a sufficiently old backup
    ORA-01110: data file 2: 'D:\ORACLE\ORADATA\DAWA\UNDOTBS206'Thanks in advance.

    SYS @ DAWA> shutdown immediate
    ORA-01109: database not open
    Database dismounted.
    ORACLE instance shut down.
    SYS @ DAWA> startup mount
    ORACLE instance started.
    Total System Global Area 1048576000 bytes
    Fixed Size                   792200 bytes
    Variable Size             551807352 bytes
    Database Buffers          494927872 bytes
    Redo Buffers                1048576 bytes
    Database mounted.
    SYS @ DAWA> recover database using backup controlfile until cancel;
    ORA-00279: change 329012 generated at 03/08/2005 16:24:46 needed for thread 1
    ORA-00289: suggestion :
    X:\ORACLE\ORADATA\FLASH_REC\DAWA\ARCHIVELOG\2011_08_18\O1_MF_1_6_%U_.ARC
    ORA-00280: change 329012 for thread 1 is in sequence #6
    Specify log: {<RET>=suggested | filename | AUTO | CANCEL}
    ORA-00308: cannot open archived log
    'X:\ORACLE\ORADATA\FLASH_REC\DAWA\ARCHIVELOG\2011_08_18\O1_MF_1_6_%U_.ARC'
    ORA-27041: unable to open file
    OSD-04002: unable to open file
    O/S-Error: (OS 2) The system cannot find the file specified.
    ORA-01547: warning: RECOVER succeeded but OPEN RESETLOGS would get error below
    ORA-01152: file 1 was not restored from a sufficiently old backup
    ORA-01110: data file 1: 'X:\ORACLE\ORADATA\DAWA\SYSTEM01.DBF'You can download the alert log from here:
    http://ahmedbaraka.com/temp/alertdawa.log

  • ORA-01152 -- When Bringing Up Standby Database

    Hi All,
    I'm trying to bring a standbye database on the same server as my primary database. i'm doing this to play around, hoping to do it with PRD using separate servers. I have found several good step by step references for doing this. I'm currently using:
    http://www.dbaclick.com/modules.php?op=modload&name=News&file=article&sid=366&mode=thread&order=0&thold=0
    I have tried several things to get this up. I have shutdown the primary db and manually copied the datafiles to the standby location and then created a standby control file. I have also tried taking an image copy of the datafiles using RMAN and then creating the standby control file. Both produce same result. I can startup mount the Standby db but when i try to open the standby db in read only mode i get the following:
    ORA-16004: backup database requires recovery
    ORA-01152: file 1 was not restored from a sufficiently old backup
    ORA-01110: data file 1:
    'C:\ORACLE\PRODUCT\10.2.0\ORADATA\standby\SYSTEM01.DBF'
    Does anyone have any idea as to why i'm getting this? Is there a preferred way to copy the primary db's datafiles to create standby. According to my instructions the manually copied datafiles shoudl be taken BEFORE the standby control file is generated. Any suggestions would be greatly appreciated... i've been wrestling with this for far too long.
    Thanks,

    i got it to go. I believe what i did wrong was not configure my parameters files correctly. LOG_ARCHIVE_DEST_2 was erroring out so the archive logs were not applied to the standby database. I manually copied and applied the archive logs to my Standbye. I was then able to open in read only. After that I had to create a password file for my standby which made the LOG_ARCIVE_DEST_2 parameter work.
    I'm good to go... thanks

  • Encount Ora-29534 when loadjava xmlparserv2.jar

    I encounted ora-29534 error message when I tried to load xml pl/sql parser using the following command:
    % loadjava -user scott/tiger -r -v xmlparserv2.jar
    Environment: Oracle8.1.5
    windows nt sp4
    jdk1.1.8
    What causes this problem and how to resolve it?
    Thanks!
    Allen

    Got the problem sorted out. Apparently it was because I had Oracle 8.1.5 which used Java 1.1.7, whereas the version of xmlparserv2.jar I had was compiled using a more recent version of Java.
    Migrated to Oracle 8.1.7, and that solved the problem.

  • Encounter ORA-01002 when calling OCIStmtFetch2 to fetch blob data

    Oracle Version:Release 10.2.0.1.0
    Description:
    We use these two functions to fetch the content of blob field dynamically in batch mode:
    OCIDefineByPos(OCI_DYNAMIC_FETCH)
    OCIDefineDynamic(callbackfun->cbf_get_data)
    We allocate fixed memory to fetch data in order to using compact memory.
    If the size of blob to be fetched is larger than the allocated memory size, the fetch can not be done in one call, which need to be interrupted.
    Those records would remain in cache and can only be fetched until calling OCIStmtFetch2 next time.
    The callback function:cbf_get_data, achieves this by returning OCI_ROWCBK_DONE, which marks current fetch interrupted.
    It would not return OCI_CONTINUE, because OCI_CONTINUE can not interrupt current fetch procedure in time.
    We made a sample code test, and found this logic only works when fetching small rows (nearly 800 rows). Exceptions occurred when fetching more rows(>=1000 rows).
    For example, among these 2 cases,
    1.(OCIStmtFetch2(m_stmthp,m_errhp,(ub4)800,OCI_FETCH_NEXT,(sb4)OCI_FETCH_RELATIVE,OCI_DEFAULT)
    2.(OCIStmtFetch2(m_stmthp,m_errhp,(ub4)1000,OCI_FETCH_NEXT,(sb4)OCI_FETCH_RELATIVE,OCI_DEFAULT)
    only the 1st one work, but the 2nd.
    After function cbf_get_data returns OCI_ROWCBK_DONE, calling OCIStmtFetch2 did not enter into callback function cbf_get_data.
    And OCIErrorGet showed such error:
    ORA-01002: fetch out of sequence
    the total number of result set is about 100,000.
    We tried to set PREFETCH to a larger value in this way::
    OCIAttrSet(m_stmthp,OCI_HTYPE_STMT,(dvoid *)&rnum,0,OCI_ATTR_PREFETCH_ROWS,m_errhp);
    rtn=OCIAttrSet((dvoid *)m_stmthp, (ub4) OCI_HTYPE_STMT,(dvoid *)&preFetch, (ub4)sizeof(preFetch), OCI_ATTR_PREFETCH_MEMORY,m_errhp);
    but it did not help.
    Waiting for you guidance.
    Thanks in advance!
    -Andy
    Edited by: Andy Tong on 2010-10-22 上午12:29

    Here is our testing Code:
    #include "oci.h"
    #include<stdio.h>
    #include<stdlib.h>
    #include<string.h>
    #pragma comment(lib,"oci.lib")
    char buf1[5000];
    char buf2[5000];
    long datalen=5000;
    ub4 outpos=1;
    ub4 outpos2=2;
    int sum=0;
    int sum2=0;
    OCIError *m_errhp;
    OCIStmt *m_stmthp;
    char      LOBBuf[8006];
    long      LOBLen=8006;
    long     gindpp=0;
    ub2     grcpp=0;
    #define MAX_ROW_NUM 56338
    /* Fetch callback to specify buffers. */
    sb4 cbf_get_data(     dvoid*          ctxp,
                             OCIDefine*     dfnhp,
                             ub4               iter,
                             dvoid**          bufpp,
                             ub4**          alenpp,
                             ub1*          piecep,
                             dvoid**          indpp,
                             ub2**          rcpp)
         if(iter==0)
              sum=0;
         else if(iter>=858) //857 exception
              //LOBBuf,LOBLen
              //     sum+=LOBLen;
              //     if(sum>1057552-100*1024)
              sum=0;
              bufpp=(dvoid)0;
              alenpp=(ub4)0;
              *piecep = (ub1)OCI_ONE_PIECE;
              indpp = (dvoid ) 0;
              rcpp     = (ub2 ) 0;
              return(OCI_ROWCBK_DONE);     
         LOBLen=8006;
         bufpp=(dvoid)LOBBuf;
         alenpp=(ub4)&LOBLen;
         *piecep = (ub1)OCI_ONE_PIECE;
         indpp = (dvoid )&gindpp;
         rcpp     = (ub2 )&grcpp;
         return(OCI_CONTINUE);     
    BOOL CTest_ociApp::InitInstance()
         OCIEnv *          m_envhp;
         OCIServer *          m_srvhp;
         OCISvcCtx *          m_svchp;
         sword               rtn;
         char               sqlState[256];
         int               nativeErr;
         char               errTxt[256];
         unsigned long          bufLen=256;
         OCIDefine hDefine =  (OCIDefine ) 0;
         OCIDefine hDefine1 = (OCIDefine ) 0;
         OCIDefine hDefine2 = (OCIDefine ) 0;
         OCIDefine hDefine3 = (OCIDefine ) 0;
         OCIDefine hDefine4 = (OCIDefine ) 0;
         int i;
         OCILobLocator** lob_array;
         char username[255];
         char password[30];
         char dbname[30];
         char szSqlStr[255];
         ub4 preFetch= 10*1024*16;
         strcpy(username,"dlg25w");
         strcpy(password,"sa");
         strcpy(dbname,"WIN10G");
         OCIEnvCreate(&m_envhp, OCI_DEFAULT | OCI_OBJECT, 0, 0, 0, 0, 0, 0);
         OCIHandleAlloc( (dvoid *)m_envhp, (dvoid **)&m_errhp,OCI_HTYPE_ERROR,(size_t) 0, (dvoid **) 0);
         OCIHandleAlloc( (dvoid *)m_envhp, (dvoid **)&m_srvhp,OCI_HTYPE_SERVER,(size_t) 0, (dvoid **) 0);
         OCIHandleAlloc( (dvoid *)m_envhp, (dvoid **)&m_svchp,OCI_HTYPE_SVCCTX,(size_t) 0, (dvoid **) 0);
         OCIHandleAlloc( (dvoid *)m_envhp, (dvoid **)&m_stmthp,OCI_HTYPE_STMT,(size_t) 0, (dvoid **)0);
         OCIServerAttach(m_srvhp, m_errhp,(text *)dbname, strlen(dbname),(ub4) OCI_DEFAULT);
         OCILogon(m_envhp,m_errhp,&m_svchp,(text *)username,strlen(username),(text *)password,strlen(password),(text *)dbname,strlen(dbname));
         ub4     rnum=0;
         unsigned int len=0;
         //rtn=OCIAttrGet(m_envhp,OCI_HTYPE_ENV,(dvoid *)&rnum,&len,OCI_ATTR_CACHE_MAX_SIZE,m_errhp);
         OCIErrorGet((dvoid *) m_errhp,(ub4)1,(OraText *)sqlState,&nativeErr,(unsigned char*)errTxt,bufLen,(ub4) OCI_HTYPE_ERROR);
         len=4;
         rnum=83886080;
         rtn=OCIAttrSet(m_envhp,OCI_HTYPE_ENV,(dvoid *)&rnum,len,OCI_ATTR_CACHE_OPT_SIZE,m_errhp);
         rtn=OCIAttrGet(m_envhp,OCI_HTYPE_ENV,(dvoid *)&rnum,&len,OCI_ATTR_CACHE_OPT_SIZE,m_errhp);
         OCIErrorGet((dvoid *) m_errhp,(ub4)1,(OraText *)sqlState,&nativeErr,(unsigned char*)errTxt,bufLen,(ub4) OCI_HTYPE_ERROR);
         rnum=2000;
         sprintf( szSqlStr,"%s", "SELECT DATA FROM MF4");
         OCIStmtPrepare(m_stmthp, m_errhp, (text*)szSqlStr, (ub4)strlen(szSqlStr),(ub4) OCI_NTV_SYNTAX, (ub4)OCI_DEFAULT);
    OCIAttrSet(m_stmthp,OCI_HTYPE_STMT,(dvoid *)&rnum,0,OCI_ATTR_PREFETCH_ROWS,m_errhp);
         /* initialize array of locators */
         OCIDefineByPos(m_stmthp, &hDefine2, m_errhp, (ub4)1,(dvoid *)0,(sb4)8006,SQLT_BIN,(dvoid *)0, (ub2 *)0, (ub2 *)0,(ub4) OCI_DYNAMIC_FETCH);//OCI_DYNAMIC_FETCH
         OCIDefineDynamic(hDefine2, m_errhp, (dvoid *)&outpos,(OCICallbackDefine)cbf_get_data);
         OCIStmtExecute(m_svchp, m_stmthp, m_errhp,(ub4)0, (ub4) 0,(const OCISnapshot*) 0,
              (OCISnapshot*)0,(ub4)OCI_DEFAULT);//OCI_STMT_SCROLLABLE_READONLY
         rtn=OCIAttrSet((dvoid *)m_stmthp, (ub4) OCI_HTYPE_STMT,(dvoid *)&preFetch, (ub4)sizeof(preFetch), OCI_ATTR_PREFETCH_MEMORY,m_errhp);
         while(1)
              rtn=OCIStmtFetch2(m_stmthp,m_errhp,(ub4)1000,OCI_FETCH_NEXT,(sb4)OCI_FETCH_RELATIVE,OCI_DEFAULT);
              OCIErrorGet((dvoid *) m_errhp,(ub4)1,(OraText *)sqlState,&nativeErr,(unsigned char*)errTxt,bufLen,(ub4) OCI_HTYPE_ERROR);
              if(rtn==OCI_NO_DATA)
                   break;
              else
         t0=GetTickCount()-t0;
         t0=0;
         OCIAttrGet((CONST void *)m_stmthp,OCI_HTYPE_STMT,(void *)&rows_fetched,(ub4 *)sizeof(rows_fetched),OCI_ATTR_ROW_COUNT ,m_errhp);
         printf("\n Total number of records:%d",rows_fetched);
         OCILogoff( m_svchp, m_errhp );
         OCIServerDetach( m_srvhp, m_errhp, OCI_DEFAULT );
         OCIHandleFree((dvoid *) m_stmthp, OCI_HTYPE_STMT);
         OCIHandleFree((dvoid *) m_svchp, OCI_HTYPE_SVCCTX);
         OCIHandleFree((dvoid *) m_srvhp, OCI_HTYPE_SERVER);
         OCIHandleFree((dvoid *) m_errhp, OCI_HTYPE_ERROR);
         getchar();
         return FALSE;
    }

  • Help! ORA 01012 WHEN execute SELECT DBMS_FLASHBACK.GET_SYSTEM_CHANGE_NUMBER

    I encounter ORA 01012 WHEN execute "SELECT DBMS_FLASHBACK.GET_SYSTEM_CHANGE_NUMBER FROM DUAL;" in my ProC program, but under SQLPLUS it is ok. The whole scenarios are:
    1. My platform is Solaris 10, Oracle 10.2g / 64bit
    2. "alter system archive log current" failure, Oracle complaint about flash_recovery_area full, so I run
    delete obsolete;
    crosscheck backup;
    delete expired backup;
    3. Later I issued command "shutdown", oralce had no reponse after long time, so I issued command "shutdown abort" to shutdown the database, and then "startup" the database successfully to "READ WRITE", user application can also accessed the database.
    4. One of my ProC program get ORA-01012 when execute SELECT DBMS_FLASHBACK.GET_SYSTEM_CHANGE_NUMBER FROM DUAL;
    5. But I got no error if I execute "SELECT DBMS_FLASHBACK.GET_SYSTEM_CHANGE_NUMBER FROM DUAL; " using SQLPLUS.
    Any suggestion about this problem? blow is my ProC function call.
    u_int32_t
    proc_GetLastSCN()
    char buf[300];
    u_int32_t scn=0;
    if (proc_ConnectDB() == APP_ERROR)
    return APP_ERROR;
    memset(buf, 0, sizeof(buf));
    snprintf(buf, sizeof(buf),
    "select DBMS_FLASHBACK.GET_SYSTEM_CHANGE_NUMBER from DUAL");
    oraca.orastxtf = ORASTFERR;
    EXEC SQL WHENEVER SQLERROR GOTO ora_sqlerror;
    EXEC SQL WHENEVER NOT FOUND DO break;
    EXEC SQL WHENEVER SQLWARNING CONTINUE;
    EXEC SQL PREPARE S5 FROM :buf;
    EXEC SQL DECLARE C5 CURSOR FOR S5;
    EXEC SQL OPEN C5;
    for (;;) {
    EXEC SQL FETCH C5 INTO :scn;
    EXEC SQL CLOSE C5;
    proc_DisconnectDB();
    return scn;
    ora_sqlerror:
    dyn_error("ORACLE error --proc_GetLastSCN\n");
    EXEC SQL CLOSE C5;
    proc_DisconnectDB();
    return 0;
    int32_t
    proc_ConnectDB()
    /* Declare variables. No declare section is needed if MODE=ORACLE. */
    VARCHAR username[DB_MAX_NAME_LEN];
    /* VARCHAR is an Oracle-supplied struct */
    VARCHAR password[DB_MAX_NAME_LEN];
    int32_t ret = APP_OK;
    strncpy((char *) username.arr, gateinfo.szSrvLogin, sizeof(gateinfo.szSrvLogin));
    username.len = (unsigned short) strlen((char *) username.arr);
    strncpy((char *) password.arr, gateinfo.szSrvPassword, strlen(gateinfo.szSrvPassword));
    password.len = (unsigned short) strlen((char *) password.arr);
    EX_SCREEN_INIT();
    EXEC SQL WHENEVER SQLERROR GOTO ora_sqlerror;
    EXEC SQL CONNECT :gateinfo.szSrvLogin IDENTIFIED BY :gateinfo.szSrvPassword;
    return ret;
    ora_sqlerror:
    errlog(ELOG_ERROR, "proc_ConnectDB@Failed to connect to %s!", gateinfo.szHistSrv);
    sql_error("ORACLE error proc_ConnectDB --\n");
    ret = APP_ERROR;
    return ret;
    }

    01012, 00000, "not logged on"
    // *Cause:
    // *Action:use COPY & PASTE so we can see what you do & how Oracle responds.

  • Encountered ORA-01722 Invalid number when query doc from  view

    Hi all,
    I have the following view.
    Select item, to_number(wo) a
    from tablea
    union all
    select item, wo
    from tablebb
    The problem rise ( ORA-01722) when I try to search for wo from the view after the view has been created. The wo field in tablea was varchar2 where user will key in the number only. And wo in tabebb is number, I can't change the column format as it is belong the my standard application table. How to solve this problem ?
    Thanks
    Lim

    sm**** wrote:
    I try to simplified my query. In fact, there are several where clause for both tables. The reason is because of the varchar2 field in WO at tablea versus the numeric field in WO for tableb. OK. The problem then is almost certainly that you have non-numeric characters in the column but you don't happen to have non-numeric characters in the columns that match all the other predicates.
    Oracle is free to apply the TO_NUMBER function before it applies some or all of the predicates you specify in your WHERE clause. If it happens to apply the TO_NUMBER on a row that has non-numeric data before it applies the condition in the WHERE clause that filters out that particular row, you'll get an error. If, on the other hand, Oracle happens to filter out the row before applying the TO_NUMBER, you'll get the results you expect. It all comes down to which plan Oracle picks. But, in general, there is no guarantee about whether you'll get an error or whether you'll get the data you want.
    You can define your own function
    CREATE OR REPLACE FUNCTION my_to_number( p_str IN VARCHAR2 )
      RETURN number
    IS
      l_num NUMBER;
    BEGIN
      l_num := to_number( p_str );
      RETURN l_num;
    EXCEPTION
      WHEN others THEN
        RETURN null;
    END;and use that instead of to_number in your query. That will catch the exception if the function is applied to a row before one of the predicates is applied.
    Justin

  • ORA-01152 error while creating db from custom template

    I have a database based on the "general purpose/transaction processing" db, but with a custom tablespace/data added. I have attempted to clone this database by using dbca to create a custom template (including data) from this database. The template creation appears to be successful -- however, when I use dbca to try to create a new db from this custom template, I get the following error when dbca attempts to initialize the instance:
    ORA-01152: file 5 was not restored from a sufficiently old backup
    ORA-01110: data file 5: <path to my custom tablespace .dbf>
    If I select "ignore" at this point, I get further errors, the next error is
    ORA-06550: line 1, column 7: PLS-00201: Identifier 'DBMS_SERVICE.DELETE_SERVICE' must be declared
    I'm using 11gR2, and am relatively inexperienced on the dba side, any help appreciated.
    Thanks,
    Ben

    Update: I had unintentionally left my custom tablespace in READONLY state after an earlier experiment with transportable tablespaces. After putting the tablespace back into READ WRITE mode and creating a new template, I was successfully able to create a new db from the template.
    I'm still a little curious why this procedure wouldn't work properly with a READONLY tablespace, however.
    Ben

  • Encountered ora-29701 during Sun Cluster for Oracle RAC 9.2.0.7 startup (UR

    Hi all,
    Need some help from all out there
    In our Sun Cluster 3.1 Data Service for Oracle RAC 9.2.0.7 (Solaris 9) configuration, my team had encountered
    ora-29701 *Unable to connect to Cluster Manager*
    during the startup of the Oracle RAC database instances on the Oracle RAC Server resources.
    We tried the attached workaround by Oracle. This workaround works well for the 1^st time but it doesn’t work anymore when the server is rebooted.
    Kindly help me to check whether anyone encounter the same problem as the above and able to resolve. Thanks.
    Bug No. 4262155
    Filed 25-MAR-2005 Updated 11-APR-2005
    Product Oracle Server - Enterprise Edition Product Version 9.2.0.6.0
    Platform Linux x86
    Platform Version 2.4.21-9.0.1
    Database Version 9.2.0.6.0
    Affects Platforms Port-Specific
    Severity Severe Loss of Service
    Status Not a Bug. To Filer
    Base Bug N/A
    Fixed in Product Version No Data
    Problem statement:
    ORA-29701 DURING DATABASE CREATION AFTER APPLYING 9.2.0.6 PATCHSET
    *** 03/25/05 07:32 am ***
    TAR:
    PROBLEM:
    Customer applied 9.2.0.6 patchset over 9.2.0.4 patchset.
    While creating the database, customer receives following error:
         ORA-29701: unable to connect to Cluster Manager
    However, if customer goes from 9.2.0.4 -> 9.2.0.5 -> 9.2.0.6, the problem does not occur.
    DIAGNOSTIC ANALYSIS:
    It seems that the problem is with libskgxn9.so shared library.
    For 9.2.0.4 -> 9.2.0.5 -> 9.2.0.6, the install log shows the following:
    installActions2005-03-22_03-44-42PM.log:,
    [libskgxn9.so->%ORACLE_HOME%/lib/libskgxn9.so 7933 plats=1=>[46]langs=1=> en,fr,ar,bn,pt_BR,bg,fr_CA,ca,hr,cs,da,nl,ar_EG,en_GB,et,fi,de,el,iw,hu,is,in, it,ja,ko,es,lv,lt,ms,es_MX,no,pl,pt,ro,ru,zh_CN,sk,sl,es_ES,sv,th,zh_TW, tr,uk,vi]]
    installActions2005-03-22_04-13-03PM.log:, [libcmdll.so ->%ORACLE_HOME%/lib/libskgxn9.so 64274 plats=1=>[46] langs=-554696704=>[en]]
    For 9.2.0.4 -> 9.2.0.6, install log shows:
    installActions2005-03-22_04-13-03PM.log:, [libcmdll.so ->%ORACLE_HOME%/lib/libskgxn9.so 64274 plats=1=>[46] langs=-554696704=>[en]] does not exist.
    This means that while patching from 9.2.0.4 -> 9.2.0.5, Installer copies the libcmdll.so library into libskgxn9.so, while patching from 9.2.0.4 -> 9.2.0.6 does not.
    ORACM is located in /app/oracle/ORACM which is different than ORACLE_HOME in customer's environment.
    WORKAROUND:
    Customer is using the following workaround:
    cd $ORACLE_HOME/rdbms/lib make -f ins_rdbms.mk rac_on ioracle ipc_udp
    RELATED BUGS:
    Bug 4169291

    Check if following MOS note helps.
    Series of ORA-7445 Errors After Applying 9.2.0.7.0 Patchset to 9.2.0.6.0 Database (Doc ID 373375.1)

  • Error ORA-01152: file 1 was not restored from a sufficiently old backup

    Its also not thread just to share info with oracle gurus here.If my findings for the below workaround is wrong then please do correct me.
    Sometime you get the error after performing restoring controlfile when you don't have autobackup controlfile on
    error ORA-01152: file 1 was not restored from a sufficiently old backup
    why?
    Cause When you shutdown the database with using the normal,transactional or immediate options not abort a full checkpoint occurs.A full checkpoint ensures that all of the dirty blocks contained in the buffer cache are written to the data files,the database comes into synchronized state at this time i.e controlfile CKPT SCN=databasefile CKPT.
    Like in this demo i am not taking backup the database in opened mode
    Demo 1
    SQL> archive log list
    Database log mode              No Archive Mode
    Automatic archival             Disabled
    Archive destination            USE_DB_RECOVERY_FILE_DEST
    Oldest online log sequence     9
    Current log sequence           11
    SQL> shutdown immediate
    Database closed.
    Database dismounted.
    ORACLE instance shut down.
    SQL> startup mount
    ORACLE instance started.
    Total System Global Area  171966464 bytes
    Fixed Size                   787988 bytes
    Variable Size             145488364 bytes
    Database Buffers           25165824 bytes
    Redo Buffers                 524288 bytes
    Database mounted.
    SQL> alter database archivelog
      2  /
    Database altered.
    SQL> archive log list
    Database log mode              Archive Mode
    Automatic archival             Enabled
    Archive destination            USE_DB_RECOVERY_FILE_DEST
    Oldest online log sequence     9
    Next log sequence to archive   11
    Current log sequence           11
    Recovery Manager: Release 10.1.0.2.0 - Production
    Copyright (c) 1995, 2004, Oracle.  All rights reserved.
    RMAN> connect target sys/sys
    connected to target database: ORCL1 (DBID=1024798223)
    RMAN> list backup
    2> ;
    using target database controlfile instead of recovery catalog
    RMAN> backup database
    2> ;
    Starting backup at 08-DEC-07
    using channel ORA_DISK_1
    channel ORA_DISK_1: starting full datafile backupset
    channel ORA_DISK_1: specifying datafile(s) in backupset
    input datafile fno=00001 name=C:\ORACLE10G\ORACLE\ORADATA\ORCL1\ORCL1\SYSTEM01.DBF
    input datafile fno=00003 name=C:\ORACLE10G\ORACLE\ORADATA\ORCL1\ORCL1\SYSAUX01.DBF
    input datafile fno=00002 name=C:\ORACLE10G\ORACLE\ORADATA\ORCL1\ORCL1\UNDOTBS01.DBF
    input datafile fno=00004 name=C:\ORACLE10G\ORACLE\ORADATA\ORCL1\ORCL1\USERS01.DBF
    channel ORA_DISK_1: starting piece 1 at 08-DEC-07
    channel ORA_DISK_1: finished piece 1 at 08-DEC-07
    piece handle=C:\ORACLE\FLASH_RECOVERY_AREA\ORCL1\ORCL1\BACKUPSET\2007_12_08\O1_MF_NNNDF_TAG20071208T143558_3ONSCZBY_.BKP
    comment=NONE
    channel ORA_DISK_1: backup set complete, elapsed time: 00:00:45
    channel ORA_DISK_1: starting full datafile backupset
    channel ORA_DISK_1: specifying datafile(s) in backupset
    including current controlfile in backupset
    including current SPFILE in backupset
    channel ORA_DISK_1: starting piece 1 at 08-DEC-07
    channel ORA_DISK_1: finished piece 1 at 08-DEC-07
    piece handle=C:\ORACLE\FLASH_RECOVERY_AREA\ORCL1\ORCL1\BACKUPSET\2007_12_08\O1_MF_NCSNF_TAG20071208T143558_3ONSFGN7_.BKP
    comment=NONE
    channel ORA_DISK_1: backup set complete, elapsed time: 00:00:05
    Finished backup at 08-DEC-07
    SQL> shutdown immediate
    ORA-01109: database not open
    Database dismounted.
    ORACLE instance shut down.Now i delete the controlfile from OS command.
    SQL> startup
    ORACLE instance started.
    Total System Global Area  171966464 bytes
    Fixed Size                   787988 bytes
    Variable Size             145488364 bytes
    Database Buffers           25165824 bytes
    Redo Buffers                 524288 bytes
    ORA-00205: error in identifying controlfile, check alert log for more infoi don't have automatized control file backup neither i have control file copy.What i will do
    to recover control file i will restore controlfile from backup.Before doing it that i will bring
    the database in mount state.
    SQL> shutdown immediate
    ORA-01507: database not mounted
    ORACLE instance shut down.
    SQL> startup mount
    ORACLE instance started.
    Total System Global Area  171966464 bytes
    Fixed Size                   787988 bytes
    Variable Size             145488364 bytes
    Database Buffers           25165824 bytes
    Redo Buffers                 524288 bytes
    ORA-00205: error in identifying controlfile, check alert log for more infoi have two backup piece in my backupset folder you cant check control file backup
    existence with list backup controlfile at RMAN prompt cause it needs database in
    mount state.You will have to test both backup set pieces.
    RMAN> restore controlfile from
    'C:\oracle\flash_recovery_area\orcl1\ORCL1\BACKUPSET\2007_12_08\O1_MF_NCSNF_TAG20071208T143558_3ONSFGN7_.BKP';
    Starting restore at 08-DEC-07
    using channel ORA_DISK_1
    channel ORA_DISK_1: restoring controlfile
    channel ORA_DISK_1: restore complete
    output filename=C:\ORACLE10G\ORACLE\ORADATA\ORCL1\ORCL1\CONTROL01.CTL
    output filename=C:\ORACLE10G\ORACLE\ORADATA\ORCL1\ORCL1\CONTROL02.CTL
    output filename=C:\ORACLE10G\ORACLE\ORADATA\ORCL1\ORCL1\CONTROL03.CTL
    Finished restore at 08-DEC-07
    SQL> startup
    ORACLE instance started.
    Total System Global Area  171966464 bytes
    Fixed Size                   787988 bytes
    Variable Size             145488364 bytes
    Database Buffers           25165824 bytes
    Redo Buffers                 524288 bytes
    Database mounted.
    ORA-01589: must use RESETLOGS or NORESETLOGS option for database open
    SQL> alter database open resetlogs
      2  /
    Database altered.You can see database now comes into open mode without raising error error
    ORA-01152: file 1 was not restored from a sufficiently old backup,you can see that
    database shutdown with immediate which synchronized the control file with database
    file.
    Demo 2
    ------------Now in this demo i am taking backup the database in opened mode before backup
    database i have deleted alls previous backup.
    Database is in opened moder if i take the backup in database opened mode
    (i.e full checkpoint will not occur controlfile CKPT SCN<>datafile CKPT SCN)
    you will get the error when you will restore controlfile from backup set.
    error ORA-01152: file 1 was not restored from a sufficiently old backup
    Reason is that CKPT SCN in the datafiles will be ahead of the backupset control file no
    full checkpoint occuring. You are not taking backup in consistent state and the
    backupset will not be in consistent state.When you will restore the control file from
    backupset then yours restored control file SCN will be lesser then yours datafile
    checkpoint SCN.
    SQL> startup
    ORACLE instance started.
    Total System Global Area  171966464 bytes
    Fixed Size                   787988 bytes
    Variable Size             145488364 bytes
    Database Buffers           25165824 bytes
    Redo Buffers                 524288 bytes
    Database mounted.
    Database opened.
    RMAN> backup database
    2> ;
    Starting backup at 11-DEC-07
    using channel ORA_DISK_1
    channel ORA_DISK_1: starting full datafile backupset
    channel ORA_DISK_1: specifying datafile(s) in backupset
    input datafile fno=00001 name=C:\ORACLE10G\ORACLE\ORADATA\ORCL1\ORCL1\SYSTEM01.D
    BF
    input datafile fno=00003 name=C:\ORACLE10G\ORACLE\ORADATA\ORCL1\ORCL1\SYSAUX01.D
    BF
    input datafile fno=00002 name=C:\ORACLE10G\ORACLE\ORADATA\ORCL1\ORCL1\UNDOTBS01.
    DBF
    input datafile fno=00004 name=C:\ORACLE10G\ORACLE\ORADATA\ORCL1\ORCL1\USERS01.DB
    F
    channel ORA_DISK_1: starting piece 1 at 11-DEC-07
    channel ORA_DISK_1: finished piece 1 at 11-DEC-07
    piece handle=C:\ORACLE\FLASH_RECOVERY_AREA\ORCL1\ORCL1\BACKUPSET\2007_12_11\O1_M
    F_NNNDF_TAG20071211T125123_3OWJD0V5_.BKP comment=NONE
    channel ORA_DISK_1: backup set complete, elapsed time: 00:00:56
    channel ORA_DISK_1: starting full datafile backupset
    channel ORA_DISK_1: specifying datafile(s) in backupset
    including current controlfile in backupset
    including current SPFILE in backupset
    channel ORA_DISK_1: starting piece 1 at 11-DEC-07
    channel ORA_DISK_1: finished piece 1 at 11-DEC-07
    piece handle=C:\ORACLE\FLASH_RECOVERY_AREA\ORCL1\ORCL1\BACKUPSET\2007_12_11\O1_M
    F_NCSNF_TAG20071211T125123_3OWJFT97_.BKP comment=NONE
    channel ORA_DISK_1: backup set complete, elapsed time: 00:00:09
    Finished backup at 11-DEC-07now i shut down the database in order to delete the control file from os command
    SQL> shutdown immediate
    Database closed.
    Database dismounted.
    ORACLE instance shut down.
    SQL> deleting the controlfile from oradata folder
    SQL> startup
    ORACLE instance started.
    Total System Global Area  171966464 bytes
    Fixed Size                   787988 bytes
    Variable Size             145488364 bytes
    Database Buffers           25165824 bytes
    Redo Buffers                 524288 bytes
    ORA-00205: error in identifying controlfile, check alert log for more infonow i would restore the controlfile from backupset.
    RMAN> restore controlfile from 'C:\oracle\flash_recovery_area\orcl1\ORCL1\BACKUP
    SET\2007_12_11\O1_MF_NCSNF_TAG20071211T125123_3OWJFT97_.BKP'
    2> ;
    Starting restore at 11-DEC-07
    allocated channel: ORA_DISK_1
    channel ORA_DISK_1: sid=159 devtype=DISK
    channel ORA_DISK_1: restoring controlfile
    channel ORA_DISK_1: restore complete
    output filename=C:\ORACLE10G\ORACLE\ORADATA\ORCL1\ORCL1\CONTROL01.CTL
    output filename=C:\ORACLE10G\ORACLE\ORADATA\ORCL1\ORCL1\CONTROL02.CTL
    output filename=C:\ORACLE10G\ORACLE\ORADATA\ORCL1\ORCL1\CONTROL03.CTL
    Finished restore at 11-DEC-07
    SQL> shutdown immediate
    ORA-01507: database not mounted
    ORACLE instance shut down.
    SQL> startup
    ORACLE instance started.
    Total System Global Area  171966464 bytes
    Fixed Size                   787988 bytes
    Variable Size             145488364 bytes
    Database Buffers           25165824 bytes
    Redo Buffers                 524288 bytes
    Database mounted.
    ORA-01589: must use RESETLOGS or NORESETLOGS option for database open
    SQL> alter database open resetlogs
      2  /
    alter database open resetlogs
    ERROR at line 1:
    ORA-01152: file 1 was not restored from a sufficiently old backup
    ORA-01110: data file 1: 'C:\ORACLE10G\ORACLE\ORADATA\ORCL1\ORCL1\SYSTEM01.DBF'what would you do that now you have lost controlfile ,you dont have copy either you dont
    have autobackup on for controlfile,you need to create the control file
    SQL> shutdown immediate
    ORA-01109: database not open
    Database dismounted.
    ORACLE instance shut down.
    SQL> startup nomount
    ORACLE instance started.
    Total System Global Area  171966464 bytes
    Fixed Size                   787988 bytes
    Variable Size             145488364 bytes
    Database Buffers           25165824 bytes
    Redo Buffers                 524288 bytes
    SQL> create controlfile reuse database orcl1 noresetlogs archivelog
      2  MAXLOGFILES 50
      3  MAXLOGMEMBERS 3
      4  MAXDATAFILES 300
      5  MAXINSTANCES 8
      6  MAXLOGHISTORY 500
      7  LOGFILE
      8                     GROUP 1 'C:\oracle10g\oracle\oradata\orcl1\orcl1\redo01.LOG',
      9                     GROUP 2 'C:\oracle10g\oracle\oradata\orcl1\orcl1\redo02.LOG',
    10                     GROUP 3 'C:\oracle10g\oracle\oradata\orcl1\orcl1\redo03.LOG'
    11  DATAFILE
    12                     'C:\oracle10g\oracle\oradata\orcl1\orcl1\SYSAUX01.DBF',
    13                     'C:\oracle10g\oracle\oradata\orcl1\orcl1\SYSTEM01.DBF',
    14                     'C:\oracle10g\oracle\oradata\orcl1\orcl1\UNDOTBS01.DBF',
    15                     'C:\oracle10g\oracle\oradata\orcl1\orcl1\USERS01.DBF'
    16 
    SQL> /
    Control file created.
    SQL> alter database open
      2  /
    Database altered.Khurram

    No need to manually recreate the controlfile. Simply issue RECOVER DATABASE prior to opening database.
    E:\>rman target /
    Recovery Manager: Release 10.2.0.1.0 - Production on Sun Dec 30 01:22:34 2007
    Copyright (c) 1982, 2005, Oracle.  All rights reserved.
    connected to target database (not started)
    RMAN> startup
    Oracle instance started
    database mounted
    database opened
    Total System Global Area     612368384 bytes
    Fixed Size                     2006192 bytes
    Variable Size                239076176 bytes
    Database Buffers             364904448 bytes
    Redo Buffers                   6381568 bytes
    RMAN> backup database;
    Starting backup at 30-DEC-07
    using target database control file instead of recovery catalog
    allocated channel: ORA_DISK_1
    channel ORA_DISK_1: sid=148 devtype=DISK
    channel ORA_DISK_1: starting full datafile backupset
    channel ORA_DISK_1: specifying datafile(s) in backupset
    input datafile fno=00001 name=E:\ORACLE\ORADATA\ORA10G\SYSTEM01.DBF
    input datafile fno=00002 name=E:\ORACLE\ORADATA\ORA10G\UNDOTBS01.DBF
    input datafile fno=00003 name=E:\ORACLE\ORADATA\ORA10G\SYSAUX01.DBF
    input datafile fno=00004 name=E:\ORACLE\ORADATA\ORA10G\USERS01.DBF
    channel ORA_DISK_1: starting piece 1 at 30-DEC-07
    channel ORA_DISK_1: finished piece 1 at 30-DEC-07
    piece handle=D:\DB_BACKUPS\12J4S23M_1_1.BKP tag=TAG20071230T012302 comment=NONE
    channel ORA_DISK_1: backup set complete, elapsed time: 00:01:35
    channel ORA_DISK_1: starting full datafile backupset
    channel ORA_DISK_1: specifying datafile(s) in backupset
    including current control file in backupset
    including current SPFILE in backupset
    channel ORA_DISK_1: starting piece 1 at 30-DEC-07
    channel ORA_DISK_1: finished piece 1 at 30-DEC-07
    piece handle=D:\DB_BACKUPS\13J4S26L_1_1.BKP tag=TAG20071230T012302 comment=NONE
    channel ORA_DISK_1: backup set complete, elapsed time: 00:00:03
    Finished backup at 30-DEC-07
    RMAN> shutdown immediate
    database closed
    database dismounted
    Oracle instance shut down
    RMAN> exit
    Recovery Manager complete.
    E:\>del e:\oracle\oradata\ora10g\*.ctl
    E:\>rman target /
    Recovery Manager: Release 10.2.0.1.0 - Production on Sun Dec 30 01:25:39 2007
    Copyright (c) 1982, 2005, Oracle.  All rights reserved.
    connected to target database (not started)
    RMAN> startup
    Oracle instance started
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-03002: failure of startup command at 12/30/2007 01:25:56
    ORA-00205: error in identifying control file, check alert log for more info
    RMAN> restore controlfile from 'D:\DB_BACKUPS\13J4S26L_1_1.BKP';
    Starting restore at 30-DEC-07
    using target database control file instead of recovery catalog
    allocated channel: ORA_DISK_1
    channel ORA_DISK_1: sid=157 devtype=DISK
    channel ORA_DISK_1: restoring control file
    channel ORA_DISK_1: restore complete, elapsed time: 00:00:03
    output filename=E:\ORACLE\ORADATA\ORA10G\CONTROL01.CTL
    output filename=E:\ORACLE\ORADATA\ORA10G\CONTROL02.CTL
    output filename=E:\ORACLE\ORADATA\ORA10G\CONTROL03.CTL
    Finished restore at 30-DEC-07
    RMAN> alter database mount;
    database mounted
    released channel: ORA_DISK_1
    RMAN> alter database open resetlogs;
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-03002: failure of alter db command at 12/30/2007 01:27:33
    ORA-01152: file 1 was not restored from a sufficiently old backup
    ORA-01110: data file 1: 'E:\ORACLE\ORADATA\ORA10G\SYSTEM01.DBF'
    RMAN> recover database;
    Starting recover at 30-DEC-07
    Starting implicit crosscheck backup at 30-DEC-07
    allocated channel: ORA_DISK_1
    channel ORA_DISK_1: sid=156 devtype=DISK
    Crosschecked 1 objects
    Finished implicit crosscheck backup at 30-DEC-07
    Starting implicit crosscheck copy at 30-DEC-07
    using channel ORA_DISK_1
    Finished implicit crosscheck copy at 30-DEC-07
    searching for all files in the recovery area
    cataloging files...
    no files cataloged
    using channel ORA_DISK_1
    starting media recovery
    archive log thread 1 sequence 1 is already on disk as file E:\ORACLE\ORADATA\ORA10G\REDO03.LOG
    archive log filename=E:\ORACLE\ORADATA\ORA10G\REDO03.LOG thread=1 sequence=1
    media recovery complete, elapsed time: 00:00:02
    Finished recover at 30-DEC-07
    RMAN> alter database open resetlogs;
    database opened
    RMAN> shutdown immediate
    database closed
    database dismounted
    Oracle instance shut down
    RMAN> startup
    connected to target database (not started)
    Oracle instance started
    database mounted
    database opened
    Total System Global Area     612368384 bytes
    Fixed Size                     2006192 bytes
    Variable Size                247464784 bytes
    Database Buffers             356515840 bytes
    Redo Buffers                   6381568 bytes
    RMAN>

  • 11g R1 problem... PLS-00103: Encountered the symbol "¿" when expecting...

    Yesterday AM. my customer went live with an upgrade. Things started out ok, but as the load on the system started to build, we started seeing errors.
    The reported error is:
    S1000 Oracle ODBC Ora ORA-06550: line 1, column 42:
    PLS-00103: Encountered the symbol "¿" when expecting one of the following:
    . ( ) , * @ % & = - + < / > at in is mod remainder not rem =>
    <an exponent (**)> <> or != or ~= >= <= <> and or like
    This is in response to calling a stored procedure with this signature.
    MY_THING (
    p1 IN NUMBER,
    p2 OUT NUMBER,
    p2 IN NUMBER
    I believe this is a failure with the ODBC driver to parse
    {call MY_STUFF.MY_THING(791200, ?, 1067744)}
    Now to head off the obvious responses, I'm going to say these things in boldface
    the procedure itself is fine, and works flawlessly under test
    *nowhere in any of the code is an upside-down '?' as reported in the error message*
    Has anyone else encountered this--or better yet solved it?

    thanks for the replies.
    I'd have to rule out triggers at the point the stored procedure is run. Other than logging, it doesn't do any writes to the database. It does a couple of look-ups, and returns the results in a cursor. As for the web servers, they're pretty much copies of each other. 'Out of the box + updates' Windows Server 2008 machines with our application installed on each.
    The software issuing the ODBC call is old, well worn, tried and true C++. In this case the only string parameters passed are 'PA' or 'PJ' the rest is all integers.
    But again I want to stress that it doesn't appear that we reach the database when it fails. It appears to fail when the ODBC driver is parsing the '{call xxxxxx} statement.
    On a hunch, I've just reconfigured our application to treat the offensive call as if it were an 'external' reference. Meaning that a new ODBC connection will be created/destroyed for each run. Not very efficient, but I'll take slow over broken any day. It's too early to tell if this will eliminate the error.

  • EXP-00056: ORACLE error 4021 encountered ORA-04021: timeout occurred while

    hi all oracle gurus ,
    i have this problem which i am facing its like this.i have a batch file that runs export every night one week back it was all okay .few days back when i looked the log files it gives me this error ---EXP-00056: ORACLE error 4021 encountered
    ORA-04021: timeout occurred while waiting to lock object
    what should i do this is a production database runing in windows platform and there is no backup pls help me .....
    export log file -------
    Connected to: Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - Production
    With the Partitioning, OLAP and Data Mining options
    Export done in AL32UTF8 character set and AL16UTF16 NCHAR character set
    About to export specified users ...
    . exporting pre-schema procedural objects and actions
    . exporting foreign function library names for user PILOT
    . exporting foreign function library names for user FINANCE
    . exporting foreign function library names for user MBCNEWS
    . exporting PUBLIC type synonyms
    . exporting private type synonyms
    . exporting PUBLIC type synonyms
    . exporting private type synonyms
    . exporting PUBLIC type synonyms
    . exporting private type synonyms
    . exporting object type definitions for user PILOT
    . exporting object type definitions for user FINANCE
    . exporting object type definitions for user MBCNEWS
    About to export PILOT's objects ...
    . exporting database links
    . exporting sequence numbers
    . exporting cluster definitions
    EXP-00056: ORACLE error 4021 encountered
    ORA-04021: timeout occurred while waiting to lock object
    ORA-06512: at "SYS.DBMS_METADATA", line 1511
    ORA-06512: at "SYS.DBMS_METADATA", line 1548
    ORA-06512: at "SYS.DBMS_METADATA", line 1864
    ORA-06512: at "SYS.DBMS_METADATA", line 3707
    ORA-06512: at "SYS.DBMS_METADATA", line 3689
    ORA-06512: at line 1
    EXP-00000: Export terminated unsuccessfully
    robyav

    this is a production database runing in windows platform and there is no backup
    what should iWell first of all you should stop using EXP for backups, it's quite unsuitable, and start using RMAN instead. Find out more.
    If you have a Metalink account you shoudl read Note:298968.1. But teh headline is there is a bug in 10gR1 which is fixed in 10gR2. This may not help you much. The workaround is to try running the export again later, which may not be any more helpful.
    Cheers, APC

  • Error: Encountered a SELECT WHEN EXPECTING the following ( + - all mod num

    I have a conditional INSERT statement where I update the record if todays date is found in the table or i will INSERT a new record if that date is not found..
    Insert statement that comes after ELSE works fine but IF part fails with the error
    encountered a select when expecting the following
    *( - + all case mod new null.. and lot more*
    IF EXISTS
    (SELECT (TO_CHAR(UpdateDate, 'MM/DD/YYYY')) FROM EmployeeUpdateEmails
         WHERE UpdateDate = select (TO_CHAR(sysdate, 'MM/DD/YYYY')) from dual)
         UPDATE EMPLOYEEUPDATEEMAILS
    SET EMP_MGR_TOTAL_CHANGES = total
         WHERE UpdateDate = select (TO_CHAR(sysdate, 'MM/DD/YYYY')) from dual
    ELSE
    This is how EmployeeUpdateEmails table is created
    CREATE TABLE EmployeeUpdateEmails
    UpdateNum SMALLINT          PRIMARY KEY,
    UpdateDate               DATE,
    Emp_Mgr_Total_Changes SMALLINT,
    Emp_Term_Total_Chnages SMALLINT
    Please Help

    IF EXISTS is not aproppriate syntax:
    SQL> declare
      2  begin
      3   if exists (select count(*) from dual)
      4   then
      5     dbms_output.put_line('it exists');
      6   else
      7     dbms_output.put_line('it doesn''t exist');
      8   end if;
      9  end;
    10  /
    if exists (select count(*) from dual)
    ERROR at line 3:
    ORA-06550: line 3, column 5:
    PLS-00204: function or pseudo-column 'EXISTS' may be used inside a SQL statement only
    ORA-06550: line 3, column 2:
    PL/SQL: Statement ignored
    SQL> declare
      2   my_var number; 
      3  begin
      4  
      5   select count(*) into my_var
      6   from   dual;
      7  
      8   if my_var >= 1
      9   then
    10     dbms_output.put_line('it exists');
    11   else
    12     dbms_output.put_line('it doesn''t exist');
    13   end if;
    14  end;
    15  /
    it exists
    PL/SQL procedure successfully completed.If you're using SQL then
    1) post the complete statement
    2) mention your database version ( the result of: select * from v$version; )
    3) consider using CASE:
    SQL> select case
      2           when (select count(*) from dual) >= 1
      3           then 'it exists'
      4           else 'it doesn''t exist'
      5         end
      6  from   dual;
    CASEWHEN(SELECTC
    it exists
    1 row selected.

  • ORACLE error 959 encountered ORA-00959: tablespace 'xyz' does not exist

    im importing a dump to a newly created BD and im using 11g. I have already tablespaces and user for the dump to be imported.
    The problems is, i have a total of 5 tablespaces created, all 4 are working well except the one tablespace and im receiving a 959 error(IMP-00003: ORACLE error 959 encountered
    ORA-00959: tablespace 'xyz' does not exist). The log mentions that the tablespace does not exist even if this tablespace exist in the list of tablespace and datafiles created.
    Hope you could help me with this. Thanks
    Edited by: user8667617 on Feb 18, 2010 11:06 PM

    SQL> Select name from v$datafile;
    NAME
    C:\APP\ORACLEADMIN\ORADATA\ORC11\SYSTEM01.DBF
    C:\APP\ORACLEADMIN\ORADATA\ORC11\SYSAUX01.DBF
    F:\ORC11DBUNDO\UNDOTBS01.DBF
    E:\ORC11DBUSER\USERS01.DBF
    E:\ORC11DBUSER\INT_TRANSACTIONS_DATA.DBF
    E:\ORC11DBUSER\INT_DATA.DBF
    E:\ORC11DBUSER\CAS_DATA.DBF
    E:\ORC11DBUSER\COS_DATA.DBF
    E:\ORC11DBUSER\INT_ONLINE_TRANSACTIONS_DATA.DBF
    9 rows selected.
    SQL> Select * from v$tablespace;
    TS# NAME INC BIG FLA ENC
    0 SYSTEM YES NO YES
    1 SYSAUX YES NO YES
    2 UNDOTBS1 YES NO YES
    4 USERS YES NO YES
    3 TEMP NO NO YES
    6 INT_TRANSACTIONS_DATA YES NO YES
    7 INT_DATA YES NO YES
    8 CAS_DATA YES NO YES
    9 COS_DATA YES NO YES
    10 INT_ONLINE_TRANSACTIONS_DATA YES NO YES
    10 rows selected.
    SQL>
    here are the result of my query and it seems that the tablespace is recognized by the DB.
    is there still any reason why? also when i try to drop the said tablespace in getting a response of the "tablespace does not exist" but when i try to create the tablespace it says that "ORA-00604: error occurred at recursive SQL level 1
    ORA-00001: unique constraint (SYS.I_TS1) violated"
    hope you can help me with this.

  • ORACLE error from auxiliary database: ORA-01152: file 2 was not restored fr

    Hello,
    i'm trying to clone a database. It is in archive log mode.
    I took a full back using below command
    run {
      backup
         tag 'DAILY_WHOLE'
         format 'FULL_backup_%s_%p_%c.bkp'     database
         plus archivelog
         tag 'DAILY_WHOLE'
         delete all input;
      backup
         current controlfile
         format 'FULL_backup_%s_%p_%c.bkp'     tag 'WHOLE'
         spfile
         format 'FULL_backup_%s_%p_%c.bkp'     tag 'WHOLE';
    }then i issue a duplicate database command
    RUN
    DUPLICATE DATABASE TO TEST_DB
              NOFILENAMECHECK
               NOREDO
              BACKUP LOCATION '/disk10/flash_recovery_area/PROD';
    }at the very end I got this error.
    contents of Memory Script:
       Alter clone database open resetlogs;
    executing Memory Script
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-03002: failure of Duplicate Db command at 05/15/2013 11:59:21
    RMAN-05501: aborting duplication of target database
    RMAN-03015: error occurred in stored script Memory Script
    RMAN-06136: ORACLE error from auxiliary database: ORA-01152: file 2 was not restored from a sufficiently old backup
    ORA-01110: data file 2: 'sysaux.dbf'Can anyone help me? I would appreciate it. thanks

    NOREDO would be used when you have a Consistent Backup (i.e. backup taken when the database is MOUNTed but not OPEN) and so, no archivelogs need to be applied. (This would also be the case for a NOARCHIVELOG database).
    See the notes on NOREDO in the DUPLICATE command documentation in the Backup and Recovery Reference.
    http://docs.oracle.com/cd/E11882_01/backup.112/e10643/rcmsynta020.htm#i81724
    Hemant K Chitale

Maybe you are looking for

  • RE: (forte-users) Including/Excluding plans

    Pascal, Before you partition try setting "trc:cf:6". Good luck, John Hornsby DS Data Systems (UK) Ltd. John.Hornsbydsdata.co.uk Tel. +44 01908 847100 Mob. +44 07966 546189 Fax. +44 0870 0525800 -----Original Message----- From: Rottier, Pascal [mailto

  • How to enable touch workspace Illustrator 2014.1

    I've installed and updated Illustrator on my laptop and on my Asus Vivotab Note 8. However, I can't seem to find the touch workspace I was looking forward to checking out on my wacom enabled tablet. Do I still need an additional update, or is somethi

  • Filter issue in ALV

    Hi All, Hope you all are doing fine!! Am displaying an alv output list for about 15fields among which VBELN ( sales document ) is one of the fields...,am able to filter all the fields in the output except for VBELN field ,,,, i really dont understand

  • ExternalInterface and Text Encoding

    Hi there: We're using ExternalInterface to pass data from the Flash player (in this case, an ActiveX control) into a SWF, and we're noticing that Unicode characters (e.g., é) are getting mangled on the way in (e.g., é). Given there's no room for an

  • IMovie shuts down at the end of image stabilization of a clip.

    shuts down each time I use image stabilization for a clip......at the end of the process......