Track DDL statement

Hi all
I want to track all DDL statements fiered on the database like Drop, Alter, Truncate, Create.
I tried looking in metalink and found out that I have to right a trigger for it.
but couldn't find any script for it.
Can anyone help me with this.

Writing triggers would be one way. The other ways is to enabling DDL auditing. Refer oracle docs. also search in this forum or http://www.asktom.oracle.com site.
Jaffar

Similar Messages

  • Track DDL statements for schema.

    Dear all,
    I want to track all DDL statements being performed on particular schema.
    I want to capture entire sql statement being run.
    How can I achive this.
    Please advice.
    Waiting for your reply.
    Regards,

    Hi all,
    I have used this trigger to track ddl.
    create table perfstat.stats$ddl_log(
    user_name varchar2(30),
    ddl_date date,
    ddl_type varchar2(30),
    object_type varchar2(18),
    owner varchar2(30),
    object_name varchar2(128)
    create or replace triggerDDLTrigger
    AFTER DDL ON DATABASE
    BEGIN
    insert into
    perfstat.stats$ddl_log
    user_name,
    ddl_date,
    ddl_type,
    object_type,
    owner,
    object_name
    VALUES
    ora_login_user,
    sysdate,
    ora_sysevent,
    ora_dict_obj_type,
    ora_dict_obj_owner,
    ora_dict_obj_name
    END;
    It's working fine ,
    But I want to capture entire sql statement into stats$ddl_log table.
    What to modify in table or trigger that I could achive this.
    Waiting for your reply.
    Thanks and regards...

  • Failed to track ddl statements

    Hi
    We are using oracle 9.2.0 database and set up logminer in order to track ddl and dml changes but
    returning previous data i mean latest archived archive logfile " ARC00140.001" but it showing the previous archive log file when
    query the below dictionay view
    SQL> select name from v$archived_log where dictionary_begin='YES';
    NAME
    D:\ORACLE\ORA92\RDBMS\ARCH\ARC00007.001
    SQL> select name from v$archived_log where dictionary_end='YES'
    2 ;
    NAME
    D:\ORACLE\ORA92\RDBMS\ARCH\ARC00007.001
    And done some modifications in scott schema and issued
    alter system switch log file 15 or 20 times and follwed the follwing steps to setup logminer
    set utl_file_dir='d:\oracle' in spfile using scope option
    SQL> ALTER DATABASE ADD SUPPLEMENTAL LOG DATA
    sql> exec dbms_logmnr_d.build('dict.ora','d:\oracle')
    SQL> exec dbms_logmnr.add_logfile(logfilename=>'D:\ORACLE\ORA92\RDBMS\ARCH\AR
    117.001', options=>dbms_logmnr.new);
    PL/SQL procedure successfully completed.
    SQL> exec dbms_logmnr.add_logfile(logfilename=>'D:\ORACLE\ORA92\RDBMS\ARCH\AR
    118.001', options=>dbms_logmnr.new);
    PL/SQL procedure successfully completed.
    SQL> exec dbms_logmnr.add_logfile(logfilename=>'D:\ORACLE\ORA92\RDBMS\ARCH\AR
    119.001', options=>dbms_logmnr.new);
    PL/SQL procedure successfully completed.
    SQL> exec dbms_logmnr.add_logfile(logfilename=>'D:\ORACLE\ORA92\RDBMS\ARCH\AR
    120.001', options=>dbms_logmnr.new);
    PL/SQL procedure successfully completed.
    SQL> exec dbms_logmnr.add_logfile(logfilename=>'D:\ORACLE\ORA92\RDBMS\ARCH\AR
    121.001', options=>dbms_logmnr.new);
    PL/SQL procedure successfully completed.
    SQL> exec dbms_logmnr.add_logfile(logfilename=>'D:\ORACLE\ORA92\RDBMS\ARCH\AR
    122.001', options=>dbms_logmnr.new);
    PL/SQL procedure successfully completed.
    SQL> exec dbms_logmnr.add_logfile(logfilename=>'D:\ORACLE\ORA92\RDBMS\ARCH\AR
    123.001', options=>dbms_logmnr.new);
    PL/SQL procedure successfully completed.
    SQL> exec dbms_logmnr.start_logmnr(dictfilename=>'d:\oracle\z.ora',options => -
    DBMS_LOGMNR.DDL_DICT_TRACKING);
    PL/SQL procedure successfully completed.
    SQL> select count(*) from v$logmnr_contents;
    COUNT(*)
    0
    Thnaks inadvance
    Mohan

    Hi
    We are using oracle 9.2.0 database and set up logminer in order to track ddl and dml changes but
    returning previous data i mean latest archived archive logfile " ARC00140.001" but it showing the previous archive log file when
    query the below dictionay view
    SQL> select name from v$archived_log where dictionary_begin='YES';
    NAME
    D:\ORACLE\ORA92\RDBMS\ARCH\ARC00007.001
    SQL> select name from v$archived_log where dictionary_end='YES'
    2 ;
    NAME
    D:\ORACLE\ORA92\RDBMS\ARCH\ARC00007.001
    And done some modifications in scott schema and issued
    alter system switch log file 15 or 20 times and follwed the follwing steps to setup logminer
    set utl_file_dir='d:\oracle' in spfile using scope option
    SQL> ALTER DATABASE ADD SUPPLEMENTAL LOG DATA
    sql> exec dbms_logmnr_d.build('dict.ora','d:\oracle')
    SQL> exec dbms_logmnr.add_logfile(logfilename=>'D:\ORACLE\ORA92\RDBMS\ARCH\AR
    117.001', options=>dbms_logmnr.new);
    PL/SQL procedure successfully completed.
    SQL> exec dbms_logmnr.add_logfile(logfilename=>'D:\ORACLE\ORA92\RDBMS\ARCH\AR
    118.001', options=>dbms_logmnr.new);
    PL/SQL procedure successfully completed.
    SQL> exec dbms_logmnr.add_logfile(logfilename=>'D:\ORACLE\ORA92\RDBMS\ARCH\AR
    119.001', options=>dbms_logmnr.new);
    PL/SQL procedure successfully completed.
    SQL> exec dbms_logmnr.add_logfile(logfilename=>'D:\ORACLE\ORA92\RDBMS\ARCH\AR
    120.001', options=>dbms_logmnr.new);
    PL/SQL procedure successfully completed.
    SQL> exec dbms_logmnr.add_logfile(logfilename=>'D:\ORACLE\ORA92\RDBMS\ARCH\AR
    121.001', options=>dbms_logmnr.new);
    PL/SQL procedure successfully completed.
    SQL> exec dbms_logmnr.add_logfile(logfilename=>'D:\ORACLE\ORA92\RDBMS\ARCH\AR
    122.001', options=>dbms_logmnr.new);
    PL/SQL procedure successfully completed.
    SQL> exec dbms_logmnr.add_logfile(logfilename=>'D:\ORACLE\ORA92\RDBMS\ARCH\AR
    123.001', options=>dbms_logmnr.new);
    PL/SQL procedure successfully completed.
    SQL> exec dbms_logmnr.start_logmnr(dictfilename=>'d:\oracle\z.ora',options => -
    DBMS_LOGMNR.DDL_DICT_TRACKING);
    PL/SQL procedure successfully completed.
    SQL> select count(*) from v$logmnr_contents;
    COUNT(*)
    0
    Thnaks inadvance
    Mohan

  • How to know which user has executed which ddl statement

    Hi All,
    Last week i faced some problem, like some one has truncated the table , so luckily i have the schema backup so i restored it till the last backup taken.
    but i want to know who has executed this ddl statement.
    i know there are some utilities are avaible with oracle, so please describe me the easiest and quickest way to get this.
    Regards
    Asif

    In order of descending simplicity
    - Use the principle of least privilege to restrict the privileges users have in the database to ensure that they cannot do things like truncating a table
    - Enable auditing of potentially problematic statements. This has to be done before the damage is done, though
    - Create a DDL trigger that logs when users issue DDL. This also must be done before the damage is done.
    - Use LogMiner to go through the archived log files that were generated at the time the table was truncated. This assumes that the database is in ARCHIVELOG mode and that you have the archived logs from last week. Using LogMiner to track down the culprit is also likely to be relatively time-intensive
    Justin

  • DDL statements and dynamic  sql  in stored procedure

    I created a stored procedure to create and drop tables, using dynamic sql.
    When I try to do the inserts using dynamic sql, i.e
    v_string := 'INSERT statement';
    EXECUTE IMMEDIATE v_string;
    I get the following error message:
    ERROR at line 1:
    ORA-00942: table or view does not exist
    ORA-06512: at line 63
    Line 63 happens to be the line that the EXECUTE IMMEDIATE v_string; statement is in.
    I am able to describe the table that the inserts are being made into, so I know that the table exists.
    Any idea why I'm getting this error message would be appreciated.

    Yes I do and I have been able to create other tables using dynamic sql.
    The table that I am having problems with SELECTs data from another table to get its column values; within the SELECT statement, the CAST function is used:
    ie. CAST(CASE SUBSTR(CAST(E_MOD AS VARCHAR(7)),2,3)
    WHEN 'AAA' THEN 'A55'
    ELSE ............
    I get the following error message:
    ERROR at line 18: (this line starts the CAST statement)
    ORA-06550: line 18, column 13:
    PLS-00103: Encountered the symbol "AAA" when expecting one of the following:
    . ( * @ % & = - + ; < / > at in is mod not rem return
    returning <an exponent (**)> <> or != or ~= >= <= <> and or
    like between into using || bulk
    When I remove the quotes or add another single quote, the same error cascades to 'A55'.
    After doing the same for the next error, I get the error message below:
    ERROR at line 1: (this line has the EXECUTE IMMEDIATE statement)
    ORA-00936: missing expression
    ORA-06512: at line 6
    Any idea what the problem could be?
    Also is there another way to have DDL statements as stored procedures other than using dynamic sql or the DBMS_SQL package?

  • ABAP Import Phase DDL Statement Error

    Hi Experts!
    I am installing SAP Netweaver PI 7.3 EHP1 and encountered an error in the ABAP import phase.
    I checked the import monitor logs and found a clue about SAPVIEW.log.
    I have checked the SAPVIEW.log and found out the following:
    ERROR: DDL statement failed
    ( DROP VIEW "APPL_MODS" )
    dsql_exec_immediate returned DS_DBOBJECTUNKNOWN
    (IMP) INFO: a failed DROP attempt is not necessarily a problem
    (DB) ERROR: DDL statement failed
    ( CREATE VIEW "APPL_MODS" ( "NAME", "TYP", "MEMBER", "DEVCLASS" ) AS SELECT T0001."NAME", T0001."TYP", T0001."MEMBER", T0002."DEVCLASS" FROM "MODSAP" T0001, "MODSAPA" T0002 WHERE T0001."NAME" = T0002."NAME" AND T0002."MIGRATED" <> 'X' )
    dsql_exec_immediate returned DS_DBOBJECTUNKNOWN
    (DB) INFO: disconnected from DB
    /usr/sap/PID/SYS/exe/uc/rs6000_64/R3load: job finished with 1 error(s)
    /usr/sap/PID/SYS/exe/uc/rs6000_64/R3load: END OF LOG:
    Please help!
    Also please let me know if any further detail is required.
    Regards,
    Ayan

    Gaurav,
    Please find the below pasted trace from SAPVIEW.log
    /usr/sap/PID/SYS/exe/uc/rs6000_64/R3load: START OF LOG: 20140823014048
    /usr/sap/PID/SYS/exe/uc/rs6000_64/R3load: sccsid @(#) $Id: //bas/721_REL/src/R3ld/R3load/R3ldmain.c#8 $ SAP
    /usr/sap/PID/SYS/exe/uc/rs6000_64/R3load: version R7.20/V1.6 [UNICODE]
    Compiled Dec  4 2013 12:54:08
    /usr/sap/PID/SYS/exe/uc/rs6000_64/R3load -ctf I /backup/NW7.3_EHP1/ABAP_Inst_EXP/51043228/DATA_UNITS/EXP3/DATA/SAPVIEW.STR /tmp/sapinst_instdir/NW731/DB6/INSTALL/STD/AS/DDLDB6.TPL SAPVIEW.TSK DB6 -l SAPVIEW.log
    /usr/sap/PID/SYS/exe/uc/rs6000_64/R3load: job completed
    /usr/sap/PID/SYS/exe/uc/rs6000_64/R3load: END OF LOG: 20140823014048
    /usr/sap/PID/SYS/exe/uc/rs6000_64/R3load: START OF LOG: 20140823014048
    /usr/sap/PID/SYS/exe/uc/rs6000_64/R3load: sccsid @(#) $Id: //bas/721_REL/src/R3ld/R3load/R3ldmain.c#8 $ SAP
    /usr/sap/PID/SYS/exe/uc/rs6000_64/R3load: version R7.20/V1.6 [UNICODE]
    Compiled Dec  4 2013 12:54:08
    /usr/sap/PID/SYS/exe/uc/rs6000_64/R3load -i SAPVIEW.cmd -dbcodepage 4102 -l SAPVIEW.log -stop_on_error -loadprocedure fast LOAD:DEF_CRT
    (DB) INFO: connected to DB
    (SQL) INFO: Searching for SQL file SQLFiles.LST
    (SQL) INFO: SQLFiles.LST not found
    (SQL) INFO: Searching for SQL file /backup/NW7.3_EHP1/ABAP_Inst_EXP/51043228/DATA_UNITS/EXP3/DB/SQLFiles.LST
    (SQL) INFO: /backup/NW7.3_EHP1/ABAP_Inst_EXP/51043228/DATA_UNITS/EXP3/DB/SQLFiles.LST not found
    (SQL) INFO: Searching for SQL file .SQL
    (SQL) INFO: .SQL not found
    (SQL) INFO: Searching for SQL file /backup/NW7.3_EHP1/ABAP_Inst_EXP/51043228/DATA_UNITS/EXP3/DB/DB6/.SQL
    (SQL) INFO: /backup/NW7.3_EHP1/ABAP_Inst_EXP/51043228/DATA_UNITS/EXP3/DB/DB6/.SQL not found
    (DB) INFO: /BI0/MHIER_VERS created #20140823014054
    (DB) INFO: /BI0/RALEAFNODCH created #20140823014054
    (DB) INFO: /BI0/RALEAFNODSP created #20140823014054
    (DB) INFO: /BI0/RBUCKET created #20140823014054
    (DB) INFO: /BI0/RCALMONTH created #20140823014054
    (DB) INFO: /BI0/RCALMONTH2 created #20140823014054
    (DB) INFO: /BI0/RCALQUART1 created #20140823014054
    (DB) INFO: /BI0/RCALQUARTER created #20140823014054
    (DB) INFO: /BI0/RCALWEEK created #20140823014054
    (DB) INFO: /BI0/RCALYEAR created #20140823014054
    (DB) INFO: /BI0/RCHNGID created #20140823014054
    (DB) INFO: /BI0/RCURRENCY created #20140823014054
    (DB) INFO: /BI0/RDATE created #20140823014054
    (DB) INFO: /BI0/RFISCPER created #20140823014054
    (DB) INFO: /BI0/RFISCPER3 created #20140823014054
    (DB) INFO: /BI0/RFISCVARNT created #20140823014054
    (DB) INFO: /BI0/RFISCYEAR created #20140823014054
    (DB) INFO: /BI0/RHALFYEAR1 created #20140823014054
    (DB) INFO: /BI0/RHIENM created #20140823014054
    (DB) INFO: /BI0/RHIER_HIEID created #20140823014054
    (DB) INFO: /BI0/RHIER_NODE created #20140823014054
    (DB) INFO: /BI0/RHIER_VERS created #20140823014054
    (DB) INFO: /BI0/RINFOPROV created #20140823014054
    (DB) INFO: /BI0/RIOBJNM created #20140823014054
    (DB) INFO: /BI0/RLANGU created #20140823014054
    (DB) INFO: /BI0/RLOGSYS created #20140823014054
    (DB) INFO: /BI0/RNODEPOSIT created #20140823014054
    (DB) INFO: /BI0/RNORESTNODE created #20140823014054
    (DB) INFO: /BI0/RRATE_TYPE created #20140823014054
    (DB) INFO: /BI0/RRECORDMODE created #20140823014054
    (DB) INFO: /BI0/RRECORDTP created #20140823014054
    (DB) INFO: /BI0/RREQUID created #20140823014054
    (DB) INFO: /BI0/RSIGNCH created #20140823014054
    (DB) INFO: /BI0/RSOURSYSTEM created #20140823014054
    (DB) INFO: /BI0/RTIME created #20140823014054
    (DB) INFO: /BI0/RTXTLG created #20140823014054
    (DB) INFO: /BI0/RTXTMD created #20140823014054
    (DB) INFO: /BI0/RTXTSH created #20140823014054
    (DB) INFO: /BI0/RUNIT created #20140823014054
    (DB) INFO: /BI0/RWEEKDAY1 created #20140823014054
    (DB) INFO: /BI0/ZBUCKET created #20140823014054
    (DB) INFO: /BI0/ZCALMONTH created #20140823014054
    (DB) INFO: /BI0/ZCALMONTH2 created #20140823014054
    (DB) INFO: /BI0/ZDATE created #20140823014054
    (DB) INFO: /BI0/ZFISCPER created #20140823014055
    (DB) INFO: /BI0/ZHALFYEAR1 created #20140823014055
    (DB) INFO: /BI0/ZINFOPROV created #20140823014055
    (DB) INFO: /BI0/ZIOBJNM created #20140823014055
    (DB) INFO: /GC1/VXXX created #20140823014055
    (DB) INFO: /OSP/V_RAUI_CHRD created #20140823014055
    (DB) INFO: /OSP/V_RAUI_CMVD created #20140823014055
    (DB) INFO: /OSP/V_RAUI_CPVD created #20140823014055
    (DB) INFO: /OSP/V_RAUI_CSED created #20140823014055
    (DB) INFO: /OSP/V_RAUI_DCDB created #20140823014055
    (DB) INFO: /OSP/V_RAUI_GRPD created #20140823014055
    (DB) INFO: /OSP/V_RAUI_MTD created #20140823014055
    (DB) INFO: /OSP/V_RAUI_MVDB created #20140823014055
    (DB) INFO: /OSP/V_RAUI_PBDB created #20140823014055
    (DB) INFO: /OSP/V_RAUI_RDDB created #20140823014055
    (DB) INFO: /OSP/V_RAUI_RFCD created #20140823014055
    (DB) INFO: /OSP/V_RAUI_RMTD created #20140823014055
    (DB) INFO: /OSP/V_RAUI_RTDB created #20140823014055
    (DB) INFO: /OSP/V_RAUI_SCD created #20140823014055
    (DB) INFO: /OSP/V_RAUI_SCHD created #20140823014055
    (DB) INFO: /OSP/V_RAUI_SELD created #20140823014055
    (DB) INFO: /OSP/V_RAUI_TMVD created #20140823014055
    (DB) INFO: /OSP/V_RAUI_TPBD created #20140823014055
    (DB) INFO: /OSP/V_RAUI_TPDB created #20140823014055
    (DB) INFO: /OSP/V_RAUI_TPRD created #20140823014055
    (DB) INFO: /OSP/V_RAUI_TRGD created #20140823014055
    (DB) INFO: /OSP/V_RAUI_VARD created #20140823014055
    (DB) INFO: /SAPAPO/GEWICHT created #20140823014055
    (DB) INFO: /SAPAPO/TRENDAM created #20140823014055
    (DB) INFO: /SAPAPO/VWALPROF created #20140823014055
    (DB) INFO: /SAPPO/FULL_HINT created #20140823014055
    (DB) INFO: /SAPPO/V_PPOCMPL created #20140823014055
    (DB) INFO: /SAPPO/V_PPO_UPD created #20140823014055
    (DB) INFO: /SAPTRX/A_CONDF4 created #20140823014055
    (DB) INFO: /SAPTRX/EE_FLDS created #20140823014055
    (DB) INFO: /SAPTRX/MSG_PARA created #20140823014055
    (DB) INFO: /SAPTRX/MSG_PTAB created #20140823014055
    (DB) INFO: /SAPTRX/STR_FLDS created #20140823014055
    (DB) INFO: /SAPTRX/VDASFEV created #20140823014055
    (DB) INFO: /SAPTRX/VDASFPAR created #20140823014055
    (DB) INFO: /SAPTRX/VD_AOMIL created #20140823014055
    (DB) INFO: /SAPTRX/VD_AOPAC created #20140823014055
    (DB) INFO: /SAPTRX/VD_AOPAE created #20140823014055
    (DB) INFO: /SAPTRX/VD_AOPAI created #20140823014055
    (DB) INFO: /SAPTRX/VD_AOPAR created #20140823014055
    (DB) INFO: /SAPTRX/VD_AOTD1 created #20140823014055
    (DB) INFO: /SAPTRX/VD_AOTD2 created #20140823014055
    (DB) INFO: /SAPTRX/VD_AOTDD created #20140823014055
    (DB) INFO: /SAPTRX/VD_AOTYP created #20140823014055
    (DB) INFO: /SAPTRX/VD_ASPAR created #20140823014055
    (DB) INFO: /SAPTRX/VD_CONDL created #20140823014055
    (DB) INFO: /SAPTRX/VD_EVTD1 created #20140823014055
    (DB) INFO: /SAPTRX/VD_EVTD2 created #20140823014055
    (DB) INFO: /SAPTRX/VD_EVTD3 created #20140823014055
    (DB) INFO: /SAPTRX/VD_EVTD4 created #20140823014055
    (DB) INFO: /SAPTRX/V_AODD02 created #20140823014055
    (DB) INFO: /SAPTRX/V_DD03 created #20140823014055
    (DB) INFO: /SAPTRX/V_DD03X created #20140823014055
    (DB) INFO: /SDF/CMO_OBJ_TR created #20140823014055
    (DB) INFO: /SDF/CMO_SMDCMP created #20140823014056
    (DB) INFO: /SDF/CMO_SMDDVC created #20140823014056
    (DB) INFO: /SDF/CMO_UMDCMP created #20140823014056
    (DB) INFO: /SDF/SMODICOMP created #20140823014056
    (DB) INFO: /SDF/SMODIDEVC created #20140823014056
    (DB) INFO: /SDF/UMOD_COMP created #20140823014056
    (DB) INFO: AKB_TRHD_DETAIL created #20140823014056
    (DB) INFO: ALTEXTHIST created #20140823014056
    (DB) INFO: APPL_DEVC created #20140823014056
    (DB) INFO: APPL_DIAL created #20140823014056
    (DB) INFO: APPL_DOMA created #20140823014056
    (DB) INFO: APPL_DTEL created #20140823014056
    (DB) INFO: APPL_ENQU created #20140823014056
    (DB) INFO: APPL_FUGR created #20140823014056
    (DB) INFO: APPL_FUGRG created #20140823014056
    (DB) INFO: APPL_FUNC created #20140823014056
    (DB) INFO: APPL_INDX created #20140823014056
    (DB) INFO: APPL_MCOB created #20140823014056
    (DB) INFO: APPL_MENU created #20140823014056
    (DB) ERROR: DDL statement failed
    ( CREATE VIEW "APPL_MODS" ( "NAME", "TYP", "MEMBER", "DEVCLASS" ) AS SELECT T0001."NAME", T0001."TYP", T0001."MEMBER", T0002."DEVCLASS" FROM "MODSAP" T0001, "MODSAPA" T0002 WHERE T0001."NAME" = T0002."NAME" AND T0002."MIGRATED" <> 'X' )
    dsql_exec_immediate returned DS_DBOBJECTUNKNOWN
    (DB) INFO: disconnected from DB
    /usr/sap/PID/SYS/exe/uc/rs6000_64/R3load: job finished with 1 error(s)
    /usr/sap/PID/SYS/exe/uc/rs6000_64/R3load: END OF LOG: 20140823014056
    /usr/sap/PID/SYS/exe/uc/rs6000_64/R3load: START OF LOG: 20140823014312
    /usr/sap/PID/SYS/exe/uc/rs6000_64/R3load: sccsid @(#) $Id: //bas/721_REL/src/R3ld/R3load/R3ldmain.c#8 $ SAP
    /usr/sap/PID/SYS/exe/uc/rs6000_64/R3load: version R7.20/V1.6 [UNICODE]
    Compiled Dec  4 2013 12:54:08
    /usr/sap/PID/SYS/exe/uc/rs6000_64/R3load -i SAPVIEW.cmd -dbcodepage 4102 -l SAPVIEW.log -stop_on_error -loadprocedure fast LOAD:DEF_CRT
    (DB) INFO: connected to DB
    (SQL) INFO: Searching for SQL file SQLFiles.LST
    (SQL) INFO: SQLFiles.LST not found
    (SQL) INFO: Searching for SQL file /backup/NW7.3_EHP1/ABAP_Inst_EXP/51043228/DATA_UNITS/EXP3/DB/SQLFiles.LST
    (SQL) INFO: /backup/NW7.3_EHP1/ABAP_Inst_EXP/51043228/DATA_UNITS/EXP3/DB/SQLFiles.LST not found
    (SQL) INFO: Searching for SQL file .SQL
    (SQL) INFO: .SQL not found
    (SQL) INFO: Searching for SQL file /backup/NW7.3_EHP1/ABAP_Inst_EXP/51043228/DATA_UNITS/EXP3/DB/DB6/.SQL
    (SQL) INFO: /backup/NW7.3_EHP1/ABAP_Inst_EXP/51043228/DATA_UNITS/EXP3/DB/DB6/.SQL not found
    (DB) ERROR: DDL statement failed
    ( DROP VIEW "APPL_MODS" )
    dsql_exec_immediate returned DS_DBOBJECTUNKNOWN
    (IMP) INFO: a failed DROP attempt is not necessarily a problem
    (DB) ERROR: DDL statement failed
    ( CREATE VIEW "APPL_MODS" ( "NAME", "TYP", "MEMBER", "DEVCLASS" ) AS SELECT T0001."NAME", T0001."TYP", T0001."MEMBER", T0002."DEVCLASS" FROM "MODSAP" T0001, "MODSAPA" T0002 WHERE T0001."NAME" = T0002."NAME" AND T0002."MIGRATED" <> 'X' )
    dsql_exec_immediate returned DS_DBOBJECTUNKNOWN
    (DB) INFO: disconnected from DB
    /usr/sap/PID/SYS/exe/uc/rs6000_64/R3load: job finished with 1 error(s)
    /usr/sap/PID/SYS/exe/uc/rs6000_64/R3load: END OF LOG: 20140823014318
    /usr/sap/PID/SYS/exe/uc/rs6000_64/R3load: START OF LOG: 20140823015246
    /usr/sap/PID/SYS/exe/uc/rs6000_64/R3load: sccsid @(#) $Id: //bas/721_REL/src/R3ld/R3load/R3ldmain.c#8 $ SAP
    /usr/sap/PID/SYS/exe/uc/rs6000_64/R3load: version R7.20/V1.6 [UNICODE]
    Compiled Dec  4 2013 12:54:08
    /usr/sap/PID/SYS/exe/uc/rs6000_64/R3load -i SAPVIEW.cmd -dbcodepage 4102 -l SAPVIEW.log -stop_on_error -loadprocedure fast LOAD:DEF_CRT
    (DB) INFO: connected to DB
    (SQL) INFO: Searching for SQL file SQLFiles.LST
    (SQL) INFO: SQLFiles.LST not found
    (SQL) INFO: Searching for SQL file /backup/NW7.3_EHP1/ABAP_Inst_EXP/51043228/DATA_UNITS/EXP3/DB/SQLFiles.LST
    (SQL) INFO: /backup/NW7.3_EHP1/ABAP_Inst_EXP/51043228/DATA_UNITS/EXP3/DB/SQLFiles.LST not found
    (SQL) INFO: Searching for SQL file .SQL
    (SQL) INFO: .SQL not found
    (SQL) INFO: Searching for SQL file /backup/NW7.3_EHP1/ABAP_Inst_EXP/51043228/DATA_UNITS/EXP3/DB/DB6/.SQL
    (SQL) INFO: /backup/NW7.3_EHP1/ABAP_Inst_EXP/51043228/DATA_UNITS/EXP3/DB/DB6/.SQL not found
    (DB) ERROR: DDL statement failed
    ( DROP VIEW "APPL_MODS" )
    dsql_exec_immediate returned DS_DBOBJECTUNKNOWN
    (IMP) INFO: a failed DROP attempt is not necessarily a problem
    (DB) ERROR: DDL statement failed
    ( CREATE VIEW "APPL_MODS" ( "NAME", "TYP", "MEMBER", "DEVCLASS" ) AS SELECT T0001."NAME", T0001."TYP", T0001."MEMBER", T0002."DEVCLASS" FROM "MODSAP" T0001, "MODSAPA" T0002 WHERE T0001."NAME" = T0002."NAME" AND T0002."MIGRATED" <> 'X' )
    dsql_exec_immediate returned DS_DBOBJECTUNKNOWN
    (DB) INFO: disconnected from DB
    /usr/sap/PID/SYS/exe/uc/rs6000_64/R3load: job finished with 1 error(s)
    /usr/sap/PID/SYS/exe/uc/rs6000_64/R3load: END OF LOG: 20140823015250
    /usr/sap/PID/SYS/exe/uc/rs6000_64/R3load: START OF LOG: 20140825011924
    /usr/sap/PID/SYS/exe/uc/rs6000_64/R3load: sccsid @(#) $Id: //bas/721_REL/src/R3ld/R3load/R3ldmain.c#8 $ SAP
    /usr/sap/PID/SYS/exe/uc/rs6000_64/R3load: version R7.20/V1.6 [UNICODE]
    Compiled Dec  4 2013 12:54:08
    /usr/sap/PID/SYS/exe/uc/rs6000_64/R3load -i SAPVIEW.cmd -dbcodepage 4102 -l SAPVIEW.log -stop_on_error -loadprocedure fast LOAD:DEF_CRT
    (DB) INFO: connected to DB
    (SQL) INFO: Searching for SQL file SQLFiles.LST
    (SQL) INFO: SQLFiles.LST not found
    (SQL) INFO: Searching for SQL file /backup/NW7.3_EHP1/ABAP_Inst_EXP/51043228/DATA_UNITS/EXP3/DB/SQLFiles.LST
    (SQL) INFO: /backup/NW7.3_EHP1/ABAP_Inst_EXP/51043228/DATA_UNITS/EXP3/DB/SQLFiles.LST not found
    (SQL) INFO: Searching for SQL file .SQL
    (SQL) INFO: .SQL not found
    (SQL) INFO: Searching for SQL file /backup/NW7.3_EHP1/ABAP_Inst_EXP/51043228/DATA_UNITS/EXP3/DB/DB6/.SQL
    (SQL) INFO: /backup/NW7.3_EHP1/ABAP_Inst_EXP/51043228/DATA_UNITS/EXP3/DB/DB6/.SQL not found
    (DB) ERROR: DDL statement failed
    ( DROP VIEW "APPL_MODS" )
    dsql_exec_immediate returned DS_DBOBJECTUNKNOWN
    (IMP) INFO: a failed DROP attempt is not necessarily a problem
    (DB) ERROR: DDL statement failed
    ( CREATE VIEW "APPL_MODS" ( "NAME", "TYP", "MEMBER", "DEVCLASS" ) AS SELECT T0001."NAME", T0001."TYP", T0001."MEMBER", T0002."DEVCLASS" FROM "MODSAP" T0001, "MODSAPA" T0002 WHERE T0001."NAME" = T0002."NAME" AND T0002."MIGRATED" <> 'X' )
    dsql_exec_immediate returned DS_DBOBJECTUNKNOWN
    (DB) INFO: disconnected from DB
    /usr/sap/PID/SYS/exe/uc/rs6000_64/R3load: job finished with 1 error(s)
    /usr/sap/PID/SYS/exe/uc/rs6000_64/R3load: END OF LOG: 20140825011937
    Please look into this..
    Regards,
    Ayan

  • Difference B/w all DDL statements in Oracle 8i and 9i

    Where can i get the difference between all the DDL statements between oracle 8i and 9i.If anyone has this pls ..post it..

    What is your national character set? What is NLS_LENGTH_SEMANTICS set to?
    Justin
    Distributed Database Consulting, Inc.
    http://www.ddbcinc.com/askDDBC

  • Executing multiple DDL statements with OracleCommand

    hi..
    im having trouble executing multiple ddl statements with the the oracle command object. i have tried to enclose them within Begin.. End; block but with no use.
    this problem seems to occur only with DDL statements,.. as my DML like update, delete and Inserts seem to work fine when enclosed within the PL /SQL block.
    single DDL statements also seem to work fine. so im guessing this has nothing to do with priviledges. any ideas?
    my code as follows
    OracleCommand command = new OracleCommand();
    command.CommandType = CommandType.Text;
    command.CommandText = string.Format(@"{0}",script);
    conn.Open();
    command.Connection = conn;
    command.ExecuteNonQuery();
    the script is read from a file, and looks like this. (note : i have removed any line breaks or any other characters)
    BEGIN ALTER TABLE SYSTEMUSER DISABLE CONSTRAINT FK_USER_CLIENT; ALTER TRIGGER SET_SUBSCRIPTION_SUB_I DISABLE; END;
    this is the error i get.
    Oracle.DataAccess.Client.OracleException: ORA-06550: line 1, column 7:
    PLS-00103: Encountered the symbol "ALTER" when expecting one of the following:
    begin case declare exit for goto if loop mod null pragma
    raise return select update while with <an identifier>
    <a double-quoted delimited-identifier> <a bind variable> <<
    close current delete fetch lock insert open rollback
    savepoint set sql execute commit forall merge pipe.

    If I'm not mistaken, we're not allowed to issue DDL inside anonymoue block (or stored procedure) since DDL has implicit commit in it. But you still can execute DDL using EXECUTE IMMEDIATE or using DBMS_SQL package. Try changing your CommandText like this,
    BEGIN
       EXECUTE IMMEDIATE 'ALTER TABLE SYSTEMUSER DISABLE CONSTRAINT FK_USER_CLIENT';
       EXECUTE IMMEDIATE 'ALTER TRIGGER SET_SUBSCRIPTION_SUB_I DISABLE';
    END;Hope this helps,
    [Nur Hidayat|http://nur-hidayat.net/]

  • DDL statements in Graphic builder 6i

    Hi.
    Is there possibility to perform DDL statements in Graphic builder 6i? Something like FORM_DDL in Forms and SRW.DO_SQL in Reports.
    I want to set role. Report has own statement SET_ROLE.
    Our application use classic security model: User has granted only LOGIN privilege by default. After login application sets roles for reading, writing, deleting to DB. Same Reports do. But in Graphic builder I can't.

    May I can use OG library and OG.Interpret command. :o)

  • Execution of ddl statement  in post-insert trigger

    hi,
    I'm working on headstart 6.5. I wants to execute a DDL statement in post-insert-trigger.The problem is this trigger is executed in between pre-commit and post-forms-commit.In pre-commit the transaction is opened with a insert statement that is inserting "open" in field status which is having a deffered check constraint QMS_NEED_TO_CLOSE_TRANSACTION.In post-forms-commit it will check whether the transaction is open if yes will check the business rule will delete the data that was inserted into qms_transaction in pre-commit trigger and will close the transaction .
         In between if i execute a DDl statement a commit will be performed on the insert statement written in pre-commit trigger.This will violate the check-constraint and we will get the error qms_need_to_close_transaction violated.
         My business logic wants this statement to be executed at the post-insert trigger on the block.Is this possible??
         Does anyone have face the same problem?Whts the workaround for the same?

    Hello,
    You could use the execute_query after the commit_form called, by exeample in a KEY-COMMIT trigger.
    KEY-COMMIT trigger
      Commit_Form ;
      Go_block( 'master_block' ) ;
      Execute_Query ;Francois

  • Executing a DDL statement from java code

    Hi all,
    this is code from jdev11.1.1.3 version. I am trying to execute a DDL statement in oracle db from java code, but "ORA-00900: invalid SQL statement" error is coming.
    I am trying to create a table in same schema in same db by using 'Copy' command.
    Same DDL command is executing from sql command prompt & table is being created. Plz help me , as how to do from java?
            public String cmb_action() {
            // Add event code here...
            try {
                //getting source db connection
                InitialContext initialContext = new InitialContext();
                DataSource ds = (DataSource) initialContext.lookup("java:comp/env/jdbc/SourceConnDS");
                Connection sourceconn = ds.getConnection();
                sourceconn.setAutoCommit(false);
                String sql = "Copy from myschema/mypass@DB insert t_dept using select * from dept;"                       
                Statement stat = sourceconn.createStatement();
                stat.executeUpdate(sql);
                sourceconn.commit();
                System.out.println("done");
              catch (Exception ne) {
                // TODO: Add catch code
                ne.printStackTrace();
            return null;
        }

    I have a requirement to transfer data from one db to another db from Java Application Layer.Maybe, maye not. We get all sorts of weird "requirements" - which are nothing but thoughts or proposed solutions.
    But,
    Did the "requirement" mention whether the table existed already or not in the target database? - If not, did it tell you to create it - drop/create it?
    Did the "requirement" deliver some explanation to why this copying was neeeded? - Are we talking replication? - Or a one time cloning?
    Etc, etc,
    Personally I would always argue against a "reuirement" like that. - It just isn't the way to do it. Period.
    Regards
    Peter
    P.S: If you are satisfied with what COPY does, then you could let Java make an OS call and do it from there?

  • How to Generate DDL Statement for PSAPROLL Tablespace on Oracle9i-HP_UX

    Hi,
    I am having SAP R3 46C installed with Oracle 9i on HP_UX 11i system.
    I want to generate required DDL statements for PSAPROLL Tablespace/Rollback Segments as Backup/recovery purpose, before converting it into PSAPUNDO.
    Its easy to find & store required DDL statements using OEM. But, I am not able to locate oemapp  (under $ORACLE_HOME/bin directory) application in the installation.
    The current patch level of installed oracle is
    I want to start OEM in HP_UX system, if it is possible.
    otherwise,
    I want to know the other alternatives to generate the required DDL statements.
    Thanks in advance.
    Regards,
    Bhavik G. Shroff

    Hi Stefan,
    On windows Platform it is very easy to get DDL info for any object of database.
    But, I was not able to start OEM in HP_UX system.
    I have done my job complete using this good package of Oracle9i, in this way.
    SQL> SET heading off
    SQL> SET long 10000
    SQL> SET pages 100
    SQL> SELECT dbms_metadata.get_ddl(u2019TABLESPACEu2019,'PSAPROLLu2019)
    FROM DBA_TABLESPACES;
    O/P:
    CREATE TABLESPACE "PSAPROLL" DATAFILE
    '/oracle/RQ1/sapdata1/roll_1/roll.data1' SIZE 681574400 REUSE ,
    '/oracle/RQ1/sapdata1/roll_2/roll.data2' SIZE 3145719808 REUSE
    LOGGING ONLINE PERMANENT BLOCKSIZE 8192
    EXTENT MANAGEMENT LOCAL UNIFORM SIZE 1048576 SEGMENT SPACE MANAGEMENT MANUAL
    SQL> SELECT dbms_metadata.get_ddl(u2019ROLLBACK_SEGMENTu2019,'PRS_0u2019)
    FROM DBA_SEGMENTS;
    CREATE ROLLBACK SEGMENT "PRS_0" TABLESPACE "PSAPROLL"
    STORAGE(INITIAL 10485760 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 32765
    Also follow this useful links:
    [DDL Generation--Oracle's Answer to Save You Time and Money|http://www.dbasupport.com/oracle/ora9i/DDLgen2.shtml]
    [DDL Generation--Oracle's Answer to Save You Time and Money|http://www.dbasupport.com/oracle/ora9i/DDLgen3.shtml]
    Good.
    Thanks a lot.

  • "DDL statement failed" in Database load faze

    Hello,
    I have an problem when installing DB2 on Solaris platform.
    During the installation, in Database load Faze, i get the error:
    MSC-01015  Process finished with error(s), check log file /tmp/sapinst_instdir/R3E47X2/SYSTEM/ABAP/DB6/NUC/DB/SAPVIEW.log
    I check the log & it has a whole bunch on tables that are created & at the end of it i get this message:
    DB) ERROR: DDL statement failed
    (CREATE VIEW "D010TINF" ( "PROG", "R3STATE", "LANGUAGE", "UNAM", "UDAT", "UTIME", "DATALG" ) AS SELECT T0001."PROGNAME"
    , T0001."R3STATE", T0001."LANGUAGE", T0001."UNAM", T0001."UDAT",  T0001."UTIME", T0001."DATALG" FROM "REPOTEXT" T0001)
    DbSlExecute: rc = 103
      (SQL error -204)
      error message returned by DbSl:
    SQL0204N  "SAPS47.REPOTEXT"; is an undefined name.  SQLSTATE=42704
    (DB) INFO: disconnected from DB
    /sapmnt/S47/exe/R3load: job finished with 1 error(s)
    /sapmnt/S47/exe/R3load: END OF LOG: 20080810125355
    /sapmnt/S47/exe/R3load: START OF LOG: 20080810130455
    /sapmnt/S47/exe/R3load: sccsid @(#) $Id: //bas/640_REL/src/R3ld/R3load/R3ldmain.c#4 $ SAP
    /sapmnt/S47/exe/R3load: version R6.40/V1.4
    /sapmnt/S47/exe/R3load -dbcodepage 1100 -i /tmp/sapinst_instdir/R3E47X2/SYSTEM/ABAP/DB6/NUC/DB/SAPVIEW.cmd -l /tmp/sapin
    st_instdir/R3E47X2/SYSTEM/ABAP/DB6/NUC/DB/SAPVIEW.log -c 300 -merge_bck -stop_on_error
    (DB) INFO: connected to DB
    (DB) ERROR: DDL statement failed
    (DROP VIEW "D010TINF")
    DbSlExecute: rc = 103
      (SQL error -204)
      error message returned by DbSl:
    SQL0204N  "SAPS47.D010TINF"; is an undefined name.  SQLSTATE=42704
    (IMP) INFO: a failed DROP attempt is not necessarily a problem
    (DB) ERROR: DDL statement failed
    (CREATE VIEW "D010TINF" ( "PROG", "R3STATE", "LANGUAGE", "UNAM", "UDAT", "UTIME", "DATALG" ) AS SELECT T0001."PROGNAME"
    , T0001."R3STATE", T0001."LANGUAGE", T0001."UNAM", T0001."UDAT",  T0001."UTIME", T0001."DATALG" FROM "REPOTEXT" T0001)
    DbSlExecute: rc = 103
      (SQL error -204)
      error message returned by DbSl:
    SQL0204N  "SAPS47.REPOTEXT"; is an undefined name.  SQLSTATE=42704
    (DB) INFO: disconnected from DB
    /sapmnt/S47/exe/R3load: job finished with 1 error(s)
    /sapmnt/S47/exe/R3load: END OF LOG: 20080810130457
    /sapmnt/S47/exe/R3load: START OF LOG: 20080810140953
    /sapmnt/S47/exe/R3load: sccsid @(#) $Id: //bas/640_REL/src/R3ld/R3load/R3ldmain.c#4 $ SAP
    /sapmnt/S47/exe/R3load: version R6.40/V1.4
    /sapmnt/S47/exe/R3load -dbcodepage 1100 -i /tmp/sapinst_instdir/R3E47X2/SYSTEM/ABAP/DB6/NUC/DB/SAPVIEW.cmd -l /tmp/sapin
    st_instdir/R3E47X2/SYSTEM/ABAP/DB6/NUC/DB/SAPVIEW.log -c 300 -merge_bck -stop_on_error
    (DB) INFO: connected to DB
    (DB) ERROR: DDL statement failed
    (DROP VIEW "D010TINF")
    DbSlExecute: rc = 103
      (SQL error -204)
      error message returned by DbSl:
    SQL0204N  "SAPS47.D010TINF"; is an undefined name.  SQLSTATE=42704
    (IMP) INFO: a failed DROP attempt is not necessarily a problem
    (DB) ERROR: DDL statement failed
    (CREATE VIEW "D010TINF" ( "PROG", "R3STATE", "LANGUAGE", "UNAM", "UDAT", "UTIME", "DATALG" ) AS SELECT T0001."PROGNAME"
    , T0001."R3STATE", T0001."LANGUAGE", T0001."UNAM", T0001."UDAT",  T0001."UTIME", T0001."DATALG" FROM "REPOTEXT" T0001)
    DbSlExecute: rc = 103
      (SQL error -204)
      error message returned by DbSl:
    SQL0204N  "SAPS47.REPOTEXT"; is an undefined name.  SQLSTATE=42704
    (DB) INFO: disconnected from DB
    /sapmnt/S47/exe/R3load: job finished with 1 error(s)
    /sapmnt/S47/exe/R3load: END OF LOG: 20080810140954
    Please lend me some of your wisdom
    Regards,
    Yoav Zilberman

    Hi Yoav,
    your import failed already before the SAPVIEW package was processed. You should check the other packages too for errors or for packages which are not imported. But the errors show that at lease the tables REPOTEXT and D010TINF are missing. I'm not sure, but I think they are in SAPDDIC package. You should run the package again before running SAPVIEW. For a functioning system you need both, tables and views.
    Regards
    Ralph

  • ERROR exec_ddl_stmt: (DB) ERROR: DDL statement failed during migration.

    Hello Experts ,
    We are in process of migration and after 90% of migration we are getting the following error as mentioned in MIGRATE_DT_XXXXX_IMP.log.:
    ERROR exec_ddl_stmt: (DB) ERROR: DDL statement failed
    (  ALTER TABLE "EDID4" ADD PRIMARY KEY(       "MANDT"       , "DOCNUM"       , "COUNTER"       , "SEGNUM"       ))
    DbSlExecute: rc = 99
      (SQL error -10108)
      error message returned by DbSl:
    ERROR exec_ddl_stmt: (DB) ERROR: DDL statement failed
    (                                           ALTER TABLE "EDID4" enable persistent merge )
    DbSlExecute: rc = 99
      (SQL error 131)
      error message returned by DbSl:
    transaction rolled back by lock wait timeout: Lock timeout occurs while waiting TABLE_LOCK of mode EXCLUSIVE(TRANSACTION_ID=14, UPDATE_TRANSACTION_ID=1442668)
    (DB) INFO: disconnected from DB
    I ran r3tans -d too to check the connection but it shows "Disconnected from DB".
    Can someone please let me know what went wrong.
    Environment Details :
    SOurce : ECC 6 Ehp5 NW702 Oracle10
    Target : ECC 6 Ehp7 NW740 HANA 1.0 Rev85
    Tool : SUM 1.0 SP12 PL04
    Phase Name :
    MAIN_SWITCH/SUBMOD_MIG_SWITCH/SUBMOD_MIG_DOWNTIME_RUN/EU_CLONE_MIG_DT_RUN
    Thanks
    Dev

    Hi, Check the Blog - DMO: optimizing system downtime ...
    we already had a discussion about in another request.
    Best Regards Roland

  • DDL Statements in a Stored Procedure

    Is there some technique which can be used to execute DDL statements in a stored procedure? I want to drop and recreate a table and a number of indexes. Is there a way for me to do this within a stored procedure?
    Thanks in advance for your assistance!!!

    BEGIN
       EXECUTE IMMEDIATE 'CREATE TABLE bonus (id NUMBER, amt NUMBER)';
    END;http://download-west.oracle.com/docs/cd/B10501_01/appdev.920/a96624/13_elems18.htm#33889

Maybe you are looking for