How to select a data file of a folder for Sqlldr during execution

Dear all

I use the client to Database 11g Rel.2 on windows 2012 server with database 10g Rel.2 on another server.

I get text files pipe-sign separated from a third-party software in a specific folder on my client machine.

This 3rd party software exports data files after every 30 minutes with the naming convention of names like "Filename-Date (YYYYMMDD) _Time (HH24MI)" like this:

TestData-20150408_0935

TestData-20150408_0905

TestData-20150408_0835

....

and so on...

I tested and successfully imported data using Sqlldr to my client computer in the database, but only with a specific name like "testdata".

I don't know how to import the last file generated with the Date last time.

You people can give me a solution to handle this situation?

Thanks in advance.

Again, this has nothing to do with Oracle. Can't you see it's not variable environment, latest is empty. Output shows clearly part of batch D:\export\%latest% file in translates into D:\export\

You have changed the batch file latest.bat with SQL * Loader without understanding how the commands work windows command line:

c:\Temp>type latest.bat
for /f %%d in (' dir / b/a-d/o-d / l ' "))
LATER the value = %% I
ECHO's Latest LAST %
output/b
)

c:\Temp>echo I am the last file > most_recent.txt

c:\Temp>latest.bat

c:\Temp>for/f %i in (' dir/b/a-d/o-d / l ' "))
LATER the value = %i
ECHO's most recent
output/b
)

c:\Temp >)
LATEST set = most_recent.txt
ECHO's most recent
output/b
)
Latest is

c:\Temp>setlocal ENABLEDELAYEDEXPANSION

c:\Temp>latest.bat

c:\Temp>for/f %i in (' dir/b/a-d/o-d / l ' "))
LATER the value = %i
ECHO's Latest most_recent.txt
output/b
)

c:\Temp >)
LATEST set = most_recent.txt
ECHO's Latest most_recent.txt
output/b
)
Last is most_recent.txt

c:\Temp >

SY.

Tags: Database

Similar Questions

  • How can I add data file to an existing table on Oracle RAC ASM with no OMF? Thank you!

    How can I add data file to an existing table on Oracle RAC ASM with no OMF? Thank you!

    Hello

    So I guess you have some files in ASM, see your first existing file structure

    Select file_name

    from dba_data_files;

    and to add to an existing table, the example below (even if you're better sticking with OMFs!)-is that what you are looking for?

    SQL > create tablespace TEST1

    2 datafile '+ DATA' size 1 M;

    Created tablespace.

    SQL > select file_name in dba_data_files;

    FILE_NAME

    --------------------------------------------------------------------------------

    +Data/orcl2/datafile/users.259.859820983

    +Data/orcl2/datafile/undotbs1.258.859820983

    +Data/orcl2/datafile/SYSAUX.257.859820983

    +Data/orcl2/datafile/system.256.859820981

    +Data/orcl2/datafile/example.269.859821049

    +Data/orcl2/datafile/Test1.271.859843053

    6 selected lines.

    SQL > alter tablespace TEST1

    2 Add datafile ' + DATA / mynewfile01.dbf ' size 2 m;

    Tablespace altered.

    SQL > select file_name in dba_data_files;

    FILE_NAME

    --------------------------------------------------------------------------------

    +Data/orcl2/datafile/users.259.859820983

    +Data/orcl2/datafile/undotbs1.258.859820983

    +Data/orcl2/datafile/SYSAUX.257.859820983

    +Data/orcl2/datafile/system.256.859820981

    +Data/orcl2/datafile/example.269.859821049

    +Data/orcl2/datafile/Test1.271.859843053

    + DATA / mynewfile01.dbf

    Thank you

  • How to recover the data file in Oralcle 10 g...? No backups and no newspaper archiving

    All,

    I need to recover the data file 2, which is for the undo tablespace and it is in the State to recover and I need to recover the data files now.

    But the bad news is we have no backup at all and we have no archive logs (log archiving is disabled in the database)...

    In this case how can I recover the data file...?


    SQL > select a.file #, b.SID, a.status from v$ datafile a, v$ tablespace b where a.ts #= b.ts #;

    FILE NAME STATUS NO.
    ---------- ------------------------------------------------------------------------------------------ -------
    1 /export/home/oracle/flexcube/product/10.2.0/db_1/oradata/bwfcc73/system01.dbf SYSTEM
    * RETRIEVE /export/home/oracle/logs/bw/undotbs01.dbf 2 *.
    3 /export/home/oracle/flexcube/product/10.2.0/db_1/oradata/bwfcc73/sysaux01.dbf online
    4 /export/home/oracle/datafiles/bw/bwfcc73.dbf online
    5 /export/home/oracle/datafiles/bw/bwfcc73_01.dbf online

    SQL > archive logs list;
    Database log mode no Archive Mode
    Automatic archival disabled
    Destination of archive USE_DB_RECOVERY_FILE_DEST
    Sequence of journal online oldest 4940
    Current log sequence 4942

    Hello

    First, you must open a ticket with oracle Support and explore the options

    You can use this note to fix:
    RECOVERY OF A LOST IN A [ID 1013221.6] UNDO TABLESPACE DATA FILE

    If you are unable to drop Undo tablespace as Undo Segment recovery must

    You can download the trace file following the opening of the ticket

    SQL>Alter session set tracefile_identifier='corrupt';
    
    SQL>Alter system dump undo header "";
    
    Go to udump
    
    ls -lrt *corrupt*
    
    Upload this trace file
    
    Also upload the alert log file
    

    Kind regards
    Levi Pereira

    Published by: Levi Pereira on November 29, 2011 13:58

  • How to print all the files in a folder without having to open each one?

    Hello

    Can someone tell me how to print all the files in a folder? I often need to print multiple files in a folder and it would allow me to save a lot of time!

    Thank you!

    I've done some testing, and it seems that Windows 7 allows print several files when they are all the same type of file.  So, for example, you can select and print 15 Word documents, but not a Word document and a single PDF document.

    To work around this limitation, you can print each file type separately.  For example, to print PDF files in a folder:

    1. Type *. PDF in the search for top-right box.
    2. For 1-15 files, press on CTRL + A to select all the.
    3. For 16 or more files, select 15 of them (click on the first, SHIFT + click the last).
    4. Click any file, and then click print .
    5. Repeat steps 3 and 4 as needed.

    Boulder computer Maven
    Most Microsoft Valuable Professional

  • How to define JDBC Data Sources in Oracle MapViewer for Oracle database 12 c Release 1 (12.1.0.1)

    How to define JDBC Data Sources in Oracle MapViewer for Oracle database Release 1 (12.1.0.1) 12 c?

    Here is my setup in the conf\mapViewerConfig.xml:


    < name map_data_source = "mvdemo12".

    jdbc_host = "127.0.0.1".

    jdbc_sid = "orcl12c1".

    jdbc_port = '1522 '.

    jdbc_user = "mvdemo".

    jdbc_password = "7OVl2rJ + hOYxG5T3vKJQb + hW4NPgy9EN.

    jdbc_mode = 'thin '.

    number_of_mappers = '3 '.

    allow_jdbc_theme_based_foi = 'true '.

    Editable = "true" / >

    <!--  ****  -->

    But it does not work.

    After use "sqlplus mvdemo / [email protected]:1522 / pdborcl", it connected to the Oracle 12 c database.

    Anyone know it?

    Thank you

    11.1.1.7.1 use the jdbc_sid syntax, i.e.

    as described in the README file, mypdb1.foo.com

    -Sources of native data (no container) MapViewer can now use the service name of database instead of SID. To provide a db service name, you will use the same attribute of jdbc_sid, but specify the name of the service with double slashes in front, as follows:

    jdbc_host = "foo.com"

    jdbc_sid="//mypdb1.foo.com".

    jdbc_port = '1522 '.

    ... ...

    />

    Use a container_ds to the 11.1.1.7.0.

    that is, instead of using

    jdbc_host = "mydbinstance".

    jdbc_sid = "pdborcl12c".

    jdbc_port = '1522 '.

    jdbc_user = "mytestuser".

    jdbc_password = "m2E7T48U3LfRjKwR0YFETQcjNb4gCMLG8/X0KWjO00Q ="

    jdbc_mode = 'thin '.

    number_of_mappers = "6".

    allow_jdbc_theme_based_foi = "false".

    Editable = "false".

    />

    use

    container_ds = "jdbc/db12c.

    number_of_mappers = "6".

    allow_jdbc_theme_based_foi = "false".

    Editable = "false".

    />

    In my case the Glassfish 3.1.2.2 JDBC connection pool definition has been

    Property

    URL jdbc:oracle:thin:@mydbinstance:1522/pdborcl12c.rest_of.service.name

    Uncheck the wrap JDBC objects in advanced Panel, that is, the page properties change JDBC connection advanced pool.

    Add a resource to that newly created JDBC pool

    Use in mapviewerconfig.xml as above

  • Move icon missing in the files downloaded in the clouds, so how do I move a file in a folder?

    Move icon missing in the files downloaded in the clouds, so how do I move a file in a folder?

    If you are on the page of files where all your files and folders are listed, then there are two ways to move:

    The thumbnail (can only move a file or folder at a time):

    • Click the triangle to display under the thumbnail.
    • In the options that appear, select the Move button.

    The list view (can move several files and folders):

    • The check boxes for the files and folders that you want to move.
    • The menu bar at the top left changes has a Move button.

  • How to recover the data pin and a location for visitors to the Web site

    need help

    I'm doing a project with asp.net blackberry

    How to recover the data pin and a location for visitors to the Web site when he pressed the button on the web using asp.net?

    so far, this is the only code that works for me to get a location in a web widget:

    http://docs.BlackBerry.com/en/developers/deliverables/17954/CS_Retrieving_a_GPS_loc_by_using_a_web_p...

  • during an update lots of my profile folder has been put in a folder on the desktop marked the old data. How to restore this data file

    During a bet to update, automatic update of windows has started and some how much my profile data has been removed and stored in a file on the desktop. There is a simple and easy way to restore this folder from the current firefox?

    You can use the contents of the Old Firefox Data folder to "roll back" the refresh, but this involves several steps. It's probably even faster than the recovery of individual files and load those into your new profile.

    Check in the folder 'Old data Firefox' update adds a folder with a random semi name on your desktop. If there is only one, that probably has your old settings and Add-ons. If there is more than one, you'll want to work with one who has been updated recently.

    Once you have identified the profile folder, that you want to restore, here is my "old profile resurrection suggested procedure:

    Overview

    Here are the steps described in more detail below:

    1. Create a new Firefox profile
    2. Delete all of this profile folder
    3. Copy in all of the old profile folder

    Create a new profile for Firefox (Windows)

    Exit Firefox completely and start up in the Profile Manager by pasting the following in the Windows search, or the Run dialog box by pressing ENTER:

    firefox.exe -P
    

    Note: any time want to switch profiles, exit Firefox and return to this dialog box.

    Click on the button create a profile, give it a name like OldSettings and skip the option to change the location of the folder. Select the new profile from the dialog box, and then start Firefox.

    Open the new profile folder in Windows Explorer

    Firefox in the new profile should look like a new installation of the plant. Open the troubleshooting information page by using either:

    • button "3-bar" menu > "?" button > troubleshooting information
    • Menu help > troubleshooting information
    • type or paste everything: in the address bar and press Enter

    In the first table, click on the view file"" button. Firefox will launch your new profile folder in Windows Explorer.

    This folder open, switch back to Firefox and get out by using either:

    • "3-bar" menu button > button "power".
    • (menu bar) File > Exit

    Firefox is closed, the profile folder must be front and Center, or you can activate it by using the taskbar.

    Copy old data instead of new

    In this new profile folder you just popped open - NOT the one on your desktop - select all content (you can use Ctrl + a) and delete (you can press Delete on the keyboard).

    Leave this window open, open or switch to your folder of old data of Firefox. Consult your old profile folder. At this level, you should see a folder named bookmarkbackups among other things.

    Select all (Ctrl + a) and copy (or right-click > copy or Ctrl + c).

    Switch to the empty profile folder in another window and paste (or right-click > paste or Ctrl + v). This may take a few minutes because some files are large.

    Launch Firefox

    Firefox should start in this 'new' profile with the old resurrected profile data. Success?

  • How to remove the data files of cRIO

    Please forgive my ignorance, but I don't see how to remove the old a cRIO data files.  I tried to get a functional data logger, and I have some old files of data on the cRIO.  I ftp copies files through IE, but I don't know how to delete the files from the cRIO.

    If you FTP via Windows Explorer, my computer, ftp://adresse IP in the address bar, you should be able to delete the files.

  • How to check the data file is set to unlimilted autoextend

    S/N,

    Oracle version: 10.2.0.4
    OS: linux

    could someone tell me how can I check the data file are set to unlimited autoextend?

    Thank you
    Bahadur.

    Salvation;

    Pelase see:
    How to check the CanGrow data files the value of Maxsize unlimited [ID 468096.1]

    Respect of
    HELIOS

  • How to check what data file have been saved?

    Hello

    I take the level 0 with RMAN incremental backup... How to check if the data files are backed up or not? When this data file have been saved? If this data file backup not more than ten days... Need to backup data files?

    Help, please

    check v$ backup_datafile.COMPLETION_TIME

    HTH

  • How to select valid dates only

    If I have a table with a column varchar2 as below, how to select records that contain only valid dates? As there is no 2010-04-31, so I need only to bring on 2010-04-30, which is a valid date.

    Select '2010-04-30'd from the double. "
    Union of all the
    Select '2010-04-31'd from the double. "

    I'm on Oracle 10.2

    Published by: Rinne on April 23, 2010 11:15

    Hello

    Tubby wrote:
    An option using SQL only, although something like that, I tend to go with the solution of francs to a user defined function. Because if you store dates as strings, you're likely to have more than just 1 kind of "bad" data in the string.

    If you try a pure-SQL solution, make sure that it does not raise an error when d is an absolute stupidity (for example, when d = "TOTAL GARBAGE").
    Do something like this:

    WHERE   CASE
              WHEN  d     IS NULL
              THEN  'Missing'
              WHEN  TRANSLATE ( d
                              , '012345678'
                        , '999999999'
                        ) != '9999-99-99'
              THEN  'Invalid format or non-numeric'
              WHEN  SUBSTR (d, 1, 4)     = '0000'     -- or test for implausible years, e.g. "< '1900'"
              THEN  'Invalid year'
              WHEN  SUBSTR (d, 6, 2)     NOT BETWEEN  '01'
                                                AND          '12'
              THEN  'Invalid month'
              WHEN  SUBSTR (d, 9, 2)     NOT BETWEEN  '01'
                                                AND          TO_CHAR ( LAST_DAY ( TO_DATE ( SUBSTR (d, 1, 7)     -- no need for "|| '01'"
                                                                          , 'YYYY-MM'
                                                        )
                                                 )
                                            , 'DD'
                                            )
              THEN  'Invalid day'
              WHEN  d     BETWEEN '1582-10-05'     -- If necessary
                         AND     '1582-10-14'
              THEN  'Julian-Gregorian calendar change'
              ELSE  'Okay'
         END     = 'Okay'
    

    In my opinion, it intercepts all possible errors in common dates of the time.

    Published by: Frank Kulash, April 23, 2010 12:57

  • How to remove the .dat files

    Hi all

    I recently updated my Surface Pro and I noticed that during the update, there is a Windows.Old folder that contain data from before the update. However, when I tried to remove this folder as the update seems to be normal, I am unable to remove 6 boring. DAT files that remain. The. DAT are associated with an app called Kno manual and some are associated with Studyblue.com that allows me to generate and store the flashcards online.

    6 of these files have file names that are ridiculously long with weird symbols two SS in the midst O...

    Whenever I try to delete these files, I get an error saying "file names are too long for the destination folder. You can shorten the file name and try again, or try a location with a shorter path. »

    I'm unable to rename these files, send them to any location or compress them, basically, I can't do anything with these files and I can't delete the entire folder Window.Old.

    Is there a way to delete these items?]]

    Thanks in advance

    Well, after a lot of research I thought it

    Forget the noise on the Unlocker download, FIleAssasin, ETC..

    Best way to do this is through the command prompt.

    Open cmd prompt, type:

    DEL/p/f/s/a "C:\Windows.old\*".

    And viola, it has deleted the. DAT files and I was able to manually delete the Window.old folder.

  • How to delete a DATA FILE and rename the other DATA of FILE Batch scripts

    DELETE or DROP d:\NDM\Data\StampFiles\STAMPLOADBKUP.csv

    RANAME d:\NDM\Data\StampFiles\STAMPLOAD_cwoo.csv data file for d:\NDM\Data\StampFiles\STAMPLOADBKUP. CSV

    what works for use in support of scripting batch above and need exact syntax please. I am poor in the batch script.

    Concerning
    Soma

    ================
    D:

    CD d:\NDM\Data\StampFiles

    del STAMPLOADBKUP.csv

    Ren STAMPLOAD_cwoo.csv STAMPLOADBKUP. CSV

    ================

    That should do it for you!

  • How to read the data file

    Hello
    I have red the DBW do that beside Scripture, is that correct?

    Thank you

    Jin

    DBWR writing data in data file... hope that the server process reads the data from the data file...

    Kind regards
    Deepak

Maybe you are looking for

  • iMovie deleted on iPhone app

    Hello. I accidentally deleted iMovie app on my IPhone 6s. How can I get it back? Thank you

  • Use the TC for backups only, while the computer is connected to a different network

    Time Capsule version 7.7.3 I want to be able to make backups without having to connect to its network via wi - fi, because I'm connected to a different wireless network to access the internet. I thought that I need to connect the TC to my computer wi

  • Installing WXP on Satellite L300-0HH

    Hello I have laptop Satellite L300-0hh and I would chang my Windows Vista and install Windows XP.Please help me find the driver for Windows XP Home edition. Thank you.

  • Satellite L500: after cleaning with a cloth keyboard problem

    Hi guys,. New to this Forum, can someone help us please Our daughter decided to give the keyboard a cleaning with a cloth but it was then that he turned and now some letters when keyed perform other functions, for example the letter t emerged the sam

  • Hard drive boot record is missing

    I recently had a virus and my antivirus told me to start in SafeMode to complete uninstallation.  It took several reboots and I've made a few changes in administrative tools to have Windows restart every time in safe mode by pressing F10 succeeded pe