Dynamic bad and Log file names!!

Hi

Hi
I have the scenario like the data files would be passed as parameter to the mapping , and the mapping would have the premapping procedure which would change the file name in the external table definition. This works fine. But the one more issue I have is that, I would like to change the bad file,log file and discard file name also through this procedure. In other words, for each incoming data file I would like to create a bad ,log and disc file.So How do I accomplish in the present procedure which does the following alter table statement
execute immediate 'alter table '||p_table_name||' location('''
||p_file_name||''')';
Any suggestion would be greatly appreciated
Thanks
Balaji

Similar Messages

  • Export dump file and log file  name as sysdate in script

    Hi to All,
    Can anybody help me to give logical backup export dump file namd log file name is as contain sysdate in its name so that we can Uniquelly identified it.
    Regards
    DXB_DBA

    On windows it gets a bit hairy as there really is no clean and nice way of doing it.There are a couple of options.
    1. If you can rely on dateformat not changing, you can use a static substring expression. For example, the following might work w/ finnish locale echo %date:~3,2%%date:~6,2%%date:~9,4%Similarly, when you know the dateformat you can tokenize the output of 'date /t' and discard the tokens you don't want.
    2. You can set dateformat to your liking and then just use %date% in your script
    3. You can run a "SELECT to_char(sysdate,..." into a file and then read that file in your script.
    4. Simon Sheppard also has a solution you could use as a basis. I have a slight issue with the approach, but that could just be me.
    5. Use gnuwin32 or similar ;)
    Also note that %date% env var is set automatically from w2k onwards, so some of the solutions might not work w/ older versions.

  • Shell Script to grep Job File name and Log File name from crontab -l

    Hello,
    I am new to shell scripting. I need to write a shell script where i can grep the name of file ie. .sh file and log file from crontab -l.
    #51 18 * * * /home/oracle/refresh/refresh_ug634.sh > /home/oracle/refresh/refresh_ug634.sh.log 2>&1
    #40 17 * * * /home/oracle/refresh/refresh_ux634.sh > /home/oracle/refresh/refresh_ux634.sh.log 2>&1
    In crontab -l, there are many jobs, i need to grep job name like 'refresh_ug634.sh' and corresponding log name like 'refresh_ug634.sh.log '.
    I am thinking of making a universal script that can grep job name, log name and hostname for one server.
    Then, suppose i modify the refresh_ug634.sh script and call that universal script and echo those values when the script gets executed.
    Please can anyone help.
    All i need to do is have footer in all the scripts running in crontab in one server.
    job file name
    log file name
    hostname
    Please suggest if any better solution. Thanks.

    957704 wrote:
    I need help how to grep that information from crontab -l
    Please can you provide some insight how to grep that shell script name from list of crontab -l jobs
    crontab -l > cron.log -- exporting the contents to a file
    cat cron.log|grep something -- need some commands to grep that infoYou are missing the point. This forum is for discussion of SQL and PL/SQL questions. What does your question have to do with SQL or PL/SQL.
    It's like you just walked into a hardware store and asked where they keep the fresh produce.
    I will point out one thing about your question. You are assuming every entry in the crontab has exactly the same format. consider this crontab:
    #=========================================================================
    # NOTE:  If this is on a clustered environment, all changes to this crontab
    #         must be replicated on all other nodes of the cluster!
    # minute        (0 thru 59)
    # hour          (0 thru 23)
    # day-of-month  (1 thru 31)
    # month         (1 thru 12)
    # weekday       (0 thru 6, sunday thru saturday)
    # command
    #=========================================================================
    00 01 1-2 * 1,3,5,7 /u01/scripts/myscript01  5 orcl  dev
    00 04 * * * /u01/scripts/myscript02 hr 365 >/u01/logs/myscript2.lis
    00 6 * * * /u01/scripts/myscript03  >/u01/logs/myscript3.lisThe variations are endless.
    When you get to an appropriate forum (this on is not it) it will be helpful to explain your business requirement, not just your proposed technical solution.

  • Automate exports and imports (file names)

    Hi all,
    I will like to do a simple export and import into another schema in another database.
    I am very comfortable with the process but all i require is how to set the dump file and log file names to be the date and name of the database being exported and imported.
    For example when I do the export I want the dump file and logfile names to be exp_ORCL_230805.dmp and exp_ORCL_230805.log for database ORCL exported on 230805.
    For the import I want the logfile name to be imp_TEST_230905.log.
    I am doing this export and import on a windows xp client but the database reside on UNIX AIX boxes.
    Thanks alot

    Set up ORACLE_SID before you start the imp/exp session on the client, then you can use file=exp_%ORACLE_SID%_%DATE%.dmp etc. (Note that if your windows locale has a date format w/ whitespace you might have to write a script to get rid of it..)

  • Process Flow ignores name and location for Control- and Log-Files

    Hi!
    Our OWB Version is 10.1.0.3.0 - DB Version 9.2.0.7.0 - OWF Version 2.6.2
    Clients and server are running on Windows. Database contains target schemas as well as OWB Design and Runtime, plus OWF repositories. The source files to load reside on the same server as the database.
    I have for example a SQL*Loader Mapping MAP_TEXT which loads one flat file "text.dat" into a table stg_text.
    The mapping MAP_TEXT is well configured and runs perfect. i.e. Control file "text.ctl" is generated to location LOC_CTL, flat file "text.dat" read from another location LOC_DATA, bad file "text.bad" is written to LOC_BAD and the log file "text.log" is placed into LOC_LOG. All locations are registered in runtime repository.
    When I integrate this mapping into a WorkFlow Process PF_TEXT, then only LOC_DATA and LOC_BAD are used. After deploying PF_TEXT, I execute it and found out, that Control and Log file are placed into the directory <OWB_HOME>\owb\temp and got generic names <Mapping Name>.ctl and <Mapping Name>.log (in this case MAP_TEXT.ctl and MAP_TEXT.log).
    How can I influence OWB to execute the Process Flow using the locations configured for the mapping placed inside?
    Has anyone any helpfull idea?
    Thx,
    Johann.

    I didn't expect to be the only one to encounter this misbehaviour of OWB.
    Meanwhile I found out what the problem is and had to recognize that it is like it is!
    There is no solution for it till Paris Release.
    Bug Nr. 3099551 at Oracle MetaLink adresses this issue.
    Regards,
    Johann Lodina.

  • Log File name and path to check Excel Download

    Hi ,
    When we download a report in Excel/PDF/HTML is it logged in any log file ? What is the log file name and path?
    Regards
    Anand

    Hi...
    one of my user tried to download the report in excel format. that excel was not opening. then he tried to download the same report again. this time he was able to open thee excel.
    So he wants to investigate why this happened first time. could you please suggest how we can investigate this?
    Regards
    Anand

  • 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

  • In R12 how to change concurrent output/log file name prefix?

    how to change concurrent output/log file name prefix?

    but i want to change change concurrent output/log file name prefix?You cannot, and I believe it is not supported for all concurrent requests -- Please log a SR to confirm this with Oracle support.
    Thanks,
    Hussein

  • How to add a date suffix to the log file name

    In Windows, I want to run certain commands and save the output to a logfile every day. How to add a suffix to the log file name so I can distinguish which log file for which day?
    e.g. cmd >> logfile.date

    AZ wrote:
    In Windows, I want to run certain commands and save the output to a logfile every day. How to add a suffix to the log file name so I can distinguish which log file for which day?
    e.g. cmd >> logfile.datemy best friend name is "google", refer to this [url | http://stackoverflow.com/questions/203090/how-to-get-current-datetime-on-windows-command-line-in-a-suitable-format-for-usi]
    This is what i did
    1) created a dummy file in c drive
    2) copy pasted below lines, you can play around more with the format
    set _my_datetime=%date%_%time%
    set _my_datetime=%_my_datetime: =_%
    set _my_datetime=%_my_datetime::=%
    set _my_datetime=%_my_datetime:/=_%
    set _my_datetime=%_my_datetime:.=_%3) Rename the file from dos
    ren some.txt dummy_file_%_my_datetime%.txt4) Here goes the output
    C:\dir
    dummy_file_Mon_09_20_2010_161347_21.txt
    Most of the code i copied from above url, you can tweak a little bit based on ur requirement and format.
    Regards
    Learner                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • How to using variable in log file name on ODI 10.1.3.5?

    Hi,
    how can i put a my variable into my log file name?
    now I use this syntax --> ExRate_<%=odiRef.getSysDate("MMddyyHHmm")%>.log.
    But I have a variable for example #server, the value = "oracleProd" and i want to put the variable value into my log file name.
    so the result that i want to get is --> ExRate_oracleProd_<%=odiRef.getSysDate("MMddyyHHmm")%>.log
    so how can I apply the variable value to my log file name? I try using odiRef.getSessionVarList(#Month) but it didn't work.
    Thanks.
    Regards,
    chris
    Edited by: 877142 on Aug 3, 2011 9:36 PM

    hi,
    You can by
    ExRate-#server-<%=odiRef.getSysDate("MMddyyHHmm")%>.log
    Note that I have changed the underscores to dashes. This is because ODI will assume that this is a wildcard/escape character.
    Hope this helps!!
    Bos

  • Compiler error - bad command or file name

    I have downloaded JDK 1.4 beta from this site and have
    ammended the path commands in my Autoexec file. I use
    the DOS edit to type my programs and save the files with
    a .java extension. When I type javac Convertion.java for
    example all I get is Bad command or file name.
    Any assistance will be appreciated.

    either you haven't rebooted your machine or you have set the PATH correctly - first reboot, then double check autoexec.bat

  • Common log file name for ESB

    What is the log file name which is logging all the informations of ESB?

    There are several
    The most common ones are :
    $OH$\soa\j2ee\home\log\home_default_group_1\oc4j\log.xml
    and
    $OH$\soa\bpel\domains\default\logs\domain.log

  • Apache2 log file names

    I'm running Mac OS X Server 10.6.4, and have 3 web sites that all resolve to the same IP number. All is working just fine except for naming the log files. I'd like to have separate files for each virtual site; that is, traffic to example1.com should go to /var/log/apache2/example1_access)log, traffic to example2.com should go to /var/log/apache2/example2accesslog, etc. I set this up in server admin, but the names of the actual log files are something like example1accesslog.1287014400 and example2accesslog.1286409600.
    This causes problems in having my web usage program finding the correct file. Can anyone point me to relevant documentation on how to solve this problem?

    The timestamps on the files are related to the fact you have log file rotation turned on.
    As for how to solve it that depends a lot on the analytics program you're using, which you omit to mention.
    You could turn off the log file rotation, but then you'd have issues with ever-growing log files
    You could rename the logs files yourself
    You could teach the analytics program to understand your log file names (this is the approach I'd take - rotating logs is VERY common and I can't think there's an analytics that doesn't handle it)

  • Adpatch default log file names-Raghuram Kotnana

    Does using of adpatch default log file names during patching makes it difficult to keep an accurate record of your patch history ?

    RaghuramKotnana wrote:
    Does using of adpatch default log file names during patching makes it difficult to keep an accurate record of your patch history ?
    It does make it difficult when you apply many patches and all are logged in the same patch log file. If you encounter issues applying patches while using the default adpatch.log name, it would be also harder to find the proper entries to grep and share with Oracle support.
    I would suggest you use the same patch driver name for the log file and replace .drv with .log (i.e. u<patch number>.log).
    Details about applied patches from your instance can be found in the tables in (Important tables used by and updated by ADPATCH utility (Doc ID 1520703.1)).
    You can also refer to eTRM website for details about each table -- http://etrm.oracle.com/
    Thanks,
    Hussein

  • I can not transfer date from one hard drive to another, I keep getting an error because I have two of the same file names and one file name is in caps and I cant change the file name

    can not transfer date from one hard drive to another, I keep getting an error because I have two of the same file names and one file name is in caps and I cant change the file name. My original external has an error and needs to be reformatted but I dont want to lose this informations its my entire Itunes library.

    Sounds like the source drive is formatted as case sensitive and the destination drive is not. The preferred format for OS X is case insensitive unless there is a compelling reason to go case sensitive.
    Why can't you change the filename? Is it because the source drive is having problems?  If so is this happening with only one or two or a few files? If so the best thing would be to copy those over individually and then rename them on the destination drive.
    If it is more then you can do manually and you can't change the name on the source you will have to reformat the destination as case sensitive.
    Btw this group is for discussion of the Support Communities itself, you;d do better posting to Lion group. I'll see if a host will move it.

Maybe you are looking for

  • Safari will not download any files or allow videos to play.

    I have recently upgraded to safari version 4.02 on a 20" iMac with OS 10.5.7. I have tried to download files from a number of web sites and a number of different file types and none will download. Files that I have tried to download are psd, png, tif

  • Default Value in Numeric Input Field in Visual Composer Application

    Hi All, I have developed a visual composer application which has a numeric input field for Hours. It is mapped to a backend module. We are using portal 7.31 The problem is that the deafult value of this input field is "0", but the rquirement is to di

  • Selection variant for a report painter

    Hi, I created a report painter report. I want to create a default selection variant for a specific user. For example, I want user GIRARDJU to have company code=ADM, period 6 to period 13. I tried to create a variant and call it U_GIRARDJU but it does

  • Adfc-config navigation not working

    Hello, I have created the following navigation in the adfc-config.xml:   <view id="partError">     <page>/partError.jspx</page>   </view>   <view id="estimation-home">     <page>/estimation-home.jspx</page>   </view>   <view id="estimation-chart">   

  • Mutli level heriarchy

    Hi All, I am trying to return XML from oracle. I am using XSU utility for the same. Seeing some solved examples I have been able to get it working for a simple one to many case. I need some help to model multi level heriarchy. For examle if a custome