ORA-01502 : index SYS.I_PROCEDURE1 is in unusable state

Oracle EE 9.2.0.8 on Windows 2003 SP2
Some SYS tables where moved by mistake with statement : "alter table sys.xxx move tablespace system;"
This caused some unusable SYS indexes but I cannot rebuild them. Each time I get same error :
ORA-01502: index 'SYS.I_PROCEDURE1' or partition of such index is in unusable state
Tracing showed me that some recursive SQL is going on and that fails because of the unusable index I_PROCEDURE1
This is the recursive sql who fails :
SQL> select audit$,options from procedure$ where obj#=115;
ERROR at line 1:
ORA-01502: index 'SYS.I_PROCEDURE1' or partition of such index is in unusable state
How do get out of this situation ?
Have already tried without succes :
- alter session set skip_unusable_indexes=true;
- altered some parameters to favor full table scans (optimizer_mode, db_file_multi_block_read_count
- tried to drop index (same error)
Thanks.
Benny Derous

Are you saying that you cannot rebuild that particular index, or other indexes? It works for me:orcl> alter index sys.i_procedure1 rebuild;
Index altered.
orcl> select * from v$version;
BANNER
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - Production
PL/SQL Release 11.2.0.3.0 - Production
CORE    11.2.0.3.0      Production
TNS for 32-bit Windows: Version 11.2.0.3.0 - Production
NLSRTL Version 11.2.0.3.0 - Production
orcl>

Similar Messages

  • ORA-01502: Index or Partition is in unusable status. while truncating table

    Hi All,
    One of our Devlopers compalined that he is getting ORA-01502 : Index or partition is unusable status while truncating the a table in our Dataware house production database. He is using the following commands.
    Alter index <index_name> unusable;
    Truncate table <table_name> ;
    He is running a scripts to truncate each table and ecah time he is passing the table name as an input parameter to script. He is using same method to truncate four tables each having a BITMAP and a REGULAR index. For two tables every thing is working fine, but for other two tables the he is getting ORA-01502 for BITMAP indexes. It a weekly process and every week he is getting the same issue. I checkd the Index status, they are in valid status only.
    For a work around I have created a table with BITMAP and regular index in our dev database. made the indexes unusable, checked their status. I truncated the table. Importent thing here is the Indexes are becoming vaild when I truncate the table.
    I suspect that my devloper's Indexes were already in unusable status (before he use the command ALTER INDEX), when he truncated the table, oracle trying to validate the index and throwing the error ORA-01502 because the Indexes are in unusabel statsu for a while.
    I tried searching for the mechanism of truncate table command and its effect on Indexes. But I did not find any luck, no one is speaking about index when truncating the table. Can any one please help me????
    Sorry for lengthy post. Any help is greatly appriciated and I thank every one in advance.

    DDL for Indexes getting ORA-01502 error
    CREATE BITMAP INDEX DWHMGR.ACT_TXN_LN_STG_01_XN3 ON DWHMGR.ACCT_TXN_LINE_TERM_BAL_STG_01 (TERM_BAL_CD ASC) TABLESPACE "BALFD_INX_04" NOLOGGING PCTFREE 1 INITRANS 2 MAXTRANS 255 STORAGE
    ( INITIAL 8M NEXT 8M MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 BUFFER_POOL DEFAULT );
    CREATE BITMAP INDEX DWHMGR.ACCT_TERM_BAL_STG_01_XN3 ON DWHMGR.ACCT_TERM_BAL_STG_01 TERM_BAL_CD ASC) TABLESPACE "BALFD_INX_04" NOLOGGING PCTFREE 1 INITRANS 2 MAXTRANS 255 STORAGE
    ( INITIAL 8M NEXT 8M MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 BUFFER_POOL DEFAULT );
    Indexes that have no issues.
    CREATE INDEX DWHMGR.ACCT_TERM_BAL_STG_01_XN2 ON DWHMGR.ACCT_TERM_BAL_STG_01 (ACCT_REF_NB ASC) TABLESPACE "BALFD_INX_04" NOLOGGING PCTFREE 1 INITRANS 2 MAXTRANS 255 STORAGE (INITIAL 8M
    NEXT 8M MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 BUFFER_POOL DEFAULT );
    CREATE BITMAP INDEX DWHMGR.ACCT_PRC_STG_01_XN1 ON DWHMGR.ACCT_PRC_STG_01 (ACCT_ORG_CD ASC) TABLESPACE "BALFD_INX_04" NOLOGGING PCTFREE 1 INITRANS 2 MAXTRANS 255 STORAGE ( INITIAL 8M
    NEXT 8M MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 BUFFER_POOL DEFAULT );
    Please look at the DDL of the indexes and let me know if you need any other information.

  • How to fix ORA-01502: index or partition of such index is in usable state?

    Greetings,
    I received the ORA-01502: index or partition of such index is in un-usable state from one of our Oracle forms, and the problem was caused by using SQL Loader w/ the "DIRECT" load option. As a result of that, the system won't allow any updates including insert/delete to the problematic table w/ the index in un-usable state. I am trying to fix the problem but so far no luck:
    When I tried to delete the duplicate rows from the table, I received the ORA-01502: index or partition of such index is in un-usable state error message;
    When I tried to rebuild the index by using the following command:
    ALTER INDEX index_name REBUILD
    I received the "ORA-01452: cannot CREATE UNIQUE INDEX; duplicate keys found
    Any help, suggestions or advice on this would be greatly appreciated.
    Thanks millions in advance!

    The duplicate key rows were inserted to the database by using the DIRECT parameter of the sql loader to specify direct path loading which bypasses integrity constraints. Since the issue exists in our production database and I am primarily an A/P w/ some responsibilities of DBA , I could really use your help to fix our production problem. I would really appreciate if you or any other guru could review my plan and code below for the fixes followed w/ some questions and give me your feedback/comments/suggestions as soon as possible:
    1 - Drop the offending index by using the following command:
    DROP INDEX <offending index name>
    2 - Run the following script to detect duplicate rows:
    SELECT *
    FROM <Table_Name> A
    WHERE
    A.rowid >
    any(SELECT B.rowid FROM <Table_Name> B
    WHERE
    B.KEY1 = A.KEY1
    and
    B.KEY2 = A.KEY2
    and
    B.KEY3 = A.KEY3
    and
    B.KEY4 = A.KEY4
    3.  Run the following script to remove the duplicates:
    DELETE
    FROM <Table_Name> A
    WHERE
    A.rowid >
    any(SELECT B.rowid FROM <Table_Name> B
    WHERE
    B.KEY1 = A.KEY1
    and
    B.KEY2 = A.KEY2
    and
    B.KEY3 = A.KEY3
    and
    B.KEY4 = A.KEY4
    4 - Rebuild the index by using the following line command:
    ALTER INDEX index_name REBUILDBut wait, how about data? Don't I need to back up and reload the data? Do I need to drop and recreate the table? Anything else I should be taking into considerations?
    p.s. Although, we only have a total of 35,736 rows of data from this table, but I want to make sure I do it right the first time.
    Thanks a lot and any/all the help!

  • ORA-01502 error in case of unusable unique index and bulk dml

    Hi, all.
    The db is 11.2.0.3 on a linux machine.
    I made a unique index unusable, and issued a dml on the table.
    Howerver, oracle gave me ORA-01502 error.
    In order to avoid ORA-01502 error, do I have to drop the unique index ,and do bulk dml, and recreate the index?
    Or Is there any other solution without re-creating the unique index?
    create table hoho.abcde as
    select level col1 from dual connect by level <=1000
    10:09:55 HOHO@PD1MGD>create unique index hoho.abcde_dx1 on hoho.abcde (col1);
    Index created.
    10:10:23 HOHO@PD1MGD>alter index hoho.abcde_dx1 unusable;
    Index altered.
    Elapsed: 00:00:00.03
    10:11:27 HOHO@PD1MGD>delete from hoho.abcde where rownum < 11;
    delete from hoho.abcde where rownum < 11
    ERROR at line 1:
    ORA-01502: index 'HOHO.ABCDE_DX1' or partition of such index is in unusable stateThanks in advance.
    Best Regards.

    Hi. all.
    The following is from "http://docs.oracle.com/cd/E14072_01/server.112/e10595/indexes002.htm#CIHJIDJG".
    Is there anyone who can show me a tip to avoid the following without dropping and re-creating an unique index?
    •DML statements terminate with an error if there are any unusable indexes that are used to enforce the UNIQUE constraint.
    Unusable indexes
    An unusable index is ignored by the optimizer and is not maintained by DML. One reason to make an index unusable is if you want to improve the performance of bulk loads. (Bulk loads go more quickly if the database does not need to maintain indexes when inserting rows.) Instead of dropping the index and later recreating it, which requires you to recall the exact parameters of the CREATE INDEX statement, you can make the index unusable, and then just rebuild it. You can create an index in the unusable state, or you can mark an existing index or index partition unusable. The database may mark an index unusable under certain circumstances, such as when there is a failure while building the index. When one partition of a partitioned index is marked unusable, the other partitions of the index remain valid.
    An unusable index or index partition must be rebuilt, or dropped and re-created, before it can be used. Truncating a table makes an unusable index valid.
    Beginning with Oracle Database 11g Release 2, when you make an existing index unusable, its index segment is dropped.
    The functionality of unusable indexes depends on the setting of the SKIP_UNUSABLE_INDEXES initialization parameter.
    When SKIP_UNUSABLE_INDEXES is TRUE (the default), then:
    •DML statements against the table proceed, but unusable indexes are not maintained.
    •DML statements terminate with an error if there are any unusable indexes that are used to enforce the UNIQUE constraint.
    •For non-partitioned indexes, the optimizer does not consider any unusable indexes when creating an access plan for SELECT statements. The only exception is when an index is explicitly specified with the INDEX() hint.
    •For a partitioned index where one or more of the partitions are unusable, the optimizer does not consider the index if it cannot determine at query compilation time if any of the index partitions can be pruned. This is true for both partitioned and non-partitioned tables. The only exception is when an index is explicitly specified with the INDEX() hint.
    When SKIP_UNUSABLE_INDEXES is FALSE, then:
    •If any unusable indexes or index partitions are present, any DML statements that would cause those indexes or index partitions to be updated are terminated with an error.
    •For SELECT statements, if an unusable index or unusable index partition is present but the optimizer does not choose to use it for the access plan, the statement proceeds. However, if the optimizer does choose to use the unusable index or unusable index partition, the statement terminates with an error.Thanks in advance.
    Best Regards.

  • Partition of such index is in unusable state

    Hi,
    We have upgraded the system 3O.B to BI 7.0 after upgrade we are getting following dump in the system for cube while accessing
    Database error text........: "ORA-01502: index 'SAPPRW./BIC/FZUCCA_C1~100' or partition of such index is in unusable state"
    How to rebuild the signal index in BI ?

    Hi,
    I am getting a similar dump for some master data. Have you managed to solve the problem? I have process chain, and everything seems to work correctly, but the system administrator informs us that we are getting system dumps.
    Please inform how to solve the problem.
    Thank you for your help.
    Ravi
    e.g.
    ORA-01502: index 'SAPSR3./BIC/B0000521000KE' or partition of such index is in unusable state
    ORA-01502: index 'SAPSR3./BIC/B0000539000KE' or partition of such index is in unusable state
    ORA-01502: index 'SAPSR3./BIC/B0000546000KE' or partition of such index is in unusable state
    ORA-01502: index 'SAPSR3./BIC/B0000563000KE' or partition of such index is in unusable state
    ORA-01502: index 'SAPSR3./BIC/B0000569000KE' or partition of such index is in unusable state
    ORA-01502: index 'SAPSR3./BIC/B0000689000KE' or partition of such index is in unusable state
    ORA-01502: index 'SAPSR3./BIC/B0000691000KE' or partition of such index is in unusable state
    ORA-01502: index 'SAPSR3./BIC/B0000696000KE' or partition of such index is in unusable state
    ORA-01502: index 'SAPSR3./BIC/B0000697000KE' or partition of such index is in unusable state
    ORA-01502: index 'SAPSR3./BIC/B0000701000KE' or partition of such index is in unusable state
    ORA-01502: index 'SAPSR3./BIC/B0000703001KE' or partition of such index is in unusable state
    ORA-01502: index 'SAPSR3./BIC/B0000715000KE' or partition of such index is in unusable state
    ORA-01502: index 'SAPSR3./BIC/B0000828001KE' or partition of such index is in unusable state
    ORA-01502: index 'SAPSR3./BIC/B0000856000KE' or partition of such index is in unusable state
    ORA-01502: index 'SAPSR3./BIC/B0000872000KE' or partition of such index is in unusable state

  • ORA-01502

    I have truncated specifuic partitions of some of the tables of my databse.
    While I was viewing the alert logs,I could see a lot of DBA jobs failing with the error,
    ORA-12012: error on auto execute of job
    ORA-01502: index or partition of such index is in unusable state
    How is it possiblwe to identify all
    index or index partition that has been marked unusable by a direct load or by a DDL operation.
    What should be the workaround now and any potential issues that I should take care of.
    Thanks in advance.

    Kindly check the following links ->
    http://ora-12012.ora-code.com/
    http://www.dbasupport.com/forums/archive/index.php/t-53627.html
    Finally,
    http://www.google.co.in/search?source=ig&hl=en&rlz=1G1GGLQ_ENIN290&=&q=ORA-12012&btnG=Google+Search&meta=lr%3D
    Regards.
    Satyaki De.

  • Using UNUSABLE on Unique Index gives "initially in unusable state" error

    I am doing the following:
    1. Truncate table
    2 Alter PK Index Disable
    2. Alter Unique Index Unusable
    3. Insert /*+ APPEND NOLOGGING*/ into my table
    My problem is, I get an "ORA-26026: unique index ... initially in unusable state" error when I try to do the Insert. If I make the Unique index non-unique it isn't a problem. If I drop the index and recreate it its not a problem - so uniqueness doesn't appear to be the issue. Can you not use UNUSABLE with a Unique index, I couldn't find any reference to this in the 10g docs.
    I am using 10.1.0.4.
    Thanks
    Richard

    26026, 0000, "unique index %s.%s initially in unusable state"
    //* Cause: A unique index is in IU state (a unique index cannot have
    //* index maintenance skipped via SKIP_UNUSABLE_INDEXES).
    //* Action: Either rebuild the index or index partition, or use
    //* SKIP_INDEX_MAINTENANCE if the client is SQL*Loader.

  • Party Merge ORA-29861: domain index is marked LOADING/FAILED/UNUSABLE

    Hi gurus,
    i am using 11.5.10.2 on linux.
    while running the party merge concurrent program , we are getting below error, please help.
    Errors in Merge :
    Application: Receivables_
    Error: Merge failed in Receivables (HZ_STAGED_PARTY_SITES ) with the following error message:
    This unexpected SQL error occurred during the merge process :
    ORA-29861: domain index is marked LOADING/FAILED/UNUSABLE
    The following record was being handled when the error occurred :
    Thanks
    RB

    Thanks Hussain, this is similer to the error i got, i will run the steps and get back to you, once again thanks for your prompt responce.
    Thx
    RB
    Edited by: R12DBA on Jul 23, 2010 4:36 PM
    Edited by: R12DBA on Jul 23, 2010 4:50 PM

  • Error in Update optimizer statistics - index is in unusable state

    Hello,
    we have this error in log Check and update optimizer statistics:
    12.02.2009     23:21:20     'BEGIN DBMS_STATS.GATHER_TABLE_STATS (OWNNAME => '"SAPPB1"', TABNAME => '"/BIC/FZPPC0002"', ESTIMATE_PERCENT => 10, METHOD_OPT =
    12.02.2009     23:21:20     ORA-20000: index "SAPPB1"."/BIC/FZPPC0002~010"  or partition of such index is in unusable state
    12.02.2009     23:21:20     ORA-06512: at "SYS.DBMS_STATS", line 13452
    12.02.2009     23:21:20     ORA-06512: at "SYS.DBMS_STATS", line 13472
    12.02.2009     23:21:20     ORA-06512: at line 1
    12.02.2009     23:21:20     BR0886E Checking/collecting statistics failed for table SAPPB1./BIC/FZPPC0002
    i can temporary fix this problem when i delete and recreate index via SE14,  but this help only for one next running update statistics, every next running update statistics has same error:  index "SAPPB1"."/BIC/FZPPC0002~010"  or partition of such index is in unusable state. Exist any definitive solution for this problem. Thanks

    Hi,
    Two methods for checking/repairing Indexing issues
    1)RSRV for a particular cube
    2)SAP_INFOCUBE_INDEXES_REPAIR report
    You can also use this sql to rebuild an Index.
    alter index <index name> rebuild online; Or you can rebuild Index by using ABAP report 'RSANAORA'.
    Please check below thread it may help you.
    /message/6483705#6483705 [original link is broken]
    https://forums.sdn.sap.com/click.jspa?searchID=12942068&messageID=2052264
    Thanks,
    Sushil

  • Receive ORA-06512 in SYS.OWM_DDL_PKG on DBMS_WM.BeginDDL call

    I'm attempting to DBMS_WM.BeginDDL on a versioned table, and I receive the following:
    ERROR at line 1:
    ORA-06512: at "SYS.OWM_DDL_PKG", line 2569
    ORA-06512: at "SYS.LT", line 11143
    ORA-06512: at line 1
    Any ideas on where this is coming from?
    Thanks.

    Hi,
    This could be a couple of things.
    If the table has a domain index, make sure that the user has the 'create table' and 'create sequence' privileges.
    If that is not the case, this is most likely one of a couple of issues with beginDDL that has already been identified and fixed in the workspace manager 9.2.0.3.0 release. This kit is available on Metalink.
    Ben

  • Upgrade oracle 9.2.0.8.0 to 10.2.03 ORA-06512: at "SYS.VERSION_SCRIPT", lin

    Upgrade oracle 9.2.0.8.0 to 10.2.03. while runing catupgrd.sql script. i am geting error.
    SELECT version_script AS file_name FROM DUAL
    ERROR at line 1:
    ORA-20000: Upgrade not supported from version
    ORA-06512: at "SYS.VERSION_SCRIPT", line 52
    Please help me.
    AT

    Strange. Metalink doc 316889.1 says you should be able to upgrade following versions directly to 10.2.0.3.0
    8.1.7.4 -> 10.2.X.X.X
    9.0.1.4 or 9.0.1.5 -> 10.2.X.X.X
    9.2.0.4 or higher -> 10.2.X.X.X
    10.1.0.2 or higher -> 10.2.X.X.X
    Not too sure but may be you need to contact Oracle support.

  • Getting ORA-06512: at "SYS.UTL_HTTP", line 1022 ORA-29270: too many open

    hi
    I am getting the following error while calling the procedure in the batch process
    ORA-06512: at "SYS.UTL_HTTP", line 1022
    ORA-29270: too many open HTTP requests
    Could you please help me on this? As this is getting affected in the live databases.
    ORA-06512: at "SYS.UTL_HTTP", line 1022
    ORA-29270: too many open HTTP requests
    CREATE OR REPLACE PROCEDURE Send_To_Spg(
    PTRANSACTION_ID               IN          VARCHAR2,
    PCHANNEL_TYPE               IN VARCHAR2 DEFAULT NULL,
    PCSS_ORDER_NUMBER          IN VARCHAR2 DEFAULT NULL,
    PTELEPHONE_NUMBER          IN VARCHAR2 DEFAULT NULL,
    PSCENARIO_TYPE               IN VARCHAR2 DEFAULT NULL,
    PCUSTOMER_REQUIRED_DATE IN          VARCHAR2 DEFAULT NULL,
    PCUSTOMER_REQUIRED_TIME IN          VARCHAR2 DEFAULT NULL,
    PCANCELLATION_REASON     IN          VARCHAR2 DEFAULT NULL,
    PCANCELLATION_NOTES          IN          VARCHAR2 DEFAULT NULL,
    PSMPF_RETENTION               IN          VARCHAR2 DEFAULT NULL,
    PEMERGENCY_WINBACK          IN          VARCHAR2 DEFAULT NULL,
    PCSS_PROJECT_ID               IN          VARCHAR2 DEFAULT NULL,
    PCSS_ORDER_NOTES          IN          VARCHAR2 DEFAULT NULL,
    PREASON_FOR_CESSATION     IN          VARCHAR2 DEFAULT NULL,
    P_RESPONSE                    OUT VARCHAR2,
    PSMART_USER_ID               IN VARCHAR2 DEFAULT NULL,
    PORACLE_ERROR               OUT VARCHAR2,
    PORACLE_ERROR_MESSAGE     OUT          VARCHAR2,
    PRESPONSE_TIME               OUT          NUMBER,
    PDATA_TRANSFER_STATUS     OUT          VARCHAR2)
    IS
    v_scenario_type               VARCHAR2(20); -- Varialble to Hold Time Out of every request to SPG
    v_transaction_time          NUMBER;          -- Total time in which Request to SPG was processed
    v_record_inserted_at     DATE;          -- Date/Time about the record insertion to the Error Handler
    v_start_time               NUMBER;          -- Variable to hold Start Time for calculationg Transaction Time
    v_url                         VARCHAR2(32767);-- URL to use when sending data to SPG
    vtransaction_id               VARCHAR2(18); -- Variable to hold Transaction ID for the request
    v_buffer                    VARCHAR2(32760);-- Variable to read response from the SPG interface
    v_timeout                    PLS_INTEGER; -- Time Out for each Transaction
    v_oracle_err_msg          VARCHAR2(600); -- Variable to hold Oracle Error Message
    v_resp                UTL_HTTP.RESP; -- Response Object
    v_req                UTL_HTTP.REQ; -- Request Object
    v_userid_pwd               SMT_ORACLE_PARAMETERS%ROWTYPE; --Variable declared to contain User ID & Password
    vl_RetCode          VARCHAR2(5000);
    vl_std_returnCode     VARCHAR2(3000);
    --PDATA_TRANSFER_STATUS Holds the Data Transfer Status which can have possible values as
    -- N => Data Has not been sent to SPG
    -- Y => Received Successful response from SPG
    -- F => On the First try to Send data to SPG Oracle Error Occured or response from SPG was a faulure
    -- S => On the Second try to Send data to SPG Oracle Error Occured or response from SPG was a faulure
    -- T => Data Has been transferred to the Error Log Table
    -- X => Data need not be transfered to Error Log Table.
    --Location of the timeout, URL & User Id & Password in Standing Data.
    c_url_stopwlr SMT_ORACLE_PARAMETERS.PARAMETER_CODE%TYPE:='SPG_WLR';-- Stop WLR URL
    c_url_cancelown SMT_ORACLE_PARAMETERS.PARAMETER_CODE%TYPE:='SPG_OWN';-- Cancel own URL
    c_url_cancelother SMT_ORACLE_PARAMETERS.PARAMETER_CODE%TYPE:='SPG_OTH';-- Cancel other URL
    c_url_amendcrd SMT_ORACLE_PARAMETERS.PARAMETER_CODE%TYPE:='SPG_CRD';--Amend CRD URL
    c_spg_useridpwd SMT_ORACLE_PARAMETERS.PARAMETER_CODE%TYPE:='SPGIDPWD'; --Contains user id and pwd
    ctimeout smt_parameters.parameter_code%TYPE:='SPGTO'; --This holds the timeout parameter
    BEGIN
         --In case the calling batch process can pass this value this SQL read will not be required & can be deleted
         --Read data transfer status for the transaction Id
         SELECT data_transfer_status INTO PDATA_TRANSFER_STATUS     FROM SPG_INTERFACE_TABLE
         WHERE transaction_id     =     PTRANSACTION_ID;
         --Record the start time
         v_start_time:=DBMS_UTILITY.GET_TIME;
         --If Data transfer status is S then send the record to error handler
         IF PDATA_TRANSFER_STATUS = 'S' THEN
              Error_Handler(PTRANSACTION_ID,PSMART_USER_ID,PORACLE_ERROR,PORACLE_ERROR_MESSAGE,v_record_inserted_at,PDATA_TRANSFER_STATUS);
         ELSE
         --In case Data Tranfer Status is something other than S then send the request to SPG
              --Initialise other variables which will be populated during the journey
              P_RESPONSE                    :=     '';
              PORACLE_ERROR               :=     NULL;
              PORACLE_ERROR_MESSAGE     :=     NULL;
              PRESPONSE_TIME               :=     0;
         --Read timeout parameter from standing data.
              BEGIN
                   SELECT VALUE INTO v_timeout FROM smt_parameters WHERE parameter_code=ctimeout;
              EXCEPTION
                   WHEN NO_DATA_FOUND THEN
                   v_timeout:=30;
              WHEN OTHERS THEN
                   v_timeout:=30;
              END;
         -- Construct the URL for Stop WLR Scenario
              IF PSCENARIO_TYPE = 'STOP_WLR' THEN
                   BEGIN
                   -- Read the Initial URL from Standing Data
                   SELECT VALUE
                        INTO v_url
                        FROM SMT_ORACLE_PARAMETERS
                        WHERE parameter_code = c_url_stopwlr
                        AND host_id = ( SELECT host_id
                                                      FROM SMART_HOSTS A
                                                      WHERE EXISTS ( SELECT 1
                                                                     FROM DB_PARAMETERS b
                                                                     WHERE A.hostname = b.hostname
                                                                     AND A.database_id = b.database_id));
                   --handle unforseen exception
                   EXCEPTION
                   WHEN NO_DATA_FOUND THEN
                        v_url:='Http://wls.brassi1c.devenv1.bt.co.uk:64738/pls/spgenv/spg_btrc.add_btrc_winback_details'; --After testing the same, URL will be fetched from the Query
                   WHEN OTHERS THEN
                        v_url:='Http://wls.brassi1c.devenv1.bt.co.uk:64738/pls/spgenv/spg_btrc.add_btrc_winback_details'; --After testing the same, URL will be fetched from the Query
                   END;
                   --construct the URL depending on the parameters to be passed to the url
                   v_url := v_url || '?';
                   v_url := v_url || 'p_data_entered=' || Smart_Urlencode('xmloverhttp') || '&';
                   v_url := v_url || 'p_channel_type=' || Smart_Urlencode(PCHANNEL_TYPE)|| '&';
                   v_url := v_url || 'p_css_start_order_no=' || Smart_Urlencode(PCSS_ORDER_NUMBER)|| '&';
                   v_url := v_url || 'p_tel_no=' || Smart_Urlencode(PTELEPHONE_NUMBER)|| '&';
                   v_url := v_url || 'p_crd=' || Smart_Urlencode(PCUSTOMER_REQUIRED_DATE)|| '&';
                   v_url := v_url || 'p_take_over_time=' || Smart_Urlencode(PCUSTOMER_REQUIRED_TIME)|| '&';
                   v_url := v_url || 'p_retainsmpf=' || Smart_Urlencode(PSMPF_RETENTION)|| '&';
                   --v_url := v_url || 'p_emergency_winback='                    || Smart_Urlencode(PEMERGENCY_WINBACK)|| '&';
                   v_url := v_url || 'p_projectno=' || Smart_Urlencode(PCSS_PROJECT_ID)|| '&';
                   v_url := v_url || 'p_ordernotes=' || Smart_Urlencode(PCSS_ORDER_NOTES)|| '&';
                   v_url := v_url || 'p_reason_cessation=' || Smart_Urlencode(PREASON_FOR_CESSATION);
              ELSIF PSCENARIO_TYPE='CANCEL_OWN' THEN
              --Fetch the URL for cancel own from standing data.
                   BEGIN
                        SELECT VALUE
                        INTO v_url
                        FROM SMT_ORACLE_PARAMETERS
                        WHERE parameter_code = c_url_cancelown
                        AND host_id = ( SELECT host_id
                                                      FROM SMART_HOSTS A
                                                      WHERE EXISTS ( SELECT 1
                                                                     FROM DB_PARAMETERS b
                                                                     WHERE A.hostname = b.hostname
                                                                     AND A.database_id = b.database_id));
              --handle unforseen exception
                   EXCEPTION
                             WHEN NO_DATA_FOUND THEN
                             v_url := 'Http://wls.brassi1c.devenv1.bt.co.uk:64738/pls/spgenv/spg_btrc.add_btrc_cancelown_details'; --After testing the same, URL will be fetched from the Query
                   WHEN OTHERS THEN
                             v_url := 'Http://wls.brassi1c.devenv1.bt.co.uk:64738/pls/spgenv/spg_btrc.add_btrc_cancelown_details'; --After testing the same, URL will be fetched from the Query
                   END;
              --construct the URL
              v_url := v_url || '?';
              v_url := v_url || 'p_data_entered=' ||Smart_Urlencode('xmloverhttp')|| '&';
              v_url := v_url || 'p_channel_type=' ||Smart_Urlencode(PCHANNEL_TYPE)|| '&';
              v_url := v_url || 'p_css_start_order_no=' ||Smart_Urlencode(PCSS_ORDER_NUMBER)|| '&';
              v_url := v_url || 'p_tel_no=' ||Smart_Urlencode(PTELEPHONE_NUMBER)|| '&';
              v_url := v_url || 'p_cancel_reason=' ||Smart_Urlencode(PCANCELLATION_REASON)|| '&';
              v_url:= v_url || 'p_cancel_notes=' ||Smart_Urlencode(PCANCELLATION_NOTES);
              ELSIF PSCENARIO_TYPE='CANCEL_OTHER' THEN
              --Fetch the URL for cancel own from standing data.
              BEGIN
              SELECT VALUE
                        INTO v_url
                        FROM SMT_ORACLE_PARAMETERS
                        WHERE parameter_code = c_url_cancelother
                        AND host_id = ( SELECT host_id
                                                      FROM SMART_HOSTS A
                                                      WHERE EXISTS ( SELECT 1
                                                                     FROM DB_PARAMETERS b
                                                                     WHERE A.hostname = b.hostname
                                                                     AND A.database_id = b.database_id));
              --handle unforseen exception
              EXCEPTION
                   WHEN NO_DATA_FOUND THEN
                        v_url := 'Http://wls.brassi1c.devenv1.bt.co.uk:64738/pls/spgenv/spg_btrc.add_btrc_cancelother_details'; --After testing the same, URL will be fetched from the Query
                   WHEN OTHERS THEN
                        v_url := 'Http://wls.brassi1c.devenv1.bt.co.uk:64738/pls/spgenv/spg_btrc.add_btrc_cancelother_details'; --After testing the same, URL will be fetched from the Query
              END;
              --construct the URL
              v_url := v_url || '?';
              v_url := v_url || 'p_data_entered=' ||Smart_Urlencode('xmloverhttp')|| '&';
              v_url := v_url || 'p_channel_type=' ||Smart_Urlencode(PCHANNEL_TYPE)|| '&';
              v_url := v_url || 'p_css_stop_order_no=' ||Smart_Urlencode(PCSS_ORDER_NUMBER)|| '&';
              v_url := v_url || 'p_tel_no=' ||Smart_Urlencode(PTELEPHONE_NUMBER)|| '&';
              v_url := v_url || 'p_cancel_reason=' ||Smart_Urlencode(PCANCELLATION_REASON);
              ELSIF Pscenario_type='AMEND_CRD' THEN
              --Fetch the URL for cancel own from standing data.
              BEGIN
              SELECT VALUE
                        INTO v_url
                        FROM SMT_ORACLE_PARAMETERS
                        WHERE parameter_code = c_url_amendcrd
                        AND host_id = ( SELECT host_id
                                                      FROM SMART_HOSTS A
                                                      WHERE EXISTS ( SELECT 1
                                                                     FROM DB_PARAMETERS b
                                                                     WHERE A.hostname = b.hostname
                                                                     AND A.database_id = b.database_id));
              --handle unforseen exception
              EXCEPTION
              WHEN NO_DATA_FOUND THEN
                   v_url := 'Http://wls.brassi1c.devenv1.bt.co.uk:64738/pls/spgenv/spg_btrc.add_btrc_amendcrd_details'; -- After testing the same , URL will be fetched from the Query
              WHEN OTHERS THEN
                   v_url := 'Http://wls.brassi1c.devenv1.bt.co.uk:64738/pls/spgenv/spg_btrc.add_btrc_amendcrd_details'; -- After testing the same , URL will be fetched from the Query
              END;
              --construct the URL
              v_url := v_url || '?';
              v_url := v_url || 'p_data_entered=' ||Smart_Urlencode('xmloverhttp')|| '&';
              v_url := v_url || 'p_channel_type=' ||Smart_Urlencode(PCHANNEL_TYPE)|| '&';
              v_url := v_url || 'p_css_start_order_no=' ||Smart_Urlencode(PCSS_ORDER_NUMBER)|| '&';
              v_url := v_url || 'p_tel_no=' ||Smart_Urlencode(PTELEPHONE_NUMBER)|| '&';
              v_url := v_url || 'p_crd='                         ||Smart_Urlencode(PCUSTOMER_REQUIRED_DATE)|| '&';
              v_url := v_url || 'p_css_change_order_numbers='||Smart_Urlencode(PCANCELLATION_REASON);
              END IF;
              --this is start of setting parameters for utl http object. the show begins...
              utl_http.set_transfer_timeout(v_timeout);
              --Set the wallet
              --XXXXX e.g.UTL_HTTP.SET_WALLET(?file:DirectoryPath?,'put password here?);
              --Set proxy
              --YYYYY e.g. utl_http.set_proxy(p_proxy_in, p_no_proxy_domains_in);
              v_url := REPLACE(v_url,'%27%27','%27'); -- Fix to ensure Double Quotes are converted to Single Quotes
              --set the required URL to utl http.
              v_req := utl_http.begin_request(v_url);
              --Authentication setting
              --Fetch the user id and password from stnding data.
              BEGIN
                   SELECT *
                        INTO v_userid_pwd
                        FROM SMT_ORACLE_PARAMETERS
                        WHERE PARAMETER_CODE=c_spg_useridpwd
                        AND HOST_ID = ( SELECT HOST_ID
                                            FROM SMART_HOSTS A
                                            WHERE EXISTS ( SELECT 1
                                                                FROM DB_PARAMETERS B
                                                                WHERE A.HOSTNAME = B.HOSTNAME
                                                                AND A.DATABASE_ID = B.DATABASE_ID));
              EXCEPTION
                   WHEN NO_DATA_FOUND THEN
                   P_RESPONSE := 'ORACLE_ERROR: USER id AND Password NOT configured IN SMT_ORACLE_PARAMETERS:SPGIDPWD';
                   WHEN OTHERS THEN
                   P_RESPONSE := 'ORACLE_ERROR: USER id AND Password NOT configured IN SMT_ORACLE_PARAMETERS:SPGIDPWD';
              END;
              --utl_http.set_authentication(v_req, p_username_in, p_password_in);
              utl_http.set_authentication(v_req, v_userid_pwd.description, v_userid_pwd.VALUE);
              v_resp := utl_http.get_response(v_req);
              --Fill in the the response time
              PRESPONSE_TIME := (DBMS_UTILITY.GET_TIME - v_start_time)/100;
              IF v_resp.reason_phrase = 'OK' THEN
                   -- Fetch the response
                   BEGIN
                        LOOP
                        utl_http.read_line(v_resp, v_buffer);
                             P_RESPONSE := P_RESPONSE || v_buffer;
                        END LOOP;
                             utl_http.end_response(v_resp);
                        EXCEPTION
                        WHEN utl_http.end_of_body THEN
                        utl_http.end_response(v_resp);
                        P_RESPONSE := P_RESPONSE || v_buffer;
                   END;
              ELSIF v_resp.reason_phrase <> 'OK' OR P_RESPONSE = '' THEN
                   --error handling starts
                   --If the HTTP Status is not OK then store the error information
                   PORACLE_ERROR_MESSAGE     :=     'Status Code: '|| v_resp.STATUS_CODE||'. Reason Phrase ' ||v_resp.reason_phrase;
                   P_RESPONSE                    :=     'ORACLE_ERROR: '||     ' Reason Phrase ' ||     v_resp.reason_phrase;
                   PORACLE_ERROR               :=     v_resp.STATUS_CODE;
              END IF;
              --In case we got successful response from SPG
              IF P_RESPONSE LIKE '%<RetCde>0</RetCde>%' THEN
                   PDATA_TRANSFER_STATUS     :=     'Y';
              ELSE
                   BEGIN
    SELECT message
                                  INTO vl_std_returnCode
                                  FROM SMT_MESSAGES
                                  WHERE MESSAGE_CODE='SPGANTIDTS';
    EXCEPTION
    WHEN NO_DATA_FOUND THEN
         vl_std_returnCode := '-12545,-29273,-1,401,';
    WHEN OTHERS THEN
                        vl_std_returnCode := '-12545,-29273,-1,401,';
    END;
                   --In case there was an error do not update Data Transfer Status
                   IF PORACLE_ERROR <> NULL AND INSTR(vl_std_returnCode, PORACLE_ERROR || ',', 1, 1) <> 0 THEN
                             PDATA_TRANSFER_STATUS:=PDATA_TRANSFER_STATUS;
                   ELSE
                        vl_RetCode := SUBSTR(P_RESPONSE, INSTR(P_RESPONSE,'<RetCde>', 1, 1),
                        INSTR(P_RESPONSE,'</RetCde>',1,1)+9 - INSTR(P_RESPONSE,'<RetCde>', 1, 1));
                        BEGIN
                             SELECT VALUE
                                  INTO vl_std_returnCode
                                  FROM SMT_ORACLE_PARAMETERS
                                  WHERE PARAMETER_CODE='SPGRCS'
                                  AND HOST_ID = ( SELECT HOST_ID
                                       FROM SMART_HOSTS A
                                       WHERE EXISTS ( SELECT 1
                                                           FROM DB_PARAMETERS B
                                                           WHERE A.HOSTNAME = B.HOSTNAME
                                                           AND A.DATABASE_ID = B.DATABASE_ID));
                   EXCEPTION
                        WHEN NO_DATA_FOUND THEN
                             vl_std_returnCode := '<RetCde>4244</RetCde><RetCde>4245</RetCde><RetCde>4246</RetCde>';
                        WHEN OTHERS THEN
                             vl_std_returnCode := '<RetCde>4244</RetCde><RetCde>4245</RetCde><RetCde>4246</RetCde>';
                        END;
                        IF INSTR(vl_std_returnCode, vl_RetCode, 1, 1) <> 0 THEN
                             --needs not to re attempted.
                             PDATA_TRANSFER_STATUS:='X';
                        ELSE
                             --In case we did'nt got SUCCESSFUL response FROM SPG THEN UPDATE the Data Transfer Status so that the failed requests can be picked up BY the NEXT batch job RUN
                             IF PDATA_TRANSFER_STATUS='N' THEN
                                  --initially if data transfer status was N then update it now to F
                                  PDATA_TRANSFER_STATUS     :=     'F';
                             ELSIF PDATA_TRANSFER_STATUS='F' THEN
                                  --initially if data transfer status was N then update it now to S
                                  PDATA_TRANSFER_STATUS     :=     'S';
                             END IF;
                        END IF;
                   END IF;
              END IF;
              --Now Update all the modified Values
         UPDATE SPG_INTERFACE_TABLE
                   SET     response          =     P_RESPONSE,
                   data_transfer_status     =     PDATA_TRANSFER_STATUS,
                   oracle_error               =     PORACLE_ERROR,
                   oracle_error_message     =     PORACLE_ERROR_MESSAGE,
                   response_time               =     PRESPONSE_TIME
                   WHERE transaction_id     =     PTRANSACTION_ID;
              COMMIT;
    END IF;
    EXCEPTION
         WHEN OTHERS THEN
         --Handling the unhandled exception
         PORACLE_ERROR               :=     SQLCODE;
         PORACLE_ERROR_MESSAGE     :=     SQLERRM;
         P_RESPONSE                    :=     'ORACLE_ERROR: '|| PORACLE_ERROR_MESSAGE;
         PRESPONSE_TIME               :=     (DBMS_UTILITY.GET_TIME - v_start_time)/100;
         SELECT data_transfer_status INTO PDATA_TRANSFER_STATUS
         FROM SPG_INTERFACE_TABLE
         WHERE transaction_id=PTRANSACTION_ID;
         --New functionality to update the oracle error and oracle error message and not the Data Transfer Status
    BEGIN
    SELECT message
    INTO vl_std_returnCode
    FROM SMT_MESSAGES
    WHERE MESSAGE_CODE='SPGANTIDTS';
    EXCEPTION
    WHEN NO_DATA_FOUND THEN
    vl_std_returnCode := '-12545,-29273,-1,';
    WHEN OTHERS THEN
    vl_std_returnCode := '-12545,-29273,-1,';
    END;
         vl_RetCode     :=     PORACLE_ERROR || ',';
    IF INSTR(vl_std_returnCode, vl_RetCode, 1, 1) <> 0 THEN
    --If the error is found in above maintained standing data do not change the Data Transfer Status
                   pdata_transfer_status:=pdata_transfer_status;
    ELSE
              IF pdata_transfer_status='N' THEN
                             PDATA_TRANSFER_STATUS     :=     'F';
                             DBMS_OUTPUT.PUT_LINE('DUE TO ERROR DATA COULDN''T GET TRANSFERED TO SPG FOR TRANSACTION'||' '||PTRANSACTION_ID);
                             DBMS_OUTPUT.PUT_LINE(SQLERRM);
              ELSIF pdata_transfer_status='F' THEN
                             PDATA_TRANSFER_STATUS     :=     'S';
                             DBMS_OUTPUT.PUT_LINE('DUE TO ERROR DATA COULDN''T GET TRANSFERED TO SPG FOR TRANSACTION'||' '||PTRANSACTION_ID);
                             DBMS_OUTPUT.PUT_LINE(SQLERRM);
    ELSE
                             DBMS_OUTPUT.PUT_LINE('Failure WHEN sending data TO Error LOG. Data Transfer Status IS ' || PDATA_TRANSFER_STATUS || '. TRANSACTION ID '|| PTRANSACTION_ID);
              END IF;
    END IF;
              --Now update all the information gathered above to the table
         UPDATE SPG_INTERFACE_TABLE
              SET     response          =     P_RESPONSE,
              data_transfer_status     =     PDATA_TRANSFER_STATUS,
              oracle_error               =     PORACLE_ERROR,
              oracle_error_message     =     PORACLE_ERROR_MESSAGE,
              response_time               =     PRESPONSE_TIME
              WHERE transaction_id     =     PTRANSACTION_ID;
              COMMIT;
    END;
    /

    I have fixed the problem by own.
    Seems there are some while space in the endpoint url.
    Fix
    http_req:= utl_http.begin_request
    trim(l_endpoint_url)
    ,'POST'
    ,'HTTP/1.1'
    It works...
    Regards
    BS

  • Ora-06502:pl/sql and ora-06512 at sys.owa_util errors

    Greetings -
    I have just installed APEX 2.2 in my 9.2.0.7 database and am going through the exercises in the "2 Day+ Application Express Developer's Guide." I was making good progress, until I got to Chapter 5, How to Control Form Layout. I created the script "ht_emp", as instructed. Everything in the script works, except for the "create or replace trigger bi_ht_emp" part. It fails with the following errors:
    ORA-06502: PL/SQL: numeric or value error ORA-06512: at "SYS.OWA_UTIL", lone 328 ORA-06512: at "SYS.HTP", line 862 ORA-06512: at "SYS.HTP", line 977 ORA-06512: at "SYS.HTP", line 995 ORA-06512: at "FLOWS_020200.WWV_FLOW_SW_API", line 428 ORA-01003: no statement parsed. I have confirmed that nls_length_semantics = BYTE
    Any suggestions?
    Thanks in advance - Gail

    Scott -
    Here's the part of the script that chokes --
    CREATE OR REPLACE TRIGGER bi_ht_emp
    BEFORE INSERT ON ht_emp
    FOR EACH ROW
    BEGIN
    SELECT ht_emp_seq.nextval
    INTO :new.emp_id
    FROM DUAL;
    :new.rec_create_date := SYSDATE;
    END;
    Thanks fro helping -
    Gail

  • Indexes are in unusable state

    hi
    i am beginner....
    indexes are in unusable state...
    how can i make it actual state

    Maybe you can use
    alter index your_index_name rebuild online;?

  • ORA-04043: object SYS.DELTA$SESSION does not exist

    Dear Friends
    after I import my data by using the follwoing import script :
    IMP JCC/P_MANUF FILE =JCC.DMP FULL
    and at the end give this message import has been imported succesfully without warning
    then when I use this script :
    SQL> SELECT TNAME FROM TAB
    2 WHERE TNAME LIKE 'USER_SESSION'
    3 /
    TNAME
    USER_SESSION
    The table USER_SESSION is exist but when I try to desplay the structure of the USER_SESSION by using this :
    SQL> DESC USER_SESSION
    ERROR:
    ORA-04043: object SYS.DELTA$SESSION does not exist
    and when I try to use the select statment as the following
    SELECT * FROM USER_SESSION
    ERROR at line 1:
    ORA-00980: synonym translation is no longer valid
    Waiting for your valuable answer.
    Best regards
    Jamil Alshaibani

    SQL> select * from V$version;
    BANNER
    Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - 64bit Production
    PL/SQL Release 11.1.0.6.0 - Production
    CORE 11.1.0.6.0 Production
    TNS for Linux: Version 11.1.0.6.0 - Production
    NLSRTL Version 11.1.0.6.0 - Production
    SQL> !uname -a
    Linux KAD-VMWARE 2.6.9-55.ELsmp #1 SMP Fri Apr 20 16:36:54 EDT 2007 x86_64 x86_64 x86_64 GNU/Linux
    SQL> sho user
    USER is "SYS"
    SQL> select object_type,status from dba_objects where object_name = 'K_DRWDWN_GRP' and OWNER = 'SYS';
    no rows selected
    Is any thing wrong with my dictionary? please let me know if i missed anything?
    Edited by: sanora600 on Oct 16, 2010 12:34 AM

Maybe you are looking for

  • Combine into a single PDF bugs, Acrobat 9

    There are a things about using the Combine into a single PDF document that are quite frustrating. Two of them have been the case for a few versions of Acrobat, one just since Acrobat 9. Firstly, only in Acrobat 9 when dragging files into the combine

  • Problem with Mail in Snow Leopard

    I have iOS10.6.8.  My mail program keeps recovering an email that I sent a week ago. It included photos.  I delete them, but they just keep returning.  Worse, no new emails from that account appear.  I can send, but not receive unless I go to my iClo

  • Mapviewer - common javascript

    Just looking into mapviewer and wanted to add some useful functionality to my map image on a jsp. Was curious if anyone knew of our had some of the more commonly needed javascript functionality for mapping applications. 1) Coordinate display with mou

  • Migrating Oracle Apps from 11.5.5 on Windows 2000 to 11.5.8 on Windows 2003

    Currently we are running Oracle Applications 11.5.5 on Windows 2000 Server. We want to migrate to faster machines running Windows 2003 Server. 11.5.5 is not supported on Windows 2003. We will need to upgrate to at least 11.5.8. Can you please suggest

  • Mobilemesyncclient

    every time I wake my imac from sleep I get a message "mobilemesyncclient wants to use the Login Keychain. Please enter the keychain password." WHen I enter my password it always freezes the comptuer and i have to power down using the button on the ba