ORA-06502 error after SSO login

Hi all.
In our intranet i'm trying to use the AS 10g SSO
as authentication with my HTML DB application.
HTML DB is into a 9.2.0.4 database in a Alpha open VMS server.
AS 10g infrastructure and AS 10g mid-tier on two difference Linux RedHat AS 2.1 servers.
Infrastructure server: http://giedi.marinarinaldi.it:7779
Mid-tier server: http://si.marinarinaldi.it:7778
HTML DB application: http://si.marinarinaldi.it:7778/pls/htmldbSVIL/f?p=106:1
I followed the related how-to document
and the SSO login page shows correctly
but when i click "login":
Error     Error determining caller of process_success:l_owner::p_partner_app_name:HTML_DB Please contact administrator.
ORA-06502: PL/SQL: numeric or value error: character to number conversion error
The SSO logi page is a our custom login page
but it works perfectly with portal.
The SSO partner application parameters:
ID:     97F428BC
Token:     4PW44GF797F428BC
Encryption Key:     12E3971BE26C4E5D
Login URL:     http://giedi.marinarinaldi.it:7779/pls/orasso/orasso.wwsso_app_admin.ls_login
Single Sign-Off URL:     http://giedi.marinarinaldi.it:7779/pls/orasso/orasso.wwsso_app_admin.ls_logout
Name:     HTML_DB
Home URL: http://si.marinarinaldi.it:7778/pls/htmldbSVIL/f?p=106:1
Success URL: http://si.marinarinaldi.it:7778/pls/htmldbSVIL/wwv_flow_custom_auth_sso.process_success
Logout URL: http://si.marinarinaldi.it:7778/pls/htmldbSVIL/htmldb
The parameters of regapp.sql script on the Alpha HTMLDB database:
Enter value for listener_token: HTML_DB:si.marinarinaldi.it:7778
Enter value for site_token: 4PW44GF797F428BC
Enter value for site_id: 97F428BC
Enter value for login_url: http://giedi.marinarinaldi.it:7779/pls/orasso/orasso.
wwsso_app_admin.ls_login
Enter value for cookie_version: v1.0
Enter value for encryption_key: 12E3971BE26C4E5D
Enter value for ip_check: N
Thank you all in advance for help.

SQL> select * from WWSEC_SSO_LOG$;
1
entry: papp_show_config
05-AUG-04
2
IN papp_show_config: after the select.
05-AUG-04
3
site name is 4PW44GF797F428BC
05-AUG-04
4
exit: papp_show_config
05-AUG-04
5
entry: urlencode
05-AUG-04
6
encoded URL is http%3A%2F%2Fsi.marinarinaldi.it%3A7778%2Fpls%2FhtmldbSVIL%2Ff%3F
p%3D106%3A1%3A6300852000501899701
05-AUG-04
7
exit: urlencode
05-AUG-04
8
entry: urlencode
05-AUG-04
9
encoded URL is http%3A%2F%2Fsi.marinarinaldi.it%3A7778
05-AUG-04
10
exit: urlencode
05-AUG-04
11
entry: encrypt_url_cookie
05-AUG-04
12
Before bake_site2pstore_token: listener token: HTML_DB:si.marinarinaldi.it:7778u
rlcookie_version: v1.0papp_url_cookie: http%3A%2F%2Fsi.marinarinaldi.it%3A7778%2
Fpls%2FhtmldbSVIL%2Ff%3Fp%3D106%3A1%3A6300852000501899701~http%3A%2F%2Fsi.marina
rinaldi.it%3A7778enabler_config.site_token: 4PW44GF797F428BCkey: 12E3971BE26C4E5
D
05-AUG-04
13
entry: bake_site2pstore_token
05-AUG-04
14
entry get_enabler_config
05-AUG-04
15
site token is 4PW44GF797F428BC
05-AUG-04
16
exit: get_enabler_config
05-AUG-04
17
In hash string. Input is 308-05-2004 10:06:52
05-AUG-04
18
In hash string. Input is ud)xc`8L`GJd~4PW44GF797F428BC~20040805100652~http%3A%2F
%2Fsi.marinarinaldi.it%3A7778%2Fpls%2FhtmldbSVIL%2Ff%3Fp%3D106%3A1%3A63008520005
01899701~http%3A%2F%2Fsi.marinarinaldi.it%3A7778
05-AUG-04
19
temp site2pstoretoken is :ud)xc`8L`GJd~4PW44GF797F428BC~20040805100652~http%3A%2
F%2Fsi.marinarinaldi.it%3A7778%2Fpls%2FhtmldbSVIL%2Ff%3Fp%3D106%3A1%3A6300852000
501899701~http%3A%2F%2Fsi.marinarinaldi.it%3A7778~5169F5D95694EE7F4EEC7D80056B56
A5
05-AUG-04
20
entry: encrypt_des
05-AUG-04
21
Key is: 12E3971BE26C4E5D
05-AUG-04
22
before rpad
05-AUG-04
23
pre mask: 503504C465CC51FDD7EBB62850973AF1503504C465CC51FDD7EBB62850973AF1503504
C465CC51FDD7EBB62850973AF1503504C465CC51FDD7EBB62850973AF1503504C465CC51FDD7EBB6
2850973AF1503504C465CC51FDD7EBB62850973AF1503504C465CC51FDD7EBB628
05-AUG-04
24
post mask: 45FBB10E9AABB801ABAC1C861EBF9AE645FBB10E9AABB801ABAC1C861EBF9AE645FBB
10E9AABB801ABAC1C861EBF9AE645FBB10E9AABB801ABAC1C861EBF9AE645FBB10E9AABB801ABAC1
C861EBF9AE645FBB10E9AABB801ABAC1C861EBF9AE645FBB10E9AABB801ABAC1C86
05-AUG-04
25
exit: bake_site2pstore_token
05-AUG-04
26
After bake_site2_pstore_token. Value is: C061F10FBDDAACCB4A5B536D036656AF013D33B
17261B66BD9C46A02004CF08081B0EB68834FA1594884A2088A6E1829A35EEA97ECF7B0F9B728B60
B7DDEFEC846EA96CDB4208783B26F7DE976B3E7912554A8FA2B383EBF0C4221858C88B10A00A2789
65C85703BEF6C3C1E3F069FF9C41059B5982CBADB7F662D481C9812EBCD7B44A7E24819CD152BB29
9F2B40F08138F7DAE05BCC58CF87FECFA89B1BEE195FB2A314699AA2C8D406AC52FCE4F5B6DCE910
A4B31714D99918BEC39E3E067BE031F5E9DF031192064B1ECAE0B100775AD76EF4D478844
05-AUG-04
27
Redirect URL generated is : http://giedi.marinarinaldi.it:7779/pls/orasso/orasso
.wwsso_app_admin.ls_login?site2pstoretoken=v1.0~97F428BC~C061F10FBDDAACCB4A5B536
D036656AF013D33B17261B66BD9C46A02004CF08081B0EB68834FA1594884A2088A6E1829A35EEA9
7ECF7B0F9B728B60B7DDEFEC846EA96CDB4208783B26F7DE976B3E7912554A8FA2B383EBF0C42218
58C88B10A00A278965C85703BEF6C3C1E3F069FF9C41059B5982CBADB7F662D481C9812EBCD7B44A
7E24819CD152BB299F2B40F08138F7DAE05BCC58CF87FECFA89B1BEE195FB2A314699AA2C8D406AC
52FCE4F5B6DCE910A4B31714D99918BEC39E3E067BE031F5E9DF031192064B1ECAE0B100775AD76E
F4D478844
05-AUG-04

Similar Messages

  • ORA-06502 error on SQL tab

    I have just installed the latest version of SQL Developer (1.2.1.3213) and am running an Oracle 9i database (version 9.2.0.7).
    When I click on the SQL tab when looking at a table I get an ORA-06502 error and the DDL generated has "-- Unable to Render DDL with DBMS_METADATA using internal generator." at the top.
    I then get a whole host of other errors when using other parts of the program until I disconnect and reconnect.
    This error also occurs when I run the following query:
    select dbms_metadata.get_ddl('TABLE',table_name , user ) from user_tables;
    Any ideas?
    Incidentally prior to this release I had an early version 1 release of SQL Developer and the SQL tab here showed nothing at all.
    Any comments would be most appreciated.

    I am currently using v2.1.1.64, Build MAIN-64.45 and have the same or a similar problem. SQL developer will not generate the SQL code, but fails with the following error:
    ORA-06502: PL/SQL: numeric or value error
    LPX-00210: expected '<' instead of 'n'
    ORA-06512: at "SYS.UTL_XML", line 0
    ORA-06512: at "SYS.DBMS_METADATA_INT", line 3688
    ORA-06512: at "SYS.DBMS_METADATA_INT", line 4544
    ORA-06512: at "SYS.DBMS_METADATA", line 466
    ORA-06512: at "SYS.DBMS_METADATA", line 640
    ORA-06512: at "SYS.DBMS_METADATA", line 1260
    ORA-06512: at line 1
    This installation doesn't have the same directory structure as in the previous reply, so I can't run the catmeta.sql script which doesn't exist in this release.
    Mike

  • ORA-06502 error when clicked on Lines tab in Oracle Service Contracts

    When i query for some contracts and click on Lines Tab,i get ORA-06502 error.
    This is not happenning with all contracts.My ICX: Numeric Characters profile is set to 10.000,00 but the user who created the contracts which were showing error message has ICX: Numeric Characters profile set to 10,000.00.
    If i change my profile option to this users profile option,then i am not getting error in these contracts but getting error when trying to view the contracts which were created by other users who's ICX: Numeric Characters profile is different from mine.
    Plz let me know how can i resolve this issue.
    Looking for your suggessions.
    Thanks,
    Ravi

    CRS Home is indicative of having Oracle clusterware installed. Is this a RAC cluster? Are you running on ASM? How many nodes? etc.
    Please fill in the blanks.

  • Unexpected error in SSO login page

    Hi all,
    We have a problem with our SSO, or with our LDAP directory, or with the way in which they work, not sure about. In the past we were using version 9.x and everything worked fine. Now we migrated to version 10.1.2.0.2 and we discovered that using the same functionality to register and log user is crashing. After a bit of debugging, the problem seems to be that the PASSWORD of the created users is encrypted using some Hash and retrieve in an array of bytes, insted of in plain text as before. In principle this shouldn't affect the way in which we use the LDAP & SSO, but for some reason, when the user tries to log in using the recently created user account and password, the SSO login page gives an "unexpected error" message. The SSO login page is the original page coming with the SSO infrastructure, no change at all on it.
    Any idea why this might happened? Is the some way to configure the SSO or the LDAP so they don't encrypt the user password? Any other possible config detail that we should check?
    Thanks in advance,
    Luis

    So after finding the log files on our SSO server, I found out the exact error message that the SSO was throwing was that the account was still not activate!!! Then I realized that we started to make use of the "Start date" LDAP field recently, and event when the date was set to the current date when the account was created, the time was set to 0s, event when the current time was also passed to the LDAP. I don't know what's the reason why the LDAP didn't get our time, passing the date-time with the format the LDAP was asking for (yyyyMMddHHmmssz), but just by rolling one day back the start date, the user accounts were automatically activate when they're creating, solving our problem.
    Regards,
    Luis
    Edited by: lagh on Dec 15, 2008 11:52 AM

  • Error in SSO login page.

    HI all,
    This time in windows 2000 Professional,I install infrastructure without error or warning(But in the installation log file I saw one error i.e., as follows.)(I put th error line into bold face.)
    Create Group URLrefreshed:oiddas/ui/oracle/ldap/das/admin/AppCreateGroupInfoAdmin
    Edit Group URL refreshed:oiddas/ui/oracle/ldap/das/admin/AppEditGroupAdmin
    Delete Group URL refreshed:oiddas/ui/oracle/ldap/das/admin/AppDeleteGroupAdmin
    Group LOV URL refreshed:oiddas/ui/oracle/ldap/das/search/LOVGroupSearch
    People Search URL refreshed:oiddas/ui/oracle/ldap/das/search/AppUserSearch
    Directory Administration URL
    refreshed:oiddas/ui/oracle/ldap/das/mypage/ViewMyPage
    Local OID cache refreshed
    PL/SQL procedure successfully completed.
    Disconnected from Oracle9i Enterprise Edition Release 9.0.1.4.0 - Production
    With the Partitioning option
    JServer Release 9.0.1.4.0 - Production
    NLS_LANG character set = UTF8
    NLS_LANG param = AMERICAN_AMERICA.UTF8
    Portal SMI: Oracle home: D:\ocsinfra was registered.
    Portal SMI: ERROR: Web DAV: /dav_portal/orasso could not be found.
    Portal SMI: Update config was successful.
    Portal SMI: Save changes was successful.
    Portal SMI: Updated DAD: /pls/orasso
    Portal SMI: Terminating.
    Portal SMI: Terminated in: 20 milliseconds.
    D:\ocsinfra\jdk\bin\java -jar D:\ocsinfra\jlib\emConfigInstall.jar targets D:\ocsinfra\sso\sso_server_target2add.xml
    End output from spawned process.
    Configuration assistant "Single Sign-On Configuration Assistant" succeeded
    Result code for launching of configuration assistant is: 0
    Launched configuration assistant 'Patch SSO'
    Tool type is: Optional.
    The command being spawned is: 'D:\ocsinfra/sso/bin/ssoca.bat patch D:\ocsinfra'
    Start output from spawned process:
    Parameters passed to ssoca : param0:patch param1:D:\ocsinfra
    INSTALL_ACTION: SSOConfigAssistant: Install Mode is PATCH
    INSTALL_ACTION: SSOConfigAssistant: SSO configuration status valid
    INSTALL_ACTION: SSOConfigAssistant : Invoking sqlplus
    D:\ocsinfra\bin\sqlplus ORASSO/*****@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=esysocs2)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=iasdb.esysocs2))) @D:\ocsinfra\sso\admin\plsql\sso\ssopachk.sql
    SQL*Plus: Release 9.0.1.4.0 - Production on Mon Feb 13 12:04:39 2006
    (c) Copyright 2001 Oracle Corporation. All rights reserved.
    SQL> Connected.
    SQL> Checking current SSO Server version...
    INFO: SSO Server version : 9.0.2.2.22
    INFO: SSO Server version to be checked: 9.0.2.2
    INFO: SSO Server version check ok
    INFO: SSO patch check status : 0
    PL/SQL procedure successfully completed.
    Disconnected from Oracle9i Enterprise Edition Release 9.0.1.4.0 - Production
    With the Partitioning option
    JServer Release 9.0.1.4.0 - Production
    INSTALL_ACTION: SSOConfigAssistant: Invoking sqlplus
    D:\ocsinfra\bin\sqlplus ORASSO/*****@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=esysocs2)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=iasdb.esysocs2))) @D:\ocsinfra\sso\admin\plsql\sso\ssopatch.sql
    SQL*Plus: Release 9.0.1.4.0 - Production on Mon Feb 13 12:04:42 2006
    (c) Copyright 2001 Oracle Corporation. All rights reserved.
    SQL> Connected.
    SQL> Calling ssopatch.sql
    Oracle 9iAS Single Sign-On Server
    Loading Package(s)...
    Package created.
    No errors.
    .After that i go to address http://esysocs2:7777/oiddas. Off this point when i click on login all addresses on Address bar covert to http://esysocs:7777/oiddas/....(remind of the system name). In otherwords "esysocs2" changes to "esysocs".i also tried again by using IP address of my machine(which is static). At this time i receive page "Single Sign On" with ERROR :Unexpected errors (WWC-41400).( this is the situation when creating the new oid users)
    Q 1)Is this error( i.e.,ERROR :Unexpected errors (WWC-41400)) is effected by the error showed as bold face in the above log file?describe me when that log file error(i.e., Portal SMI: ERROR: Web DAV: /dav_portal/orasso could not be found will occurs(I mean in which situation?)
    In services window, Oracle OLAP 9.0.1.0.1,OracleOCSInfra_homewebcachemon services are not starting when i attempted to start. I installed the infrastructure 8or 9 times in this week. Every installation time it is same that services are not starting and the error in SSO page.
    Q 2) Why these services are not starting for me? Is the services basically doesn't start or any mistakes i did in the installation process? ( I know i didn't do any mistake at the installation time.) describe me when these services needed and how to start those sevices if necessary?
    One more thing is which password we will enter when we attemp for the first time on the SSO. In manuals it is saying that "enter the oid username and the password". At first, in installation time we didn't create the oid users. By default what is the oid username and the password.
    Q 3) What is the default OID & SSO username and the password.
    >>>> Please solve my problem waiting for the replies eagerly.
    with thank in advance./kumaraswamy.n

    I solved all my problems By setting the domain name to my system and using the windows 2003 server.

  • ORA-06502 Error When Calling Function

    Hi,
    We have upgraded Oracle Database Server 9i to 11.1.0.7 and we are now using ODP.NET version 2.112.2.0 instead of 9.2.0.4 dll.
    After the migration, we encountered ORA-06502 problem when we are calling a function from .NET application. We investigated and found that we have to set the parameter size for the return value parameter (varchar2). But there is a strange case that how do we guess the return value size, it can be 5 characters or 5.000 characters. Before 11g Oracle.DataAccess, we do not have that such problem. We were setting the parameter size 225 by default, but ODP.NET was returning 500 characters without any error.
    The question is that how do we guess or know the actual parameter size when we are passing a Return Value parameter to the function?
    Or is there a solution for this behaviour of ODP.NET?
    Thanks.

    Is there a reason you can not set it to the default maximum size for a varchar2 of 32k?
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using Oracle.DataAccess.Client;
    using System.Data;
    namespace test_function2
    class Program
    static void Main(string[] args)
    OracleConnection con = new OracleConnection("Data Source=UTF8;User ID=scott;Password=tiger");
    OracleCommand cmd = new OracleCommand("test_return", con);
    cmd.CommandType = CommandType.StoredProcedure;
    OracleParameter test_return = new OracleParameter("test_return", OracleDbType.Varchar2, 32000);
    test_return.Direction = ParameterDirection.ReturnValue;
    cmd.Parameters.Add(test_return);
    OracleParameter test_input = new OracleParameter("test_input", OracleDbType.Varchar2);
    test_input.Direction = ParameterDirection.Input;
    test_input.Value = "blah";
    cmd.Parameters.Add(test_input);
    try
    con.Open();
    cmd.ExecuteNonQuery();
    con.Close();
    Console.WriteLine("{0}", test_return.Value);
    Console.WriteLine("Press Enter to Continue");
    Console.ReadLine();
    catch (OracleException e)
    Console.WriteLine(e.Number);
    Console.WriteLine(e.Message);
    Console.WriteLine("test failed\nPress Enter to Continue");
    Console.ReadLine();
    create or replace function test_return(in_var in varchar2)
    return varchar2 is
    begin
    return lpad(in_var, 4000, 'TEST test') || lpad(in_var, 4000, 'DONE done');
    end test_return;
    /

  • Partner application configuration is missing error on SSO login page

    We have APEX 3.1.2 setup as a partner application and an application within APEX setup to use SSO for authentication. Following a link to the APEX application redirects to the Single Sign-On page, as it should, but it also shows "Error: The partner application configuration is missing or expired." I type in my password and username, click the Login button, and (if I entered my username and password correctly, of course!) then the APEX application is shown. So, I cannot figure out why we're getting the no_papp_err error and I have not found any solutions to that issue on Metalink or anywhere else on the Internet. Any ideas? I'm concerned that we have a misconfiguration somewhere that is causing this error and will affect any other partner application we setup in the future.
    We're on Oracle Portal 10.1.4, SSO 10.1.2, and SSL is setup on both infra and mid tiers.

    Did you try checking the partner application entries on the SSO-login server page?
    please login as orcladmin or some other user with membership in, i beleive, iasadmins group. verify that for this partner application, what you see here corresponds to the application URL. it looks like your login page call may have issues. so check for login url too.
    also check the ORASSO.WWSSO_LS_CONFIGURATION_INFO$ for entries corresponding to Apex application.

  • Version 3.1 fault - ORA-06502 error when creating SQL Report Region/Page

    I usually perfect my query in SQL*PLUS before I create a new report region.
    Consequently, I copy the code into the region wizard to create the new page. However, since we have upgraded to Version 3.1, virtually every report I have tried to create has created the following error:
    ORA-06502: PL/SQL: numeric or value error: character string buffer too small
    It would appear that a maximum of 960 characters can be used to create the region/page. Perversely, once the page/region has been created, I can then edit the source and include as much code as I want (so far I've not run up against a limit)
    As it's just annoying, but not stopping me doing what I wanted to do, I've not got around to mentioning this error previously, but it occurred to me that I should (so I am!)
    David

    Hi David,
    Thank you for reporting this. Unfortunately, this was a regression introduced in Application Express 3.1. The workaround is to edit the region, as you suggested. This has been filed as Bug 6956070 and will be corrected in the forthcoming Application Express 3.1.1 patch set.
    Joel

  • ORA-00372 error after DB backup

    Hello,
    After performing a backup on tape using Amanda, one of the tablespaces is generating an ORA-00372 error. The DB is 10g1, on Solaris' SunOS 5.10.
    ORA-01110: data file 6: '[path]/filename.dbf'
    ORA-00372: file 6 cannot be modified at this time
    ORA-01110: data file 6: '[path]/filename.dbf'
    While trying to log in sqlplus as a regular user, I get the ORA-01033 message:
    ERROR:
    ORA-01033: ORACLE initialization or shutdown in progress
    I can log in as sysdba, to find out that the DB is only mounted, when I issue an 'alter database open;' I get the 00372 error above.
    The RMAN backup sequence was the following:
    run {
    allocate channel ch1 type disk;
    backup
    incremental
    level=0
    database;
    release channel ch1;
    After the backup, the state of the DB was not checked, but some application process that used it stopped responding, so after trying to restart the process, a reboot command was issued from a shell - I don't know if this has anything to do with the actual state of the DB.
    - What can I do to get the DB to the open state ('alter tablespace ... online' doesn't work with the DB in mounted state)?
    - What possibly generated this particular situation?
    Thank you all for any ideas,
    Adrian

    I tried to retrieve the status of the tablespaces with the following query
    select     TABLESPACE_NAME, STATUS, CONTENTS
    from      dba_tablespaces
    order      by TABLESPACE_NAME
    but I cannot run it, as the DB is only mounted - I get the error:
    ORA-01219: database not open: queries allowed on fixed tables/views only
    Is there another way to find out? And I don't know how to find the status of the file...

  • Ora-06502 error while running a form

    Hi
    DECLARE
    pl_id PARAMLIST;
    begin
         PL_ID:=GET_PARAMETER_LIST('TMP');
         IF NOT ID_NULL(PL_ID) THEN
              DESTROY_PARAMETER_LIST('TMP');
         END IF;
         PL_ID:=CREATE_PARAMETER_LIST('TMP');
         ADD_PARAMETER(PL_ID,'PARAMFORM','TEXT_PARAMETER','NO');
         /*ADD_PARAMETER(PL_ID,'Y_N','TEXT_PARAMETER',:L_CHOICE);
         add_parameter(pl_id,'WHERE','TEXT_PARAMETER',:TI_WHERE);
         add_parameter(pl_id,'ORDERBY','TEXT_PARAMETER',:TI_ORDERBY);*/
         RUN_PRODUCT(REPORTS,'LEXUSE1.REP',SYNCHRONOUS, RUNTIME, FILESYSTEM, PL_ID, NULL);
         EXCEPTION
              WHEN OTHERS THEN
              MESSAGE(SQLERRM);
              MESSAGE(' ');
    END;
    i am using the above code on when-button-pressed trigger to call a report, but when i press the button i get an error message ORA-06502 PL/SQL Numeric or Value Error. dont know why

    Remove single quotes around TEXT_PARAMETER
    ADD_PARAMETER(PL_ID,'PARAMFORM',TEXT_PARAMETER,'NO');

  • ORA-06502: error when inserting into table via db link with long datatype

    Folks,
    I am getting the following error:
    ORA-06502: PL/SQL: numeric or value error: character string buffer too small.
    This occurs when an insert is done via a database link into a table that has a LONG data type for one of the columns, and the string contains some carriage returns and or line feeds.
    I have checked by removing the db link, and inserting into a local table with identical column data types, where there is no error.
    So this might be another db link bug?
    So I need to remove the carriage returns and/or line feeds
    in my pl/sql block in the page process. I have tried
    l_text := REPLACE(l_text, CHR(10), ' ');
    l_text := REPLACE(l_text, CHR(13), NULL);
    but still getting the ORA-06502. Would really appreciate some advice here, please.
    Cheers
    KIM

    Scott,
    Time to 'fess up':
    My fault sorry, the error was coming from another page process where I had allowed insufficient string length for one of the variables, and my error message did not identify the page process clearly.
    This leads me to make a request for future releases, could the system error messages state which page process caused the problem?
    One other thing I notice, and this might be a feature not a fault, the page processes are numbered: "Page Process:      3 of 5". However process 3 is not the 3rd one to be processed, and probably refers to the order in which they are created. Should the number reflect the process order?
    Cheers
    KIM

  • ORA-06502 - Error when running "Ask The Expert 0.9"

    Hi ,
    I successfully installed "Ask the Expert" package with Apex 3.0 on Oracle 10g Database 10.2.0.1.0. No error ocurred during the import in my Apex environment.
    Besides that, i'm having problems when i tried to run the "Aks the Expert". It always shows the following message errors:
    ORA-06502: PL/SQL: numeric or value error: character string buffer too small
    Error Unable to write activity log.
    I think it was a problem with APEX instalation, but i could run the Sample Application of Apex without any problem.
    I opened an SR in Metalink, but to my surprise, the analist of support don't know what's wrong with the demo "Ask de Expert".
    The debug function of the application show the following commands before the error ocurrs:
    0.01:
    0.01: S H O W: application="103" page="1" workspace="" request="" session="6648566035252817"
    0.01: Language derived from: FLOW_PRIMARY_LANGUAGE, current browser language: en-us
    0.01: alter session set nls_language="AMERICAN"
    0.01: alter session set nls_territory="AMERICA"
    0.01: NLS: CSV charset=WE8MSWIN1252
    0.01: ...NLS: Set Decimal separator="."
    0.01: ...NLS: Set NLS Group separator=","
    0.02: ...NLS: Set date format="DD-MON-RR"
    0.02: ...Setting session time_zone to -03:00
    0.02: NLS: Language=en-us
    0.02: Application 103, Authentication: CUSTOM2, Page Template: 667896385843019243
    0.02: ...Determine if user "N3COUTINHO" workspace "951808960237899" can develop application "103" in workspace "951808960237899"
    0.02: ...ok to reuse builder session for user:nobody
    0.03: ...Application session: 6648566035252817, user=nobody
    0.03: ...Determine if user "N3COUTINHO" workspace "951808960237899" can develop application "103" in workspace "951808960237899"
    0.03: Session: Fetch session header information
    0.03: ...Metadata: Fetch page attributes for application 103, page 1
    0.03: Fetch session state from database
    0.03: Branch point: BEFORE_HEADER
    0.03: Fetch application meta data
    0.04: Computation point: BEFORE_HEADER
    0.04: ...Perform computation of item: P1_CLEAN_CRITERIA, type=FUNCTION_BODY
    0.04: ...Performing function body computation
    0.06: ...Session State: Save "P1_CLEAN_CRITERIA" - saving same value: ""
    0.06: Processing point: BEFORE_HEADER
    0.06: ...Process "Read and Write Activity Cookie": PLSQL (BEFORE_HEADER) declare l_cookie_id number; begin owa_util.mime_header('text/html', FALSE); -- ate_api.read_activity_cookie; l_cookie_id := ate_api.fetch_activity_cookie_val( 'COOKIE_ID' ); -- if l_cookie_id is null then l_cookie_id :=
    Content-type: text/html; charset=ISO-8859-1 Set-Cookie: activity_ask_expert=1|2400346189796; expires=Wed, 01-Jan-2020 08:00:00 GMT; path=/;
    0.06: Encountered unhandled exception in process type PLSQL
    0.06: Show ERROR page...
    0.06: Performing rollback...
    Please, could any one help me to solve this problem ? Metalink couldn't help me diagnosing what's wrong.
    Thanks,
    Sergio Coutinho

    Hi,
    I don´t know if it help the analisis, but i collect some informations about my environment:
    1) HTML DB version
    3.0.1
    2) Database version
    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit Production
    With the Partitioning, OLAP and Data Mining options
    3) Database server operating system (as well, if 32-bit or 64-bit)
    Solaris 5.9 - 64 bits
    4) Database Parameters:
    PARAMETER VALUE
    NLS_CALENDAR GREGORIAN
    NLS_CHARACTERSET WE8ISO8859P1
    NLS_COMP BINARY
    NLS_CURRENCY $
    NLS_DATE_FORMAT DD-MON-RR
    NLS_DATE_LANGUAGE AMERICAN
    NLS_DUAL_CURRENCY $
    NLS_ISO_CURRENCY AMERICA
    NLS_LANGUAGE AMERICAN
    NLS_LENGTH_SEMANTICS BYTE
    NLS_NCHAR_CHARACTERSET AL16UTF16
    NLS_NCHAR_CONV_EXCP FALSE
    NLS_NUMERIC_CHARACTERS .,
    NLS_RDBMS_VERSION 10.2.0.1.0
    NLS_SORT BINARY
    NLS_TERRITORY AMERICA
    NLS_TIMESTAMP_FORMAT DD-MON-RR HH.MI.SSXFF AM
    NLS_TIMESTAMP_TZ_FORMAT DD-MON-RR HH.MI.SSXFF AM TZR
    NLS_TIME_FORMAT HH.MI.SSXFF AM
    NLS_TIME_TZ_FORMAT HH.MI.SSXFF AM TZR
    Could it explain why ASK THE EXPERT is running on hosted apex site and it´s
    generating error when running in my environment?
    Thanks for the help !
    Sergio

  • ORA-06502 error during dbms_mview.refresh

    I created a Materialized view MV1 and refreshed using dbms_mview.refresh option and it worked.
    dbms_mview.refresh (list => 'MV1', method => 'F');
    My requirement is to refresh MV1 daily at 10.00 P.M. I created a procedure ( code attached below) to execute the dbms_mview.refresh and scheduled the procedure to run at 10.00 P.M.
    I am getting the following error in a regular basis not always.
    ORA-06502: PL/SQL: numeric or value error: raw variable length too long
    Kindly do the needfull.
    PACKAGE:
    CREATE OR REPLACE PACKAGE BODY PKG_COMMON
    AS
    LOG EXCEPTIONS
    PROCEDURE log (
    p_package IN ttfa_log.package_name%TYPE DEFAULT NULL,
    p_procedure IN ttfa_log.procedure_name%TYPE DEFAULT NULL,
    p_log_priority IN ttfa_log.log_priority%TYPE DEFAULT 'INFO',
    p_params IN ttfa_log.parameters%TYPE DEFAULT NULL,
    p_line_number IN ttfa_log.line_number%TYPE DEFAULT NULL,
    p_error_stack IN VARCHAR2 DEFAULT NULL,
    p_error_backtrace IN VARCHAR2 DEFAULT NULL
    IS
    l_step PLS_INTEGER := 0;
    l_log_date DATE;
    PRAGMA AUTONOMOUS_TRANSACTION;
    BEGIN
    l_step := 20;
    l_log_date := sysdate;
    l_step := 40;
    INSERT INTO ttfa_log
    ( log_id
    ,log_date
    ,log_priority
    ,username
    ,package_name
    ,procedure_name
    ,line_number
    ,error_code
    ,log_message
    ,backtrace_tmp
    ,parameters
    ,partition_key
    VALUES
    ( ttfa_log_id_seq.NEXTVAL
    ,l_log_date
    ,p_log_priority
    ,LOWER(USER)
    ,p_package
    ,p_procedure
    ,p_line_number
    ,SUBSTR( p_error_stack, 1, INSTR(p_error_stack,':') - 1 )
    ,substr(p_error_stack,1,4000)
    ,substr(p_error_backtrace,1,4000)
    ,p_params
    ,EXTRACT(MONTH FROM l_log_date)
    COMMIT;
    EXCEPTION
    WHEN OTHERS
    THEN
    RAISE_APPLICATION_ERROR(-20001, 'Error in pkg_ttfa_log.log ' ||chr(13) || 'Actual Error=>' ||DBMS_UTILITY.FORMAT_ERROR_STACK);
    END log;
    REFRESH MATERIALIZED VIEW
    PROCEDURE refresh_mi_mvs
    IS
    BEGIN
    -- Refresh Materialized View
    BEGIN
    dbms_mview.refresh (list => 'MV1', method => 'F');
    EXCEPTION
    WHEN OTHERS THEN
    log (
    p_package => 'PKG_COMMON'
    ,p_procedure => 'refresh_mvs'
    ,p_log_priority => 'ERROR'
    ,p_params => 'MV1'
    ,p_line_number => 40
    ,p_error_stack => DBMS_UTILITY.FORMAT_ERROR_STACK
    ,p_error_backtrace => DBMS_UTILITY.FORMAT_ERROR_BACKTRACE
    ROLLBACK;
    END;
    EXCEPTION
    WHEN OTHERS THEN
    log (
    p_package => 'PKG_COMMON'
    ,p_procedure => 'refresh_mi_mvs'
    ,p_log_priority => 'ERROR'
    ,p_params => 'Package Exception'
    ,p_line_number => 90
    ,p_error_stack => DBMS_UTILITY.FORMAT_ERROR_STACK
    ,p_error_backtrace => DBMS_UTILITY.FORMAT_ERROR_BACKTRACE
    ROLLBACK;
    END;
    END PKG_TTFA_COMMON;

    It impossible from what you have posted to know whether the issue is what you are passing to Oracle or what you have written yourself. Have your run a trace? If not that is the first step.
    And when you post next ... a version number would be very helpful.

  • Buffer to small ORA-22835 error after migration from 9i to 10g

    Hello Oracle-Experts,
    I had to calculate hash-values for a corresponding clob-field which worked with oracle 9i (9.0.2.1)
    After migration to oracle 10g (10.2.0.1.0) I get an ORA-22835 error (Buffer too small for CLOB to CHAR conversion.
    Here is the output for the 10g version:     
         SQL*Plus: Release 10.2.0.1.0 - Production on Mi Jun 13 16:19:28 2007
         Copyright (c) 1982, 2005, Oracle. All rights reserved.
         Verbunden mit:
         Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
         With the Partitioning, OLAP and Data Mining options
         SQL> CREATE TABLE test_conv (value CLOB);
         Tabelle wurde erstellt. (Table created.)
         SQL> DECLARE vLong LONG:= LPAD('M',4400,'M');
         2 BEGIN
         3 INSERT INTO test_conv(value) VALUES (vLong);
         4 END;
         5 /
         PL/SQL-Prozedur erfolgreich abgeschlossen. (PL/SQL procedure successfully completed.)
         SQL> SELECT dbms_utility.get_hash_value(value,1,power(2,30)) from test_conv;
         SELECT dbms_utility.get_hash_value(value,1,power(2,30)) from test_conv
         FEHLER in Zeile 1:
         ORA-22835: Puffer zu klein für Konvertierung von CLOB zu CHAR oder BLOB zu RAW
         (tatsächlich: 4400, maximal: 4000)
         (Buffer too small for CLOB to CHAR or BLOB to RAW conversion (actual: 4400, maximum: 4000))
    This is the result with     9i
         Verbunden mit:
         Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production
         With the Partitioning, OLAP and Oracle Data Mining options
         JServer Release 9.2.0.1.0 - Production
         SQL> CREATE TABLE test_conv (value CLOB);
         Tabelle wurde angelegt.     (Table created.)
         SQL> DECLARE vLong LONG:= LPAD('M',4400,'M');
         2 BEGIN
         3 INSERT INTO test_conv(value) VALUES (vLong);
         4 END;
         5 /
         PL/SQL-Prozedur wurde erfolgreich abgeschlossen. (PL/SQL procedure successfully completed.)
         SQL> SELECT dbms_utility.get_hash_value(value,1,power(2,30)) from test_conv;
         DBMS_UTILITY.GET_HASH_VALUE(VALUE,1,POWER(2,30))
         478332438
    Any help is appreciated.
    Best Regards
    Matthias

    You have hit a bug, 3984527 - CLOB LARGER THAN 4000 INSERTED INTO VARCHAR2(4000) COLUMN IS.
    You may want to check this metalink note: Note:388512.1 for further explanation and workarouds.
    From the error message manual, Verbatim:
    ORA-22835: Buffer too small for CLOB to CHAR or BLOB to RAW conversion (actual: string, maximum: string)
    Cause: An attempt was made to convert CLOB to CHAR or BLOB to RAW, where the LOB size was bigger than the buffer limit for CHAR and RAW types. Note that widths are reported in characters if character length semantics are in effect for the column, otherwise widths are reported in bytes.
    Action: Do one of the following:
    1. Make the LOB smaller before performing the conversion, for example, by using SUBSTR on CLOB
    2. Use DBMS_LOB.SUBSTR to convert CLOB to CHAR or BLOB to RAW.
    ~ Madrid.

  • Very weird ORA-06502 error while creating procedure

    Hi All,
    i try to create the following procedure (on a 10.2 database):
    create or replace procedure audit_report
    as
    cursor c_audit_user (b_start_date date, b_end_date date)
    is
    select user_id
    , os_user
    , session_id
    , host
    , last_program
    , last_action
    , last_module
    , to_char(logon_day,'dd-mm-yyyy') logon_day
    , logon_time
    , to_char(logoff_day,'dd-mm-yyyy') logoff_day
    , logoff_time
    , elapsed_minutes
    from audit_user
    where logon_day >= b_start_date
    and logon_day < b_end_date
    order by logon_day desc
    cursor c_audit_ddl (b_start_date in date, b_end_date in date)
    is
    select user_name
    , to_char(ddl_date,'dd-mm-yyyy hh24:mi:ss') ddl_date
    , ddl_type
    , object_type
    , owner
    , object_name
    , sql_text
    from audit_ddl
    where ddl_date >= b_start_date
    and ddl_date < b_end_date
    order by ddl_date desc
    cursor c_audit_trail (b_start_date in date, b_end_date in date)
    is
    select os_username
    , username
    , to_char(timestamp,'dd-mm-yyyy hh24:mi:ss') timestamp
    , owner
    , obj_name
    , to_char(action) action
    , action_name
    , decode(ses_actions,'---S------------','DELETE',
    '------S---------','INSERT',
    '---------S------','SELECT',
    '----------S-----','UPDATE',
    '---S--S--S------','DELETE/INSERT/SELECT',
    '---S--S--SS-----','DELETE/INSERT/SELECT/UPDATE',
    '------S--S------','INSERT/SELECT',
    '------S--SS-----','INSERT/SELECT/UPDATE',
    '---------SS-----','SELECT/UPDATE',
    'DDL ACTION') ses_actions
    , priv_used
    from dba_audit_Trail
    where username <> 'DBSNMP'
    and timestamp >= b_start_date
    and timestamp < b_end_date
    order by timestamp desc
    v_header_user varchar2(255);
    v_sep_user varchar2(255);
    v_header_ddl varchar2(255);
    v_sep_ddl varchar2(255);
    v_header_dml varchar2(255);
    v_sep_dml varchar2(255);
    v_record_user varchar2(255);
    v_record_ddl varchar2(255);
    v_record_dml varchar2(255);
    v_report utl_file.file_type;
    v_file_dir varchar2(255);
    v_file_name varchar2(255);
    v_start_date date;
    v_end_date date;
    v_db_name varchar2(255);
    begin
    -- Find start and end date of previous week (Sunday to Monday)
    if to_char(sysdate,'DAY') = 'MONDAY' then
    v_start_date := trunc(sysdate-8);
    v_end_date := trunc(sysdate-1);
    elsif
    to_char(sysdate,'DAY') = 'TUESDAY' then
    v_start_date := trunc(sysdate-9);
    v_end_date := trunc(sysdate-2);
    elsif
    to_char(sysdate,'DAY') = 'WEDNESDAY' then
    v_start_date := trunc(sysdate-10);
    v_end_date := trunc(sysdate-3);
    elsif
    to_char(sysdate,'DAY') = 'THURSDAY' then
    v_start_date := trunc(sysdate-11);
    v_end_date := trunc(sysdate-4);
    elsif
    to_char(sysdate,'DAY') = 'FRIDAY' then
    v_start_date := trunc(sysdate-12);
    v_end_date := trunc(sysdate-5);
    elsif
    to_char(sysdate,'DAY') = 'SATURDAY' then
    v_start_date := trunc(sysdate-13);
    v_end_date := trunc(sysdate-6);
    elsif
    to_char(sysdate,'DAY') = 'SUNDAY' then
    v_start_date := trunc(sysdate-14);
    v_end_date := trunc(sysdate-7);
    end if;
    --Fill headers
    v_header_user := 'USER_ID OS_USER SESSION_ID HOST LAST_PROGR'||
    ' LAST_ACTION LAST_MODULE LOGON_DAY'||
    ' LOGON_TI LOGOFF_DAY LOGOFF_T ELAPSED_MINUTES';
    v_sep_user := '---------- --------- ---------- -------- ----------'||
    '-------------------- ----------- ----------- ---------'||
    v_header_ddl := 'USER_NAME DDL_DATE DDL_TYPE OBJECT_TYPE'||
    ' OWNER OBJECT_NAME SQL_TEXT';
    v_sep_ddl := '---------- --------------------- ---------- -----------'||
    '--------- ---------- -------------------- -------------'||
    v_header_dml := 'OS_USERNAME USERNAME TIMESTAMP OWNER'||
    ' OBJ_NAME ACTION ACTION_NAME SES_ACTIONS'||
    ' PRIV_USED';
    v_sep_dml := '----------- ---------- --------------------- ---------- '||
    '--------------- ------ --------------- ------------------'||
    --Create audit report file
    v_file_dir := 'AUDIT_REPORT_DIR';
    select name
    into v_db_name
    from v$database;
    v_file_name := 'audit_report_'||v_db_name||'_'||to_char(v_start_date,'yyyymmdd')||'-'||to_char(v_end_date-1,'yyyymmdd')||'.log';
    v_report := utl_file.fopen(v_file_dir, v_file_name, 'w');
    --Report Header
    utl_file.put_line(v_report,'AUDIT REPORT');
    utl_file.put_line(v_report,'------------');
    utl_file.put_line(v_report,'Database: '||v_db_name);
    utl_file.put_line(v_report,'From : '||to_char(trunc(v_start_date),'dd-mm-yyyy'));
    utl_file.put_line(v_report,'To : '||to_char(trunc(v_end_date),'dd-mm-yyyy'));
    utl_file.put_line(v_report,'Created : '||to_char(sysdate,'dd-mm-yyyy hh24:mi:ss'));
    utl_file.new_line(v_report);
    --Report Detail records
    utl_file.put_line(v_report,v_header_user);
    utl_file.put_line(v_report,v_sep_user);
    for r_audit_user in c_audit_user(v_start_date,v_end_date) loop
    v_record_user := rpad(r_audit_user.user_id,11,' ')||
    rpad(r_audit_user.os_user,11,' ')||
    rpad(r_audit_user.session_id,11,' ')||
    rpad(r_audit_user.host,9,' ')||
    rpad(r_audit_user.last_program,31,' ')||
    rpad(r_audit_user.last_action,12,' ')||
    rpad(r_audit_user.last_module,12,' ')||
    rpad(r_audit_user.logon_day,11,' ')||
    rpad(r_audit_user.logon_time,9,' ')||
    rpad(r_audit_user.logoff_day,11,' ')||
    rpad(r_audit_user.logoff_time,9,' ')||
    lpad(r_audit_user.elapsed_minutes,15,' ');
    utl_file.put_line(v_report,v_record_user);
    end loop;
    utl_file.new_line(v_report);
    utl_file.put_line(v_report,v_header_ddl);
    utl_file.put_line(v_report,v_sep_ddl);
    for r_audit_ddl in c_audit_ddl(v_start_date,v_end_date) loop
    v_record_ddl := rpad(r_audit_ddl.user_name,11,' ')||
    rpad(r_audit_ddl.ddl_date,22,' ')||
    rpad(r_audit_ddl.ddl_type,11,' ')||
    rpad(r_audit_ddl.object_type,21,' ')||
    rpad(r_audit_ddl.owner,11,' ')||
    rpad(r_audit_ddl.object_name,21,' ')||
    rpad(r_audit_ddl.sql_text,100,' ');
    utl_file.put_line(v_report,v_record_ddl);
    end loop;
    utl_file.new_line(v_report);
    utl_file.put_line(v_report,v_header_dml);
    utl_file.put_line(v_report,v_sep_dml);
    for r_audit_trail in c_audit_trail(v_start_date,v_end_date) loop
    v_record_dml := rpad(r_audit_trail.os_username,12,' ')||
    rpad(r_audit_trail.username,11,' ')||
    rpad(r_audit_trail.timestamp,22,' ')||
    rpad(r_audit_trail.owner,11,' ')||
    rpad(r_audit_trail.obj_name,16,' ')||
    rpad(r_audit_trail.action,7,' ')||
    rpad(r_audit_trail.action_name,16,' ')||
    rpad(r_audit_trail.ses_actions,19,' ')||
    rpad(r_audit_trail.priv_used,20,' ');
    utl_file.put_line(v_report,v_record_dml);
    end loop;
    utl_file.new_line(v_report);
    utl_file.put_line(v_report, '*** End of report ***');
    utl_file.fclose(v_report);
    end;
    This gives me the following error:
    ERROR at line 1:
    ORA-00604: error occurred at recursive SQL level 1
    ORA-06502: PL/SQL: numeric or value error: character string buffer too small
    ORA-06512: at line 8
    When i try to create the procedure as this, i get the same error:
    create or replace procedure audit_report
    as
    /*cursor c_audit_user (b_start_date date, b_end_date date)
    is
    select user_id
    , os_user
    , session_id
    , host
    , last_program
    , last_action
    , last_module
    , to_char(logon_day,'dd-mm-yyyy') logon_day
    , logon_time
    , to_char(logoff_day,'dd-mm-yyyy') logoff_day
    , logoff_time
    , elapsed_minutes
    from audit_user
    where logon_day >= b_start_date
    and logon_day < b_end_date
    order by logon_day desc
    cursor c_audit_ddl (b_start_date in date, b_end_date in date)
    is
    select user_name
    , to_char(ddl_date,'dd-mm-yyyy hh24:mi:ss') ddl_date
    , ddl_type
    , object_type
    , owner
    , object_name
    , sql_text
    from audit_ddl
    where ddl_date >= b_start_date
    and ddl_date < b_end_date
    order by ddl_date desc
    cursor c_audit_trail (b_start_date in date, b_end_date in date)
    is
    select os_username
    , username
    , to_char(timestamp,'dd-mm-yyyy hh24:mi:ss') timestamp
    , owner
    , obj_name
    , to_char(action) action
    , action_name
    , decode(ses_actions,'---S------------','DELETE',
    '------S---------','INSERT',
    '---------S------','SELECT',
    '----------S-----','UPDATE',
    '---S--S--S------','DELETE/INSERT/SELECT',
    '---S--S--SS-----','DELETE/INSERT/SELECT/UPDATE',
    '------S--S------','INSERT/SELECT',
    '------S--SS-----','INSERT/SELECT/UPDATE',
    '---------SS-----','SELECT/UPDATE',
    'DDL ACTION') ses_actions
    , priv_used
    from dba_audit_Trail
    where username <> 'DBSNMP'
    and timestamp >= b_start_date
    and timestamp < b_end_date
    order by timestamp desc
    v_header_user varchar2(255);
    v_sep_user varchar2(255);
    v_header_ddl varchar2(255);
    v_sep_ddl varchar2(255);
    v_header_dml varchar2(255);
    v_sep_dml varchar2(255);
    v_record_user varchar2(255);
    v_record_ddl varchar2(255);
    v_record_dml varchar2(255);
    v_report utl_file.file_type;
    v_file_dir varchar2(255);
    v_file_name varchar2(255);
    v_start_date date;
    v_end_date date;*/
    v_db_name varchar2(255);
    begin
    /*-- Find start and end date of previous week (Sunday to Monday)
    if to_char(sysdate,'DAY') = 'MONDAY' then
    v_start_date := trunc(sysdate-8);
    v_end_date := trunc(sysdate-1);
    elsif
    to_char(sysdate,'DAY') = 'TUESDAY' then
    v_start_date := trunc(sysdate-9);
    v_end_date := trunc(sysdate-2);
    elsif
    to_char(sysdate,'DAY') = 'WEDNESDAY' then
    v_start_date := trunc(sysdate-10);
    v_end_date := trunc(sysdate-3);
    elsif
    to_char(sysdate,'DAY') = 'THURSDAY' then
    v_start_date := trunc(sysdate-11);
    v_end_date := trunc(sysdate-4);
    elsif
    to_char(sysdate,'DAY') = 'FRIDAY' then
    v_start_date := trunc(sysdate-12);
    v_end_date := trunc(sysdate-5);
    elsif
    to_char(sysdate,'DAY') = 'SATURDAY' then
    v_start_date := trunc(sysdate-13);
    v_end_date := trunc(sysdate-6);
    elsif
    to_char(sysdate,'DAY') = 'SUNDAY' then
    v_start_date := trunc(sysdate-14);
    v_end_date := trunc(sysdate-7);
    end if;
    --Fill headers
    v_header_user := 'USER_ID OS_USER SESSION_ID HOST LAST_PROGR'||
    ' LAST_ACTION LAST_MODULE LOGON_DAY'||
    ' LOGON_TI LOGOFF_DAY LOGOFF_T ELAPSED_MINUTES';
    v_sep_user := '---------- --------- ---------- -------- ----------'||
    '-------------------- ----------- ----------- ---------'||
    v_header_ddl := 'USER_NAME DDL_DATE DDL_TYPE OBJECT_TYPE'||
    ' OWNER OBJECT_NAME SQL_TEXT';
    v_sep_ddl := '---------- --------------------- ---------- -----------'||
    '--------- ---------- -------------------- -------------'||
    v_header_dml := 'OS_USERNAME USERNAME TIMESTAMP OWNER'||
    ' OBJ_NAME ACTION ACTION_NAME SES_ACTIONS'||
    ' PRIV_USED';
    v_sep_dml := '----------- ---------- --------------------- ---------- '||
    '--------------- ------ --------------- ------------------'||
    --Create audit report file
    v_file_dir := 'AUDIT_REPORT_DIR';
    select name
    into v_db_name
    from v$database;
    v_file_name := 'audit_report_'||v_db_name||'_'||to_char(v_start_date,'yyyymmdd')||'-'||to_char(v_end_date-1,'yyyymmdd')||'.log';
    v_report := utl_file.fopen(v_file_dir, v_file_name, 'w');
    --Report Header
    utl_file.put_line(v_report,'AUDIT REPORT');
    utl_file.put_line(v_report,'------------');
    utl_file.put_line(v_report,'Database: '||v_db_name);
    utl_file.put_line(v_report,'From : '||to_char(trunc(v_start_date),'dd-mm-yyyy'));
    utl_file.put_line(v_report,'To : '||to_char(trunc(v_end_date),'dd-mm-yyyy'));
    utl_file.put_line(v_report,'Created : '||to_char(sysdate,'dd-mm-yyyy hh24:mi:ss'));
    utl_file.new_line(v_report);
    --Report Detail records
    utl_file.put_line(v_report,v_header_user);
    utl_file.put_line(v_report,v_sep_user);
    for r_audit_user in c_audit_user(v_start_date,v_end_date) loop
    v_record_user := rpad(r_audit_user.user_id,11,' ')||
    rpad(r_audit_user.os_user,11,' ')||
    rpad(r_audit_user.session_id,11,' ')||
    rpad(r_audit_user.host,9,' ')||
    rpad(r_audit_user.last_program,31,' ')||
    rpad(r_audit_user.last_action,12,' ')||
    rpad(r_audit_user.last_module,12,' ')||
    rpad(r_audit_user.logon_day,11,' ')||
    rpad(r_audit_user.logon_time,9,' ')||
    rpad(r_audit_user.logoff_day,11,' ')||
    rpad(r_audit_user.logoff_time,9,' ')||
    lpad(r_audit_user.elapsed_minutes,15,' ');
    utl_file.put_line(v_report,v_record_user);
    end loop;
    utl_file.new_line(v_report);
    utl_file.put_line(v_report,v_header_ddl);
    utl_file.put_line(v_report,v_sep_ddl);
    for r_audit_ddl in c_audit_ddl(v_start_date,v_end_date) loop
    v_record_ddl := rpad(r_audit_ddl.user_name,11,' ')||
    rpad(r_audit_ddl.ddl_date,22,' ')||
    rpad(r_audit_ddl.ddl_type,11,' ')||
    rpad(r_audit_ddl.object_type,21,' ')||
    rpad(r_audit_ddl.owner,11,' ')||
    rpad(r_audit_ddl.object_name,21,' ')||
    rpad(r_audit_ddl.sql_text,100,' ');
    utl_file.put_line(v_report,v_record_ddl);
    end loop;
    utl_file.new_line(v_report);
    utl_file.put_line(v_report,v_header_dml);
    utl_file.put_line(v_report,v_sep_dml);
    for r_audit_trail in c_audit_trail(v_start_date,v_end_date) loop
    v_record_dml := rpad(r_audit_trail.os_username,12,' ')||
    rpad(r_audit_trail.username,11,' ')||
    rpad(r_audit_trail.timestamp,22,' ')||
    rpad(r_audit_trail.owner,11,' ')||
    rpad(r_audit_trail.obj_name,16,' ')||
    rpad(r_audit_trail.action,7,' ')||
    rpad(r_audit_trail.action_name,16,' ')||
    rpad(r_audit_trail.ses_actions,19,' ')||
    rpad(r_audit_trail.priv_used,20,' ');
    utl_file.put_line(v_report,v_record_dml);
    end loop;
    utl_file.new_line(v_report);
    utl_file.put_line(v_report, '*** End of report ***');
    utl_file.fclose(v_report);*/
    null;
    end;
    So all code is commented out, but still the error.
    Any ideas?
    Kind regards,
    Dave

    just out of interest, what output do you get if you desc user_source?
    I get:
    NAME                                               VARCHAR2(30)               
    TYPE                                               VARCHAR2(12)               
    LINE                                               NUMBER                     
    TEXT                                               VARCHAR2(4000)        

Maybe you are looking for

  • How to upload Purchase oder text through BDC. or BAPI

    Hi...    I wish to know how to upload purchase oder text wich is in MM01 t-code and has a screen number 4040 and program name SAPLMGMM, i want to migrate a material master data to another client by this fields, Basic, Purchasing, Purchase oder text (

  • Macbook as extension of Imac

    Ok new to this... I want to use my macbook as a mobile version of my imac and not as two separate computers, so everytime I use my Imac I just update my macbook..I understand they're two different specs but can this still be done?

  • HT4528 flickering issues

    i am having flickering issues with my screen lately and i adjusted the brightness and have done many resets and i cant get it to stop.  there is also blurring of lines from white lettering to dark screen. does anyone know a fix for this issue? thanx

  • Why do DNS servers log in to my Router ?

    When I check the IP address of the computers logging in to my Wireless Router, I sometimes see two DNS addresses (DNS addresses from my internet Service provider) logged in. DSoes that mean that I am being hacked ?  Thanks for any information.

  • HT2905 Can I delete albums in folder on hard drive

    I am trying to clean up harddrive space on my laptop, all my albums are in a MP3 folder and Itunes folder. Can I delete the MP3 folder?