Error using dbms_redefinition package

Hi,
I am trying to use dbms_redefinition package to add a column to a table using primary key method
SQL> conn / as sysdba
Connected.
SQL> grant execute on sys.dbms_redefinition to hr;
Grant succeeded.
SQL> grant dba to hr;
Grant succeeded.
SQL> conn hr/<password>
Connected.
SQL> create table tab1(roll_no number constraint roll_pk primary key,last_name varchar2(30));
Table created.
SQL> insert into tab1 values (1,'Hall');
1 row created.
SQL> commit;
Commit complete.
SQL> insert into tab1 values (2,'Mall');
1 row created.
SQL> commit;
Commit complete.
SQL> insert into tab1 values (3,'Roll');
1 row created.
SQL> commit;
Commit complete.
Adding required column
SQL>
SQL> alter table tab1 add(first_name varchar2(30));
Table altered.
Checking if table can be redefined
SQL> exec dbms_redefinition.can_redef_table('HR','TAB1',DBMS_REDEFINITION.CONS_USE_PK);
PL/SQL procedure successfully completed.
Creating interim table
SQL> create table tab2 as select roll_no,first_name,last_name from tab1 where 1=2;
Table created.
Adding primary key to interim table
SQL> alter table tab2 add constraint roll_pk_1 primary key (roll_no);
Table altered.
Starting redefinition :
SQL> exec dbms_redefinition.start_redef_table('HR','TAB1','TAB2','ROLL_NO,FIRST_NAME,LAST_NAME');
BEGIN dbms_redefinition.start_redef_table('HR','TAB1','TAB2','ROLL_NO,FIRST_NAME,LAST_NAME'); END;
ERROR at line 1:
ORA-00439: feature not enabled: Advanced replication
ORA-06512: at "SYS.DBMS_REDEFINITION", line 52
ORA-06512: at "SYS.DBMS_REDEFINITION", line 1646
ORA-06512: at line 1
SQL>
Could you please help.
Thanks,
Haider

You can, yes. That's why CAN_REDEF_TABLE and START_REDEF_TABLE both have an OPTIONS_FLAG argument that lets you specify whether you want to use the primary key or the ROWID to redefine the table.
SQL> drop table foo;
Table dropped.
SQL> create table foo( col1 number, col2 number );
Table created.I can't redefine the table using the primary key since there is no primary key
SQL> ed
Wrote file afiedt.buf
  1  begin
  2    sys.DBMS_REDEFINITION.CAN_REDEF_TABLE ( 'SCOTT', 'FOO' );
  3* end;
SQL> /
begin
ERROR at line 1:
ORA-12089: cannot online redefine table "SCOTT"."FOO" with no primary key
ORA-06512: at "SYS.DBMS_REDEFINITION", line 139
ORA-06512: at "SYS.DBMS_REDEFINITION", line 1782
ORA-06512: at line 2But I can use the ROWID
SQL> ed
Wrote file afiedt.buf
  1  begin
  2    sys.DBMS_REDEFINITION.CAN_REDEF_TABLE ( 'SCOTT', 'FOO', dbms_redefinition.cons_use_rowid );
  3* end;
SQL> /
PL/SQL procedure successfully completed. Justin

Similar Messages

  • Error with dbms_redefinition package?

    Hi everybody!
    I have a table ‘object_log’(it is partioned) .
    I used dbms_redefinition to change its partion , and evrythink was ok.
    When I tried to redefine this table for the second time it failed!
    I run this script
    BEGIN
    DBMS_REDEFINITION.start_redef_table(
    uname => 'TL_ETL',
    orig_table => 'OBJECT_LOG',
    int_table => 'OBJECT_LOG2');
    END;
    This is the error:
    Ora-12008 error in materialized view refresh path

    Sorry, I didn'see the other errors
    evrything is clear now :)
    ORA-12008: error in materialized view refresh path
    ORA-14400: inserted partition key does not map to any partition
    ORA-06512: at "SYS.DBMS_REDEFINITION", line 50
    ORA-06512: at "SYS.DBMS_REDEFINITION", line 1343
    ORA-06512: at line 2

  • Error using SAPM --  package SAPKGPAD08

    Hi
    I am trying to update the EA-APPL packages through SPAM
    my current patch level is 7 and i am trying to load patch 8
    package name SAPKGPAD08
    i have checked for all dependencies, extra .. everything ok
    i get error during import phase.. with exit code 8
    below is the log file .. (the end of the file)
    ==================================
    file  == SAPPGPAD08.DEV.txt
    ==================================
    2EETW165 Function "REIT_GUI_TC_BASE_POPUP (REIT_GUI_TC_BASE_POPUP|01)" does not fit into the existing function group "(REIT_GUI_TC_BASE|02)".
    2 ETW167 Please transport the whole function group.
    4 ETW000      table SPROXDAT: entry in DB is 32 bytes bigger than in file.
    4 ETW000      ... ignoring such differences.
    4 ETW000      table APB_LPD_CONTROL: entry in DB is 1 byte bigger than in file.
    4 ETW000      ... ignoring such differences.
    4 ETW000      table FPB_EXP_CA_ASSM: entry in DB is 12 bytes smaller than in file.
    4 ETW000      ... ignoring such differences.
    3WETW109 table "FPB_EXP_CA_ITM1" does not exist in nametab.
    3WETW109 table "FPB_EXP_CA_ITM1T" does not exist in nametab.
    3WETW109 table "FPB_EXP_PATHS" does not exist in nametab.
    4 ETW000      table FPB_EXP_SCEN: entry in DB is 30 bytes smaller than in file.
    4 ETW000      ... ignoring such differences.
    3WETW109 table "FPB_EXP_SECT" does not exist in nametab.
    3WETW109 table "FPB_EXP_SECTT" does not exist in nametab.
    3WETW109 table "FPB_EXP_SRVOTYPS" does not exist in nametab.
    4 ETW000      table FPB_EXP_STPGRP: entry in DB is 1 byte smaller than in file.
    4 ETW000      ... ignoring such differences.
    3WETW109 table "TIVITTCEXECREG" does not exist in nametab.
    3WETW109 table "TIVITTCEXECREGT" does not exist in nametab.
    3WETW109 table "TIVITTCREGVAR" does not exist in nametab.
    3WETW109 table "TIVITTCREGVART" does not exist in nametab.
    4 ETW690 "0" "0"
    4 ETW000 COMMIT (30868956).
    4 ETW000 30868956 bytes read.
    4 ETW000 Transport overhead 29.6 %.
    4 ETW000 Data compressed to 8.3 %.
    4 ETW000 Duration: 7 sec (4409851 bytes/sec).
    3 ETW710 "0" "0"
    4 ETW000  [dev trc     ,00000]  Sun May 13 20:44:43 2007                         6137953  6.137953
    4 ETW000  [dev trc     ,00000]  Disconnecting from ALL connections:                   24  6.137977
    4 ETW000  [dev trc     ,00000]  disconnected from 'DEV', con_hdl=0                  1863  6.139840
    4 ETW000  [dev trc     ,00000]  Disconnected from connection 0                        82  6.139922
    4 ETW000  [dev trc     ,00000]  statistics db_con_commit (com_total=2, com_tx=2)
    4 ETW000                                                                              28  6.139950
    4 ETW000  [dev trc     ,00000]  statistics db_con_rollback (roll_total=0, roll_tx=0)
    4 ETW000                                                                              23  6.139973
    4 ETW000 Disconnected from database.
    4 ETW000 End of Transport (0008).
    4 ETW000 date&time: 13.05.2007 - 20:44:43
    4 ETW000 10 warnings occured.
    4 ETW000 1 error occured.
    1 ETP152 TESTIMPORT
    1 ETP110 end date and time   : "20070513204443"
    1 ETP111 exit code           : "8"
    1 ETP199 ######################################
    ================================================
    Any help would be much appreciated
    regards
    abdul.

    Finally ..
    I was able to solve these errors
    Solution:  ( for others reference.. maybe it might help someone ..like me)
    Steps
    I had created a queue with the ea appl packages 7 and 8.
    first i deleted this queue.. (as it was in test phase i could)
    then i choose only package 7 and uploaded it.. (the error was with package 8)
    then i updated package ea dfps (7)  .... as i needed that also
    then i updated package ecc-dimp(7)....as i needed this too
    during which i had to increase the appheapsz of the db (ibm db udb 9)
    through its control center..
    and its log file size ... (this as i was getting sql error 945 during import of ecc dimp 7)
    then  after all the 7 level packages had gone
    i updated package level 8 of ea appl .........( it went like a breeze)
    no headaches
    then i was also able to update 8 level packages of ea dfps and ecc dimp
    maybe this might help someone ..... maybe not
    thanks to all of u guys who tried to help
    regards
    Abdul

  • Negative effects by using DBMS_REDEFINITION package

    Hello everybody,
    I am looking for all 'bad' side effects of using the package.
    I am in project where the definition of tables changes.
    Sometimes a column needs to be placed in the middle of the table.
    Up to now there are scripts which doing a lot of drops of columns, updates, add adds again.
    My idea was to use the package, which I could test successfully.
    Now I learned, that the grants to the table are lost.
    What else should be concerned by using the package?
    Thanks

    Hi,
    Sometimes a column needs to be placed in the middle of the table.hmm and why do you need some redefinition/reorg for the table - just put the columns on the right place in the select statement?
    Now I learned, that the grants to the table are lost.hmm not "really"... have a look at the procedure "COPY_TABLE_DEPENDENTS".
    http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14258/d_redefi.htm#sthref5656
    -> This subprogram is used to clone the dependent objects like grants, triggers, constraints and privileges from the table being redefined to the interim table (which represents the post-redefinition table).
    Side effects:
    You need to create/rebuild the indexes.. because of the rowids change.
    Btw. your scenario seems a little bit "strange" to me...
    Regards
    Stefan

  • Runtime error using utl_file package

    Hi Friends,
    This is the procedure for reading sample data from flat file , but it won't work.
    create or replace procedure test_utl_file
    is
    ftype utl_file.file_type;
    ch varchar2(200);
    begin
    ftype := utl_file.FOPEN('C:\oracle\temp','data.txt,R');
    utl_file.get_line(ftype,ch);
    dbms_output.put_line(ch);
    end;
    This code is compiled succesfully , but at runtime it shows an error msg
    ORA-29280: invalid directory path
    ORA-06512: at "SYS.UTL_FILE", line 33
    ORA-06512: at "SYS.UTL_FILE", line 436
    ORA-06512: at "SCOTT.TEST_UTL_FILE", line 7
    ORA-06512: at line 1
    I had entered the directory entry in int.ora file
    utl_file_dir=C:\oracle\temp
    & i used another way also,
    by using alter set utl_file_dir=C:\oracle\temp scope=spfile;
    Can anyone help me to resolve this problem.
    Rgrds,
    Anand

    What database version are you using?
    The UTL_FILE_DIR parameter has been deprecated by oracle in favour of direcory objects because of it's security problems.
    The correct thing to do is to create a directory object e.g.:
    CREATE OR REPLACE DIRECTORY mydir AS 'c:\myfiles';
    Note: This does not create the directory on the file system. You have to do that yourself and ensure that oracle has permission to read/write to that file system directory.
    Then, grant permission to the users who require access e.g....
    GRANT READ,WRITE ON DIRECTORY mydir TO myuser;
    Then use that directory object inside your FOPEN statement e.g.
    fh := UTL_FILE.FOPEN('MYDIR', 'myfile.txt', 'r');
    Note: You MUST specify the directory object name in quotes and in UPPER case for this to work as it is a string that is referring to a database object name which will have been stored in uppercase by default.

  • Error using DBMS_METADATA package

    Hi All,
    I have the following query and trying to get the DDLs for the foreign Key constraint on tables
    SELECT   TO_CHAR (DBMS_METADATA.get_ddl ('CONSTRAINT', constraint_name))
               || ';'
        FROM   all_constraints
       WHERE   status = 'ENABLED'
               AND table_name IN
                        ('OD_MF_ACCT_PLCY')
    ORDER BY   table_name;I am getting the following error:
    ORA-31603: object "ACCTROLE_FK_ACCTPLCY" of type CONSTRAINT not found in schema "D_OD"
    ORA-06512: at "SYS.DBMS_SYS_ERROR", line 105
    ORA-06512: at "SYS.DBMS_METADATA", line 2806
    ORA-06512: at "SYS.DBMS_METADATA", line 4333
    ORA-06512: at line 1
    Note able to decipher the same. Could you help me what it means?
    Thanks,
    Saff

    The table is in D_OD only.
    But I think I got the error...Was just reading about various constant types....instead of CONSTRAINT i think I need to give REF_CONSTRAINT as the type...
    This worked out
    SELECT   TO_CHAR (DBMS_METADATA.get_ddl ('REF_CONSTRAINT', constraint_name))
               || ';'
        FROM   user_constraints
       WHERE   status = 'ENABLED' AND constraint_type = 'R'
               AND table_name IN
                        ('OD_MF_ACCT_PLCY')
    ORDER BY   table_name;Thanks,
    Saff
    Edited by: saffron on Feb 1, 2010 1:19 PM

  • Error while sending a mail using UTP_MAIL package in Oracle 10g

    Hi,
    We are using UTP_MAIL package to send a mail from Oracle 10g.We have follwed the following steps ...
    SQL> connect sys/password as sysdba
    Connected.
    SQL> @$ORACLE_HOME/rdbms/admin/utlmail.sql
    Package created.
    Synonym created.
    SQL> @$ORACLE_HOME /rdbms/admin/prvtmail.plb
    Package body created.
    SQL > alter system set smtp_out_server = '<mail_server_ip:25>' scope =spfile;
    System altered..
    Now we try the code
    begin
    utl_mail.send(
    sender => 'sender's mail',
    recipients => 'receiver mail',
    CC => 'optional',
    subject => 'Testing utl_mail',
    message => 'Test Mail'
    end;
    But we get the following error...
    ERROR at line 1:
    ORA-29278: SMTP transient error: 421 Service not available
    ORA-06512: at "SYS.UTL_SMTP", line 21
    ORA-06512: at "SYS.UTL_SMTP", line 97
    ORA-06512: at "SYS.UTL_SMTP", line 139
    ORA-06512: at "SYS.UTL_MAIL", line 405
    ORA-06512: at "SYS.UTL_MAIL", line 594
    ORA-06512: at line 2
    We also tried connecting to the mail server through telnet .But it is not getting connected..
    Please help us to solve the issue.

    From your own posting you may have the clue, if you try to access your mail server through telnet and it is not successful, it means the service is down or there are networking issues.
    On pre 10gR2 versions there was a bug 4083461.8. It could affect you if you are on 10gR1
    "Bug 4083461 - UTL_SMTP.OPEN_CONNECTION in shared server fails with ORA-29278 Doc ID:      Note:4083461.8"
    This was fixed on 10gR2 base and on 9.2.0.8.0
    ~ Madrid

  • Error while invoking webservice using UTL_HTTP package

    Hi All,
    I am invoking a webservice (SOAP Request) from a PL/SQL block using UTL_HTTP package.
    I am able to send the complete request and am getting the required instance on the BPEL Console, but the process is errorring out while getting response back.
    and the PL/SQL Block is ending in error mentioned below:
    ERROR at line 1:
    ORA-29266: end-of-body reached
    ORA-06512: at "SYS.UTL_HTTP", line 1321
    ORA-06512: at "APPS.CSM_BPEL_TEST_PKG", line 34
    ORA-06512: at line 1
    Can anyone let me know what is the cause of this.
    Thanks in advance

    My guess would be that your request is not properly constructed,
    29266, 00000, "end-of-body reached"
    // *Cause:  The end of the HTTP response body was reached.
    // *Action: If the end of the HTTP response is reached prematurely, check if
    //          the HTTP response terminates prematurely.  Otherwise, end the
    //          HTTP response.John

  • Error while using UTL_DBWS package

    Hello
    I want to call a web service using UTL_DBWS package as explained in this link.
    http://www.oracle-base.com/articles/10g/utl_dbws10g.php
    I implemented the example successfully, and I need to my own web service.
    my web service is just a java class that return a hello world and a parameter. deployed on Integrated weblogic server shipped with Jdeveloper11g.
    here is my java class
    package ws;
    import javax.jws.Oneway;
    import javax.jws.WebMethod;
    import javax.jws.WebParam;
    import javax.jws.WebService;
    @WebService
    public class HelloWorld {
        public HelloWorld() {
        @WebMethod(action = "http://ws//sayHelloWorld")
        public String sayHelloWorld(){
            return "Hello World";
        @WebMethod(action = "http://ws//sayHelloWorld")
        public String sayHelloName(@WebParam(name = "arg0")
            String n){
            return "Hello " + n;
    }my WSDL is
      <?xml version="1.0" encoding="UTF-8" ?>
    - <!--  Published by JAX-WS RI at http://jax-ws.dev.java.net. RI's version is Oracle JAX-WS 2.1.5.
      -->
    - <!--  Generated by JAX-WS RI at http://jax-ws.dev.java.net. RI's version is Oracle JAX-WS 2.1.5.
      -->
    - <definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://ws/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://ws/" name="HelloWorldService">
    - <types>
    - <xsd:schema>
      <xsd:import namespace="http://ws/" schemaLocation="http://127.0.0.1:7101/Application15-Model-context-root/HelloWorldPort?xsd=1" />
      </xsd:schema>
      </types>
    - <message name="sayHelloWorld">
      <part name="parameters" element="tns:sayHelloWorld" />
      </message>
    - <message name="sayHelloWorldResponse">
      <part name="parameters" element="tns:sayHelloWorldResponse" />
      </message>
    - <message name="sayHelloName">
      <part name="parameters" element="tns:sayHelloName" />
      </message>
    - <message name="sayHelloNameResponse">
      <part name="parameters" element="tns:sayHelloNameResponse" />
      </message>
    - <portType name="HelloWorld">
    - <operation name="sayHelloWorld">
      <input message="tns:sayHelloWorld" />
      <output message="tns:sayHelloWorldResponse" />
      </operation>
    - <operation name="sayHelloName">
      <input message="tns:sayHelloName" />
      <output message="tns:sayHelloNameResponse" />
      </operation>
      </portType>
    - <binding name="HelloWorldPortBinding" type="tns:HelloWorld">
      <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" />
    - <operation name="sayHelloWorld">
      <soap:operation soapAction="http://ws//sayHelloWorld" />
    - <input>
      <soap:body use="literal" />
      </input>
    - <output>
      <soap:body use="literal" />
      </output>
      </operation>
    - <operation name="sayHelloName">
      <soap:operation soapAction="http://ws//sayHelloWorld" />
    - <input>
      <soap:body use="literal" />
      </input>
    - <output>
      <soap:body use="literal" />
      </output>
      </operation>
      </binding>
    - <service name="HelloWorldService">
    - <port name="HelloWorldPort" binding="tns:HelloWorldPortBinding">
      <soap:address location="http://127.0.0.1:7101/Application15-Model-context-root/HelloWorldPort" />
      </port>
      </service>
      </definitions>and my function is to call the web service
    CREATE OR REPLACE FUNCTION SAYHelloMYNAME (p_int_1 IN Varchar2)
      RETURN NUMBER
    AS
      l_service          UTL_DBWS.service;
      l_call                 UTL_DBWS.call;
      l_wsdl_url         VARCHAR2(32767);
      l_namespace        VARCHAR2(32767);
      l_service_qname    UTL_DBWS.qname;
      l_port_qname       UTL_DBWS.qname;
      l_operation_qname  UTL_DBWS.qname;
      l_xmltype_in        XMLTYPE;
      l_xmltype_out       XMLTYPE;
      l_return          VARCHAR2(100);
    BEGIN
      l_wsdl_url        := 'http://127.0.0.1:7101/Application15-Model-context-root/HelloWorldPort?wsdl';
      l_namespace       := 'http://ws/';
      l_service_qname   := UTL_DBWS.to_qname(l_namespace, 'HelloWorldService');
      l_port_qname      := UTL_DBWS.to_qname(l_namespace, 'HelloWorldPort');
      l_operation_qname := UTL_DBWS.to_qname(l_namespace, 'sayHelloName');
       l_service := UTL_DBWS.create_service (
        wsdl_document_location => URIFACTORY.getURI(l_wsdl_url),
        service_name           => l_service_qname);
      l_call := UTL_DBWS.create_call (
        service_handle => l_service,
        port_name      => l_port_qname,
        operation_name => l_operation_qname);
      l_xmltype_in :=  XMLTYPE('<?xml version="1.0" encoding="utf-8"?>
        <sayHelloWorld xmlns="' || l_namespace || '">
          <parameters>' || p_int_1 || '</parameters>
          </sayHelloWorld>');
      l_xmltype_out := UTL_DBWS.invoke(call_Handle => l_call,
                                       request     => l_xmltype_in);
      UTL_DBWS.release_call (call_handle => l_call);
      UTL_DBWS.release_service (service_handle => l_service);
      l_return := l_xmltype_out.extract('//return/text()').getstringVal();
      RETURN l_return;
    END;
    /but when I test the function I get this error
    ORA-29532: Java call terminated by uncaught Java exception: java.lang.IllegalAccessException: error.build.wsdl.model: oracle.j2ee.ws.common.tools.api.WsdlValidationException: Failed to read wsdl file at: "http://127.0.0.1:7101/Application15-Model-context-root/HelloWorldPort?wsdl", caused by: java.net.ConnectException.    : Connection refused
    ORA-06512: at "WSUSER.UTL_DBWS", line 193
    ORA-06512: at "WSUSER.UTL_DBWS", line 190
    ORA-06512: at "WSUSER.SAYHELLOMYNAME", line 24any suggestions?

    M.Jabr wrote:
    can you elaborate more on this?
    I can open http://127.0.0.1:7101/Application15-Model-context-root/HelloWorldPort?wsdl
    on my browser.Is your browser on that Oracle server? You are instructing Oracle server code (the UTL_DBWS package) to access that URL.
    The IP in that URL is a localhost IP address - and that means using the local IP stack only. So it expects a web server on the Oracle server platform on tcp port 7101. It cannot use that IP to access your client/development machine.
    How can I test it using UTL_HTTP?You can write a basic web browser, minus the rendering engine, using UTL_HTTP. You can also use it for web service calls - which is my preference as I deem the UTL_DBWS package to clunky and complex.
    See:
    {message:id=1925297} (sample PL/SQL web browser)
    {message:id=4205205} (sample PL/SQL web browser SOAP call)

  • Error while using UTL_FILE package

    I am getting error while using UTL_FILE package in apex 3.0 version
    Pls help me out.

    ok, how are you using UTL_FILE and what is the error?

  • Error when using DBMS_XMLDOM package

    Hello,
    I have created a set of triggers that use the DBMS_XMLDOM packages. These triggers were created on a Win 2k install of 9.2.0.2.1. A brand new user was created and a specific set of permissions granted. The permissions were:
    GRANT CONNECT, RESOURCE, AQ_ADMINISTRATOR_ROLE, AQ_USER_ROLE
    GRANT EXECUTE ON DBMS_AQADM
    GRANT EXECUTE ON DBMS_AQ
    grant execute on dbms_aqin
    execute dbms_java.grant_permission('<USER>', 'java.net.SocketPermission', 'localhost:1024-', 'accept, listen, resolve');
    execute dbms_java.grant_permission( '<USER>', 'SYS:java.lang.RuntimePermission', ' getClassLoader', '' )
    execute dbms_java.grant_permission( '<USER>', 'SYS:java.lang.RuntimePermission' , 'setContextClassLoader', '' )
    I then went to install these triggers on our application database server. This is a Solaris installation that started out as 9.2.0.1.0 and was then upgraded to 9.2.0.2.0. I created the user and granted the exact same permissions on this database. However, everytime I attempt to execute the triggers, or anything else that uses DBMS_XMLDOM packages, I get the following error:
    doc dbms_xmldom.DOMDocument;
    ERROR at line 3:
    ORA-06550: line 3, column 11:
    PLS-00201: identifier 'DBMS_XMLDOM.DOMDOCUMENT' must be declared
    I did not create the application database instance on the Solaris machine, but from what I've talked with the DBA, it was created as a general database, which is how I created my test databases. I also verified that the users in both databases have Execute on SYS.XMLDOM granted.
    Any ideas on why I might be getting this error?
    Thanks,
    Andrew

    When I try the describe, it says object not found. If I go into OEM, I don't see that package either. Again, I didn't create that database, but I thought the XML DB stuff was installed by default with the database. Is there a way to add that package after the database is created?
    Thanks,
    Andrew

  • Error logging using DBMS_ERRLOG package

    Hi All,
    We have following tables, which are growing day-by-day and giving performance problems.
    There are total 25 tables (1 parent and 24 child tables, with different structures).
    Here i gave some Samples, NOT actual table structures.
    Actually we don't require all the data for our regular activities.
    So we thought of moving part of the data into Other (Archive) tables, on daily basis.
    Using SOME criteria, we are finding eligible records to be moved into Archive tables.
    All child records follows the Parent.
    Original Tables
    ==================
    create table customer (c_id number(5), c_name varchar2(10),c_address varchar2(10));
    create table orders (o_id number(5),c_id number(5),o_info clob);
    create table personal_info (p_id number(5),c_id number(5), age number(3), e_mail varchar2(25), zip_code varchar2(10)):
    Archive Tables
    ==============
    create table customer_arch (c_id number(5), c_name varchar2(10),c_address varchar2(10));
    create table orders_arch (o_id number(5),c_id number(5),o_info varchar2(100));
    create table personal_info_arch (p_id number(5),c_id number(5), age number(3), e_mail varchar2(25), zip_code varchar2(10)):
    Temp table
    ==========
    create table C_temp (rnum number(5), ids number(5));
    Sample Code
    ============
    PROCEDURE payment_arch
    IS
         l_range_records NUMBER (4) := 2000;
         l_total_count NUMBER(10) := 0;
         l_prev_count NUMBER(10) := 0;
         l_next_count NUMBER(10) := 0;
    BEGIN
    --Finding eligible records to be moved into Archive tables.
    INSERT INTO C_TEMP
         SELECT ROWNUM,c_id FROM customer;
    SELECT NVL(MAX(ID),0) INTO l_total_count FROM OPP_PAYMENT_ID_TEMP;
    IF l_total_count > 0 -- Start Count check
    THEN
         LOOP     -- Insert Single payments
              IF ((l_total_count - l_prev_count) >= l_next_count )
              THEN
                   l_next_count := l_prev_count + l_range_records;
              ELSE
                   l_next_count := l_total_count;
              END IF;
              l_prev_count := l_prev_count ;
              INSERT INTO customer_ARCH
              SELECT * FROM customer a
              WHERE c_id in (SELECT c_id
              FROM C_TEMP b WHERE rnum BETWEEN l_prev_count AND l_next_count);
              INSERT INTO orders_ARCH
              SELECT * FROM orders a
              WHERE c_id in (SELECT c_id
              FROM C_TEMP b WHERE rnum BETWEEN l_prev_count AND l_next_count);
              INSERT INTO personal_info_ARCH
              SELECT * FROM personal_info a
              WHERE c_id in (SELECT c_id
              FROM C_TEMP b WHERE rnum BETWEEN l_prev_count AND l_next_count);
              --     Delete Archived Single Payments
              DELETE customer a
              WHERE c_id in (SELECT c_id
              FROM C_TEMP b WHERE ID BETWEEN l_prev_count AND l_next_count);
              COMMIT;
              IF l_next_count = l_total_count
              THEN
              EXIT;
              else
              l_prev_count := l_next_count;
              END IF;
         END LOOP;     -- Insert Single payments
    END IF; -- End Count check
    EXCEPTION
    WHEN NO_DATA_FOUND
    THEN
    NULL;
    WHEN OTHERS
    THEN
    RAISE_APPLICATION_ERROR('-20002','payment_arch: ' || SQLCODE ||': ' || SQLERRM);
    END Payment_Arch;
    In production, we may require to archive 25000 Parent records and 25000*4*3 child records per day.
    Now the problem is:
    By any chance, if record fails, We want to know the Exact record ,just "c_id" for the particular table
    where the error raised and Error message.
    We thought of using DBMS_ERRLOG package, but we CAN NOT log errors of Different tables into SINGLE error log table.
    In the above case It require 3 Different tables and it logs all columns from the original table.
    It's a un-necessary burden on the database.
    We would be very glad, if anyone can help us with some good thought.
    Thanks in advance.
    srinivas

    duplicate post
    Insufficient privilege error when executing DBMS_ERRLOG through PLSQL

  • Error while using DBMS_XMLSave package...

    Hi All,
    I am using DBMS_XMLSave package and when I try to execute the following code, it is giving me error "Java call terminated by uncaught Java exception:"
    I am executing following code ....
    declare
    insCtx DBMS_XMLSave.ctxType;
    begin
    insCtx := DBMS_XMLSave.newContext('scott.emp');
    end;
    I am getting following error ...
    ERROR at line 1:
    ORA-29532: Java call terminated by uncaught Java exception:
    java.lang.ExceptionInInitializerError
    ORA-06512: at "SYS.DBMS_XMLSAVE"
    ORA-06512: at line
    Please help me to overcome the problem....
    Thanx in advance ,
    Yogesh

    Found maybe an applicable reference...
    On http://publib.boulder.ibm.com/infocenter/wasinfo/v4r0/index.jsp?topic=/com.ibm.support.was.doc/html/Java_2_Connectivity_(J2C)/1163246.html
    it says:
    * Application code is missing a setXXX method call somewhere.
    * There might be a problem in the Oracle JDBC driver code.
    If the latter is the problem than you should or try a different JDBC driver or (which is probably the best solution anyway) create an iTar with Oracle support via metalink.oracle.com
    Other references can also be found on the internet when using google which could be applicable. Search on keywords: "Missing IN or OUT parameter at index"
    Message was edited by:
    mgralike

  • Error in mail adapter whilst using 'mail package' option

    Hello,
    I am using receiver mail adapter. Its working fine when I do not use 'mail package option'. But when I use mail package option, this error comes in
    Message processing failed. Cause: com.sap.aii.af.modules.conversion.xml2plain.ConversionException: No data is allowed on this structure level (2) at XML element Mail,Subject
    This is the sample of payload:
    <?xml version="1.0" encoding="UTF-8" ?>
    - <ns1:Mail xmlns:ns1="http://sap.com/xi/XI/Mail/30">
      <Subject>Data Update to  Portal failed</Subject>
      <From>sender email id/From>
      <To>receiver email id/To>
      <Reply_To />
      <Content_Type>text/plain</Content_Type>
      <Content>Error: Undefined Error</Content>
      </ns1:Mail>
    Any idea what should I do to get it working. Alternatively, is it possible to use the dynamic value into the email 'TO' field.
    Thanks in adavance

    Hi All,
    I need the same info in my requirement . The Scenario is MAIL > FILE . THe Vendor sends the email with  Invoices ( An Attachment) to a mail server and the attachment has to be moved to the network folder (File )
    Here , I used  IMAP4 Protocol in MAil Sender CC
    I wanted to know is it  required to use :localejbs/ AF_Modules/PayloadSwapBean and any module configuration to petch the attachment  ?

  • Error while using Copy Package

    Hi,
    I want to copy data from category BudgetV1 to BudgetV2,
    I have tried to use Copy Package but I always get error with
    error message "The file is empty".
    Can anyone help me with the problem?
    Thanks in advance.

    Hi,
    Please check if you have data in category BudgetV1. This error normally occurs when there is no data in source specified in COPY package. Make sure to select appropriate members when you specify other source dimensions.
    Hope this helps.
    Regards,
    Shoba

Maybe you are looking for