Batch file for Export Job

Hi,
We created an OS batch file for our daily exports (backups). This file is scheduled to run daily at 7:00 P.M. A test run showed that it did not work. Can somebody find an error in the script?
rem ***** SAMPLE BATCH FILE TO DO DAILY EXPORT ******
@echo Export started at:
@echo
date /T
time /T
rem Here's a one-line NT command (But a long line!)
rem one that splits all the date parts out, outting
rem each one into it's own variable (weekday, day, month, year)
for /f "tokens=1-4 delims=/ " %%a in('date /t') do
(set=weekend=%%a& set day=%%b& set month=%%c& set year=%%d)
set logfile=%year%_%month%_%day%.log
set expfile=%year%_%month%_%day%.exp
set ORACLE_SID=BDC
set ORACLE_HOME=D:\oracle\product\10.2.0
exp system/bdcadmin@bdc full=y grants=y file=D:\export\bdc.dmp log=D:\export\bdc.log compress=N
@echo Export completed at:
@echo
date /T
time /T
rem ************* END OF BATCH FILE *********************
Thank you!

You can straight away use this batch file after modifying the exp line with your machine details and schema name.
@echo off
if %1/==:/ goto %2
if NOT %1/==/?/ goto Begin
for %%C in (echo. goto:End) do %%C
:Begin --------------------------------------------------------------
if NOT errorlevel 1 %0 : %OS%Parse MM DD
%0 : %OS%Parse DD MM
:Windows_NTParse ----------------------------------------------------
for /f "tokens=1-4 delims=/.- " %%A in ('date /t') do (
set Dow=%%A&set %3=%%B&set %4=%%C&set YYYY=%%D&goto End)
:Parse --------------------------------------------------------------
for %%C in (md cd) do %%C @tmp@
%COMSPEC% /e:2048 /c ~tmp1.bat > ~tmp2.bat
call ~tmp2
if NOT errorlevel 1 goto Slash
lfnfor on > "%_D%.-"
ren "%_D%.-" "??? ?? ?? ????"
for %%F in ("??? ?? ?? ????") do set _D=%%F
lfnfor off
:Slash
for %%S in ("%3=%%%4%%" "%4=%%YYYY%%" "YYYY=%%1") do echo set %%S>>~tmp1.bat
for %%S in (%_D%) do call ~tmp1 %%S
if errorlevel 1 goto Cleanup
%COMSPEC% /e:2048 /c ~tmp1.bat > ~tmp2.bat
call ~tmp2
:Cleanup
for %%C in ("set _D=" cd.. "deltree /y @tmp@ > NUL") do %%C
:End ----------------------------------------------------------------
exp system/oracle file=D:\Backup\PERF_4.2_%yyyy%%mm%%dd%.dmp log=D:\Backup\PERF_4.2_%yyyy%%mm%%dd%.log owner=TEST
****************************************************************************************

Similar Messages

  • How to create a Batch file for java application  ?

    HI,
    How to create a Batch file for java application ?
    And whats the use of creating batch file ?
    Thanks in advance

    [http://static.springsource.org/spring-batch/]
    Assuming you want to develop a batch application rather than actually just create a .bat file ..

  • HOw to create a Batch file for java application and whats the use of this ?

    HI,
    How to create a Batch file for java application ?
    And whats the use of creating batch file ?
    Thanks in advance

    First of all, you're OT.
    Second, you can find this everywhere in the net.
    If you got a manifest declaring main class (an classpath if needed), just create a file named whatever.bat, within same directory of jar file, containing:
    javaw -jar ./WhateverTheNameOfYourJarIs.jar %*By the way, assuming a Windows OS, you can just double click the jar file (no batch is needed).
    Otherwise use:
    javaw -cp listOfJarsAndDirectoriesSeparedBySemiColon country/company/application/package/className %*Where 'country/company/application/package/' just stands for a package path using '/' as separator instead of '.'
    Don't specify the .class extension.
    Javaw only works on Windows (you asked for batch, I assumed .BAT, no .sh), in Linux please use java.exe (path may be needed, Windows doesn't need it 'cause java's executables are copied to system32 folder in order to be always available, see PATH environment variable if you don't know what I'm talking about) and use ':' as classpath (cp) separator.
    The '%***' tail is there in order to pass all parameters, it only works on Windows, refer to your shell docs for other OSs (something like $* may work).
    This way you have a command you can call to launch your code (instead of opening NetBeans just to see your app working). You could schedule tasks on it or just call it in any command prompt (hope you know what it is 'cause there have been people in this very same forum with no clue about it, if not just hold the 'Windows button' and press 'R', then type 'cmd' and run it).
    Finally add dukes and give 'hem away.
    Bye.

  • Iphoto fails to render files for export to certain folders after upgrade

    I just upgraded to Yosemite and the latest version of iPhoto but I now unfortunately get an error message when I try to export photos. It seems to work if I export to the main Documents folder but fails if I try to export to a sub folder of the main Documents folder (very odd) which is where I want the exports to be saved. The error message says "Unable to render file for export:/Volumes/NO NAME/DCIM/IMG-1058.jpg". I don't know why the path name shown here is a SD Card path which is not connected. Hope someone can help? It worked fine before the upgrade to iPhoto 9.6.1
    Thanks
    Craig

    The iPhoto preference file might be wonky. Try the following:
    1 - delete the iPhoto preference file, com.apple.iPhoto.plist, that resides in your
         User/Home/Library/ Preferences folder.
    2 - delete the contents the following folder: User/Library/Containers/com.apple.iPhoto
    3 - reboot, launch iPhoto and try again.
    NOTE: For Mavericks and Yosemite,  go to your Home folder and use the View ➙ Show View Options menu to bring the this window:
    where you can check the Show Library Folder checkbox.

  • How to define table specific QUERY in parameter file for Export Utility

    Hi All
    I am trying to create A SINGLE parameter file for export utility. I have 2 tables and want to use a different QUERY condition for each of these tables. However i do not want to create 2 seperate parameter files for this and run/script exp twice.
    Is there a way to do it ?
    NOTE: I am using normal export utility for Version 9 and NOT oracle data pump.
    Following is an example of what i want to achive in parameter file:
    Tables = (TabA,TabB)
    # for table - TabA
    QUERY = "where id =25"
    #for table - TabB
    QUERY = " where court_id=54 and id >1"
    Please advice on syntax of parameter file so that exp knows that it has to process 1st condition for only TabA and second condition for TabB.
    Any samples/syntax examples are greately appreciated.
    thanks in advance!
    cool tech

    No there is no such alternative. Query condition is applicable to all the tables listed in TABLES parameter.
    http://download.oracle.com/docs/cd/B10501_01/server.920/a96652/ch01.htm#1005843

  • Sending log files for scheduled jobs as attachment through mail

    Hi All,
    Can any one please help me out to write a pl/sql program to send log files for scheduled jobs as attachment through mail.
    Thanks.

    Why would anyone do that as this code has already been posted here a thousand times, it is all over the Internet, and the only thing you need to do is to search for it?
    I agree it would cost you some effort, but you are getting paid for it, and we are not getting paid for delivering it on a golden plate on your doorstep, as you can not be bothered to use online resources.
    Sybrand Bakker
    Senior Oracle DBA

  • In iPhoto I get "unable to render file for export" when trying to export a file to an SD card?

    I have been trying to save jpg files to an SD card.  When I export from iPhoto is says "unable to render file for export".  It will let me export to the desktop.  Then when I try to copy or move to the SD card, it says the SD card does not have enought free space.  It's a 1 gig card and the files are under 100k.  I have tried different SD cards, formating the cards with the camera.  The card has 200 filles (57mb) when I started and wanted to add more.  I have ereased the card trying to see if that would help.  No go!  Any ideas?

    What is the filesystem on that card?
    i assume, you made sure that the little white lock mechanism at the side of the card is unlocked?
    Try, if you can set the "Ignore ownership on this volume" flag for the card in the "Get Info" panel for the card.

  • When i queue a file for export the encoder is changing my settings to ACC Audio & my settings are not in the drop down

    when i queue a file for export the encoder is changing my settings to ACC Audio & my settings are not in the drop down. Help

    There's something else going on. When you search, the search box searches the Spotlight database that it created when indexing. It doesn't search the computer again. I suspect a hosed index. System Preferences->Spotlight->Privacy->delete all volumes and readd them back in. That should reindex the computer and all attached HDs. BTW, by default there are many places Spotlight doesn't return information from, mainly the various Library folders and the System folder. If you want to find everything, do this:
    Click on the Desktop, CMD+F, click on Kind button, select Other, drill down to File invisible, check it, continue down to System files, check it, and click OK. Now, click on + button, click on the left-hand item and select System files and select are included, click on the plus button, click on the left-hand item and select File visibility and select visible or invisible, select File Name, save the search, drag its icon to the Dock, and use to search your entire Mac—currently starts with By Name, but Contents is available. I use this instead of CMD+F or CMD+spacebar for all searches.

  • Batch file for IE settings

    Hi everybody,
    I want to make some changes to IE settings of many PCs to be able to open a tool which willl be used by all users using the systems..
    Since same settings are to be applied to different systems. I want to create a batch file for it .
    Settings are :
    1.Go to internet Options-- security--sites--trusted sites and and the site
    https://abc.com under it
    2.Set security level for this zone as Low
    3.Check enable protected mode
    4.Go to internet options--settings--privacy and uncheck Turn on Pop-up blocker
    5.Go to tools--compatibility view settings and the site
    https://abc.com under it . Check option - display intranet sites
    in compatibility view
    I did some research on net and found that all these settings are done by changing entries in registery.
    The site http://support.microsoft.com/kb/182569 gave lot of info on what various codes mean . But since I am new to creating
    batch files , it does not help me in writing commands. Little more research showed me that my commands would be something like
    reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\CurrentVersion\Internet Settings" /.....................
    However I cannot use trial and error as any unwanted change to registery may cause damage to my systems .
    It would really be very helpful if anyone can help me with his/her expertise in batch files and reg files.
    My target will be for IE8/9/10/11 preview . I am assuming the commands would be same for these versions which are comparitively new.
    Thanks,
    Mani
    manISRT

    Hi,
    this is a very broad topic, with quite a few scenarios, and potentially lots of complexity.
    Here are some thoughts I have written down for you to consider:
    Firstly, you really need to understand the basics of IE Zones, and how it is that addresses are categorised into each zone.
    There are default settings for each zone, and these are initially defined by MS, but you, or the user can, and may, have changed which zone is active, in which situation.
    E.g., if you are dealing with pc's in your organisation and under your control, vs pc's not in your organisation and/or not under your control.
    For pc's which are in your organisation, are they used only inside your office network, or are they also used outside your office network?
    Are the pc's under your control managed by Active Directory (are they members of your organisation's AD Domain?
    Does your office network use a network firewall or proxy, and the pc's inside gain access to the internet by "traversing" this proxy?
    Is the website you mention, "inside" your organisation's network, or, "outside" your organisation's network?
    If outside, how do your organisation's pc's currently become configured for internet access?
    Do they have configurations applied to the pc's, such as proxy settings? If so, does this use Proxy Auto Configuration (PAC) or INS, such as wpad.dat or proxy.pac?
    Note that if you adjust site-to-zone settings, and/or settings for a particular zone, other websites which are categorised into that zone will also attract the adjusted settings, so you need to ensure that any changes you make, are suitable for those other
    websites too.
    Is the website address part of your organisation's domain name, or a domain name that you already have particular settings for?
    Is the website/address and the content upon it controlled by your organisation?
    For compatibility view, depending upon the IE browser version, there are different methods available, you may not need to adjust the browser settings if the webpages are suitably constructed:
    Does the website specify <!DOCTYPE  ?
    Does the website supply X-UA-Compatible metatag?
    You can deliver most settings for IE in a few different ways:
    - AD GPO (you can use Group Policy Admin Templates, or, Group Policy Preferences)
    - IEAK (you can deploy a settings package with or without deploying a version of the browser)
    - registry settings (which you can deploy using scripts or batch files)
    - get the user to manually apply the settings via the user interface
    Note that some settings may need to be applied per-user (HKCU) and some settings are per-machine (HKLM).
    If you have a multi-user or hotdesk scenario (where more than a single user, uses the same machine), this might require you to re-apply the settings for each and every user.
    E.g.:
    Your organisation is wanting to use a hosted web application, accessed from inside your organisation, but it is hosted outside your ogranisation.
    The address is http://contoso.websales.hosterxyz.com
    You examine your existing pc configurations and determine that the IE Trusted Sites zone is not currently in use by any standard configurations.
    The hosted web application requires IE Protected Mode to be disabled (because of some special functions/features).
    You examine the default settings of the IE Trusted Sites zone, and observe that the Trusted Sites zone already has Protected Mode disabled.
    You decide to categorise the website "http://contoso.websales.hosterxyz.com" as a Trusted Site.
    On a test pc, you manually add the website "http://contoso.websales.hosterxyz.com" to Trusted Sites, and test the web application is operating correctly.
    You then create an AD GPO, which adds this website address into the Trusted Sites zone, and link/apply/deploy this GPO within your AD.
    Your organisations computers automatically read, process and apply this GPO, and all computers are now configured for this website as a Trusted Site.
    Note that if you use the "classic" GPO methods (Admin Templates), users can no longer manually adjust websites in or out of the Trusted Sites zone, because when "classic" GPO is deployed, it removes the ability for users to adjust these
    settings manually.
    This may be suitable for your organisation, or, unsuitable - it depends upon the degree of "freedom" you wish/need to allow.
    Alternately, you could use IEAK or GP Preferences, to deploy the Trusted Sites settings - these two methods allow the end-user to manually adjust if they choose. This means the end-user can remove the settings you deployed.
    Again, this may (or not) suit your scenario.
    Don
    (Please take a moment to "Vote as Helpful" and/or "Mark as Answer", where applicable.
    This helps the community, keeps the forums tidy, and recognises useful contributions. Thanks!)

  • Looking to build a batch file for BCDedit

    I'm trying to build a batch file for bcdedit to get the variable off of one of my boots for the identifier to use to build my dual boot system.  I've been testing with trying to just get the identifier but I'm unable to get the variable when I try.
    Any help will be greatly appreciated!
    I've ran all the steps individually and they function like they are supposed to.
    Here is the basics. 
    First I need to change the descriptions around so
    bcdedit /set {current} description "Staff"
    bcdedit /set (insert variable for second boot) description "test"
    next I need to change order
    bcdedit /displayorder {current} /addfirst
    Last is to set the second drive partition
    bcdedit /set (insert variable) device partition=D:
    bcdedit /set (insert variable) osdevice partition=D:

    This is how I was finally able to get it up and working.  I just got it this morning.  I did end up having to use powershell:
    #Set the colors for the console window
    $Host.Ui.RawUi.BackGroundColor = "Black"
    $Host.Ui.RawUi.ForeGroundColor = "White"
    #Clear the screen
    cls
    Function WriteValue ($Label, $Value)
        Write-Host $Label -foregroundcolor "Gray" -NoNewLine
        Write-Host ": " -foregroundcolor "Gray" -NoNewLine
        Write-Host $Value
    Function WriteSuccess
        Write-Host ": " -foregroundcolor "Gray" -NoNewLine
        Write-Host Success -foregroundcolor "Green"
    $otherboot = bcdedit /enum `
      | Select-String "path" -Context 2,0 `
      | % { $_.Context.PreContext[0] -replace '^identifier +' } `
      | ? { $_ -ne "{current}" }
    bcdedit /set $otherboot description "Test"
    bcdedit /set $otherboot device partition=D:
    bcdedit /set $otherboot osdevice partition=D:
    WriteValue "Boot ID is" $otherboot
    WriteSuccess

  • Batch-input for exporting cost calculation to a local file (ecc 6.0)

    Hi,
    we had a batch-input to export some data in a local file (excel format) in SAP 4.5B.
    We recorded transaction CK11 for a material number, we got Itemization screen and then we recorded menu' option "List . Export . Local file / Spreadsheet). If the batch-input ran in foreground it would produce required outputs (some excel files).
    Now we are migrating from 4.5B version to Ecc6.0; we recorded same transaction (both ck11 and ck11n, to be more ), but at execution time the window for local file saving never is displayed and B.I. stops with error.
    One difference is that now data are collected into a container,  instead that in a write list ...

    Hi again,
    the data i look for is a result of calculation of different tables so for every single product, it is calculated. In standart CO reports, there is no such report that give me that detail.
    Finally i managed to call print OK code, but it was in the foreground processing mode, i cannot run it on backround processing..
    I know i misuse the LSMW, but i think LSMW may have such flexibility to use such reports, thanks to SAP.. it was an adhoc report i tried to combine, so writing a program may be much more time consuming.

  • .bat or .sh file for executing jobs in data services

    are there any command line utilities where i can import the .atl files and executes the jobs in data services
    i was able to import the .atl files using 'al_engine' but not able to find the arguments to execute the jobs.
    Here is my requiremen:
    There would be 2 master scripts :
    Master_Initial_Script.bat/.sh - This would have all the pre/post checks and would call the DS Initial Job
    Master_Delta_Script.bat/.sh - This would have all the pre/post checks and would call the DS Delta Job
    Pre-Checks for Delta Job -
    If the initial job is not loaded then
                    Do not move further to execute the Delta job
    else
                    Execute the Delta job
    Post Checks for Delta Job:
    Print the statement when the job starts successfully,
    Checks the error/return code and prints Job success message in a log file

    This looks more like scheduling the job with dependency.
    Unfortunately, BODS scheduler doesnt support setting depedencies for running the jobs.
    So, the best way to go forward is export the jobs to a batch files in a particular location.
    Use the batch files with a external scheduling tool and set the dependency.
    A scheduling tool such as Control M or Redwood chronacle scheduler should be able to execute the batch files.
    Set the dependency in the scheduling tool accordingly.
    Let me know if you need any more details.
    Regards,
    Kishore Reddy L.

  • Unix shell script to batch file for windows

    Hello all,
    Iam writing a program in java in unix environment and iam executing using shell scripts in unix this program is for client-server environment
    which look like this:
    For server:
    #! /bin/ksh
    export CLASSPATH=/user/vpp/jal/classes:$CLASSPATH
    #set var for filename config file
    export JAL_CONF_FILE=/user/vpp/jal/conf/JALapp.conf
    java -DJAL_CONF_FILE=$JAL_CONF_FILE jalsvr/JALTCPServer 7776for client side it is
    #! /bin/ksh
    export CLASSPATH=/user/vpp/jal/classes:$CLASSPATH
    echo $CLASSPATH
    java jalcl/JALTCPClient msoc05:7776my question is know i want to execute them in windows by creating batch files runsvr.bat, runcl.batbut how
    i gave PATH by giving JRE path but what is the replacement of export because iam having all class files
    in /jalcl for clients and /jalsvr for server but want to create this batch file in separate /bin folder how to do.please help me

    Thank you for reply ,
    And sorry by mistake question repeated twice,
    but when iam executing those batch files it is throwing some exceptions,
    in that file you did not mention to set the JRE path whether it is not necessary and also there msoc05 is the machine name of unix system that need to kept or need to be changed with window IP address .please reply.
    thanks in advance.

  • Procedure/batch file to export data from sql to excel(predefined path)

    Hi,
    I have countries, sites, states tables (total 3) in database (i have user id and password to connect to this database).
    every week i need to extract data from these tables into excel files and i need to save those in shared drive for team use.
    Currently i am connecting to database every time running sql query and manually exporting that latest data to excel and saving that as excel files in (G:\team\common\) folder with specific name.
    output format should be : excel (.xls)
    file names should - countries.xls,sites.xls,states.xls
    server name : ap21
    output location : G:\team\common\ ( G is shared drive).
    i heard that we could create batch file to do this task and also we could use oracle procedure to do this task. but not sure which one is the best option.
    could you please guide me what is the option and also help me with technical stuff to do this task.

    Hello,
    output format should be : excel (.xls)Do you really want to create .xls files? This is not easy to do because it is a proprietary (MS) binary format. You should consider other formats like .csv or .xlsx. Follow the link in the previous answer how to generate them.
    file names should ...The name of the files does not matter, you are free to name them as you like.
    server name : ap21
    output location : G:\team\common\ ( G is shared drive).You can write the file generated in the database only to directories that are accessible from the db as Oracle Directories. You could mount the shared drive to the db server, but it might be better to write the output to a server directory and then transfer them to the shared drive with OS-copy command or FTP.
    i heard that we could create batch file to do this task and also we could use oracle procedure to do this task. but not sure which one is the best option.I would use Oracle Scheduler to execute a PL/SQL procedure to generate the files and then a OS-batch file to transfer them. You can use the Scheduler to execute the batch file too, see {message:id=3895983}.
    Regards
    Marcus

  • How to create a batch file for a java program?

    I have a java project in JCreator and the project is organised into packages. I have also configured JCreator to provide 2 arguments to the main method when the project is executed.
    I would want to create a batch file (.bat) for this project where the batch file can automatically use the arguments set in JCreator when the program runs.
    How do I go about creating the batch file?

    where the batch file can automatically use the arguments set in JCreatorThat all depends JCreator... can you get those arguments somehow?

Maybe you are looking for