Generation of Control file in OWB Mapping.

Hi All,
OWB config details is as follows:
OWB 9i :9.2.0.2.8
OWB Repository: 9.2.0.2.0
OWB 9i Client OS: Windows XP Environment
Oracle DB 9i Enterprise Edition 9.2.0.1.0-64 bit Production on IBM AIX machine.
I developed mapping which involved a source file (CSV) & oracle table as target.
Validated & Generated mapping. No error displayed.
Configured mapping set Data File Location, Bad File Location, Log File Location (All these parameters were set to point to different directories in unix.)
Registered all the above location in Deployment Manager.
Deployed the mapping & executed mapping.
I was expecting control file generated by mapping to create on unix partition, however many times it did save on my local machine on Windows XP rather than on unix. The control file created in the local directory where OWB client is installed.
When the same mapping is executed from another machine still the file was created on my local machine.
This was observed after I created file location for Bad file & Log file from OWB.
Why does control file is created on local machine rather than Unix Server?
Can someone please let me know more on this?
Thanks in Advance.
Regards,
Vidyanand

Hi Vidyanand
You may try to register physical file location under one logical location. Then register the location with physical datafile lication. It worked for us.
Cheers, Bana

Similar Messages

  • Importing already-made SQL*Loader control files in OWB 10g

    Hi all,
    Suppose that I have a certain amount of already hand-made SQL*Loader control files, say 50 or so.
    Each of these control files have a variable quantity of fields.
    I feel really lazy, so I would like to know if it is possible to import directly these control files instead of re-typing them in the design center. That would save me a lot of time.
    Thanks !
    Burgy

    Hi Burgy
    One option is to use the sqlloader option to generate an external table from the SQLLoader control file (search for generate_only in the sqlloader documentation). If you define the external table in the database you can reverse engineer this into OWB.
    Cheers
    David

  • OWB 10g: how control files are generated?

    We are using OWB 10g within a 10g Database. We want to know how control files are generated by OWB in the file system. The reason we need to know is because our DBAs do not want to create directory objects pointing to NAS devices, their policy states that all directory objects should be on SAN shares. We rather use NAS shares since it simplifies our batch (too long to explain here). OWB has the "CREATE ANY DIRECTORY" privilege granted. Is it using this privilege to create a directory object for the path we specify the control file in the mapping or is it writing directly to this path? We checked the directory objects created (SELECT * FROM DBA_DIRECTORIES) after deploying a control file and it didn't seem to have created any new ones. Anyone knows how OWB creates these control files?

    Yes, indeed that's what we were after. We basically wanted to be sure we are not breaking an internal policy that says that "Oracle directory objects can not be located on NAS shares". The reasoning behind this policy is that NAS shares are not deemed highly available or high I/O devices hence our Oracle DBAs will not allow us to create any Oracle directory objects in NAS shares. The policy states that all database data should be stored in SAN shares which are directly attached to the servers and are therefore high I/O devices. It is arguable if the OWB data we want to load is really part of a database, we believe it is not. There are other implications in our environment about using NAS instead of SAN (NAS can run in active-active mode across different data centres, whereas SAN requires replication since it doesn't usually work well in an active-active mode across different data centres). So based on your answer we should be fine since OWB reads and writes directly to the files without using Oracle Directory Objects which supports our theory that these are not DB specific files and are only "OWB App" files which can then sit on a NAS without breaking the above stated policy.

  • CTL file in OWB 9.2

    I have a mapping with file as source. I want to generate a CTL file that contains actual physical directory of my location and not the location name. I have specified my own path where the control file for this mapping should get generated.
    (1) When I generate this mapping <map.ctl> file has location_name of the file module and not the physical path in the ctl script.
    (2) When I deploy this mapping - ctl file is not generated in the specified directory.
    (3) Only when I execute this mapping thru OWB that a CTL file containing the physical location of the data file is generated in the OS directory.
    My questions are :
    (1) How do I generate a CTL file containing physical location - without executing the mapping thru OWB. I want to do that so that I can run from sqlldr directly.
    (2) What is the function of Deploy in case of file to table mappings.
    (3) What is the OWB recommended way of deploying and executing such mappings involving sqlldr in prod environment.

    Vibha,
    Sorry for the late response.
    (1) How do I generate a CTL file containing physical location - without executing the mapping thru OWB. I want to do that so that I can run from sqlldr directly.
    There should be no need to run from sqlldr directly. Warehouse Builder manages the execution in which case you get all the error handling and logging included in the runtime audit browser.
    (2) What is the function of Deploy in case of file to table mappings.
    Deploy stores the control file in the runtime repository, so that it can be picked up at execution time, temporarily be stored on the file system and OWB will then execute SQL loader natively.
    (3) What is the OWB recommended way of deploying and executing such mappings involving sqlldr in prod environment.
    Deploy to the production environment and execute it through OEM or a command line scheduling.
    Mark.

  • Flat File as Source in OWB Mapping.

    Hi All,
    Configuration Details is as follows:
    Oracle 9i Warehouse Builder Client: 9.2.0.2.8
    Oracle 9i Warehouse Builder Repository: 9.2.0.2.0
    Windows XP Professional
    I developed a mapping which involves a flat file as source & Oracle Table as target steps followed were as follows.
    1. Created Flat File module, selected Connector & Location Details.
    2. Done mapping for source file & target table.
    3. Validated & Generated the mappings.
    4. Deployed the mapping in Deployment Manager.
    5. Following was Error Message after execution of the mapping.
    Completion Status: Completed with errors.
    Meesage Log: Starting Execution of VHM_MAP2. Starting Task VHM_MAP2. RPE-01013:SQL Loader reported error condition,number 4. Completing Task VHM_MAP2.
    Following was Control File generated by the above mapping.
    OPTIONS ( ERRORS=50, BINDSIZE=50000, ROWS=200, READSIZE=65536)
    LOAD DATA
    CHARACTERSET WE8MSWIN1252
    INFILE '{{TEXT_DATA_LOCATION.RootPath}}dept.txt'
    BADFILE '{{TEXT_DATA_LOCATION.RootPath}}dept.bad'
    DISCARDFILE '{{TEXT_DATA_LOCATION.RootPath}}dept.discard'
    INTO TABLE "{{TARGET_LOCATION.Schema}}"."DEPT"
    APPEND
    REENABLE DISABLED_CONSTRAINTS
    FIELDS
    TERMINATED BY ','
    OPTIONALLY ENCLOSED BY '"'
    "DEPTNO" POSITION (1) INTEGER EXTERNAL ,
    "DNAME" CHAR ,
    "LOC" CHAR
    Please note that no message is displayed in Row Activity & output parameters in Deployment Manager.
    I worked on lower version of the OWB & in that version there was no concept of Location, Connector, Deployment Manager.
    Not sure why the above mapping is failing?
    Also I would like to know where can I get more information about the mapping errors which are different from oracle error messages.
    e.g. In above case error message is RPE-01013: SQL Loader reported error condition, number 4 .
    Thanks in Advance.
    Regards,
    Vidyanand

    Hi
    I'm using single host implementation OWB10g/Oracle on same host.
    My flat file location is
    c:\source\dept.txt
    Pl tell me if I have to save the same file on any particular location for OWB to read.
    Implementation in OWB10g
    1. Created Flat File module, selected Connector & Location Details.
    2. Done mapping for source file & target table.
    3. Validated & Generated the mappings.
    4. Deployed the mapping in Deployment Manager.
    5. Following was Error Message after execution of the mapping.
    Can not read data from file
    c:\souredept.txt
    OPTIONS ( ERRORS=50, BINDSIZE=50000, ROWS=200, READSIZE=65536)
    LOAD DATA
    CHARACTERSET WE8MSWIN1252
    INFILE '{{TEXT_DATA_LOCATION.RootPath}}dept.txt'
    BADFILE '{{TEXT_DATA_LOCATION.RootPath}}dept.bad'
    DISCARDFILE '{{TEXT_DATA_LOCATION.RootPath}}dept.discard'
    INTO TABLE "{{TARGET_LOCATION.Schema}}"."DEPT"
    APPEND
    REENABLE DISABLED_CONSTRAINTS
    FIELDS
    TERMINATED BY ','
    OPTIONALLY ENCLOSED BY '"'
    "DEPTNO" POSITION (1) INTEGER EXTERNAL ,
    "DNAME" CHAR ,
    "LOC" CHAR
    Thx in advance

  • Add "Trailing Nullcolls" to sql loader control files generated by OWB

    Hi gurus,
    I've got a problem loading data with SQL Loader. I need to add the parameter "trailing nullcols" into the SQL Loader control file generated by OWB. I don't want to do this by saving the skript on my hard disk and run it manually, so any ideas where I can put this parameter? I am using OWB 10.1 on a windows 2000 machine.
    Thanks
    Stephan

    Hi,
    I found the solution to problem.
    1; Select the mapping where you map your source flat file to a table.
    2; Right click on the mapping and select "configure"
    3; Go Sources and Targets -&gt; YOUR_TABLE_NAME -&gt; SQL*Loader Parameters
    4; Set Trailing Nullcols = true :-)
    Thank you to anyone looking at this problem.
    Greetings
    Stephan

  • How do i map one field to another in control file via SQL Loader

    Can someone please reply back to this question
    Hi,
    I have a flat file (student.dat delimiter %~| ) using control file (student.ctl) through sql loader. Here are the details.
    student.dat
    student_id, student_firstname, gender, student_lastName, student_newId
    101%~|abc%~|F %~|xyz%~|110%~|
    Corresponding table
    Student (
    Student_ID,
    Student_FN,
    Gender,
    Student_LN
    Question:
    How do i map student_newId field to student_id field in STUDENT DB table so that new id should be inserted in student_id column. How do i specify the mapping in control file. I dont want to create a new column in student table. Please let me know the best way to do this.
    Can someone please reply back to this question.
    My approach:
    In control file i will sepecify the below, Is this a best approach?. Do we have any othe way?
    STUDENT_ID *(:STUDENT_NEWID)*,
    STUDENT_FN,
    GENDER,
    STUDENT_LNAME,
    STUDENT_NEWID BOUNDFILLER
    Thanks
    Sunil
    Edited by: 993112 on Mar 13, 2013 12:28 AM
    Edited by: 993112 on Mar 13, 2013 12:30 AM
    Edited by: 993112 on Mar 13, 2013 12:31 AM
    Edited by: 993112 on Mar 18, 2013 2:52 AM

    OK, ok...
    Here is the sample data:
    101%~|abc%~|F %~|xyz%~|110%~|
    102%~|def%~|M %~|pqr%~|120%~|
    103%~|ghi%~|M %~|stu%~|130%~|
    104%~|jkl%~|F %~|vwx%~|140%~|
    105%~|mno%~|F %~|yza%~|150%~|Here is the control file:
    LOAD DATA
    INFILE student.dat
    TRUNCATE INTO TABLE STUDENT
    FIELDS TERMINATED BY '%~|' TRAILING NULLCOLS
      student_old  FILLER
    , student_fn
    , gender
    , student_ln
    , student_id
    )And here is the execution:
    SQL> CREATE TABLE student
      2  (
      3    student_id   NUMBER
      4  , student_fn   VARCHAR2 (10)
      5  , gender       VARCHAR2 (2)
      6  , student_ln   VARCHAR2 (10)
      7  );
    Table created.
    SQL>
    SQL> !sqlldr / control=student.ctl
    SQL*Loader: Release 11.2.0.3.0 - Production on Tue Mar 19 14:37:31 2013
    Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.
    Commit point reached - logical record count 5
    SQL> select * from student;
    STUDENT_ID STUDENT_FN                     GENDER STUDENT_LN
           110 abc                            F      xyz
           120 def                            M      pqr
           130 ghi                            M      stu
           140 jkl                            F      vwx
           150 mno                            F      yza
    SQL>:p

  • WB_XML_LOAD Control File

    I am very new to OWB and need to load an xml file into a table.
    I think that I need to use WB_XML_LOAD and have found the syntax for the control file I need however I cannot work out how to get the pre mapping process to recognise the control file (I am not sure that I have created the control file correctly either)
    I tried importing the control file as a flat file but get an error when I attempt to validate the mapping (Invalid combination of operators) am I correct to assume this is because I should not be using the flat file import mechanism to get at the control file?
    I have looed at the XML toolkit documentation (which gives me the file content but not the means of 'seeing' it) and I have been through the OWB documentation which again gives me the syntax and structure but not the method or mechanics.
    I also searched this forum but only found posts that were well ahead of where I am.
    I am more than happy to read the manual if only I could find it...
    Thanks
    Leo

    I found some of the answer in this post error while loading XML files into scott user which showed me that I was missing a mapping between two dummy tables.
    Now I am getting the following errors when I attempt to deploy:
    ORA-00955 Name is already used by an existing object
    ORA-06512 at line 35
    ORA-01031 insufficient privileges
    I suspect they are all to do with permissions as I am logged in as one user but attempting to write to a schema owned by another user.
    I am not clear about how accounts are used in OWB or even which account is being used.
    I am logged in to Design Center as User A
    The module containing the mapping to be deployed is created by User B
    The schema being written to is owned by User C
    I followed the instructions in the linked post but could not see any relevant objects listed even when I viewd all objects owned by each of the users accounts.
    Leo
    Edited by: Leo on 08-Feb-2011 06:52

  • Problem in OWB map for source change capture

    The problem is as follows:-
    Our OWB map between two different databases, captures change in data at source and populates them in target. It is a one to one map. The map is failing to process some rows from source database though it gives no:of errors as 0 in the audit view thus we infer that the map is running successfully.
    In our case, we have a composite key ( Instance_id, Version_number) at source as well as target. One instance_id can has more than one version number. We have observed that the view is picking up all the version_number for a particular instance_id but the map is unable to populate the last version_number to the target table.
    But when this map was executed in another environment and it is successfully populating all the data in the target.
    The brief description of the map is as follows:-
    The map has a view which captures all the changes in data (insert and update) .From this view we filter the rows which were already processed in previous map run (with help of watermark). Then we sort the rows based on DML type and watermark . These rows are then mapped to a target table. The loading type of the map is INSERT/UPDATE.

    Hi Nagesh,
    When we are doing I18N for that Application. Go to Navigator Tab
    Here Select Particular Projects--à src-àPackages-àsap-àvijay
    To internationalize the Web Dynpro application, copy the automatically generated *.xlf files and save them under a new name in the same directory.
    The new name must meet the following convention:
    u2022 .xlf
    For example, if you are creating *.xlf files for German,
    Use the language key de.
    Here Click on OK
    After that we can edit and translate these new *.xlf files in the S2X Editor.
    ApplyTemFirstView.wdview_de.xlf-àClick on Resource Text Tab
    Select Particular Text and Change the language to German-àClick on EDIT Button
    Here Enter German Lang-àClick on OK
    Now Go to Web Dynpro Explorer Tab
    Select Project-àRC Click on Rebuild Project
    Select Project-àRC Click on Reload
    Then Deploye the Application
    How to Check in Explorer. It is converting to German Language or not
    Open Internet Explorer
    Tool-àInternet Options -àClick on Languages Button-àClick on ADD Button
    Select German Language--àClick on OK
    Now We will Check in Portal
    Created Web Dynpro iView in Portal. That iView assign to the particular WorkSet-àAssign to Role
    Select that user Can Change Language
    Regards
    Vijay Kalluri

  • Need a help: how to recover using backup control file?

    Please a help:
    First computer
    1. I create a database
    2. put it in archive mode,
    3. shutdown and made a cold backup
    4. Created backup control file (alter database backup control file to trace)
    5. I started up and created some archived log files.
    Second Computer
    1. I copied all files created in the step 3 above except the control file
    2. I create all the same map directory on the 2nd computer as in the 1st computer
    3. I recreate the control file from the script got in the step 4 above
    4. I Copy archived log files generated at the step 5 in the local directory in the second computer
    5. I set the logsource and set the autorecovery to on
    6. I recover the database: RECOVER DATABASE USING BACKUP CONTROL FILE UNTIL CANCEL
    Error got:
    the archived log file applied do not go beyond the first one?,How could I do to applied all archived log files copied from the first computer to the second computer to have the same data?
    Thank you very much

    archived log sequeces in the first computerSQL> select sequence#,first_change#,next_change# from v$log_history;
    SEQUENCE# FIRST_CHANGE# NEXT_CHANGE#
    1 553723 555484
    2 555484 557345
    Actions I did in the second Computer(after copied the former two archived log files from the 1st computer)
    SQL> CREATE CONTROLFILE REUSE DATABASE "ORCL" RESETLOGS ARCHIVELOG
    2 MAXLOGFILES 16
    3 MAXLOGMEMBERS 3
    4 MAXDATAFILES 100
    5 MAXINSTANCES 8
    6 MAXLOGHISTORY 292
    7 LOGFILE
    8 GROUP 1 'C:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\REDO01.LOG' SIZE 50M,
    9 GROUP 2 'C:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\REDO02.LOG' SIZE 50M,
    10 GROUP 3 'C:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\REDO03.LOG' SIZE 50M
    11 -- STANDBY LOGFILE
    12 DATAFILE
    13 'C:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\SYSTEM01.DBF',
    14 'C:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\UNDOTBS01.DBF',
    15 'C:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\SYSAUX01.DBF',
    16 'C:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\USERS01.DBF'
    17 CHARACTER SET WE8ISO8859P1
    18 ;
    Control file created.
    SQL> archive log list;
    Database log mode Archive Mode
    Automatic archival Disabled
    Archive destination USE_DB_RECOVERY_FILE_DEST
    Oldest online log sequence 0
    Next log sequence to archive 0
    Current log sequence 0
    SQL> alter database archivelog;
    Database altered.
    SQL> set logsource C:\local_destination1_orcl
    SQL> set autorecovery on;
    SQL> recover database using backup controlfile until cancel;
    ORA-00279: change 555611 generated at 01/18/2007 14:14:14 needed for thread 1
    ORA-00289: suggestion :
    C:\LOCAL_DESTINATION1_ORCL\ARCH.1_1_612194518_43F17CF5.ARC
    ORA-00280: change 555611 for thread 1 is in sequence #1
    ORA-00328: archived log ends at change 555483, need later change 555611
    ORA-00334: archived log:
    'C:\LOCAL_DESTINATION1_ORCL\ARCH.1_1_612194518_43F17CF5.ARC'
    Idon't know where the change 555611 is coming from?

  • NEED TO RECOVER A DATABASE USING RMAN with CONTROL FILE AND NO RMAN CATALOG, DISK FAILURE..

    Hello All,
    The disk failure caused our production data on the disk to be resotred with the backup data available and recovered through RMAN with cotrolfile , and no catalog DB is configured.
    I had the restored the spfile and control file then recovered the database,
    startup nomount;
    RESTORE SPFILE FROM ' path '  ;
    Shutdown immediate;
    startup nomount
    Restore controfile from autobackup;
    restore database;
    [AT POINT , A MESSAGE PROMPTED LIKE " failur of restored command - some targets not found"  (thinking may be few archives are not found, i proceeded to incomeplete recovery of DB) ]
    recover database;
    Finished reocvery .
    Now in the Grid control i see that 60 blocks of a particular datafile are corrupted and needs recovery. Do i need to get the data file resotred again and recover it or any simple way to recover this data file
    When i perform the block recovery , it says recovery failed and when i run the data file recovery it succeeds. Please provide you inputs to recover the database as it is production BI database and pretty critical to our client.
    Thanks for your valuable time in advance.
    Regards,
    Ran G.

    These is a common problem if the object are created due to NOLOGGIN option. If you check most of the object which are facing block corruption is indexes .
    Use the below query to check the objects :
    It will map each block from v$database_block_corruption to either a segment or if the block is free.
    $ sqlplus / as sysdba
    set pagesize 2000
    set linesize 250
    SELECT e.owner, e.segment_type, e.segment_name, e.partition_name, c.file#
    , greatest(e.block_id, c.block#) corr_start_block#
    , least(e.block_id+e.blocks-1, c.block#+c.blocks-1) corr_end_block#
    , least(e.block_id+e.blocks-1, c.block#+c.blocks-1)
    - greatest(e.block_id, c.block#) + 1 blocks_corrupted
    , null description
    FROM dba_extents e, v$database_block_corruption c
    WHERE e.file_id = c.file#
    AND e.block_id <= c.block# + c.blocks - 1
    AND e.block_id + e.blocks - 1 >= c.block#
    UNION
    SELECT s.owner, s.segment_type, s.segment_name, s.partition_name, c.file#
    , header_block corr_start_block#
    , header_block corr_end_block#
    , 1 blocks_corrupted
    , 'Segment Header' description
    FROM dba_segments s, v$database_block_corruption c
    WHERE s.header_file = c.file#
    AND s.header_block between c.block# and c.block# + c.blocks - 1
    UNION
    SELECT null owner, null segment_type, null segment_name, null partition_name, c.file#
    , greatest(f.block_id, c.block#) corr_start_block#
    , least(f.block_id+f.blocks-1, c.block#+c.blocks-1) corr_end_block#
    , least(f.block_id+f.blocks-1, c.block#+c.blocks-1)
    - greatest(f.block_id, c.block#) + 1 blocks_corrupted
    , 'Free Block' description
    FROM dba_free_space f, v$database_block_corruption c
    WHERE f.file_id = c.file#
    AND f.block_id <= c.block# + c.blocks - 1
    AND f.block_id + f.blocks - 1 >= c.block#
    order by file#, corr_start_block#;
    Below oracle support note will help you :
    ORA-1578 / ORA-26040 Corrupt blocks by NOLOGGING - Error explanation and solution (Doc ID 794505.1)
    The Gains and Pains of Nologging Operations (Doc ID 290161.1)
    SQL> select d.NAME as DBF_NAME, t.NAME as TS_NAME, d.UNRECOVERABLE_CHANGE# as NOLOG_CHNG#, to_char(d.UNRECOVERABLE_TIME, 'Dy DD-Mon-YYYY HH24:MI:SS') as NOLOG_TIME from V$DATAFILE d join V$TABLESPACE t on d.TS# = t.TS# order by t.NAME;
    Thanks,
    gssdba.wordpress.com

  • Bulk Load data without specifying column names in control file

    I am totally new to the world of Oracle databases and am having some trouble doing some basic data imports from a csv file. I have a large amount of data in an excel spreadsheet (a couple hundred columns by varying numbers of rows from 2- several thousand) which I want to import into my Oracle 11g Database. Currently I am trying to use sql loader and specify the import syntax in the control file. From the examples I've seen so far, it seems you must specify the columns individually for what you are importing. This is simply not reasonable for several hundred columns of data.
    Is there sql loader syntax (or a better method all together) to import a comma delimited csv or excel spreadsheet into an oracle database where it automatically generates a table and columns based on the data in the target import file? Even if I must first create the table in the database, my key issue is being able to generate the column names during import to match the column headers in the import file. I appreciate any help you could provide.
    FYI here is my first meager attempt at importing a comma delimited csv, here is my ctl file:
    load data
    infile 'C:\filepath\mock_data.csv'
    into table allData
    fields terminated by "," optionally enclosed by '"'
    It says Syntax error at line 4. Expecting "(", found end of file.
    I suspect there is more at issue here than a missing "("

    You have to create the control file to map to the table.
    Since you would already have created the tables, you could generate the controlfiles based on the table structures.
    See the "unloader.zip" file under the Files link at http://asktom.oracle.com
    -- it has scripts to create unload a table to a flat file and to create the SQLLoader controlfile to reload that data to another target database. It would be the second set of scripts that you can use.
    Hemant K Chitale

  • Webservice  to Idoc/File using ABAP mapping

    Hi Experts,
    I need your expert advise on below scenario.The flow of the scenario is..
    1)I will get a control record from a webservice(SOAP sender adpater), this initiates the process flow.
    2)based on control record ,The ABAP mapping program will call a program(within the PI sys) to fetch the data from DB table.then the ABAP mapping program will have to create 2 messages for the target. One is IDoc and another one is File.
    Pls suggest the best approach.
    Regards,
    Srini

    Hi Prateek,
    Thanks for quick reply.
    there is a main program which has different classes and methoda to fetch the data from DB tables.I dont want to touch this main program.
    what  i am going to do is, I will this main program from abap mapping by passing the control record information.based on this control record,the main program will fetch data for ABAP mapping.From ABAP mapping, i have to generate 2 messages,one for IDOc and another one is for File.
    Hope you got my requirement.
    Regards,
    Srini

  • Different log file name in the Control file of SQL Loader

    Dear all,
    I get every day 3 log files with ftp from a Solaris Server to a Windows 2000 Server machine. In this Windows machine, we have an Oracle Database 9.2. These log files are in the following format: in<date>.log i.e. in20070429.log.
    I would like to load this log file's data to an Oracle table every day and I would like to use SQL Loader for this job.
    The problem is that the log file name is different every day.
    How can I give this variable log file name in the Control file, which is used for the SQL Loader?
    file.ctl
    LOAD DATA
    INFILE 'D:\gbal\in<date>.log'
    APPEND INTO TABLE CHAT_SL
    FIELDS TERMINATED BY WHITESPACE
    TRAILING NULLCOLS
    (SL1 DATE "Mon DD, YYYY HH:MI:SS FF3AM",
    SL2 char,
    SL3 DATE "Mon DD, YYYY HH:MI:SS FF3AM",
    SL4 char,
    SL5 char,
    SL6 char,
    SL7 char,
    SL8 char,
    SL9 char,
    SL10 char,
    SL11 char,
    SL12 char,
    SL13 char,
    SL14 char,
    SL15 char)
    Do you have any better idea about this issue?
    I thought of renaming the log file to an instant name, such as in.log, but how can I distinguish the desired log file, from the other two?
    Thank you very much in advance.
    Giorgos Baliotis

    I don't have a direct solution for your problem.
    However if you invoke the SQL loader from an Oracle stored procedure, it is possible to dynamically set control\log file.
    # Grant previleges to the user to execute command prompt statements
    BEGIN
    dbms_java.grant_permission('bc4186ol','java.io.FilePermission','C:\windows\system32\cmd.exe','execute');
    END;
    * Procedure to execute Operating system commands using PL\SQL(Oracle script making use of Java packages
    CREATE OR REPLACE AND COMPILE JAVA SOURCE NAMED "Host" AS
    import java.io.*;
    public class Host {
    public static void executeCommand(String command) {
    try {
    String[] finalCommand;
    finalCommand = new String[4];
    finalCommand[0] = "C:\\windows\\system32\\cmd.exe";
    finalCommand[1] = "/y";
    finalCommand[2] = "/c";
    finalCommand[3] = command;
    final Process pr = Runtime.getRuntime().exec(finalCommand);
    new Thread(new Runnable() {
    public void run() {
    try {
    BufferedReader br_in = new BufferedReader(new InputStreamReader(pr.getInputStream()));
    String buff = null;
    while ((buff = br_in.readLine()) != null) {
    System.out.println("Process out :" + buff);
    try {Thread.sleep(100); } catch(Exception e) {}
    catch (IOException ioe) {
    System.out.println("Exception caught printing process output.");
    ioe.printStackTrace();
    }).start();
    new Thread(new Runnable() {
    public void run() {
    try {
    BufferedReader br_err = new BufferedReader(new InputStreamReader(pr.getErrorStream()));
    String buff = null;
    while ((buff = br_err.readLine()) != null) {
    System.out.println("Process err :" + buff);
    try {Thread.sleep(100); } catch(Exception e) {}
    catch (IOException ioe) {
    System.out.println("Exception caught printing process error.");
    ioe.printStackTrace();
    }).start();
    catch (Exception ex) {
    System.out.println(ex.getLocalizedMessage());
    public static boolean isWindows() {
    if (System.getProperty("os.name").toLowerCase().indexOf("windows") != -1)
    return true;
    else
    return false;
    * Oracle wrapper to call the above procedure
    CREATE OR REPLACE PROCEDURE Host_Command (p_command IN VARCHAR2)
    AS LANGUAGE JAVA
    NAME 'Host.executeCommand (java.lang.String)';
    * Now invoke the procedure with an operating system command(Execyte SQL-loader)
    * The execution of script would ensure the Prod mapping data file is loaded to PROD_5005_710_MAP table
    * Change the control\log\discard\bad files as apropriate
    BEGIN
    Host_Command (p_command => 'sqlldr system/tiburon@orcl control=C:\anupama\emp_join'||1||'.ctl log=C:\anupama\ond_lists.log');
    END;Does that help you?
    Regards,
    Bhagat

  • SQL Query of an OWB map (row based)

    If I trace a session, execute an OWB map (row based), will the trace file contain the actual SQL query ?
    The problem with me is that when I am executing this row -based OWB map, it is throwing me an error CursorFetchMapTerminationRTV20007 BUT ( plus taking a long time) when I am taking out the intermediate SQL insert query,it is working fine ( and also within a very short period of time)
    Execution status = COMPLETE
    message text = ORA-06502: PL/SQL: numeric or value error: character string buffer too small
    message text = CursorFetchMapTerminationRTV20007
    No. task errors = 0
    No. task warnings = 2
    No. errors = 1
    Since this OWB map (Truncate Insert)  is row based hence I cannot cannot get the back end query from the OWB generated pl/sql package so wondering if I trace the session, check the trace file, may be I will able to see the exact SQL query generated. But wanted to confirm the same.

    Yes, the actual SQL run in the session will be in the trace file.

Maybe you are looking for

  • Windows 7 Aero on a MBP?

    I got Win7 running through a VM that supports Aero on my MBP. How do I know "aero" is running or how do you activate it? sorry if it is a silly question, but thanks for any input.

  • Encoding from

    HI am converting data to <?xml version='1.0' encoding='UTF-8'?><ns1:OFACCheck xmlns:ns1="http://massmutual.com/webservices"><ns1:XMLRequest><OFACRequests><requestcount>1</requestcount></OFACRequests></ns1:XMLRequest> </ns1:OFACCheck> but when message

  • Play sound behavior in CS4 fails to play sound on click of a flash button

    For my college coursework I have created several flash buttons to use as track preview images. The button works fine however trying to get the track to play seems an impossibility! I've inserted the SWF flash button into the place I want it in my tab

  • Need to view Windows files & online content on my iMac

    I've tried DL'ing the thing several times, but nothing works. Thanks

  • I want all my music and playlists to sync on all my devices.

    So I want all my music and playlists to sync on all my devices. I'm not sure if I do not have the correct options checked or what. I have an iPhone 5, a PC, a laptop and a tablet and I would like to make it so that if I make changes on one device it