Tuning Advisor doesn't work: ORA-13605, ORA-06512,

I'm trying to use SQL Tuning Advisor with the query: select * from MYTABLE;  but I got the following errors.
Nothing changes if I switch from custom user to admin user.
I'm using Oracle SQL Developer 4.0.0.13.80 and Oracle XE 11g
ORA-13605: The specified task or object staName30874 does not exist for the current user.
ORA-06512: at "SYS.DBMS_SYS_ERROR", line 86
ORA-06512: at "SYS.PRVT_ADVISOR", line 5878
ORA-06512: at "SYS.DBMS_SQLTUNE", line 926
ORA-06512: at line 2
13605. 00000 -  "The specified task or object %s does not exist for the current user." 
*Cause:    The user attempted to reference an advisor task or object
           using a name that does not exist in the Advisor repository.
*Action:   Adjust the name and retry the operation.
Codice fornitore 13605
ORA-13717: Tuning Package License is needed for using this feature.
ORA-06512: at "SYS.PRVT_SMGUTIL", line 52
ORA-06512: at "SYS.PRVT_SMGUTIL", line 37
ORA-06512: at "SYS.DBMS_MANAGEMENT_PACKS", line 26
ORA-06512: at "SYS.DBMS_SQLTUNE", line 625
ORA-06512: at line 5
Any help?
Thanks

by the way, perhaps the problem is different. please read this.
Re: ORA-13717:Tuning Package License is needed for using this feature

Similar Messages

  • Site Advisor doesn't work w/Firefox v5. How can I revert to an earlier revision?

    Your notification said the update to FFv5 was "strongly recommended". If you'd told me siteadviser would be disabled, I'd never have updated.
    Site Adviser doesn't work w/Firefox V5. How can I revert to an earlier revision?
    Thx

    i sympathize. there is absolutely no warning that firefox 4 will not work with my g5, and there is no way to get back to firefox 3.6. hello mozilla!!! what were you thinking?!?!??

  • Binding dynamic variable in XQuery doesn't work: ORA-00932

    I have a table with several columns. One of those columns is a XMLType.
    My goal is to have a query which selects rows from the table of which the XML column matches certain criteria.
    I'm trying following example (JDBC) : http://download.oracle.com/docs/cd/B28359_01/appdev.111/b28369/xdb_xquery.htm#insertedID11
    First, I created my own query, which looks like:
    select * from MyTable t, XMLTABLE( xmlnamespaces (DEFAULT 'http://test), 'for $i in /RootElement where $i/SubElement[contains(Element, "someValue")] return "true"' passing t.xmlColumn)This works as expected. Next, as done in the example, I'm trying to replace the "someValue" with a dynamic variable.
    Query then looks like:
    select * from MyTable t, XMLTABLE( xmlnamespaces (DEFAULT 'http://test), 'for $i in /RootElement where $i/SubElement[contains(Element, $val)] return "true"' passing t.xmlColumn, :1 as "val")This does not seem to work, neither in SQLDeveloper nor in java.
    I always get the :
    java.sql.SQLException: ORA-00932: inconsistent datatypes: expected - got CHAR(SQLDeveloper just gives ORA-00932)
    When I put $val between quotes (so "$val") then I get no error, but then I get no results either.
    I think it will not replace $val in that case but just use it as a literal, so thats not what I want
    I also tried to remove "contains" xpath and use the exact same example as on the oracle page
    select * from MyTable t, XMLTABLE( xmlnamespaces (DEFAULT 'http://test), 'for $i in /RootElement where $i/SubElement/Key = $val return "true"' passing t.xmlColumn, :1 as "val")But this doens't help either.
    I'm clueless about this, so any help would be appreciated
    Edited by: user5893566 on Nov 29, 2008 6:24 AM

    Ok, I tested it using the latest enterprise edition (11g) and there it works as expected.
    However, on 10.2.0.1.0 and 10.2.0.3.0 it gives this error.
    Is this a bug which has been fixed or should I do something special on 10g ?
    I installed all of these as normal without any special settings, created the tables and ran the query...

  • Hi, I have installed ff 5, but the mcafee site advisor doesn't work (it did tell me this - sorry!). How can I reinstall v4.0.1 please? thank you

    Does exactly what it says on the tin innit

    McAfee have taken the decision to rewrite the Firefox SiteAdvisor plugin to make it easier to update. This should ensure that Mozilla's fast-release schedule does not cause lengthy delays after future version updates. What it means for Firefox now though is that until the rewrite is complete - and tested - SiteAdvisor is being prevented from loading in Firefox in order to avoid the possibility of software incompatibility.
    The SA rewrite is projected to take a few weeks to complete and test; it should be ready by about the third week of July, although the exact date is not being given at this stage. It could be earlier.
    In the meantime, users who are concerned about the safety of websites may wish to consider WOT as a temporary substitute. WOT ratings are set by user consensus rather than by automated site testing, so WOT is not a full replacement for SiteAdvisor. It is, however, a good rating tool in its own right (I use both it and SiteAdvisor in all my browsers) and is apparently unaffected by the upgrade to FF5.
    There is a discussion about this on the McAfee forums [https://community.mcafee.com/message/194743#194743 HERE]

  • OBIEE/EBS R12 - works, except for one user - ORA-06512 error

    OBIEE 10.3.1.4 / EBS 12.0.4
    Oracle 11g
    HPUX 11.31 64 bit Itanium
    We are successfully using EBS integration with OBIEE, but for one user that we have created it doesn't work. When they try to access OBIEE from EBS we get this error in NQServer.log:
    *[nQSError: 13011] Query for Initialization Block 'EBS Security Context' has failed.*
    *[nQSError: 17001] Oracle Error code: 6510, message: ORA-06510: PL/SQL: unhandled user-defined exception*
    ORA-06512: at "APPS.APP_SESSION", line 313
    at OCI call OCIStmtExecute: call / 101507300 */ APP_SESSION.validate_icx_session('NIOWQbvOlCFpGilcGDvlBIY-:S').*
    *[nQSError: 17011] SQL statement execution failed.*
    This is when the query is run against EBS to authenticate the user:
    select FND_GLOBAL.RESP_ID,
    FND_GLOBAL.RESP_APPL_ID,
    FND_GLOBAL.SECURITY_GROUP_ID,
    FND_GLOBAL.RESP_NAME,
    FND_GLOBAL.USER_ID,
    FND_GLOBAL.EMPLOYEE_ID,
    FND_GLOBAL.USER_NAME from dual
    It is only for one user that has the problem. All others users work fine.
    Has anyone else seen this problem?
    Our EBS DBA has checked that the above sql can be run with the session set to the problem user, and compared with a user who can successfully connect to OBIEE. The results were the same for both.

    I was on the wrong lines with this one.
    The error in the NQServer.log was not from the problem user, it was a separate user.
    The real cause of a specific user not being able to login was a corrupt web catalog (which we're still trying to resolve)

  • Impdump fails with ORA-06512: at "SYS.KUPW$WORKER", line 6345

    Hi All,
    We are trying to import a data from PROD to test using datapump utility.
    Its is failing with the below error.
    Import: Release 10.2.0.4.0 - 64bit Production on Friday, 01 July, 2011 11:32:12
    Copyright (c) 2003, 2007, Oracle. All rights reserved.
    Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    Master table "SYS"."SYS_IMPORT_SCHEMA_02" successfully loaded/unloaded
    Starting "SYS"."SYS_IMPORT_SCHEMA_02": /******** AS SYSDBA remap_tablespace=FCATDB:USERS SCHEMAS=FCATDB:FCATDB directory=EXPDP_DIR dumpfile=expdp_fcatdb.dmp logfile=probin1.log
    Processing object type SCHEMA_EXPORT/USER
    ORA-39083: Object type USER failed to create with error:
    ORA-02380: profile BOB does not exist
    Failing sql is:
    CREATE USER "FCATDB" IDENTIFIED BY VALUES '57433E901EB2CA43' DEFAULT TABLESPACE "USERS" TEMPORARY TABLESPACE "TEMP" PROFILE "BOB"
    Processing object type SCHEMA_EXPORT/SYSTEM_GRANT
    ORA-39083: Object type SYSTEM_GRANT failed to create with error:
    ORA-01917: user or role 'FCATDB' does not exist
    Failing sql is:
    GRANT SELECT ANY SEQUENCE TO "FCATDB"
    ORA-39083: Object type SYSTEM_GRANT failed to create with error:
    ORA-01917: user or role 'FCATDB' does not exist
    Failing sql is:
    GRANT CREATE SYNONYM TO "FCATDB"
    ORA-39083: Object type SYSTEM_GRANT failed to create with error:
    ORA-01917: user or role 'FCATDB' does not exist
    Failing sql is:
    GRANT SELECT ANY TABLE TO "FCATDB"
    ORA-39083: Object type SYSTEM_GRANT failed to create with error:
    ORA-01917: user or role 'FCATDB' does not exist
    Failing sql is:
    GRANT UNLIMITED TABLESPACE TO "FCATDB"
    Processing object type SCHEMA_EXPORT/ROLE_GRANT
    ORA-39083: Object type ROLE_GRANT failed to create with error:
    ORA-01917: user or role 'FCATDB' does not exist
    Failing sql is:
    GRANT "CONNECT" TO "FCATDB"
    ORA-39083: Object type ROLE_GRANT failed to create with error:
    ORA-01917: user or role 'FCATDB' does not exist
    Failing sql is:
    GRANT "RESOURCE" TO "FCATDB"
    ORA-39083: Object type ROLE_GRANT failed to create with error:
    ORA-01917: user or role 'FCATDB' does not exist
    Failing sql is:
    GRANT "DBA" TO "FCATDB"
    Processing object type SCHEMA_EXPORT/DEFAULT_ROLE
    ORA-39083: Object type DEFAULT_ROLE failed to create with error:
    ORA-01918: user 'FCATDB' does not exist
    Failing sql is:
    ALTER USER "FCATDB" DEFAULT ROLE ALL
    Processing object type SCHEMA_EXPORT/PRE_SCHEMA/PROCACT_SCHEMA
    ORA-39083: Object type PROCACT_SCHEMA failed to create with error:
    ORA-31625: Schema FCATDB is needed to import this object, but is unaccessible
    ORA-01435: user does not exist
    Failing sql is:
    BEGIN
    sys.dbms_logrep_imp.instantiate_schema(schema_name=>SYS_CONTEXT('USERENV','CURRENT_SCHEMA'), export_db_name=>'BOBL_PRO', inst_scn=>'71243687320');COMMIT; END;
    Processing object type SCHEMA_EXPORT/SYNONYM/SYNONYM
    ORA-39083: Object type SYNONYM failed to create with error:
    ORA-01917: user or role '' does not exist
    Failing sql is:
    CREATE SYNONYM "FCATDB"."FCC_ACPKS_MISC" FOR "BOB"."ACPKS_MISC"@"FCATFCLINK.REGRESS.RDBMS.DEV.US.ORACLE.COM"
    ORA-39083: Object type SYNONYM failed to create with error:
    ORA-01917: user or role '' does not exist
    Failing sql is:
    CREATE SYNONYM "FCATDB"."FCC_ACTBS_ACCBAL_HISTORY" FOR "ACTBS_ACCBAL_HISTORY"@"FCATFCLINK.REGRESS.RDBMS.DEV.US.ORACLE.COM"
    ORA-39083: Object type SYNONYM failed to create with error:
    ORA-01917: user or role '' does not exist
    Failing sql is:
    CREATE SYNONYM "FCATDB"."FCC_ACTBS_ACCSTATS_PTD" FOR "ACTBS_ACCSTATS_PTD"@"FCATFCLINK.REGRESS.RDBMS.DEV.US.ORACLE.COM"
    ORA-39083: Object type SYNONYM failed to create with error:
    ORA-01917: user or role '' does not exist
    Failing sql is:
    CREATE SYNONYM "FCATDB"."FCC_ACVWS_ALL_AC_ENTRIES" FOR "ACVWS_ALL_AC_ENTRIES"@"FCATFCLINK.REGRESS.RDBMS.DEV.US.ORACLE.COM"
    ORA-39083: Object type SYNONYM failed to create with error:
    ORA-01917: user or role '' does not exist
    Failing sql is:
    CREATE SYNONYM "FCATDB"."FCC_BCTBS_CONTRACT_PARTIES" FOR "BCTBS_CONTRACT_PARTIES"@"FCATFCLINK.REGRESS.RDBMS.DEV.US.ORACLE.COM"
    ORA-39083: Object type SYNONYM failed to create with error:
    ORA-01917: user or role '' does not exist
    Failing sql is:
    CREATE SYNONYM "FCATDB"."FCC_BCTB_CONTRACT_MASTER" FOR "BCTB_CONTRACT_MASTER"@"FCATFCLINK.REGRESS.RDBMS.DEV.US.ORACLE.COM"
    ORA-39083: Object type SYNONYM failed to create with error:
    ORA-01917: user or role '' does not exist
    Failing sql is:
    CREATE SYNONYM "FCATDB"."FCC_BCTMS_DOCS_MASTER" FOR "BCTMS_DOCS_MASTER"@"FCATFCLINK.REGRESS.RDBMS.DEV.US.ORACLE.COM"
    ORA-39083: Object type SYNONYM failed to create with error:
    ORA-01917: user or role '' does not exist
    Failing sql is:
    CREATE SYNONYM "FCATDB"."FCC_BCTM_PRODUCT_MASTER" FOR "BCTM_PRODUCT_MASTER"@"FCATFCLINK.REGRESS.RDBMS.DEV.US.ORACLE.COM"
    ORA-39083: Object type SYNONYM failed to create with error:
    ORA-01917: user or role '' does not exist
    Failing sql is:
    CREATE SYNONYM "FCATDB"."FCC_BCVW_REPORTS" FOR "BCVW_REPORTS"@"FCATFCLINK.REGRESS.RDBMS.DEV.US.ORACLE.COM"
    ORA-39083: Object type SYNONYM failed to create with error:
    ORA-01917: user or role '' does not exist
    Failing sql is:
    CREATE SYNONYM "FCATDB"."FCC_CATMS_CHECK_BOOK" FOR "CATMS_CHECK_BOOK"@"FCATFCLINK.REGRESS.RDBMS.DEV.US.ORACLE.COM"
    ORA-39083: Object type SYNONYM failed to create with error:
    ORA-01917: user or role '' does not exist
    Failing sql is:
    CREATE SYNONYM "FCATDB"."FCC_CFTBS_CONTRACT_CHARGES" FOR "CFTBS_CONTRACT_CHARGES"@"FCATFCLINK.REGRESS.RDBMS.DEV.US.ORACLE.COM"
    ORA-39083: Object type SYNONYM failed to create with error:
    ORA-01917: user or role '' does not exist
    Failing sql is:
    CREATE SYNONYM "FCATDB"."FCC_CFTBS_CONTRACT_INTEREST" FOR "CFTBS_CONTRACT_INTEREST"@"FCATFCLINK.REGRESS.RDBMS.DEV.US.ORACLE.COM"
    ORA-39083: Object type SYNONYM failed to create with error:
    ORA-01917: user or role '' does not exist
    Failing sql is:
    CREATE SYNONYM "FCATDB"."FCC_CFTMS_FLOAT_RATE_DETAIL" FOR "CFTMS_FLOAT_RATE_DETAIL"@"FCATFCLINK.REGRESS.RDBMS.DEV.US.ORACLE.COM"
    ORA-39083: Object type SYNONYM failed to create with error:
    ORA-01917: user or role '' does not exist
    Failing sql is:
    CREATE SYNONYM "FCATDB"."FCC_CFTMS_FLOAT_RATE_MASTER" FOR "CFTMS_FLOAT_RATE_MASTER"@"FCATFCLINK.REGRESS.RDBMS.DEV.US.ORACLE.COM"
    ORA-39083: Object type SYNONYM failed to create with error:
    ORA-01917: user or role '' does not exist
    Failing sql is:
    CREATE SYNONYM "FCATDB"."FCC_CFTMS_PRODUCT_CHARGE" FOR "CFTMS_PRODUCT_CHARGE"@"FCATFCLINK.REGRESS.RDBMS.DEV.US.ORACLE.COM"
    ORA-39083: Object type SYNONYM failed to create with error:
    ORA-01917: user or role '' does not exist
    Failing sql is:
    CREATE SYNONYM "FCATDB"."FCC_CFTMS_PRODUCT_ICCF" FOR "CFTMS_PRODUCT_ICCF"@"FCATFCLINK.REGRESS.RDBMS.DEV.US.ORACLE.COM"
    ORA-39083: Object type SYNONYM failed to create with error:
    ORA-01917: user or role '' does not exist
    Failing sql is:
    CREATE SYNONYM "FCATDB"."FCC_CFTMS_PRODUCT_INTEREST" FOR "CFTMS_PRODUCT_INTEREST"@"FCATFCLINK.REGRESS.RDBMS.DEV.US.ORACLE.COM"
    ORA-39083: Object type SYNONYM failed to create with error:
    ORA-01917: user or role '' does not exist
    Failing sql is:
    CREATE SYNONYM "FCATDB"."FCC_CFTMS_RATE_CODE" FOR "CFTMS_RATE_CODE"@"FCATFCLINK.REGRESS.RDBMS.DEV.US.ORACLE.COM"
    ORA-39083: Object type SYNONYM failed to create with error:
    ORA-01917: user or role '' does not exist
    Failing sql is:
    CREATE SYNONYM "FCATDB"."FCC_CFTM_RATE_CODE" FOR "CFTM_RATE_CODE"@"FCATFCLINK.REGRESS.RDBMS.DEV.US.ORACLE.COM"
    ORA-39083: Object type SYNONYM failed to create with error:
    ORA-01917: user or role '' does not exist
    Failing sql is:
    CREATE SYNONYM "FCATDB"."FCC_CHKHOL_AND_GET_NEXTWDAY" FOR "FN_CHKHOL_AND_GET_NEXTWDAY"@"FCATFCLINK.REGRESS.RDBMS.DEV.US.ORACLE.COM"
    ORA-39083: Object type SYNONYM failed to create with error:
    ORA-01917: user or role '' does not exist
    Failing sql is:
    CREATE SYNONYM "FCATDB"."FCC_CLTBS_ACCOUNT_MASTER" FOR "CLTBS_ACCOUNT_M
    Processing object type SCHEMA_EXPORT/TABLE/COMMENT
    ORA-39112: Dependent object type COMMENT skipped, base object type TABLE:"FCATDB"."ADMINTXNUNAUTHDATA" creation failed
    ORA-39112: Dependent object type COMMENT skipped, base object type TABLE:"FCATDB"."ADMINTXNUNAUTHDATA" creation failed
    ORA-39112: Dependent object type COMMENT skipped, base object type TABLE:"FCATDB"."ADMINTXNUNAUTHDATA" creation failed
    ORA-39112: Dependent object type COMMENT skipped, base object type TABLE:"FCATDB"."ADMINTXNUNAUTHDATA_HISTORY" creation failed
    ORA-39112: Dependent object type COMMENT skipped, base object type TABLE:"FCATDB"."ADMINTXNUNAUTHDATA_HISTORY" creation failed
    ORA-39112: Dependent object type COMMENT skipped, base object type TABLE:"FCATDB"."ADMINTXNUNAUTHDATA_HISTORY" creation failed
    ORA-39112: Dependent object type COMMENT skipped, base object type TABLE:"FCATDB"."DAILYTXNAMT" creation failed
    ORA-39112: Dependent object type COMMENT skipped, base object type TABLE:"FCATDB"."FCATFLEXMLAUDITLOG" creation failed
    ORA-39112: Dependent object type COMMENT skipped, base object type TABLE:"FCATDB"."MSTALERTNOTIFIER" creation failed
    ORA-39112: Dependent object type COMMENT skipped, base object type TABLE:"FCATDB"."MSTALERTNOTIFIER" creation failed
    ORA-39112: Dependent object type COMMENT skipped, base object type TABLE:"FCATDB"."MSTALERTNOTIFIER" creation failed
    ORA-39112: Dependent object type COMMENT skipped, base object type TABLE:"FCATDB"."MSTAPPSEQUENCE" creation failed
    ORA-39112: Dependent object type COMMENT skipped, base object type TABLE:"FCATDB"."MSTAPPSEQUENCE" creation failed
    ORA-39112: Dependent object type COMMENT skipped, base object type TABLE:"FCATDB"."MSTAPPSEQUENCE" creation failed
    ORA-39112: Dependent object type COMMENT skipped, base object type TABLE:"FCATDB"."MSTAPPSEQUENCE" creation failed
    ORA-39112: Dependent object type COMMENT skipped, base object type TABLE:"FCATDB"."MSTAPPSEQUENCE" creation failed
    ORA-39112: Dependent object type COMMENT skipped, base object type TABLE:"FCATDB"."MSTAPPSEQUENCE" creation failed
    ORA-39112: Dependent object type COMMENT skipped, base object type TABLE:"FCATDB"."MSTAPPSEQUENCE" creation failed
    ORA-39112: Dependent object type COMMENT skipped, base object type TABLE:"FCATDB"."MSTAPPSEQUENCE" creation failed
    ORA-39112: Dependent object type COMMENT skipped, base object type TABLE:"FCATDB"."MSTAPPSEQUENCE" creation failed
    ORA-39112: Dependent object type COMMENT skipped, base object type TABLE:"FCATDB"."MSTAPPSEQUENCE" creation failed
    ORA-39112: Dependent object type COMMENT skipped, base object type TABLE:"FCATDB"."MSTINITAUTHTYPES" creation failed
    ORA-39112: Dependent object type COMMENT skipped, base object type TABLE:"FCATDB"."MSTPERSONALCUST" creation failed
    ORA-39112: Dependent object type COMMENT skipped, base object type TABLE:"FCATDB"."MSTTXN" creation failed
    ORA-39112: Dependent object type COMMENT skipped, base object type TABLE:"FCATDB"."TXN_TEMP_MSTCORPORATE" creation failed
    ORA-39112: Dependent object type COMMENT skipped, base object type TABLE:"FCATDB"."TXN_TEMP_MSTCORPORATE" creation failed
    Processing object type SCHEMA_EXPORT/FUNCTION/FUNCTION
    ORA-39126: Worker unexpected fatal error in KUPW$WORKER.PUT_DDL [FUNCTION:"FCATDB"."FN_CHKHOL_AND_GET_NEXTWDAY"]
    ORA-44001: invalid schema
    ORA-06512: at "SYS.DBMS_SYS_ERROR", line 95
    ORA-06512: at "SYS.KUPW$WORKER", line 6345
    ----- PL/SQL Call Stack -----
    object line object
    handle number name
    c000000224567298 15032 package body SYS.KUPW$WORKER
    c000000224567298 6372 package body SYS.KUPW$WORKER
    c000000224567298 12800 package body SYS.KUPW$WORKER
    c000000224567298 12080 package body SYS.KUPW$WORKER
    c000000224567298 3346 package body SYS.KUPW$WORKER
    c000000224567298 6972 package body SYS.KUPW$WORKER
    c000000224567298 1314 package body SYS.KUPW$WORKER
    c00000022c7210b8 2 anonymous block
    Job "SYS"."SYS_IMPORT_SCHEMA_02" stopped due to fatal error at 11:32:41
    Please help me on this.
    Db version : 10.2.0.4
    Os : HP-UX.
    Thanks and Regards,

    ORA-01917: user or role 'FCATDB' does not existError: ORA 1917
    Text: user or role <name> does not exist
    Cause: An invalid user or role name was specified.
    Action: Check that a valid user or role name is used.
    If you are using IMPDP then no need to mention the user name, if the user is different then you can use remap_schema option,
    If dumpfile has only one schema then no need to mention the clause SCHEMAS also.
    change as SCHEMAS=FCATDB instead of SCHEMAS=FCATDB:FCATDB
    impdp /******** AS SYSDBA remap_tablespace=FCATDB:USERS SCHEMAS=FCATDB directory=EXPDP_DIR dumpfile=expdp_fcatdb.dmp logfile=probin1.log

  • Worker fails when running MSDODPCODE.sql causing ORA-33290 and ORA-06512

    Hi All,
    Hopefully somebody can help / point me in the right direction. I'm testing the process of upgrading our R12.0.5 Financials (Database 10.2.0.4) to R12.1.3 and have hit a problem when applying the 12.1.1 Maintenance Pack.
    The worker has failed with the following in it's log file.
    "sqlplus -s APPS/***** @/u01/app/applmgr/CGSYSTST/apps/apps_st/appl/msd/12.0.0/patch/115/sql/MSDODPCODE.sql
    begin
    ERROR at line 1:
    ORA-33290: Analytic workspace ODPCODE cannot be attached in the mode you requested because another user has it attached in an incompatible mode.
    ORA-06512: at "SYS.DBMS_AW", line 67
    ORA-06512: at "SYS.DBMS_AW", line 131
    ORA-06512: at "SYS.DBMS_AW", line 792
    ORA-06512: at "SYS.DBMS_AW", line 767
    ORA-06512: at "APPS.MSD_AW_LOADER", line 10
    ORA-06512: at line 3"
    It might be worth noting that I also hit the same problem when testing RUP 6 for R12.0.6 - it was partially because of this that I decided to scrap going to 12.0.6 1st and go straight to R12.1.3 - making it a much bigger upgrade.
    Thanks
    Andy

    Hi Taher,
    1st few lines from /u01/app/oracle/CGSYSTST/db/tech_st/10.2.0/admin/CGSYSTST_trinity/udump/cgsystst_ora_7942.trc are....
    Dump file /u01/app/oracle/CGSYSTST/db/tech_st/10.2.0/admin/CGSYSTST_trinity/udump/cgsystst_ora_7942.trc
    Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production With the Partitioning, OLAP, Data Mining and Real Application Testing options ORACLE_HOME = /u01/app/oracle/CGSYSTST/db/tech_st/10.2.0
    System name: Linux
    Node name: TRINITY
    Release: 2.6.16.60-0.39.3-smp
    Version: #1 SMP Mon May 11 11:46:34 UTC 2009
    Machine: x86_64
    Instance name: CGSYSTST
    Redo thread mounted by this instance: 1
    Oracle process number: 17
    Unix process pid: 7942, image: oracle@TRINITY
    *** ACTION NAME:() 2011-03-07 12:07:03.718
    *** MODULE NAME:(SQL*Plus) 2011-03-07 12:07:03.718
    *** SERVICE NAME:(CGSYSTST) 2011-03-07 12:07:03.718
    *** SESSION ID:(341.32826) 2011-03-07 12:07:03.718 Exception signal: 11 (SIGSEGV), code: 1 (Address not mapped to object), addr: 0x2af815d5ce17, PC: [0x2af713076608, intelfast_memcpy.A()+10]
    *** 2011-03-07 12:07:03.718
    ksedmp: internal or fatal error
    ORA-07445: exception encountered: core dump [_intel_fast_memcpy.A()+10] [SIGSEGV] [Address not mapped to object] [0x2AF815D5CE17] [] [] Current SQL statement for this session:
    begin
    -- attach code aw
    msd_aw_loader.attach_code_aw;
    -- create temp marker variable to prevent individual scripts from updating
    dbms_aw.execute('define _noupdate session boolean'); end;
    Andy

  • Stucked between SQL Tuning Advisor and and SQL statement

    Hi,
    There is an important query running on my system which consists
    MEMBER OF function.
    At first place let me explain why i used MEMBER OF,
    I am sending a string( eg : #123#124#125) to query and a function converts this string into a number array.
    After then I use this number array inside my sql.
    The reason I am using this structure, in order to generate a dynamic IN statement inside my sql. (IF you have any other solution that would be great)
    The most important point is; when I put this statement to SQL Tuning Advisor the response is only ORA-00932: inconsistent datatypes: expected UDT got CHAR
    Any answer will be greatly appreciated.
    Thanks

    Solomon Yakobson wrote:
    Object oriented stuff almost never provides better performance over relational. You should stay away from MEMBER OF if performance is a factor. Instead of:
    WHERE expr MEMBER OF nested-tableI'd test:
    WHERE expr IN (SELECT column_value FROM TABLE(nested-table))SY.
    expr IN (SELECT COLUMN_VALUE FROM TABLE (CAST (v_type_number_table AS type_number_table)))worked like a charm. i hope tuning advisor will like it as i do.
    thanks.

  • Oracle 10g SQL Tuning Advisor

    I am working as a junior DBA. I tried to tune a query using SQL Tuning Advisor that is with DBMS_SQLTUNE.I have created the tuning task successfully with DBMS_SQLTUNE.create_tuning_task.But when i execute the tuning task with EXEC DBMS_SQLTUNE.execute_tuning_task() i got an error like
    SQL> EXEC DBMS_SQLTUNE.execute_tuning_task(task_name => 'rep_three');
    BEGIN DBMS_SQLTUNE.execute_tuning_task(task_name => 'rep_three'); END;
    ERROR at line 1:
    ORA-00081: address range [0x60000000000A7D70, 0x60000000000A7D74) is not
    readable
    ORA-00600: internal error code, arguments: [kesatmGetSqlStats:optCost], [], [],
    ORA-06512: at "SYS.PRVT_ADVISOR", line 1624
    ORA-06512: at "SYS.DBMS_ADVISOR", line 186
    ORA-06512: at "SYS.DBMS_SQLTUNE", line 1008
    ORA-06512: at line 1The oracle version is Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - 64bi. The OS is HP-UX. The version is HP-UX B.11.23 U ia64.
    I tried to execute DBMS_SQLTUNE as DWH user.I have granted the advisor,DROP ANY SQL PROFILE,ALTER ANY SQL PROFILE,CREATE ANY SQL PROFILE privileges and DBA roles to the DWH user. The way i ran DBMS_SQLTUNE is, first i logged in as DWH user and i tried to execute the query for getting the SQL_ID for the query. For getting the SQL_ID i selected the SQL_ID column value for the DWH user session from v$session.I kept that query executing and meanwhile i opened another session as DWH user and created the tuning task as follows
    DECLARE
      l_sql_tune_task_id  VARCHAR2(100);
    BEGIN
      l_sql_tune_task_id := DBMS_SQLTUNE.create_tuning_task (
                              sql_id      => 'b65fj39dkkb9v',
                              scope       => DBMS_SQLTUNE.scope_limited,
                              time_limit  => 3600,
                              task_name   => 'rep_three',
                              description => 'Report Tuning');
      DBMS_OUTPUT.put_line('l_sql_tune_task_id: ' || l_sql_tune_task_id);
    END;
    /The creation of tuning task was successful.And i executed the tuning task as follows
    EXEC DBMS_SQLTUNE.execute_tuning_task(task_name => 'rep_three');The above mentioned errors came when i executed the tuning task.
    I am also adding the query which i have tried to tune
    select * from dwh.beneficiary_dim BEN_DIM,
                     (Select adr_dp_id,
                   adr_account_no,
                   ADR_ADDRESS_LINE_1 || ' ' ||
                   ADR_ADDRESS_LINE_2 || ' ' ||
                   ADR_ADDRESS_LINE_3 || ' ' ||
                   ADR_ADDRESS_LINE_4 as ADDRESS,
                   adr_pin_code,adr_phone_no,adr_fax_no
              from dwh.beneficiary_address_dim where adr_type_id = 1) PERMANENT_ADD_DIM,
           (Select adr_dp_id,
                   adr_account_no,
                   ADR_ADDRESS_LINE_1 || ' ' ||
                   ADR_ADDRESS_LINE_2 || ' ' ||
                   ADR_ADDRESS_LINE_3 || ' ' ||
                   ADR_ADDRESS_LINE_4 as ADDRESS,
                   adr_pin_code,adr_phone_no,adr_fax_no
              from dwh.beneficiary_address_dim where adr_type_id = 2) BANK_ADD_DIM,
           (Select adr_dp_id,
                   adr_account_no,
                   ADR_ADDRESS_LINE_1 || ' ' ||
                   ADR_ADDRESS_LINE_2 || ' ' ||
                   ADR_ADDRESS_LINE_3 || ' ' ||
                   ADR_ADDRESS_LINE_4 as ADDRESS,
                   adr_pin_code,adr_phone_no,adr_fax_no
              from dwh.beneficiary_address_dim where adr_type_id = 3) NOM_GUARDIAN_ADD_DIM,
           (Select adr_dp_id,
                   adr_account_no,
                   ADR_ADDRESS_LINE_1 || ' ' ||
                   ADR_ADDRESS_LINE_2 || ' ' ||
                   ADR_ADDRESS_LINE_3 || ' ' ||
                   ADR_ADDRESS_LINE_4 as ADDRESS,
                   adr_pin_code,adr_phone_no,adr_fax_no
              from dwh.beneficiary_address_dim where adr_type_id = 4) CORR_ADD_DIM,
           (Select adr_dp_id,
                   adr_account_no,
                   ADR_ADDRESS_LINE_1 || ' ' ||
                   ADR_ADDRESS_LINE_2 || ' ' ||
                   ADR_ADDRESS_LINE_3 || ' ' ||
                   ADR_ADDRESS_LINE_4 as ADDRESS,
                   adr_pin_code,adr_phone_no,adr_fax_no
              from dwh.beneficiary_address_dim where adr_type_id = 6) MINOR_ADDRESS,
                     (Select rp.requestid as requestid,
    decode(rp.value,'ALL','ALL','','ALL',decode(substr(rp.value,1,instr(rp.value,'|',1,1)-1),'','ALL',substr(rp.value,1,instr(rp.value,'|',1,1)-1))) as Name,
    decode(rp.value,'ALL','ALL','','ALL',decode(substr(rp.value,(instr(rp.value,'|',1,1)+1),((instr(rp.value,'|',1,2))-(instr(rp.value,'|',1,1)+1))),'','ALL',substr(rp.value,(instr(rp.value,'|',1,1)+1),((instr(rp.value,'|',1,2))-(instr(rp.value,'|',1,1)+1))))) as Address,
    decode(rp.value,'ALL','ALL','','ALL',decode(substr(rp.value,(instr(rp.value,'|',1,2)+1)),'','ALL',substr(rp.value,(instr(rp.value,'|',1,2)+1)))) as PAN
                      from disadmin.requestparameters rp, disadmin.requestparameters rps, disadmin.reportrequests rr
                     where rp.parameterid = 'CNAS_PARAM_VALUE'   
                       and rr.status = 'A'
                       and rp.requestid = rr.id
                       and rp.id = rps.id) P_PARAM_VALUE,
                     (Select rp.requestid as requestid, rp.value as Type
                        from disadmin.requestparameters rp, disadmin.reportrequests rr
                       where rp.parameterid = 'CNAS_NAME_TYPE'
                         and rr.status = 'A'
                         and rp.requestid = rr.id)  P_NAME_TYPE,
                     (Select rp.requestid as requestid, rp.value as Addtype
                        from disadmin.requestparameters rp, disadmin.reportrequests rr
                       where rp.parameterid = 'CNAS_ADDRESS_TYPE'
                         and rr.status = 'A'
                         and rp.requestid = rr.id) P_ADDRESS_TYPE    
       where ( 1= case when P_NAME_TYPE.Type = 'F' then
                   case when BEN_DIM.BDM_FIRST_HOLDER_NAME like DECODE(P_PARAM_VALUE.Name,'ALL','%'||BEN_DIM.BDM_FIRST_HOLDER_NAME||'%','%'||P_PARAM_VALUE.Name||'%')
                             or BEN_DIM.BDM_FIRST_HOLDER_SURNAME like DECODE(P_PARAM_VALUE.Name,'ALL','%'||BEN_DIM.BDM_FIRST_HOLDER_SURNAME||'%','%'||P_PARAM_VALUE.Name||'%')
                        then 1
                   else null end
                 else            
                   case when P_NAME_TYPE.Type = 'ALL' then
                     case when (BEN_DIM.BDM_FIRST_HOLDER_NAME like DECODE(P_PARAM_VALUE.Name,'ALL','%'||BEN_DIM.BDM_FIRST_HOLDER_NAME||'%','%'||P_PARAM_VALUE.Name||'%')
                                or BEN_DIM.BDM_FIRST_HOLDER_SURNAME like DECODE(P_PARAM_VALUE.Name,'ALL','%'||BEN_DIM.BDM_FIRST_HOLDER_SURNAME||'%','%'||P_PARAM_VALUE.Name||'%'))
                                and BEN_DIM.BDM_SECOND_HOLDER_NAME like DECODE(P_PARAM_VALUE.Name,'ALL','%'||BEN_DIM.BDM_SECOND_HOLDER_NAME||'%','%'||P_PARAM_VALUE.Name||'%')
                                and BEN_DIM.BDM_THIRD_HOLDER_NAME like DECODE(P_PARAM_VALUE.Name,'ALL','%'||BEN_DIM.BDM_THIRD_HOLDER_NAME||'%','%'||P_PARAM_VALUE.Name||'%')
                          then 1
                     else null end
                   else null end 
                 end )                    
         and BEN_DIM.BDM_IT_PAN like DECODE(P_PARAM_VALUE.PAN,'ALL','%'||BEN_DIM.BDM_IT_PAN||'%','%'||P_PARAM_VALUE.PAN||'%')
         and (1 = case when P_ADDRESS_TYPE.ADDTYPE = 1 then
                         case when instr(PERMANENT_ADD_DIM.ADDRESS, DECODE(P_PARAM_VALUE.ADDRESS,'ALL',PERMANENT_ADD_DIM.ADDRESS, P_PARAM_VALUE.ADDRESS)) <> 0
                              then 1
                         else null end
                       when P_ADDRESS_TYPE.ADDTYPE = 3 then
                         case when instr(NOM_GUARDIAN_ADD_DIM.ADDRESS, DECODE(P_PARAM_VALUE.ADDRESS,'ALL',NOM_GUARDIAN_ADD_DIM.ADDRESS, P_PARAM_VALUE.ADDRESS)) <> 0 
                           then 1
                         else null end 
                       when P_ADDRESS_TYPE.ADDTYPE = 4 then
                         case when instr(CORR_ADD_DIM.ADDRESS, DECODE(P_PARAM_VALUE.ADDRESS,'ALL',CORR_ADD_DIM.ADDRESS, P_PARAM_VALUE.ADDRESS)) <> 0 
                           then 1
                         else null end
                       when P_ADDRESS_TYPE.ADDTYPE = 6 then
                         case when instr(MINOR_ADDRESS.ADDRESS, DECODE(P_PARAM_VALUE.ADDRESS,'ALL',MINOR_ADDRESS.ADDRESS, P_PARAM_VALUE.ADDRESS)) <> 0 
                           then 1
                         else null end 
                  else null end );The above query also tries to access some tables from another user DISADMIN. Could you please help me in solving this problem while using SQL Tuning Advisor ? I am the only DBA here.

    will the rows really be updated just by using the package?Considering DMLs
    SQL> select * from test
      2  /
            NO
             1
             2
    SQL> ed
    Wrote file afiedt.buf
      1  DECLARE
      2   my_task_name VARCHAR2(30);
      3  my_sqltext   CLOB;
      4  BEGIN
      5  my_sqltext := 'insert into test values (3)';
      6  my_task_name := DBMS_SQLTUNE.CREATE_TUNING_TASK(
      7   sql_text    => my_sqltext,
      8  task_name   => 'my_sql_tuning_task');
      9* end;
    SQL> /
    PL/SQL procedure successfully completed.
    SQL> BEGIN
      2  DBMS_SQLTUNE.EXECUTE_TUNING_TASK( task_name => 'my_sql_tuning_task' );
      3  END;
      4  /
    PL/SQL procedure successfully completed.
    SQL> select * from test
      2  /
            NO
             1
             2
    SQL> SELECT DBMS_SQLTUNE.REPORT_TUNING_TASK( 'my_sql_tuning_task')
      2    FROM DUAL;
    DBMS_SQLTUNE.REPORT_TUNING_TASK('MY_SQL_TUNING_TASK')
    GENERAL INFORMATION SECTION
    Tuning Task Name   : my_sql_tuning_task
    Tuning Task Owner  : TEST
    Scope              : COMPREHENSIVE
    Time Limit(seconds): 1800
    Completion Status  : COMPLETED
    Started at         : 03/27/2008 05:16:14
    Completed at       : 03/27/2008 05:16:16
    DBMS_SQLTUNE.REPORT_TUNING_TASK('MY_SQL_TUNING_TASK')
    Schema Name: TEST
    SQL ID     : gwkmgmyj9824t
    SQL Text   : insert into test values (3)
    There are no recommendations to improve the statement.
    -------------------------------------------------------------------------------Adith

  • SQL Tuning Advisor  Error

    I wanted to use the SQL Tuning Advisor feature of the SQL Worksheet. The DBA granted me ADVISOR system privilege. But when I tried to use the feature, I get the following errors:
    An error was encountered performing the requested operation:
    ORA-06550: line 20, column 101:
    PLS-00103: Encountered the symbol "ANYDATA" when expecting one of the folllowing:
    .(),*%&=-+</> at in is mod remainder not rem
    <an exponenet (**) <> or != or ~= >= <> and or like LIKE2_
    LIKE4_LIKEC_between|| multiset member SUBMULTISET_
    The symbol "." was substituted for "ANYDATA" to continue.
    ORA-6550: line 20, column 140:
    PLS-00103: Encountered the symbol "ANYDATA" when expecting one of the folllowing:
    .(),*%&=-+</> at in is mod remainder not rem
    <an exponenet (**) <> or != or ~= >= <> and or like LIKE2_
    LIKE4_LIKEC_between|| mul
    ORA-6550:line 20, column 179:
    PLS-00103: Encountered the symbol "ANYDATA" when expecting one of the folllowing:
    .(),*%&=-+</> at in is mod remainder not rem
    <an exponenet (**) <> or != or ~= >= <> and or like LIKE2_
    LIKE4_LIKEC_between|| multiset
    06550,00000 - "line %s, column %s:\n%s"
    *Cause: Usually a PL/SQL compilation error.
    *Action:
    Vendor code 6550Then I get this right after the previous one:
    An error was encountered performing the requested operation:
    ORA-13605: The specified task or boject staName12325 does not exist for the current user.
    ORA-06512: at "SYS.DBMS_SYS_ERROR", line 86
    ORA-06512: at "SYS.PRVT_ADVISOR", line 4841
    ORA-06512: at "SYS.DBMS_SQLTUNE", line 1093
    ORA-06512: at line 2
    13605.0000 - "The specified task or object %s does not exist for the current user."
    *Cause:   The user attempted to reference an advisor task or object
        using a anme that does not exist in the Advisor repository.
    *Action:  Adjust the name and retry the operation.
    Vendor code 13605Can someone please help me? I am not a DBA so I stumped by these error codes.
    Oracle SQL Developer 3.0.04 Build MAIn-04.34
    Oracle Database 10g Enterprise Edition Release 10.2.0.5.0
    Robert

    The query is
    select      "V_CDR_OUTGOING_CALLS"."FIRST_NAME" as "FIRST_NAME",
          "V_CDR_OUTGOING_CALLS"."MIDDLE_INITIAL" as "MIDDLE_INITIAL",
          "V_CDR_OUTGOING_CALLS"."LAST_NAME" as "LAST_NAME",
          "V_CDR_OUTGOING_CALLS"."ORG_UNIT" as "ORG_UNIT",
          "V_CDR_OUTGOING_CALLS"."DEPT_DESC" as "DEPT_DESC",
          "V_CDR_OUTGOING_CALLS"."FROM_NUMBER" as "FROM_NUMBER",
          "V_CDR_OUTGOING_CALLS"."TO_NUMBER" as "TO_NUMBER",
          "V_CDR_OUTGOING_CALLS"."TO_CITY" as "TO_CITY",
          "V_CDR_OUTGOING_CALLS"."TO_STATE" as "TO_STATE",
          "V_CDR_OUTGOING_CALLS"."DATETIME_CONNECT" as "DATETIME_CONNECT",
          "V_CDR_OUTGOING_CALLS"."DURATION_MIN" as "DURATION_MIN"
    from      "V_CDR_OUTGOING_CALLS" "V_CDR_OUTGOING_CALLS"
    where :P12_PHONE_NUMBER  = FROM_NUMBER or :P12_PHONE_NUMBER = TO_NUMBER
    AND "V_CDR_OUTGOING_CALLS"."DATETIME_CONNECT" BETWEEN to_date(:P12_START_DATE,'MM/DD/YYYY') AND to_date(:P12_END_DATE,'MM/DD/YYYY')The view is
    CREATE OR REPLACE FORCE VIEW "VOIP"."V_CDR_OUTGOING_CALLS" ("ID", "EMPID", "FIRST_NAME", "MIDDLE_INITIAL", "LAST_NAME", "ORG_UNIT", "DEPT_DESC", "PHONE", "FROM_NUMBER", "TO_NUMBER", "TO_CITY", "TO_STATE", "DATETIME_CONNECT", "DATETIME_DISCONNECT", "DURATION_SEC", "DURATION_MIN")
    AS
      SELECT c.ID,
        e.empid empid,
        e.first_name,
        e.middle_initial,
        e.last_name,
        e.org_descr,
        e.dept_desc,
        e.full_telephone,
        c.from_number,
        c.to_number,
        x.city to_city,
        x.state to_state,
        c.datetime_connect,
        c.datetime_disconnect,
        c.duration_sec,
        c.duration_min
      FROM v_cdr c ,
        v_cdr_emp e,
        telephone_exchanges x
      WHERE c.from_number         = e.phone
      AND SUBSTR(c.to_number,1,7) = x.EXCHANGE
      AND LENGTH(c.to_number)     > 7;The table and views are defined as:
    CREATE TABLE "VOIP"."TELEPHONE_EXCHANGES"
        "EXCHANGE" VARCHAR2(7 BYTE) NOT NULL ENABLE,
        "CITY"     VARCHAR2(200 BYTE),
        "STATE"    VARCHAR2(2 BYTE),
        CONSTRAINT "TELEPHONE_EXCHANGES_PK" PRIMARY KEY ("EXCHANGE") USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "VOIPDATA" ENABLE
      PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING STORAGE
        INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT
      TABLESPACE "VOIPDATA" ;
    CREATE OR REPLACE FORCE VIEW "VOIP"."V_CDR" ("ID", "FROM_NUMBER", "TO_NUMBER", "DATETIME_CONNECT", "DATETIME_DISCONNECT", "DURATION_SEC", "DURATION_MIN", "PKID", "DATE_OF_CALL")
    AS
      SELECT ID,
        DECODE( LENGTH(CALLINGPARTYNUMBER),6, SUBSTR(CALLINGPARTYNUMBER,1,2)
        || '-'
        ||SUBSTR(CALLINGPARTYNUMBER,3) ,10, SUBSTR(CALLINGPARTYNUMBER,1,3)
        || '-'
        ||SUBSTR(CALLINGPARTYNUMBER,4,3)
        || '-'
        ||SUBSTR(CALLINGPARTYNUMBER,7) ,CALLINGPARTYNUMBER)FROM_NUMBER,
        DECODE( LENGTH(ORIGINALCALLEDPARTYNUMBER), 6, SUBSTR( ORIGINALCALLEDPARTYNUMBER,1,2)
        || '-'
        ||SUBSTR(ORIGINALCALLEDPARTYNUMBER,3) , 10, SUBSTR( ORIGINALCALLEDPARTYNUMBER,1,3)
        || '-'
        ||SUBSTR(ORIGINALCALLEDPARTYNUMBER,4,3)
        || '-'
        ||SUBSTR(ORIGINALCALLEDPARTYNUMBER,7) , 12, SUBSTR( ORIGINALCALLEDPARTYNUMBER,3,3)
        || '-'
        ||SUBSTR(ORIGINALCALLEDPARTYNUMBER,6,3)
        || '-'
        ||SUBSTR(ORIGINALCALLEDPARTYNUMBER,9) , ORIGINALCALLEDPARTYNUMBER) TO_NUMBER,
        new_time(to_date(TO_CHAR(to_date('01.01.70','dd.mm.rr')+ (DATETIMECONNECT/( 60 *60*24)), 'mm-dd-yyyy hh24:mi:ss'),'mm-dd-yyyy hh24:mi:ss'),'GMT','EDT') DATETIME_CONNECT,
        new_time(to_date(TO_CHAR(to_date('01.01.70','dd.mm.rr')+ ( DATETIMEDISCONNECT /(60*60*24)), 'mm-dd-yyyy hh24:mi:ss'),'mm-dd-yyyy hh24:mi:ss'),'GMT','EDT') DATETIME_DISCONNECT,
        duration Duration_sec,
        ROUND(duration/60,2) Duration_MIN,
        pkid,
        to_date(TO_CHAR(new_time(to_date(TO_CHAR(to_date('01.01.70','dd.mm.rr')+ (DATETIMECONNECT/( 60 *60*24)), 'mm-dd-yyyy hh24:mi:ss'),'mm-dd-yyyy hh24:mi:ss'),'GMT','EDT'),'DD-MON-YYYY')) date_of_call
      FROM CALL_DETAILS_CDR C
      WHERE datetimeconnect <> 0;
    The above view is based on table CALL_DETAILS_CDR defined as:
    CREATE TABLE "VOIP"."CALL_DETAILS_CDR"
        "ID"                             NUMBER NOT NULL ENABLE,
        "CDRRECORDTYPE"                  NUMBER,
        "G_CALLMANAGERID"                NUMBER,
        "G_CALLID"                       NUMBER,
        "O_LEGCALLIDENTIFIER"            NUMBER,
        "DATETIMEORIGINATION"            NUMBER,
        "O_NODEID"                       NUMBER,
        "O_SPAN"                         NUMBER,
        "O_IPADDR"                       NUMBER,
        "CALLINGPARTYNUMBER"             VARCHAR2(50 BYTE),
        "CALLINGPARTY_USERID"            VARCHAR2(128 BYTE),
        "O_CAUSE_LOCATION"               NUMBER,
        "O_CAUSE_VALUE"                  NUMBER,
        "O_PRECEDENCELEVEL"              NUMBER,
        "O_MEDIATRANSPORTADDR_IP"        NUMBER,
        "O_MEDIATRANSPORTADDR_PORT"      NUMBER,
        "O_MCAP_PAYLOADCAPABILITY"       NUMBER,
        "O_MCAP_MAXFRAMESPERPACKET"      NUMBER,
        "O_MCAP_G723BITRATE"             NUMBER,
        "O_VCAP_CODEC"                   NUMBER,
        "O_VCAP_BANDWIDTH"               NUMBER,
        "O_VCAP_RESOLUTION"              NUMBER,
        "O_VIDEOTRANSPORTADDR_IP"        NUMBER,
        "O_VIDEOTRANSPORTADDR_PORT"      NUMBER,
        "O_RSVPAUDIOSTAT"                VARCHAR2(64 BYTE),
        "O_RSVPVIDEOSTAT"                VARCHAR2(64 BYTE),
        "DESTLEGIDENTIFIER"              NUMBER,
        "DESTNODEID"                     NUMBER,
        "DESTSPAN"                       NUMBER,
        "DESTIPADDR"                     NUMBER,
        "ORIGINALCALLEDPARTYNUMBER"      VARCHAR2(50 BYTE),
        "FINALC_PARTYNUMBER"             VARCHAR2(50 BYTE),
        "FINALC_PARTY_USERID"            VARCHAR2(128 BYTE),
        "DESTCAUSE_LOCATION"             NUMBER,
        "DESTCAUSE_VALUE"                NUMBER,
        "DESTPRECEDENCELEVEL"            NUMBER,
        "DESTMEDIATRANSPORTADDR_IP"      NUMBER,
        "DESTMEDIATRANSPORTADDR_PORT"    NUMBER,
        "DESTMCAP_PAYLOADCAPABILITY"     NUMBER,
        "DESTMCAP_MAXFRAMESPERPACKET"    NUMBER,
        "DESTMCAP_G723BITRATE"           NUMBER,
        "DV_CAP_CODEC"                   NUMBER,
        "DV_CAP_BANDWIDTH"               NUMBER,
        "DV_CAP_RESOLUTION"              NUMBER,
        "DV_TRANSPORTADDR_IP"            NUMBER,
        "DV_TRANSPORTADDR_PORT"          NUMBER,
        "DESTRSVPAUDIOSTAT"              VARCHAR2(64 BYTE),
        "DESTRSVPVIDEOSTAT"              VARCHAR2(64 BYTE),
        "DATETIMECONNECT"                NUMBER,
        "DATETIMEDISCONNECT"             NUMBER,
        "LASTREDIRECTDN"                 VARCHAR2(50 BYTE),
        "PKID"                           VARCHAR2(4000 BYTE),
        "O_INALCALLEDPARTYNUM_PARTITION" VARCHAR2(50 BYTE),
        "CALLINGPARTYNUM_PARTITION"      VARCHAR2(50 BYTE),
        "FINALC_PARTYNUM_PARTITION"      VARCHAR2(50 BYTE),
        "LASTREDIRECTDNPARTITION"        VARCHAR2(50 BYTE),
        "DURATION"                       NUMBER,
        "O_DEVICENAME"                   VARCHAR2(129 BYTE),
        "DESTDEVICENAME"                 VARCHAR2(129 BYTE),
        "O_CALLTERMINATION_BEHALF"       NUMBER,
        "DESTCALLTERMINATION_BEHALF"     NUMBER,
        "O_CALLEDPARTYREDIRECT_BEHALF"   NUMBER,
        "LASTREDIRECTREDIRECT_BEHALF"    NUMBER,
        "O_CALLEDPARTYREDIRECTREASON"    NUMBER,
        "LASTREDIRECTREDIRECTREASON"     NUMBER,
        "DESTCONVERSATIONID"             NUMBER,
        "G_CALLID_CLUSTERID"             VARCHAR2(50 BYTE),
        "JOIN_BEHALF"                    NUMBER,
        "COMMENTS"                       VARCHAR2(2048 BYTE),
        "AUTHCODEDESCRIPTION"            VARCHAR2(50 BYTE),
        "AUTHORIZATIONLEVEL"             NUMBER,
        "CLIENTMATTERCODE"               VARCHAR2(32 BYTE),
        "O_DTMFMETHOD"                   NUMBER,
        "DESTDTMFMETHOD"                 NUMBER,
        "CALLSECUREDSTATUS"              NUMBER,
        "O_CONVERSATIONID"               NUMBER,
        "O_MCAP_BANDWIDTH"               NUMBER,
        "DESTMCAP_BANDWIDTH"             NUMBER,
        "AUTHORIZATIONCODEVALUE"         VARCHAR2(32 BYTE),
        "OUTPULSEDCALLINGPARTYNUMBER"    VARCHAR2(50 BYTE),
        "OUTPULSEDCALLEDPARTYNUMBER"     VARCHAR2(50 BYTE),
        "O_IPV4V6ADDR"                   VARCHAR2(64 BYTE),
        "DESTIPV4V6ADDR"                 VARCHAR2(64 BYTE),
        "O_VCAP_CODEC_CHAN2"             NUMBER,
        "O_VCAP_BANDWIDTH_CHAN2"         NUMBER,
        "O_VCAP_RESOLUTION_CHAN2"        NUMBER,
        "O_V_TRANSPORTADDR_IP_CHAN2"     NUMBER,
        "O_V_TRANSPORTADDR_PORT_CHAN2"   NUMBER,
        "O_V_OCHANNEL_ROLE_CHAN2"        NUMBER,
        "DV_CAP_CODEC_CHAN2"             NUMBER,
        "DV_CAP_BANDWIDTH_CHAN2"         NUMBER,
        "DV_CAP_RESOLUTION_CHAN2"        NUMBER,
        "DV_TRANSPORTADDR_IP_CHAN2"      NUMBER,
        "DV_TRANSPORTADDR_PORT_CHAN2"    NUMBER,
        "DV_CHANNEL_ROLE_CHAN2"          NUMBER,
        "DATE_CREATED" DATE,
        CONSTRAINT "CALL_DETAILS_CDR_PK" PRIMARY KEY ("ID") USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "VOIPDATA" ENABLE,
        CONSTRAINT "PKID_UNIQUE" UNIQUE ("PKID") USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 167 COMPUTE STATISTICS STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "VOIPDATA" ENABLE
      PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING STORAGE
        INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT
      TABLESPACE "VOIPDATA" ;
    CREATE INDEX "VOIP"."CALL_DETAILS_CDR_INDEX3" ON "VOIP"."CALL_DETAILS_CDR"
        "ORIGINALCALLEDPARTYNUMBER",
        "DATETIMECONNECT"
      PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS STORAGE
        INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT
      TABLESPACE "VOIPDATA" ;
    CREATE INDEX "VOIP"."CALL_DETAILS_CDR_INDEX2" ON "VOIP"."CALL_DETAILS_CDR"
        "CALLINGPARTYNUMBER",
        "DATETIMECONNECT"
      PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS STORAGE
        INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT
      TABLESPACE "VOIPDATA" ;
    CREATE UNIQUE INDEX "VOIP"."CALL_DETAILS_CDR_PK" ON "VOIP"."CALL_DETAILS_CDR"
        "ID"
      PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS STORAGE
        INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT
      TABLESPACE "VOIPDATA" ;
    CREATE UNIQUE INDEX "VOIP"."PKID_UNIQUE" ON "VOIP"."CALL_DETAILS_CDR"
        "PKID"
      PCTFREE 10 INITRANS 2 MAXTRANS 167 COMPUTE STATISTICS STORAGE
        INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT
      TABLESPACE "VOIPDATA" ;
    The view, V_CDR_EMP, is defined as:
    CREATE OR REPLACE FORCE VIEW "VOIP"."V_CDR_EMP" ("EMPID", "FIRST_NAME", "MIDDLE_INITIAL", "LAST_NAME", "ORG", "ORG_DESCR", "DEPT", "DEPT_DESC", "ADDRESS", "PHONE", "FULL_TELEPHONE")
    AS
      SELECT e.empid,
        e.First_name,
        e.Middle_Initial,
        e.Last_name,
        e.Org,
        o.org_descr,
        e.Dept,
        d.Dept_desc,
        e.Address,
        DECODE (SUBSTR(e.address,1,6),'ONEMAD','10-'
        || SUBSTR (e.telephone,9), '225PAS','10-'
        || SUBSTR (e.telephone,9), '233PAS','10-'
        || SUBSTR (e.telephone,9), '115BWA','10-'
        || SUBSTR (e.telephone,9), DECODE(SUBSTR(e.address,1,4),'PATC','11-'
        || SUBSTR (e.telephone,9), 'JAMS','12-'
        || SUBSTR (e.telephone,9), 'JSTC','12-'
        || SUBSTR (e.telephone,9), 'PABT','19-'
        || SUBSTR (e.telephone,9), 'TLPT','08-'
        || SUBSTR (e.telephone,9), 'HCMF','12-'
        || SUBSTR (e.telephone,9), DECODE(SUBSTR(e.address,1,3),'GWB','17-'
        || SUBSTR (e.telephone,9), 'LGA','13-'
        || SUBSTR (e.telephone,9), 'EWR','14-'
        || SUBSTR (e.telephone,9), 'JFK','15-'
        || SUBSTR (e.telephone,9), 'SIB','18-'
        || SUBSTR (e.telephone,9), 'MVP','14-'
        || SUBSTR (e.telephone,9), 'WTC','10-'
        || SUBSTR (e.telephone,9), 'CON','12-'
        || SUBSTR (e.telephone,9), DECODE(SUBSTR(e.address,1,2),'HT','11-'
        || SUBSTR (e.telephone,9), 'BP','06-'
        || SUBSTR (e.telephone,9), 'LT','16-'
        || SUBSTR (e.telephone,9), 'PN','07-'
        || SUBSTR (e.telephone,9), DECODE(SUBSTR(e.address,1,5),'2GWAY','04-'
        || SUBSTR (e.telephone,9), '3GWAY','04-'
        || SUBSTR (e.telephone,9), DECODE(SUBSTR(e.address,1,10),'PORT IVORY','07-'
        || SUBSTR (e.telephone,9),e.telephone) ) ) ) ) ) phone,
        e.telephone full_telephone
      FROM [email protected] e ,
        [email protected] d ,
        [email protected] o
      WHERE e.active = 'Y'
      AND e.dept     = d.dept
      AND e.org      = o.org;Robert

  • Date object doesn't work in query filters

    I'm trying to create a universe object called Next Biweekly Pay End Date.  Some background: there is an end date for our biweekly payrolls every 14 days, and the logic behind the object is basically that if there was a biweekly pay end date 7 days ago, the next one is 7 days from today (that is, sysdate + 7), etc.</p>
    I have it working so that it displays the correct date when used in a WebI report.  However, when I use it in a query filter in a WebI report (like, Pay End Date = Next Biweekly Pay End Date), I don't get an error, but I also don't get any data.  Somehow my object doesn't work in a query filter.  The purpose of the object is for use in query filters, so I need to get this to work.</p>
    My best guess about why it doesn't work in a query filter is due to some issue with the data type.  Pay End Date has a data type of date in the universe.  I gave Next Biweekly Pay End Date a data type of date also, but the query filter still doesn't work; I get "no data to fetch."</p>
    We're using XI 3.1.6 and Oracle 10.  Any ideas about how to get this to work?</p>
    If it helps, here is the definition of Next Biweekly Pay End Date.  The logic is that it takes today's date, subtracts Oct. 31, 2009 (a biweekly pay end date), divides by 14, and looks at the remainder.  If the remainder is 0, then today is a pay end date and the next one is 14 days from now.  If the remainder is 1, yesterday was a pay end date and the next one is 13 days from now, etc.</p>
    case</p>
      when mod((trunc(sysdate)) - (to_date('31/10/2009')),14) = 0 then (sysdate + 14)</p>
      when mod((trunc(sysdate)) - (to_date('31/10/2009')),14) = 1 then (sysdate + 13)</p>
      when mod((trunc(sysdate)) - (to_date('31/10/2009')),14) = 2 then (sysdate + 12)</p>
      when mod((trunc(sysdate)) - (to_date('31/10/2009')),14) = 3 then (sysdate + 11)</p>
      when mod((trunc(sysdate)) - (to_date('31/10/2009')),14) = 4 then (sysdate + 10)</p>
      when mod((trunc(sysdate)) - (to_date('31/10/2009')),14) = 5 then (sysdate + 9)</p>
      when mod((trunc(sysdate)) - (to_date('31/10/2009')),14) = 6 then (sysdate + 8)</p>
      when mod((trunc(sysdate)) - (to_date('31/10/2009')),14) = 7 then (sysdate + 7)</p>
      when mod((trunc(sysdate)) - (to_date('31/10/2009')),14) = 8 then (sysdate + 6)</p>
      when mod((trunc(sysdate)) - (to_date('31/10/2009')),14) = 9 then (sysdate + 5)</p>
      when mod((trunc(sysdate)) - (to_date('31/10/2009')),14) = 10 then (sysdate + 4)</p>
      when mod((trunc(sysdate)) - (to_date('31/10/2009')),14) = 11 then (sysdate + 3)</p>
      when mod((trunc(sysdate)) - (to_date('31/10/2009')),14) = 12 then (sysdate + 2)</p>
      when mod((trunc(sysdate)) - (to_date('31/10/2009')),14) = 13 then (sysdate + 1)</p>
    end

    Thanks for the suggestions.
    I did some more testing, and there seems to be something more complicated going on.  I ran the following code in SQL*Plus:
    SELECT distinct M_PYDW1.PYSTATUS.DW_OWNER,
    case
    when to_date(sysdate, 'dd/mm/yyyy hh24:mi:ss') >= to_date('01/01/2010','dd/mm/yyyy hh24:mi:ss') then To_Date((sysdate - 2),'dd/mm/yyyy')
    else to_date(sysdate +2, 'dd/mm/yyyy')
    end
    FROM M_PYDW1.PYSTATUS
    The condition should be true, because the sysdate (today is Jan. 20) is greater than 1/1/2010, so I should get a result of sysdate - 2 (Jan. 18).  But the result I get is Jan. 22 (sysdate +2).  It seems that the comparison is failing even though I'm formatting both sysdate and 1/1/2010 as dates with a timestamp.  What could cause that?
    One more mystery: when I run the same code as above in a WebI report (using custom SQL), I get the error ORA-1830, date format picture ends before converting entire input string.

  • Need help to debug SQL Tuning Advisor Error Message

    Hi,
    I am getting an error message while try to get recommendations from the SQL Tuning Advisor.
    Environment:
    Oracle Version:  11.2.0.3.0
    O/S: AIX
    Following is my code:
    declare
    my_task_name  varchar2 (30);
    my_sqltext    clob;
    begin
    my_sqltext := 'SELECT DISTINCT MRKT_AREA AS DIVISION, PROMO_ID,
                    PROMO_CODE,
                    RBR_DTL_TYPE.PERF_DETL_TYP, 
                    RBR_DTL_TYPE.PERF_DETL_DESC,
                    RBR_DTL_TYPE.PERF_DETL_SUB_TYP,
                    RBR_DTL_TYPE.PERF_DETL_SUB_DESC,
                    BU_SYS_ITM_NUM,
                    RBR_CPN_LOC_ITEM_ARCHIVE.CLI_SYS_ITM_DESC,
                    PROMO_START_DATE,
                    PROMO_END_DATE,
                    PROMO_VALUE2,
                    PROMO_VALUE1,
                    EXEC_COMMENTS,
                    PAGE_NUM,
                    BLOCK_NUM,
                    AD_PLACEMENT,
                    BUYER_CODE,
                    RBR_CPN_LOC_ITEM_ARCHIVE.CLI_STAT_TYP,
                    RBR_MASTER_CAL_ARCHIVE.STATUS_FLAG
    FROM  (PROMO_REPT_OWNER.RBR_CPN_LOC_ITEM_ARCHIVE
    INNER JOIN PROMO_REPT_OWNER.RBR_MASTER_CAL_ARCHIVE
    ON (RBR_CPN_LOC_ITEM_ARCHIVE.CLI_PROMO_ID = PROMO_ID)
    AND (RBR_CPN_LOC_ITEM_ARCHIVE.CLI_PERF_DTL_ID = PERF_DETAIL_ID)
    AND (RBR_CPN_LOC_ITEM_ARCHIVE.CLI_STR_NBR = STORE_ZONE)
    AND (RBR_CPN_LOC_ITEM_ARCHIVE.CLI_ITM_ID = ITM_ID))
    INNER JOIN PROMO_REPT_OWNER.RBR_DTL_TYPE
    ON (RBR_MASTER_CAL_ARCHIVE.PERF_DETL_TYP = RBR_DTL_TYPE.PERF_DETL_TYP)
    AND (RBR_MASTER_CAL_ARCHIVE.PERF_DETL_SUB_TYP = RBR_DTL_TYPE.PERF_DETL_SUB_TYP)
    WHERE ( ((MRKT_AREA)=40)
    AND ((RBR_DTL_TYPE.PERF_DETL_TYP)=1)
    AND ((RBR_DTL_TYPE.PERF_DETL_SUB_TYP)=1) )
    AND ((CLI_STAT_TYP)=1 Or (CLI_STAT_TYP)=6)
    AND ((RBR_MASTER_CAL_ARCHIVE.STATUS_FLAG)=''A'')
    AND ( ((PROMO_START_DATE) >= to_date(''2011-10-20'', ''YYYY-MM-DD'')
    And (PROMO_END_DATE) <= to_date(''2011-10-26'', ''YYYY-MM-DD'')) )
    ORDER BY MRKT_AREA';
    my_task_name := dbms_sqltune.create_tuning_task
                                 (sql_text => my_sqltext,
                                  user_name => 'PROMO_REPT_OWNER',
                                  scope     => 'COMPREHENSIVE',
                                  time_limit => 3600,
                                  task_name  => 'Test_Query',
                                  description  => 'Test Query');
    end;
    begin
      dbms_sqltune.execute_tuning_task(task_name => 'Test_Query');
    end;
    set serveroutput on size unlimited;
    set pagesize 5000
    set linesize 130
    set long 50000
    set longchunksize 500000
    SELECT DBMS_SQLTUNE.REPORT_TUNING_TASK('Test_Query') FROM DUAL;
    Output:
    snippet .....
    FINDINGS SECTION (1 finding)
    1- Index Finding (see explain plans section below)
    The execution plan of this statement can be improved by creating one or more
    indices.
    Recommendation (estimated benefit: 71.48%)
    - Consider running the Access Advisor to improve the physical schema design
    or creating the recommended index.
    Error: Cannot fetch actions for recommendation: INDEX
    Error: ORA-06502: PL/SQL: numeric or value error: character string buffer too small
    Rationale
    Creating the recommended indices significantly improves the execution plan
    of this statement. However, it might be preferable to run "Access Advisor"
    using a representative SQL workload as opposed to a single statement. This
    will allow to get comprehensive index recommendations which takes into
    account index maintenance overhead and additional space consumption.
    snippet
    Any ideas why I am getting ORA-06502 error?
    Thanks in advance
    Rogers

    Bug 14407401 - ORA-6502 from index recommendation section of DBMS_SQLTUNE output (Doc ID 14407401.8)
    Fixed:
    The fix for 14407401 is first included in
    12.1.0.1 (Base Release)

  • Count(*) in the loop doesn't work and I really don't know why...

    Hello,
    I can't figure out why the following doesn't work. I cannot debug for I do not have privileges on this server.
    The execution always fails on bolded line. If I substitute the variable with the table name itself it works. The variable is properly populated in each of the iterations as I can see it by using dbms_output package. The small but may be important detail may be I am connected as user A but the tables are in the schema B. However I can list the tables and their columns in all_tab_cols view and there are synonyms made in my schema which allow me to access the B tables without prefixing them.
    I get the error:
    Error report:
    ORA-00900: invalid SQL statement
    ORA-06512: at line 26
    00900. 00000 - "invalid SQL statement"
    *Cause:   
    *Action:
    I ran out of ideas and I do not have access to any of the Oracle instance to be able to debug right now.
    Variable type for v_tables is wrong? I do not have some magic privilege to use execute immediate with variable?
    Oracle server has a bad day today?
    The crap is 11.1.0.7 if it has anything to do with my problem.
    Please help if you can.
    Grzegorz
    declare
    v_number number := 646989;
    v_current_table nvarchar2(50);
    v_itemno number;
    type t is table of nvarchar2(50);
    v_tables t;
    begin
    dbms_output.put_line('Working...');
    select table_name bulk collect into v_tables from all_tab_cols where column_name = 'ITEMNO' order by table_name;
    for i in 1 .. v_tables.count loop
    dbms_output.put_line('Number: ' || i);
    v_current_table := v_tables(i);
    <b>execute immediate 'select count(*) from ' || v_current_table || ' where itemno = :a' into v_itemno using v_number;</b>
    if (v_itemno > 0) then
    dbms_output.put_line('Current table contains specific ITEMNO: ' || v_current_table);
    end if;
    end loop;
    end;

    In SQL Plus run this and see what SQL is your code returning. Then execute the SQL individually.
    set serveroutput on
    declare
         v_number number := 646989;
         v_current_table nvarchar2(50);
         v_itemno number;
         type t is table of nvarchar2(50);
         v_tables t;
         lSqlString varchar2(20000);
    begin
         select table_name
           bulk collect into v_tables
           from all_tab_cols
          where column_name = 'ITEMNO'
          order by table_name;
         for i in 1 .. v_tables.count loop
              v_current_table := v_tables(i);
              lSqlString := 'select count(*) from ' || v_current_table || ' where itemno = :a';
              dbms_output.put_line(lSqlString);
              --execute immediate  lSqlString into v_itemno using v_number;
         end loop;
    end;

  • Compensation handler and compensate activity doesn't work

    Hi!
    i'm trying to build process with compensation handlers and it doesn't work .. to test it i made the following example:
    in scope_1 there is simple assign_1 and in compensation handler there is assign_2. after scope_1 i throw error and in catchAll branch i have compensate activity - calling compensation of scope_1. But that compensation activity is never invoked! can please someone tell me why? what am i doing wrong?
    I have bpel 10.1.2 ...
    Thanks, Tomas
    This is the source of my process:
    <process name="pokusy" targetNamespace="http://xmlns.oracle.com/pokusy"
    xmlns="http://schemas.xmlsoap.org/ws/2003/03/business-process/"
    xmlns:xp20="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.Xpath20"
    xmlns:bpws="http://schemas.xmlsoap.org/ws/2003/03/business-process/"
    xmlns:ns4="http://xmlns.oracle.com/pcbpel/adapter/db/all_keycodes/"
    xmlns:ldap="http://schemas.oracle.com/xpath/extension/ldap"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns5="aa"
    xmlns:bpelx="http://schemas.oracle.com/bpel/extension"
    xmlns:client="http://xmlns.oracle.com/pokusy"
    xmlns:ora="http://schemas.oracle.com/xpath/extension"
    xmlns:orcl="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.ExtFunc">
    <partnerLinks>
    <partnerLink name="client" partnerLinkType="client:pokusy"
    myRole="pokusyProvider" partnerRole="pokusyRequester"/>
    </partnerLinks>
    <variables>
    <variable name="inputVariable" messageType="client:pokusyRequestMessage"/>
    <variable name="outputVariable" messageType="client:pokusyResponseMessage"/>
    </variables>
    <faultHandlers>
    <catchAll>
    <sequence name="Sequence_2">
    <compensate name="Compensate_2" scope="Scope_1"/>
    <assign name="Assign_3">
    <copy>
    <from expression="concat(bpws:getVariableData('outputVariable','payload','/client:pokusyProcessResponse/client:result'),'after compensate..')"/>
    <to variable="outputVariable" part="payload"
    query="/client:pokusyProcessResponse/client:result"/>
    </copy>
    </assign>
    <invoke name="Invoke_1" partnerLink="client"
    portType="client:pokusyCallback" operation="onResult"
    inputVariable="outputVariable"/>
    </sequence>
    </catchAll>
    </faultHandlers>
    <sequence name="main">
    <receive name="receiveInput" partnerLink="client" portType="client:pokusy"
    operation="initiate" variable="inputVariable" createInstance="yes"/>
    <scope name="Scope_1">
    <compensationHandler>
    <assign name="Assign_2">
    <copy>
    <from expression="concat( bpws:getVariableData('outputVariable','payload','/client:pokusyProcessResponse/client:result'),'...COMPENSATE!!!')"/>
    <to variable="outputVariable" part="payload"
    query="/client:pokusyProcessResponse/client:result"/>
    </copy>
    </assign>
    </compensationHandler>
    <sequence name="Sequence_1">
    <assign name="Assign_1">
    <copy>
    <from expression="concat(bpws:getVariableData('inputVariable','payload','/client:pokusyProcessRequest/client:keyCode'),'...first assign...')"/>
    <to variable="outputVariable" part="payload"
    query="/client:pokusyProcessResponse/client:result"/>
    </copy>
    </assign>
    </sequence>
    </scope>
    <throw name="Throw_1" faultName="ns5:aa"/>
    <invoke name="callbackClient" partnerLink="client"
    portType="client:pokusyCallback" operation="onResult"
    inputVariable="outputVariable"/>
    </sequence>
    </process>

    this might be caused by a bug I found too causing eventhandlers not to work, the work round in your case would be:
    blar blar blar
    </variables>
    <!-- start work round --><scope><!-- end work round -->
    <faultHandlers>
    blar blar blar
    blar blar blar
    </sequence>
    <!-- start work round --></scope><!-- end work round -->
    </process>
    i.e. what I'm saying is that top level handler don't work since they are ignored by the engine because they are not in a scope. Try it and see....

  • Repository event handler doesn't work when inserting an xml-doc via ftp

    Hi,
    I want to add a 'schemaLocation'-attribute to an XML-document when I load it in the repository. Therefore, I use the precreate-repository event and created a Repository Event Handler (see code extract below).
    Everything works fine if I type the following code in SQL Plus:
    Declare
    v_return BOOLEAN;
    Begin
    v_return:=DBMS_XDB.createresource('/public/xml/test.xml', XMLType(bfilename('XMLDIR', 'test.xml'),nls_charset_id('AL32UTF8')));
    end;Unfortunately, when I try to insert an XML-document via ftp into the /public/xml folder it doesn´t work as expected and no 'schemaLocation'-attribute is added to the new resource.
    What's the reason for this strange behavior and how can I solve it?
    For your information: I use the Oracle Database 11g Enterprise Edition Release 11.2.0.1.0
    Thank you very much for your help!!!
    Repository Event Handler code extract:_
    create or replace
    PACKAGE BODY schemalocation AS
    PROCEDURE handlePreCreate (eventObject DBMS_XEVENT.XDBRepositoryEvent) AS
    XDBResourceObj DBMS_XDBRESOURCE.XDBResource;
    var XMLType;
    l_return BOOLEAN;
    l_xmldoc dbms_xmldom.DOMDocument;
    l_docelem dbms_xmldom.DOMElement;
    l_attr dbms_xmldom.DOMAttr;
    c1 clob;
    node     dbms_xmldom.DOMNode;
    txid varchar2(100);
    dDoc DBMS_XMLDOM.DOMDocument;
    nlNodeList DBMS_XMLDOM.DOMNodeList;
    BEGIN
    XDBResourceObj := DBMS_XEVENT.getResource(eventObject);
    dbms_lob.createTemporary(c1,TRUE);
    var:=DBMS_XDBRESOURCE.getcontentxml(XDBResourceObj);
    l_xmldoc := dbms_xmldom.newDOMDocument(var);
    l_docelem := DBMS_XMLDOM.getDocumentElement(l_xmldoc);
    ------ add schemaLocation attribute
    l_attr := DBMS_XMLDOM.createAttribute(l_xmldoc, 'xsi:schemaLocation');
    DBMS_XMLDOM.setValue(l_attr, 'urn:iso:std:iso:20022:tech:xsd:sese.023.001.01 http://www.test.com/Testswift.xsd');
    l_attr := DBMS_XMLDOM.setAttributeNode(l_docelem, l_attr);
    DBMS_XMLDOM.WRITETOCLOB(l_xmldoc, c1);
    ------- get the value of the TxId-tag
    dDoc := DBMS_XMLDOM.NEWDOMDOCUMENT(c1);
    nlNodeList := DBMS_XMLDOM.GETELEMENTSBYTAGNAME(dDoc, 'TxId');
    node := DBMS_XMLDOM.ITEM(nlNodeList, 0);
    txid:= dbms_xmldom.getnodevalue(dbms_xmldom.getfirstchild(node));
    l_return:=DBMS_XDB.createresource('/public/ok/'||txid||'.xml', XMLType(c1));
    END;

    Marco,
    Here's an example of the problem :
    create or replace package handle_events
    as
      procedure handlePreCreate(p_event dbms_xevent.XDBRepositoryEvent);
    end;
    create or replace package body handle_events
    is
    procedure handlePreCreate (p_event dbms_xevent.XDBRepositoryEvent)
    is
      XDBResourceObj dbms_xdbresource.XDBResource;
      doc XMLType;
      res boolean;
    begin
      XDBResourceObj := dbms_xevent.getResource(p_event);
      doc := dbms_xdbresource.getContentXML(XDBResourceObj);
      select insertchildxml(
        doc
      , '/root'
      , '@xsi:schemaLocation'
      , 'urn:iso:std:iso:20022:tech:xsd:sese.023.001.01 http://www.test.com/Testswift.xsd'
      , 'xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"'
      into doc
      from dual;
      res := dbms_xdb.CreateResource('/public/xml/result.xml', doc);
    end;
    end;
    declare
    res boolean;
    begin
    res := dbms_xdb.CreateFolder('/public');
    res := dbms_xdb.CreateFolder('/public/tmp');
    res := dbms_xdb.CreateFolder('/public/xml');
    end;
    declare
    res            boolean;
    resconfig      xmltype;
    my_schema      varchar2(30) := 'DEV';
    resconfig_path varchar2(300) := '/public/ResConfig.xml';
    resource_path  varchar2(300) := '/public/tmp';
    begin
      resconfig  := xmltype(
    '<ResConfig xmlns="http://xmlns.oracle.com/xdb/XDBResConfig.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.oracle.com/xdb/XDBResConfig.xsd http://xmlns.oracle.com/xdb/XDBResConfig.xsd">
      <event-listeners set-invoker="true">
        <listener>
          <description>My event handler</description>
          <schema>'||my_schema||'</schema>
          <source>HANDLE_EVENTS</source>
          <language>PL/SQL</language>
          <events>
            <Pre-Create/>
          </events>
          <pre-condition>
            <existsNode>
              <XPath>/r:Resource[r:ContentType="text/xml"]</XPath>
              <namespace>xmlns:r="http://xmlns.oracle.com/xdb/XDBResource.xsd"</namespace>
            </existsNode>
          </pre-condition>
        </listener>
      </event-listeners>
      <defaultChildConfig>
        <configuration>
          <path>'||resconfig_path||'</path>
        </configuration>
      </defaultChildConfig>
    </ResConfig>'
      res := dbms_xdb.CreateResource(resconfig_path, resconfig);
      dbms_resconfig.addResConfig(resource_path, resconfig_path, null);
    end;
    /Giving the following input XML file :
    <?xml version="1.0" encoding="utf-8"?>
    <root xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>This works :
    SQL> declare
      2    res boolean;
      3  begin
      4    res := dbms_xdb.CreateResource('/public/tmp/test.xml',
      5               xmltype(bfilename('TEST_DIR','test.xml'), nls_charset_id('AL32UTF8')));
      6  end;
      7  /
    PL/SQL procedure successfully completed.
    SQL> select XMLSerialize(document xdburitype('/public/xml/result.xml').getXML()
    as clob indent size = 2)  result
      2  from dual
      3  ;
    RESULT
    <root xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="
    urn:iso:std:iso:20022:tech:xsd:sese.023.001.01 http://www.test.com/Testswift.xsd
    "/>With the same document loaded via FTP, we get :
    SQL> select XMLSerialize(document xdburitype('/public/xml/result.xml').getXML()
    as clob indent size = 2)  result
      2  from dual
      3  ;
    ERROR:
    ORA-31011: XML parsing failed
    ORA-19202: Error occurred in XML processing
    LPX-00283: document encoding is UTF-16-based but default input encoding is not
    Error at line 1
    no rows selectedand the content looks like :
    < ? x m l   v e r s i o n = " 1 . 0 "   e n c o d i n g = " u t f - 8 " ? >
    < r o o t   x m l n s : x s i = " h t t p : / / w w w . w 3 . o r g / 2 0 0 1 / X M L S c h e m a - i n s t a n c e " / >As a workaround, I've found that serializing and re-parsing the document solves the problem :
      select insertchildxml(
        xmltype(doc.getclobval())
      , '/root'
      , '@xsi:schemaLocation'
      , 'urn:iso:std:iso:20022:tech:xsd:sese.023.001.01 http://www.test.com/Testswift.xsd'
      , 'xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"'
      into doc
      from dual;
    ...We then get the expected result after FTP transfer :
    SQL> select XMLSerialize(document xdburitype('/public/xml/result.xml').getXML()
    as clob indent size = 2)  result
      2  from dual
      3  ;
    RESULT
    <?xml version="1.0" encoding="UTF-8"?>
    <root xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="
    urn:iso:std:iso:20022:tech:xsd:sese.023.001.01 http://www.test.com/Testswift.xsd
    "/>The workaround also works for the DOM version presented above.
    Any ideas?

Maybe you are looking for

  • How can i get my contacts back if i dont have the back up

    How can i get my contacts back if i dont have the back up

  • Oracle 10g vs Oracle 11g query performance

    Hi everyone, We are moving from Oracle 10g to Oracle 11g database. I have a query which in Oracle 1g takes 85 seconds to run, but when I run the same query in Oracle 11g database, it takes 635 seconds. I have confirmed that all indexes on tables invo

  • Archive Link Integration

    Hello everybody, we have an custom archive system where we want to develop an HTTP SAP Archive Link Adapter. No problem so far, everything is described in the interface manual. But one thing is not clear enough: The HTTP Request "Create" could be rea

  • Cannot find SRC.ZIP or SRC.JAR

    Hello, I just installed JDK 6 SE and I cannot find the SRC.JAR and SRC.ZIP files. I want to use the debugger in Eclipse and it is telling me: The jar file rt.jar has no source attachment. but I cannot seem to find it in the installation directory C:\

  • Data block's table layout complicate command button?

    Why after I create a data block's layout using table format, when I try to insert a command button into the canvas, the button always appear like a concatenated buttons (i.e. if I have 5 rows in the tabular format for displaying the data block, my co