ORA-08004 Solution?

Please let me know how to resolve ORA-08004? its basically giving me an exception of seq value exceded & i dont know how to get and change specified sequence value
Please tell me the query also let me know how to change specified sequence value
Thanks,
Waheed.

SQL> create sequence seq1 maxvalue 2;
Sequence created.
SQL> select seq1.nextval from dual;
   NEXTVAL
         1
SQL> /
   NEXTVAL
         2
SQL> /
select seq1.nextval from dual
ERROR at line 1:
ORA-08004: sequence SEQ1.NEXTVAL exceeds MAXVALUE and cannot be instantiated
SQL> alter sequence seq1 maxvalue 100;
Sequence altered.
SQL> select seq1.nextval from dual;
   NEXTVAL
         3
SQL> /
   NEXTVAL
         4
SQL>To see actual sequence max value you can do :
SQL> select max_value from user_sequences
  2  where sequence_name = 'SEQ1';
MAX_VALUE
       100
SQL>of course change SEQ1 with your sequence name.

Similar Messages

  • ORA-06508 Solution for attached libraries

    If you are getting the ORA-06508 runtime error, it may be the result of a corrupted .pll file. You can solve this by doing the following:
    1) Remove the attached .pll file from the form.
    2) Verify whether the refrenced objects in the form from the .olb are existing in the .olb, if not you will get this error.
    3) Compile the .pll and and generate .plx(by using Ctrl-T) keep both .pll and .plx in the same directory.
    4) Re-attache the compiled .pll file.
    Cheers,
    Dave

    I've written a couple of tips here:
    PLL - PLX - how when compiling and what to deploy
    But one way of getting this error can also be this: you have a form and pll. You compile PLL and generate a PLX, then you compile the form, then you deploy the form and the PLL. The problem here is that since the PLX was present at compile time, it is also required at runtime - no longer will just the PLL suffice.
    Had you just saved your PLL (with no PLX present in the folder) you could have compiled your form and just deployed the fmx and pll.
    Regards,
    Jesper Vad Kristensen

  • Troubles with TNSNAMES.ORA - with solution

    Hi There
    I've had the problems described and solved in other entries of the forum.
    But then I ran in to a new one, the product would only read part of the file..!
    I've found that the problem apparently is that if there is an entry with a host that is not available then the product stops reading the file.
    I removed the entry and then it continued until the next unavailable server, which i then deleted. Finally I had a full TNS list in the product. But when the other servers becomes available again I have to add them to TNSNAMES.ORA, so I hope Oracle will fix it.
    A part from that a fine product.
    /regards Ole Jørgensen

    Thats strange, as we do not ping every host to make sure it is available. is this a 10.2 Oracle Home?

  • Database Link ORA-04054

    Hi
    I try send data from DB1 to DB2 via dblink.
    I created link
    CREATE DATABASE LINK MED
    CONNECT TO user IDENTIFIED BY pass
    USING
    '(DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 10.255.134.30)(PORT = 1521))
    (CONNECT_DATA =
    (SERVICE_NAME = med)
    and I can select data from remote table without errors.
    When I try Insert data to remote table (with PLSQL)
    for xx in (select u.*, sm.nr_gm, sm.nazwa nazwa_miejsc from adresy u ,sl_miejscow@med sm where u.miasto=sm.ident and
    not exists
    (select * from PAC@med pk where pk.ident_pac=u.identyfikator and pk.jednoraz='K' )
    and u.data_zap is not null)
    loop
    insert into PAC@MED
    (ident_pac, od_daty, do_daty, adr_ulica, adr_kod, nr_domu, nr_lokalu, telefon, jednoraz,z_kim_mieszka,ident_miejsc,ident_poczty,ident_kraj, adr_gmina, WOJEW_KOD, ADR_MIEJSC)
    values
    ( xx.identyfikator, sysdate, to_date('31/12/2099','dd/mm/yyyy'),xx.ULICA, xx.KOD,xx.DOM,xx.LOKAL,
    xx.TELEFON,'K',82, xx.MIASTO, xx.MIASTO, xx.kraj, xx.nr_gm,99, xx.nazwa_miejsc);
    end loop;
    I have error ORA-04054: database link string does not exist.
    Can you help me ??
    Message was edited by:
    AndyPol

    I found solution.
    Main problem was in GLOBAL_NAMES parameter.
    This description help me:
    Problem Description:
    ====================
    You receive an ORA-02069 error during an insert to a remote database through a
    database link when the insert contained a local sequence.
    ORA-02069: global_names parameter must be set to TRUE for this operation
    Cause: A remote mapping of the statement is required but cannot be
    achieved because global_names should be set to TRUE for it to
    be achieved.
    Action: Issue alter session set global_names = true if possible
    Problem Explanation:
    ====================
    This is expected behaviour.
    The insert statement is transformed so that it can be executed at the remote
    end of the dblink. The reference to the local sequence has to be qualified so
    that the remote end knows to call back to the local instance. The qualification
    is made by appending @local_dbname.domain to the sequence reference if
    global_names=true. When global_names=false, the code cannot make the assumption
    that the qualifier will be valid and reports the error ORA-02069 'global_names
    parameter must be set to TRUE for this operation'.
    Search Words:
    =============
    DBLINK SEQUENCE GLOBAL_NAMES ORA-2069
    Solution Description:
    =====================
    Use the following workaround:
    1. Create a 'temporary' table on the local database for holding the inserts.
    2. Insert the entire row into this table.
    3. Insert the 'temporary' row from the temporary table to the remote table.
    4. Delete the 'temporary' row from the temporary table.
    This is slower but it will get around the problem. It help me
    OR
    Set GLOBAL_NAMES=TRUE in the init<SID>.ora - not work for me
    Solution Explanation:
    =====================
    The first workaround bypasses the remote node having to make a
    call back to the local instance to reference the local sequence.

  • Moving init.ora file

    Hi,
    I'm in 8i on WinXP. By doing following I move init.ora file :
    SQLPLUS>shutdown immediate
    user>oradim -EDIT -SID DB1 -PFILE C:\oracle\admin\db1\exp\initdb1.ora -startmode auto
    Now if I start the service, it is OK and DB would be open. but if I issu startup I have errors :
    SQL> startup
    LRM-00109: could not open parameter file 'C:\oracle\admin\db1\pfile\initdb1.ora'
    LRM-00113: error when processing file 'C:\oracle\admin\db1\pfile\initdb1.ora'
    ORA-01078: failure in processing system parameters
    Even if registry fir pfile key is changed, it is with new position of init.ora file, but startup command line look for ancient init.ora file, Why ?
    I should use :
    SQL> startup pfile='C:\oracle\admin\db1\exp\initdb1.ora'
    Any solution ?
    Many thanks.

    we are in 8i :
    HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE\HOME0
    ID REG_SZ 0
    ORACLE_GROUP_NAME REG_SZ Oracle - OraHome81
    ORACLE_HOME_NAME REG_SZ OraHome81
    ORACLE_HOME REG_SZ C:\oracle\ora81
    ORA_REPRMAN_AUTOSTART REG_EXPAND_SZ TRUE
    ORA_REPRMAN_PFILE REG_EXPAND_SZ C:\oracle\admin\reprman\pfile\init.ora
    ORA_REPRMAN_SHUTDOWN REG_EXPAND_SZ TRUE
    ORA_REPRMAN_SHUTDOWNTYPE REG_EXPAND_SZ i
    ORA_REPRMAN_SHUTDOWN_TIMEOUT REG_EXPAND_SZ 30
    NLS_LANG REG_SZ FRENCH_FRANCE.WE8ISO8859P1
    ORACLE_HOME_KEY REG_SZ Software\ORACLE\HOME0
    SQLPATH REG_SZ C:\oracle\ora81\dbs
    ORACLE_BASE REG_SZ C:\oracle
    MSHELP_TOOLS REG_SZ C:\oracle\ora81\MSHELP
    RDBMS_CONTROL REG_SZ C:\oracle\ora81\DATABASE
    RDBMS_ARCHIVE REG_SZ C:\oracle\ora81\DATABASE\ARCHIVE
    ORACLE_SID REG_SZ reprman
    ORA_DB1_AUTOSTART REG_EXPAND_SZ TRUE
    ORA_DB1_PFILE REG_EXPAND_SZ C:\oracle\admin\db1\exp\initdb1.ora
    ORA_DB1_SHUTDOWN REG_EXPAND_SZ TRUE
    ORA_DB1_SHUTDOWNTYPE REG_EXPAND_SZ i
    ORA_DB1_SHUTDOWN_TIMEOUT REG_EXPAND_SZ 30

  • ORA-29400 , ORA-40024, ORA-06512 errors

    Does anyone have an explanation why seemingly minor changes to the input data to a Generalized Linear Regression model predicting a numeric target results in these errors? Any way to get more diagnostic information as to the specific cause?
    (I am using the DBMS_DATA_MINING API, specifically CREATE_MODEL).

    Hi,
    The key error in your list is the following:
    ORA-40024: solution to least squares problem could not be found
    Cause: Unable to find solution because the predictor covariance matrix was singular.
    Action: Enable ridge regression or remove exact multicollinearities from the build data.
    Do you have ridge regression disabled?
    If so try enabling it and let me know if the model builds.
    There is a related thread that you might be interested in reviewing as well.
    GLM Statistis Output Question: ODM 11g + GLM classification + not able to see the following statistics
    Thanks, Mark

  • Use of warehouse for 'as of' balance custom fields

    we captured custom fields on each account/contact for current balance, current deposits, current trade volume
    we are updating these fields daily based on the transactional system integration
    how/will i be able to report on the day over day #'s or month over month given the built in warehouse -
    client wants a report to track the historical progression of these balances. Do we need to capture any additional fields?
    I thought this was a better approach then capturing the individual transactions (e.g. deposits, withdrawals, trades) as
    custom objects. Please would someone confirm?
    Edited by: user8903936 on Dec 8, 2010 11:01 AM

    Hi,
    my Ora-Trigger-Solution works well on R/3 development system.
    On quality assurance system it dumps with ORA-04098.
    It looks like, that required object privileges have been never granted.
    Do someone know, what priviliges or authorisations have to be maintained and where to maintain this?
    Thanks and regards,
    Wolfgang

  • Problem in Database Recovery..

    I m working at Test Environment, My database is running in ArchiveLogMode. I have current backup and old backup (one month old),
    For practice of Backup & Recovery, I deleted the control files, online redo logs and data files and restored from old backup(one month old).
    Note: I want to let you know that I have all the ArchivedRedoLog files and I have also created one tablespace (tablespace: abamco_test)that is not available in old backup.
    Is it possible to recover that tablespace with only ArchivedRedoLog files (No datafile backup)??????????
    =========================================================================
    SQL> select name from v$database;
    NAME
    ROCK
    SQL> shutdown immediate
    Database closed.
    Database dismounted.
    ORACLE instance shut down.
    <><> deleted all the datafiles, redologs, and control files.
    <><> copied & pasted all the redologs, and control files from one month old backup
    SQL> startup
    ORACLE instance started.
    Total System Global Area 167772160 bytes
    Fixed Size 1247876 bytes
    Variable Size 83887484 bytes
    Database Buffers 75497472 bytes
    Redo Buffers 7139328 bytes
    ORA-00205: error in identifying control file, check alert log for more info
    SQL> shutdown immediate
    ORA-01507: database not mounted
    ORACLE instance shut down.
    <><> COpied One month old control file and pasted in OraData folder.
    SQL> startup
    ORACLE instance started.
    Total System Global Area 167772160 bytes
    Fixed Size 1247876 bytes
    Variable Size 83887484 bytes
    Database Buffers 75497472 bytes
    Redo Buffers 7139328 bytes
    Database mounted.
    ORA-01157: cannot identify/lock data file 1 - see DBWR trace file
    ORA-01110: data file 1: 'D:\ORACLE\PRODUCT\10.2.0\ORADATA\ROCK\SYSTEM01.DBF'
    SQL> shutdown immediate
    ORA-01109: database not open
    Database dismounted.
    ORACLE instance shut down.
    <><> Copied all the datafiles, oneline redo log files from one month Old backup.
    SQL> startup
    ORACLE instance started.
    Total System Global Area 167772160 bytes
    Fixed Size 1247876 bytes
    Variable Size 83887484 bytes
    Database Buffers 75497472 bytes
    Redo Buffers 7139328 bytes
    Database mounted.
    ORA-01113: file 1 needs media recovery
    ORA-01110: data file 1: 'D:\ORACLE\PRODUCT\10.2.0\ORADATA\ROCK\SYSTEM01.DBF'
    SQL> recover database;
    ORA-00283: recovery session canceled due to errors
    ORA-01110: data file 6: 'D:\ORACLE\PRODUCT\10.2.0\ORADATA\ROCK\ABAMCO_TEST01.DBF'
    ORA-01157: cannot identify/lock data file 6 - see DBWR trace file
    ORA-01110: data file 6: 'D:\ORACLE\PRODUCT\10.2.0\ORADATA\ROCK\ABAMCO_TEST01.DBF'
    SQL> shutdown immediate
    ORA-01109: database not open
    Database dismounted.
    ORACLE instance shut down.
    SQL> startup
    ORACLE instance started.
    Total System Global Area 167772160 bytes
    Fixed Size 1247876 bytes
    Variable Size 83887484 bytes
    Database Buffers 75497472 bytes
    Redo Buffers 7139328 bytes
    Database mounted.
    ORA-01122: database file 1 failed verification check
    ORA-01110: data file 1: 'D:\ORACLE\PRODUCT\10.2.0\ORADATA\ROCK\SYSTEM01.DBF'
    ORA-01207: file is more recent than control file - old control file
    SQL> recover database;
    ORA-00283: recovery session canceled due to errors
    ORA-01122: database file 1 failed verification check
    ORA-01110: data file 1: 'D:\ORACLE\PRODUCT\10.2.0\ORADATA\ROCK\SYSTEM01.DBF'
    ORA-01207: file is more recent than control file - old 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 167772160 bytes
    Fixed Size 1247876 bytes
    Variable Size 83887484 bytes
    Database Buffers 75497472 bytes
    Redo Buffers 7139328 bytes
    SQL> alter database backup controlfile to trace;
    alter database backup controlfile to trace
    ERROR at line 1:
    ORA-01507: database not mounted
    SQL> alter database mount;
    Database altered.
    SQL> alter database backup controlfile to trace;
    Database altered.
    SQL> shutdown immediate;
    ORA-01109: database not open
    Database dismounted.
    ORACLE instance shut down.
    <><> copied the (contents) from generated file and saved in controlfile_recover.sql script.
    STARTUP NOMOUNT
    CREATE CONTROLFILE REUSE DATABASE "ROCK" NORESETLOGS ARCHIVELOG
    MAXLOGFILES 16
    MAXLOGMEMBERS 3
    MAXDATAFILES 100
    MAXINSTANCES 8
    MAXLOGHISTORY 292
    LOGFILE
    GROUP 1 'D:\ORACLE\PRODUCT\10.2.0\ORADATA\ROCK\REDO01.LOG' SIZE 50M,
    GROUP 2 'D:\ORACLE\PRODUCT\10.2.0\ORADATA\ROCK\REDO02.LOG' SIZE 50M,
    GROUP 3 'D:\ORACLE\PRODUCT\10.2.0\ORADATA\ROCK\REDO03.LOG' SIZE 50M
    -- STANDBY LOGFILE
    DATAFILE
    'D:\ORACLE\PRODUCT\10.2.0\ORADATA\ROCK\SYSTEM01.DBF',
    'D:\ORACLE\PRODUCT\10.2.0\ORADATA\ROCK\UNDOTBS01.DBF',
    'D:\ORACLE\PRODUCT\10.2.0\ORADATA\ROCK\SYSAUX01.DBF',
    'D:\ORACLE\PRODUCT\10.2.0\ORADATA\ROCK\USERS01.DBF',
    'D:\ORACLE\PRODUCT\10.2.0\ORADATA\ROCK\SYSTEM03.DBF',
    'D:\ORACLE\PRODUCT\10.2.0\ORADATA\ROCK\ABAMCO_TEST01.DBF'
    CHARACTER SET WE8MSWIN1252
    SQL> @D:\controlfile_recover.sql
    ORACLE instance started.
    Total System Global Area 167772160 bytes
    Fixed Size 1247876 bytes
    Variable Size 83887484 bytes
    Database Buffers 75497472 bytes
    Redo Buffers 7139328 bytes
    CREATE CONTROLFILE REUSE DATABASE "ROCK" RESETLOGS ARCHIVELOG
    ERROR at line 1:
    ORA-01503: CREATE CONTROLFILE failed
    ORA-01565: error in identifying file 'D:\ORACLE\PRODUCT\10.2.0\ORADATA\ROCK\ABAMCO_TEST01.DBF'
    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-01507: database not mounted
    ALTER DATABASE OPEN RESETLOGS
    ERROR at line 1:
    ORA-01507: database not mounted
    ALTER TABLESPACE TEMP ADD TEMPFILE 'D:\ORACLE\PRODUCT\10.2.0\ORADATA\ROCK\TEMP01.DBF' REUSE
    ERROR at line 1:
    ORA-01109: database not open
    SQL> alter tablespace ABAMCO_TEST offline;
    alter tablespace ABAMCO_TEST offline
    ERROR at line 1:
    ORA-01109: database not open
    SQL>
    SQL>
    SQL> shutdown immediate;
    ORA-01507: database not mounted
    ORACLE instance shut down.
    <><> I removed one line 'D:\ORACLE\PRODUCT\10.2.0\ORADATA\ROCK\ABAMCO_TEST01.DBF' from controlfile_recover.sql
    SQL> @D:\controlfile_recover.sql
    ORACLE instance started.
    Total System Global Area 167772160 bytes
    Fixed Size 1247876 bytes
    Variable Size 83887484 bytes
    Database Buffers 75497472 bytes
    Redo Buffers 7139328 bytes
    CREATE CONTROLFILE REUSE DATABASE "ROCK" RESETLOGS ARCHIVELOG
    ERROR at line 1:
    ORA-01503: CREATE CONTROLFILE failed
    ORA-01163: SIZE clause indicates 12800 (blocks), but should match header 1536
    ORA-01110: data file 5: 'D:\ORACLE\PRODUCT\10.2.0\ORADATA\ROCK\SYSTEM03.DBF'
    ORA-01507: database not mounted
    ALTER DATABASE OPEN RESETLOGS
    ERROR at line 1:
    ORA-01507: database not mounted
    ALTER TABLESPACE TEMP ADD TEMPFILE 'D:\ORACLE\PRODUCT\10.2.0\ORADATA\ROCK\TEMP01.DBF' REUSE
    ERROR at line 1:
    ORA-01109: database not open
    SQL> SHUTDOWN IMMEDIATE;
    ORA-01507: database not mounted
    ORACLE instance shut down.
    SQL> @D:\controlfile_recover.sql
    ORACLE instance started.
    Total System Global Area 167772160 bytes
    Fixed Size 1247876 bytes
    Variable Size 83887484 bytes
    Database Buffers 75497472 bytes
    Redo Buffers 7139328 bytes
    CREATE CONTROLFILE REUSE DATABASE "ROCK" RESETLOGS ARCHIVELOG
    ERROR at line 1:
    ORA-01503: CREATE CONTROLFILE failed
    ORA-01163: SIZE clause indicates 16384 (blocks), but should match header 1536
    ORA-01110: data file 5: 'D:\ORACLE\PRODUCT\10.2.0\ORADATA\ROCK\SYSTEM03.DBF'
    ORA-01507: database not mounted
    ALTER DATABASE OPEN RESETLOGS
    ERROR at line 1:
    ORA-01507: database not mounted
    ALTER TABLESPACE TEMP ADD TEMPFILE 'D:\ORACLE\PRODUCT\10.2.0\ORADATA\ROCK\TEMP01.DBF' REUSE
    ERROR at line 1:
    ORA-01109: database not open
    SQL> shutdown immediate;
    ORA-01507: database not mounted
    ORACLE instance shut down.
    SQL> @D:\controlfile_recover.sql
    ORACLE instance started.
    Total System Global Area 167772160 bytes
    Fixed Size 1247876 bytes
    Variable Size 83887484 bytes
    Database Buffers 75497472 bytes
    Redo Buffers 7139328 bytes
    CREATE CONTROLFILE REUSE DATABASE "ROCK" RESETLOGS ARCHIVELOG
    ERROR at line 1:
    ORA-01503: CREATE CONTROLFILE failed
    ORA-01163: SIZE clause indicates 32768 (blocks), but should match header 1536
    ORA-01110: data file 5: 'D:\ORACLE\PRODUCT\10.2.0\ORADATA\ROCK\SYSTEM03.DBF'
    ORA-01507: database not mounted
    ALTER DATABASE OPEN RESETLOGS
    ERROR at line 1:
    ORA-01507: database not mounted
    ALTER TABLESPACE TEMP ADD TEMPFILE 'D:\ORACLE\PRODUCT\10.2.0\ORADATA\ROCK\TEMP01.DBF' REUSE
    ERROR at line 1:
    ORA-01109: database not open
    SQL> shutdown immediate;
    ORA-01507: database not mounted
    ORACLE instance shut down.
    SQL> @D:\controlfile_recover.sql
    ORACLE instance started.
    Total System Global Area 167772160 bytes
    Fixed Size 1247876 bytes
    Variable Size 83887484 bytes
    Database Buffers 75497472 bytes
    Redo Buffers 7139328 bytes
    CREATE CONTROLFILE REUSE DATABASE "ROCK" RESETLOGS ARCHIVELOG
    ERROR at line 1:
    ORA-01503: CREATE CONTROLFILE failed
    ORA-01163: SIZE clause indicates 65536 (blocks), but should match header 1536
    ORA-01110: data file 5: 'D:\ORACLE\PRODUCT\10.2.0\ORADATA\ROCK\SYSTEM03.DBF'
    ORA-01507: database not mounted
    ALTER DATABASE OPEN RESETLOGS
    ERROR at line 1:
    ORA-01507: database not mounted
    ALTER TABLESPACE TEMP ADD TEMPFILE 'D:\ORACLE\PRODUCT\10.2.0\ORADATA\ROCK\TEMP01.DBF' REUSE
    ERROR at line 1:
    ORA-01109: database not open
    SQL>
    Any suggestions? what should I do now?

    Here's what I found on Metalink :
    Subject: ORA-1163 creating a controlfile
    Doc ID: Note:377933.1 Type: PROBLEM
    Last Revision Date: 24-JUL-2006 Status: REVIEWED
    Problem Description:
    ====================
    You are attempting to recreate your controlfile after a clean shutdown ( shutdown normal or immediate)
    Upon running the create controlfile script you receive:
    CREATE CONTROLFILE REUSE DATABASE "PRODAB" NORESETLOGS ARCHIVELOG
    ERROR at line 1:
    ORA-01503: CREATE CONTROLFILE failed
    ORA-01163: SIZE clause indicates 12800 (blocks), but should match header 240160
    ORA-01110: data file X: '<full path of datafile>'
    Problem Explanation:
    ====================
    Sample controlfile.sql
    CREATE CONTROLFILE REUSE DATABASE "PRODAB" NORESETLOGS ARCHIVELOG
    MAXLOGFILES 16
    MAXLOGMEMBERS 3
    MAXDATAFILES 100
    MAXINSTANCES 8
    MAXLOGHISTORY 454
    LOGFILE
    GROUP 1 '/oradata/PROD/redo01.log' SIZE 10M,
    GROUP 2 '/oradata/PROD/redo02.log' SIZE 10M,
    GROUP 3 '/oradata/PROD/redo03.log' SIZE 10M
    -- STANDBY LOGFILE
    DATAFILE
    '/oradata/PROD/system01.dbf',
    '/oradata/PROD/undotbs01.dbf',
    '/oradata/PROD/sysaux01.dbf',
    '/oradata/PROD/users01.dbf', <----------------Notice the extra comma after thelast datafile.
    CHARACTER SET WE8ISO8859P1
    Search Words:
    =============
    create controlfile ORA-1503 ORA-1163 ORA-1110
    Solution Description:
    =====================
    This extra comma is causing the create controlfile to raise this unexpected error as seen above.
    Solution Explanation:
    =====================
    This is a syntax error and by removing the trailing comma the create control should bypass this error.
    Wow ! Oracle made a syntax error ! why am i not surprised ? :)
    Thanks Khurram for your help !

  • How to use new sequence when one is reached its maxvalue in PL SQL code

    Hi,
    Currently, I am populating a unique product serial number in a table column using a sequence call to generate new number. For different products, I have different sequences and in my PL SQL code usiing IF..Else block I populate serial number for different products. For one most selling product sequence, we are reaching a Max value in production in a month and to make sure that application will continue to work fine for various end users without getting any error on their screens, I want my code to switch to new sequence automatically. I just need to add another if condition but my problem is how to find accurately when max value is reached for old sequence.
    As call to old sequence can happen in different sessions there could be inconsistency and can end up at error. My new sequence value has to start with AV1000. Please suggest.
    My old sequence look like this :
    SEQUENCE Prd
    INCREMENT BY 1
    START WITH AS1000
    MAXVALUE AS9999
    MINVALUE AS1000
    CYCLE NOCYCLE
    CACHE 2
    Order Yes;
    Edited by: user11695088 on Jul 15, 2009 12:14 AM

    Catch the exception and use your new sequence. But somehow, I'm not liking your alternative approach.
    SQL> set line 300
    SQL> set pages 50000
    SQL> set serveroutput on
    SQL> create sequence testing_seq increment by 1 start with 1 maxvalue 3
      2  /
    Sequence created.
    SQL>
    SQL> create or replace procedure test_seq_proc(p_seq out number)
      2  is
      3  begin
      4     select testing_seq.nextval
      5     into p_seq
      6     from dual;
      7  --
      8     dbms_output.put_line(p_seq);
      9  --
    10  end;
    11  /
    Procedure created.
    SQL> declare v_out number;
      2  begin
      3     test_seq_proc(v_out);
      4  end;
      5  /
    1
    PL/SQL procedure successfully completed.
    SQL> /
    2
    PL/SQL procedure successfully completed.
    SQL> /
    3
    PL/SQL procedure successfully completed.
    SQL> /
    declare v_out number;
    ERROR at line 1:
    ORA-08004: sequence TESTING_SEQ.NEXTVAL exceeds MAXVALUE and cannot be instantiated
    ORA-06512: at "ETL_ADMIN.TEST_SEQ_PROC", line 4
    ORA-06512: at line 3
    SQL>Cheers
    Sarma.

  • JAEHYLEE  (R12 IBY)  Format Batch Error

    Symptoms-
    On 12.0.2 in Production:
    payment batch the Format Payment Instruction Program 수행시 다음과 같은 에러 발생
    ERROR
    IBY_FD_PAYMENT_FORMAT module: Format Payment Instructions
    SQLException occurred: ORA-01422: exact fetch returns more than requested number of rows
    ORA-06512: at "APPS.IBY_FD_EXTRACT_GEN_PVT", line 375
    ORA-06512: at "APPS.IBY_FD_EXTRACT_GEN_PVT", line 205
    ORA-06512: at "APPS.IBY_FD_EXTRACT_GEN_PVT", line 101
    ORA-06512: at "APPS.IBY_EXTRACTGEN_PVT", line 76
    ORA-06512: at line 1
    Cause
    Bug 6388935:Format payment instruction program error WITH ORA-01422"
    Solution
    To implement the solution, please execute the following steps:
    기존의 Payment Instruction은 cancel처리후 one-off Patch 6500756 를 적용하여야 합니다. R12.0.2에서만 적용가능
    Reference
    464778.1

    Hi,
    Please see if (Note: 564536.1 - Release 12 : ADSTRTAL.sh returns error : TIMED OUT( 100000 ): INTERRUPTED EXCEPTION) helps.
    Regards,
    Hussein

  • Page Parameters in PL/SQL Pages

    The OAS User's Guide says:
    "You can define page parameters for PL/SQL Pages. Values for these parameters are passed to bind variables in the PL/SQL code. For example, if the PL/SQL page 'myplsqlpage' contains the PL/SQL statement 'a:=:param1'; and a page parameter is specified named 'param1' with the value '123' (param1=123), this URL is used to access the PL/SQL page in Oracle AS Portal:
    http://myportal/myplsqlpage?param1=123
    In the PL/SQL code, the bind variable 'a' is assigned the value '123'."
    But I did that but I have the following message:
    ORA-01008: not all the variables have been binded (WWS-22518).
    Please I have an example.
    Thanks in advance.

    Hi Patrick,
    Your suggestion seems interesting and simplistic and I wonder if you could make it working. Because, I worked on a similar suggestion some months ago and it did not work. unless I am confusing your idea with something else, it is not designed to work - although it was claimed in the documentation to work. On talking to Oracle we were able to pin down that it was a documentation bug and a new note was created to state that.
    You may wanna see the following Metalink Note which says that passing parameters from a PLSQL page is not allowed.
    regards,
    AMN
    Subject:      Unable To Pass Parameters To A PL/SQL Page
    Doc ID:      Note:550373.1
    Cause
    Page parameters were not designed to work with PL/SQL pages. However the Oracle® Application Server Portal User's Guide states that this is possible.
    This is a documentation bug and it is related to the following unpublished bugs:
    BUG 5007570: GET PARAMETERS IN PL/SQL PAGE
    BUG 3473023: PASSING PARAMETERS TO PL/SQL PAGE IS ERRORING OUT - ORA-1008
    Solution
    -- To implement the solution, please execute the following steps::
    PL/SQL pages do not support to pass parameters. If you need to pass page parameters to a database provider components such as forms and reports, then you need to create a simple page and follow notes below:
    Note 265180.1
    Title: How to pass parameters to a form, which is placed as a
    portlet inside a page?
    Note 287545.1
    Title: How Pass Parameter Via URL to a Report Using Page Parameters

  • Standby destination control file enqueue unavailable

    Hi,
    more than two days ..totally i tried 3 times for creating standby database in oralce 10g ..everthing working fine but i didnt get archive log from primary database..please help me
    NOTE: both primary and standby database on same system
    *#standby database 'stby' (omitted common parameters)*
    *.compatible='10.2.0.3.0'
    *.control_files='d:\oracle\product\10.2.0\oradata\stby\controlsb01.ctl','d:\oracle\product\10.2.0\oradata\stby\controlsb02.ctl','d:\oracle\product\10.2.0\oradata\stby\controlsb03.ctl'
    *.db_file_name_convert='D:\oracle\product\10.2.0\oradata\live','D:\oracle\product\10.2.0\oradata\stby'
    *.db_name='live'
    *.fal_client='stby'
    *.fal_server='live'
    *.log_archive_config='DG_CONFIG=(live,stby)'
    *.log_archive_dest_1='LOCATION=D:\oracle\product\10.2.0\flash_recovery_area\stby VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=stby'
    *.log_archive_dest_2='SERVICE=live ARCH ASYNC VALID_FOR=(ONLINE_LOGFILE,PRIMARY_ROLE) DB_UNIQUE_NAME=live'
    *.log_file_name_convert='D:\oracle\product\10.2.0\oradata\live','D:\oracle\product\10.2.0\oradata\stby'
    *.remote_login_passwordfile=EXCLUSIVE
    *.standby_file_management='AUTO'
    *.instance_name=stby
    *.db_unique_name=stby
    *#primary database 'live'*
    *.compatible='10.2.0.3.0'
    *.control_files='d:\oracle\product\10.2.0\oradata\live\control01.ctl','d:\oracle\product\10.2.0\oradata\live\control02.ctl','d:\oracle\product\10.2.0\oradata\live\control03.ctl'
    *.db_file_name_convert='D:\oracle\product\10.2.0\oradata\stby','D:\oracle\product\10.2.0\oradata\live'
    *.db_name='live'
    *.fal_client='live'
    *.fal_server='stby'
    *.log_archive_config='DG_CONFIG=(live,stby)'
    *.log_archive_dest_1='LOCATION=D:\oracle\product\10.2.0\flash_recovery_area\live VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=live'
    *.log_archive_dest_2='SERVICE=stby ARCH ASYNC VALID_FOR=(ONLINE_LOGFILE,PRIMARY_ROLE) DB_UNIQUE_NAME=stby'
    *.log_file_name_convert='D:\oracle\product\10.2.0\oradata\stby','D:\oracle\product\10.2.0\oradata\live'
    *.remote_login_passwordfile=EXCLUSIVE
    *.standby_file_management='AUTO'
    *.instance_name=live
    *.DB_UNIQUE_NAME=live
    *#standby database*
    SQL> STARTUP MOUNT
    ORACLE instance started.
    Total System Global Area 251658240 bytes
    Fixed Size 1290012 bytes
    Variable Size 159383780 bytes
    Database Buffers 83886080 bytes
    Redo Buffers 7098368 bytes
    Database mounted.
    SQL> alter database recover managed standby database disconnect from session;
    Database altered.
    SQL> select group#,member from v$logfile;
    GROUP#
    MEMBER
    3
    D:\ORACLE\PRODUCT\10.2.0\ORADATA\STBY\REDO03.LOG
    2
    D:\ORACLE\PRODUCT\10.2.0\ORADATA\STBY\REDO02.LOG
    1
    D:\ORACLE\PRODUCT\10.2.0\ORADATA\STBY\REDO01.LOG
    GROUP#
    MEMBER
    4
    D:\ORACLE\PRODUCT\10.2.0\ORADATA\STBY\SREDO04.LOG
    5
    D:\ORACLE\PRODUCT\10.2.0\ORADATA\STBY\SREDO05.LOG
    6
    D:\ORACLE\PRODUCT\10.2.0\ORADATA\STBY\SREDO06.LOG
    6 rows selected.
    *#primary database*
    SQL> ALTER SYSTEM SWITCH LOGFILE;
    SQL> select SEQUENCE#, applied from v$archived_log;
    SEQUENCE# APP
    15 NO
    16 NO
    17 NO
    18 NO
    19 NO
    20 NO
    SQL> SELECT SEQUENCE#,STATUS FROM V$MANAGED_STANDBY;
    SEQUENCE# STATUS
    0 CONNECTED
    19 CLOSING
    20 CLOSING
    0 CONNECTED
    0 CONNECTED
    0 CONNECTED
    0 CONNECTED
    0 CONNECTED
    *#standby database*
    SQL> select * from v$archived_log;
    no rows selected
    *#see even my standby database open .*
    SQL> alter database open;
    Database altered.
    *# listener.ora*
    STBY =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = selvaPC)(PORT = 2031))
    LIVE =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = selvaPC)(PORT = 2030))
    SID_LIST_STBY =
    (SID_LIST =
    (SID_DESC =
    (GLOBAL_DBNAME = live)
    (SID_NAME = stby)
    SID_LIST_LIVE =
    (SID_LIST =
    (SID_DESC =
    (GLOBAL_DBNAME = live)
    (SID_NAME = live)
    *# tnsnames.ora*
    STBY =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = selvaPC)(PORT = 2030))
    (CONNECT_DATA =
    (SERVER = DEDICATED)
    (SERVICE_NAME = live)
    LIVE =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = selvaPC)(PORT = 2031))
    (CONNECT_DATA =
    (SERVER = DEDICATED)
    (SERVICE_NAME = stby)
    *#Error in alert file..during startup primary database*
    Controlfile lock conflict at host 'stby'
    Possible invalid cross-instance archival configuration
    ORA-16146: standby destination control file enqueue unavailable
    thanks
    selva..

    If you user this then a lot of information ( threads) can be found with the same problem.
    Anyway the original ORA-message/solution is:
    Error:     ORA-16146 (ORA-16146)
    Text:     standby destination control file enqueue unavailable
    Cause:     The target standby destination control file is currently
         unavailable to the Remote File Server (RFS) process. This
         indicates that the target destination is the primary database
         itself.
    Action:     Check for and eliminate the standby destination archive log
         parameter in question.
    This means you have an error in the log_archive_dest entries on the standby server.
    Can you use Dataguard Manager (dgmgrl) to verify the configuration?
    Edit:
    Our Dataguard config e.g. has on primary:
    log_archive_config='dg_config=(STDBY)'
    On the standby it is:
    log_archive_config='dg_config=(PRIMARY)'

  • Use of Oracle Triggers as Deltamechanism for Custom Tables

    Hi Colleagues,
    we have a 50 million records Y-Table in SAP ECC 6.0 with Oracle 10.2.0.2.0.
    The Y-Table have no update, timestamp or numeric pointer fields for using the SAP generic delta feature.
    So we will use the Oracle trigger feature: CREATE TRIGGER <trigger_name> FOR <table_name> to get the Y-table keys of inserted, updated or deleted records.
    Are there any side effects or warnings for this?
    Thanks and regards,
    Wolfgang

    Hi,
    my Ora-Trigger-Solution works well on R/3 development system.
    On quality assurance system it dumps with ORA-04098.
    It looks like, that required object privileges have been never granted.
    Do someone know, what priviliges or authorisations have to be maintained and where to maintain this?
    Thanks and regards,
    Wolfgang

  • Short dump in BW side

    Hi All,
    When  I a am Extracting data from R/3 to BW. short damp happend in BW side as Runtime Error          DBIF_RSQL_SQL_ERROR
    Except.                   CX_SY_OPEN_SQL_DB 
    please any one help me  and  let me know the reasons why it happens short dump in BW side.
    Adavance Thanks,
    Achari

    Problem:
    DBIF_RSQL_SQL_ERROR error
    ORA-00060
    Solution:
    ORA-00060 deadlock detected while waiting for resource
    Cause: Your session and another session are waiting for a resource locked by the other.
    This condition is known as a deadlock.
    To resolve the deadlock, one or more statements were rolled back for the other session to continue work.
    Action: Either:
    Enter a ROLLBACK statement and re-execute all statements since the last
    commit or
    Wait until the lock is released, possibly a few minutes, and then re-execute
    the rolled back statements.
    <u>As per my knowledge,</u>
    In this case the error has occured @ inserting the record to the facttable and
    a lock situation has occured. So as said in the solution.....
    <b>To resolve the deadlock, one or more statements were rolled back for the other session to continue work.</b>
    need to restart (rollback) the failed step again.
    *Check the SQL statement and identify where the lock situation is.
    in ST22, check the source code extract where the code will be displayed, and the error will be shown near the arrow (----
    >) mark
    *Wait untill lock gets released.
    *Repeat the failed process step.
    ****The solution I got form the Oracle 8i error messages.****
    Regards,
    Vijay

  • Configure data guard broker on Oracle 11.2.0.1

    Our primary is a 3 node RAC of 11.2.0.1 on Redhat 5.2. The physical standby is a single instance on redhat 5.2. After configured data guard, I am trying to configure data guard broker following docOracle® Data Guard Broker 11g Release 2 (11.2)
    E10702-01
    It says to add a entry to the listener.ora file
    LISTENER = (DESCRIPTION =
    (ADDRESS_LIST=(ADDRESS=(PROTOCOL=tcp)(HOST=host_name)
    (PORT=port_num))))
    SID_LIST_LISTENER=(SID_LIST=(SID_DESC=(SID_NAME=sid_name)
    (GLOBAL_DBNAME=db_unique_name_DGMGRL.db_domain)
    (ORACLE_HOME=oracle_home)))My lstener.ora under grid_home is LISTENER=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER))))            # line added by Agent
    LISTENER_SCAN1=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN1))))                # line added by Agent
    ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER=ON              # line added by AgentAfter addedLISTENER =
      (DESCRIPTION_LIST =
        (DESCRIPTION =
          (ADDRESS_LIST =
            (ADDRESS = (PROTOCOL = TCP)(HOST = cchORdb1)(PORT = 1521))
            (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))
    SID_LIST_LISTENER =
      (SID_LIST =
        (SID_DESC =
          (GLOBAL_DBNAME = cchprd_DGMGRL)
          (SID_NAME = cchprd)
          (ORACLE_HOME = /u01/app/oracle/product/11.2.0/dbhome_1)
      )I started the listener and got errorLSNRCTL> start
    Starting /u01/app/grid/bin/tnslsnr: please wait...
    TNSLSNR for Linux: Version 11.2.0.1.0 - Production
    System parameter file is /u01/app/grid/network/admin/listener.ora
    Log messages written to /u01/app/oracle/diag/tnslsnr/cchORdb1/listener/alert/log.xml
    Error listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=cchORdb1)(PORT=1521)))
    TNS-12542: TNS:address already in use
    TNS-12560: TNS:protocol adapter error
      TNS-00512: Address already in use
       Linux Error: 98: Address already in use
    Listener failed to start. See the error message(s) above..Without the Listener and SID_LIST_LISTENER entries, the grid infrastucture appear to manage a default listener and works OK. After add these, it appears to conflick with the default setting. I also tried to add a different listener name, then I got messge LISTENER is already startedHow should one handle this problem?
    Thanks.

    Shutdown the listener and check for white spaces in the file. Try to restart it. If if fails review against my example below.
    Here is my working example:
    PRIMARY
    LISTENER =
    (DESCRIPTION_LIST =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = primary.myserver.com)(PORT = 1521))
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))
    SID_LIST_LISTENER =
    (SID_LIST =
    (SID_DESC =
    (SID_NAME = PLSExtProc)
    (ORACLE_HOME = /u01/app/oracle/product/11.2.0)
    (PROGRAM = extproc)
    (SID_DESC =
    (global_dbname = PRIMARY_DGMGRL.myserver.com)
    (ORACLE_HOME = /u01/app/oracle/product/11.2.0)
    (SID_NAME = PRIMARY)
    STANDBY
    LISTENER =
    (DESCRIPTION_LIST =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = standby.mydomain.com)(PORT = 1521))
    SID_LIST_LISTENER =
    (SID_LIST =
    (SID_DESC =
    (SID_NAME = PLSExtProc)
    (ORACLE_HOME = /u01/app/oracle/product/11.2.0)
    (PROGRAM = extproc)
    (SID_DESC =
    (global_dbname = STANDBY_DGMGRL.mydomain.com)
    (ORACLE_HOME = /u01/app/oracle/product/11.2.0)
    (sid_name = STANDBY)
    ADR_BASE_LISTENER = /u01/app/oracle
    INBOUND_CONNECT_TIMEOUT_LISTENER=120
    When I first tried to setup this up several months ago I had this issue:
    ORA-12514 during SWITCHOVER
    Problem: You perform a switchover using DGMGRL. Though the switchover itself completes successful, databases don't get started up again. Instead, DGMGRL output holds an
    ORA-12514: TNS:listener does not currently know of service requested in connect
    Cause: This is a configuration issue: DGMGRL needs a special entry in the listener.ora.
    Solution: Details on this can be found in the Metalink note 308943.1. Make sure both, your primary and standby database have an explicit entry in the listener.ora like this:
    SID_LIST_LISTENER = (
    SID_LIST = (
    SID_DESC = ( GLOBAL_DBNAME = <db_unique_name>DGMGRL.<dbdomain> )
    ( SERVICE_NAME = <db_unique_name>.<db_domain> )
    ( SID_NAME = <ORACLE_SID> )
    ( ORACLE_HOME = <ORACLE_HOME> )
    Take special care, that:
    * <db_unique_name> reflects the databases unique name (SHOW PARAMETER db_unique_name)
    * <db_domain> reflects the databases domain (SHOW PARAMETER db_domain)
    * <ORACLE_SID> and <ORACLE_HOME> reflect the corresponding settings of the database
    Having adjusted your listener.ora files, restart the listener (lsnrctl stop && lsnrctl start). Give your databases a few minutes to register with the listener again, and then - just to be on the safe side - let the listener tell you its configuration: lsnrctl status && lsnrctl services. Check the output if everything matches.
    Edited by: mseberg on Dec 10, 2010 8:01 AM

Maybe you are looking for

  • I  Need some standard report

    I need some standard reports regarding Purchage Data Analysis Report and Open Sales order report . Thanks & Regards Satish Patnaik

  • Can not get my wireless to work for windows

    Just bought a new macbook pro 15 and used bootcamp to install windows 7 pro. Now I can not get any internet, wired or wireless. Is there any drives I can install to solve this problem?

  • XI Services

    Hi What is XI Services? Please give me idea. Thanks

  • Type Layer Error in CS5.5

    I've been getting error messages with type layers: "The type layers in this document were rasterized because something prevented the text engine from being initialized." "Could not complete your request because of a program error." Restarting and rei

  • Activate a replacement Gusto 2

    I have a Samsung Gusto 2 that I just had sent to me to replace my broken one. It tells me to push send, when powered up, but a message comes on and tells me that I am Celluer, and must buy a calling card. Have tried for ALMOST 2 hours to get to tech