Trying to understand a crontab job for my database export and reloading

FILE=ENTP_`date "+%d%m%y"`.dmp.Z
LOG=ENTP_`date "+%d%m%y"`.log
rm -f /tmp/exp_pipe
*/sbin/mknod /tmp/exp_pipe p*compress < /tmp/exp_pipe > $FILE | echo $PASS | exp ben@XEPROD tables=TBL_ABCD,TBL_EFGH,TBL_IJKLM_QWER triggers=n direct=y *file=/tmp/exp_pipe* log=$LOG
rm -f /tmp/exp_pipei don't understand the bold parts.
what i know from /sbin is, anything that is put within there is for root command only. So my thinking, the above job can only executed in root enviroment.
the file part , what i understand is oracle exp / imp command and normally the file= will be like file=some.dmp . So now it become /tmp/exp_pipe which causes much confusion. Cos according to the declare variable, it should be file=$FILE .

flaskvacuum wrote:
FILE=ENTP_`date "+%d%m%y"`.dmp.Z
LOG=ENTP_`date "+%d%m%y"`.log
rm -f /tmp/exp_pipe
*/sbin/mknod /tmp/exp_pipe p*compress < /tmp/exp_pipe > $FILE | echo $PASS | exp ben@XEPROD tables=TBL_ABCD,TBL_EFGH,TBL_IJKLM_QWER triggers=n direct=y *file=/tmp/exp_pipe* log=$LOG
rm -f /tmp/exp_pipei don't understand the bold parts. The parts you've marked are simply formatting options for the date command:
# date
Tue Feb  7 17:26:49 PST 2012
# date '+%d'
07
# date '+%m'
02
# date '+%y'
12
# date '+%d%m%y'
070212
#The date command, along with its formatting options, is wrapped in backticks. This will fork a shell to run the subcommand, and substitute the shell's output (the output of the date command) into the containing string. That containing string is defining a variable. Taking the first example:
# echo $FILE
# FILE=ENTP_`date "+%d%m%y"`.dmp.Z
# echo $FILE
ENTP_070212.dmp.Z
#>
what i know from /sbin is, anything that is put within there is for root command only. So my thinking, the above job can only executed in root enviroment. There are a number of utilities in /sbin that can be run as normal users, perhaps with a more restricted impact. That subdirectory just contains things that a normal user doesn't regularly need to have on their search path ($PATH).
the file part , what i understand is oracle exp / imp command and normally the file= will be like file=some.dmp . So now it become /tmp/exp_pipe which causes much confusion. Cos according to the declare variable, it should be file=$FILE.The named pipe being used in your example is to compress the output, thereby reducing disk space. Breaking the example down into a more simplistic example:
bryan$ FILE=ENTP_`date "+%d%m%y"`.test.out.Z
bryan$ echo $FILE
ENTP_070212.test.out.Z
bryan$ rm -f /tmp/exp_pipe
bryan$ mknod /tmp/exp_pipe p
bryan$ compress < /tmp/exp_pipe > $FILE | echo this is a simple test > /tmp/exp_pipe
bryan$ ls -la $FILE
-rw-rw-r--. 1 bryan bryan 27 Feb  7 17:46 ENTP_070212.test.out.Z
bryan$ file ENTP_070212.test.out.Z
ENTP_070212.test.out.Z: compress'd data 16 bits
bryan$ zcat ENTP_070212.test.out.Z |more
this is a simple test
bryan$The mknod creates the pipe, compress reads FROM the pipe, and writes the compressed output TO $FILE. You could have put compress in the background with an ampersand, but simply suffixing it with a pipe has the same effect given that when "exp" is finished writing to the pipe (signaled by EOF), compress would return anyway. The end result is something like this:
exp command file=pipe_file --> compress reading FROM the pipe_file --> $FILE which is a *.Z file indicating it is compressed output.
Best Regards,
Bryan Wood

Similar Messages

  • How to schedule a crontab job for a script?

    Hi,
    Can anyone help me in this?
    Actually, i want to schedule a crontab job for a script.
    the script needs to check for a file in a diectory.
    When ever a particular file in a directory is created, then i need to run that script. (creation time of file and execution time of script must be same)
    So, how can i do this?
    any suggestions?
    Thanks,
    Suman.

    crontab manual http://linux.about.com/od/commands/l/blcmdl5_crontab.htm
    if you need check files on OS, crontab is good way... to do
    Example: checking trace file older 30 days and remove (00.00 -> every days )
    file.sh:
    ........begin file......
    #!/bin/sh
    find PATH/udump -name '*.trc' -type f -mtime +30 -exec rm {} \;
    ........end file......
    $ chmod 750 file.sh
    $ mv file.sh /home/oracle/file.sh
    -- edit crontab
    $ crontab -e
    0 0 * * * /home/oracle/file.sh
    -- list crontab
    $ crontab -l
    0 0 * * * /home/oracle/file.sh
    good luck

  • I am trying to understand the licensing procedures for using tabKiller for 3.5.7 firefox. Who should I contact for this? I do not see any customer service phone number for Firefox

    I am trying to understand the licensing procedures for using tabKiller for 3.5.7 firefox. Who should I contact for this? I do not have the customer service phone number for Firefox

    Tab Killer is not created by Mozilla, it is created by a private individual who has made it available at no cost for other people to use.

  • I am trying to change my email address for an Apple ID and it is saying that it is already in use. I then sign in with that Apple ID and it says that the account is not set up yet, I don't want to set up the account, but I do want to use the email address

    I am trying to change my email address for an Apple ID and it is saying that it is already in use. I then sign in with that Apple ID and it says that the account is not set up yet, I don't want to set up the account, but I do want to use the email address in my original Apple ID! HELP!

    Welcome to the Apple community.
    Once you have created a rescue address, you cannot delete it, nor can you change it to the same address as used by your ID. There are numerous providers you can get additional email addresses from, such as Hotmail, Yahoo, Google etc etc.

  • I am trying connect to a SQL instance for our CRM program and I am receiving To Connect to this Server you must use SQL Management Studio or SQL Server Management

    I am trying connect to a SQL instance for our CRM program and I am receiving To Connect to this Server you must use SQL Management Studio or SQL Server Management 
    This is a Brand new Server 2012 that is running our CRM product and it is trying to connect to a Server 2008 R2 server with SQL Server 2008 R2 SP2 instance (10.50.4000)
    I have seen this in the past where it needed the 2005 backwards compatibility components installed but those are not supported on 2012 server and this is not a 2005 SQL instance.
    I am trying to install the Shared Management Objects for SQL Server 2008 but it tells me I need to install the CLR types, which I did install. But it continues to tell me to install the CLR types.
    Has anyone ran into any issues like this? (this happens trying to connect to multiple SQL Servers from this new 2012 Server)
    Thanks!
    -Max

    Hello,
    Which version and edition of the SQL Server instance did you installed on the new server machine?  If you install SQL Server 2012 Express edition, you can try to install SQL Server Management Studio 2012 from
    this link.
    You can connect to SQL Server 2008 R2 or earily verions with SSMS 2012.
    What's more, Microsoft SQL Server 2008 Management Objects Collection requires Microsoft Core XML Services (MSXML) 6.0, Microsoft SQL Server Native Client, and Microsoft SQL Server System CLR Types. You can try to download and install
    SQL Serve 2008 Feature Pack
    which contains packages above.
    Regards,
    Fanny Liu
    Fanny Liu
    TechNet Community Support

  • BPC10 - Data manager package for dimension  data export and import

    Dear BPC Expers,
    Need your help.
    I am trying to set up a data manager package for first time to export dimension - master data from one application and import in another application ( both have same properties) .
    I created a test data manager package from Organize > add package > with  process chain /CPMB/EXPORT_MD_TO_FILE  and Add
    In the advance tab of each task there are some script logic already populated. please find attached the details of the script logic written under each of the tasks like MD_Source, concvert and target .
    I have not done any chnages in the script inside the task .
    But when i run the package , I have selected a dimension 'Entity' but in second prompt ,it ask for a transformation file , and syatem autometically add the file ... \ROOT\WEBFOLDERS\COLPAL\FINANCE\DATAMANAGER\TRANSFORMATIONFILES\Import.xls
    I have not changed anything there
    in the next prmpt , it ask for a output file ..and it won't allow me enter the file name .....i
    Not sure how to proceed further.
    I shall be greatfull if someone guide me from your experiance  how to set up a simple the data manager package for master data export from dimension . Should I update the transformation file in the script for import file and  output file in the advance tab. how and what  transformation file to be created and link to the data manager package for export / import .
    What are the steps to be executed to run the package for exporting master data from dimension and import it another application .
    Thanks in advance for your guidance.
    Thanks and Regards,
    Ramanuj
    =====================================================================================================
    Detals of the task
    Task : APPL_MD-SOURCE
    (DIMENSIONMEMBER, %DIMENSIONMEMBERS%, "Please select dimension", "Please select members", %DIMS%)
    (TRANSFORMATION,%TRANSFORMATION%,"Transformation file:",,,Import.xls)
    (OUTFILE,,"Please enter an output file",Data files (*.txt)|*.txt|All files(*.*)|*.*)
    (RADIOBUTTON,%ADDITIONINFO%,"Add other information(Environment,Model,User,Time)?",1,{"Yes","No"},{"1","0"})
    (%TEMPNO1%,%INCREASENO%)
    (%TEMPNO2%,%INCREASENO%)
    (/CPMB/APPL_MD_SOURCE,SELECTION,%DIMENSIONMEMBERS%)
    (/CPMB/APPL_MD_SOURCE,OUTPUTNO,%TEMPNO1%)
    (/CPMB/EXPORT_MD_CONVERT,INPUTNO,%TEMPNO1%)
    (/CPMB/EXPORT_MD_CONVERT,TRANSFORMATIONFILEPATH,%TRANSFORMATION%)
    (/CPMB/EXPORT_MD_CONVERT,SUSER,%USER%)
    (/CPMB/EXPORT_MD_CONVERT,SAPPSET,%APPSET%)
    (/CPMB/EXPORT_MD_CONVERT,SAPP,%APP%)
    (/CPMB/EXPORT_MD_CONVERT,OUTPUTNO,%TEMPNO2%)
    (/CPMB/FILE_TARGET,INPUTNO,%TEMPNO2%)
    (/CPMB/FILE_TARGET,FULLFILENAME,%FILE%))
    (/CPMB/FILE_TARGET,ADDITIONALINFO,%ADDITIONINFO%))
    Task : EXPORT_MD_CONVERT
    (DIMENSIONMEMBER, %DIMENSIONMEMBERS%, "Please select dimension", "Please select members", %DIMS%)
    (TRANSFORMATION,%TRANSFORMATION%,"Transformation file:",,,Import.xls)
    (OUTFILE,,"Please enter an output file",Data files (*.txt)|*.txt|All files(*.*)|*.*)
    (RADIOBUTTON,%ADDITIONINFO%,"Add other information(Environment,Model,User,Time)?",1,{"Yes","No"},{"1","0"})
    (%TEMPNO1%,%INCREASENO%)
    (%TEMPNO2%,%INCREASENO%)
    (/CPMB/APPL_MD_SOURCE,SELECTION,%DIMENSIONMEMBERS%)
    (/CPMB/APPL_MD_SOURCE,OUTPUTNO,%TEMPNO1%)
    (/CPMB/EXPORT_MD_CONVERT,INPUTNO,%TEMPNO1%)
    (/CPMB/EXPORT_MD_CONVERT,TRANSFORMATIONFILEPATH,%TRANSFORMATION%)
    (/CPMB/EXPORT_MD_CONVERT,SUSER,%USER%)
    (/CPMB/EXPORT_MD_CONVERT,SAPPSET,%APPSET%)
    (/CPMB/EXPORT_MD_CONVERT,SAPP,%APP%)
    (/CPMB/EXPORT_MD_CONVERT,OUTPUTNO,%TEMPNO2%)
    (/CPMB/FILE_TARGET,INPUTNO,%TEMPNO2%)
    (/CPMB/FILE_TARGET,FULLFILENAME,%FILE%))
    (/CPMB/FILE_TARGET,ADDITIONALINFO,%ADDITIONINFO%))
    Task : FILE_TARGET
    (DIMENSIONMEMBER, %DIMENSIONMEMBERS%, "Please select dimension", "Please select members", %DIMS%)
    (TRANSFORMATION,%TRANSFORMATION%,"Transformation file:",,,Import.xls)
    (OUTFILE,,"Please enter an output file",Data files (*.txt)|*.txt|All files(*.*)|*.*)
    (RADIOBUTTON,%ADDITIONINFO%,"Add other information(Environment,Model,User,Time)?",1,{"Yes","No"},{"1","0"})
    (%TEMPNO1%,%INCREASENO%)
    (%TEMPNO2%,%INCREASENO%)
    (/CPMB/APPL_MD_SOURCE,SELECTION,%DIMENSIONMEMBERS%)
    (/CPMB/APPL_MD_SOURCE,OUTPUTNO,%TEMPNO1%)
    (/CPMB/EXPORT_MD_CONVERT,INPUTNO,%TEMPNO1%)
    (/CPMB/EXPORT_MD_CONVERT,TRANSFORMATIONFILEPATH,%TRANSFORMATION%)
    (/CPMB/EXPORT_MD_CONVERT,SUSER,%USER%)
    (/CPMB/EXPORT_MD_CONVERT,SAPPSET,%APPSET%)
    (/CPMB/EXPORT_MD_CONVERT,SAPP,%APP%)
    (/CPMB/EXPORT_MD_CONVERT,OUTPUTNO,%TEMPNO2%)
    (/CPMB/FILE_TARGET,INPUTNO,%TEMPNO2%)
    (/CPMB/FILE_TARGET,FULLFILENAME,%FILE%))
    (/CPMB/FILE_TARGET,ADDITIONALINFO,%ADDITIONINFO%))
    ================================================================================

    1. Perhaps you want to consider a system copy to a "virtual system" for UAT?
    2. Changes in QAS (as with PROD as well) will give you the delta. They should ideally be clean... You need to check the source system.
    Another option is to generate the profiles in the target system. But for that your config has to be sqeaky clean and in sync, including very well maintained and sync'ed Su24 data.
    Cheers,
    Julius

  • Java framework/toolkit for POJO, database persistence and XML

    Hi all,
    I've been wondering if there's a toolkit or framework for developing Java program (could be standalone Java program, EJBs etc.)
    I surfed around casually and found some but there isn't any detailed description of what and how each framework/toolkit does. So I hope to ask around if you've anything that you have used before and would like to point to me to look further.
    Given the huge number of open source toolkits, libraries and frameworks out there, it can be quite confusing as to which one is more suitable for me. Also with Sun's move into JDO and Java Persistence API, things become more messy and complicated - there isn't any clear leader in this area and things are starting to change with the inclusion of JDO which seems to be the future standard persistence API to use.
    So far, I've only worked with Hibernate for database persistence before. So I'm wondering if there're other options such as Hibernate with XDoclet, Castor and Spring framework etc. that can easily transform Plain Old Java Objects (POJO) -- hopefully using Java Reflection w/o using mapping XML files like in Hibernate -- into SQL for database persistence and XML text data and vice-versa. The current problem is that I've been spending tons of time writing code to transform data in Java objects into XML (using my own format) and also doing mapping files for Hibernate.
    I am hoping for something simple like:
    Object o = new Object();
    o.setProperty = "something";
    String xml = o.toXML(); // Convert object to XML text.
    o.save(); // Save to database.
    // The reverse: Parse XML into object and load from database
    Object o = new Object();
    o.fromXML(xml);
    o.load();
    // Properties should be initialized from database or XML.
    Anything similar to this out there?

    Hi,
    Just to share what I've found after surfing a bit more on this issue to promote more discussion on this area.
    For mapping of Java objects to XML, we can try looking more at Castor and JAXB.
    For database persistence to/from Java objects, look at Hibernate and JDO.
    There is this Hydrate project (hydrate.sourceforge.net) that I do not know where it fits in still. But it is supposed to do data transformation and mapping between Java objects, XML and database representation.
    Fyi.

  • Crontab job does not execute Export script

    Hello Dear Oracle/Linux Gurus,
    I have limited knowledge about Cron job scheduling. After reading few articles/documentation, i have scheduled an Export job with crontab.
    When i run manually script (./exportuser.sh) Then its working fine. But with crontab is doesn't trigger. Log file exist but does not contain any entry, its empty.
    I would be grateful if you could let me know where is mistake?
    Thankyou in advance.
    ----Crontab entries are below here----
    oracle@backup-oracle:~/oracle/product/10.2.0/db_1/admin/orcl/dpdump> crontab -l
    # DO NOT EDIT THIS FILE - edit the master and reinstall.
    # (/tmp/crontab.XXXXFcYToV installed on Mon Dec 5 10:26:28 2011)
    # (Cron version V5.0 -- $Id: crontab.c,v 1.12 2004/01/23 18:56:42 vixie Exp $)
    * 21 * * * /home/oracle/oracle/product/10.2.0/db_1/rdbms/scripts/exportuser.sh > /home/oracle/oracle/product/10.2.0/db_1/rdbms/scripts/log/exportuser.log
    ----exportuser.sh is below here-----
    cd /home/oracle/oracle/product/10.2.0/db_1/admin/orcl/dpdump
    find /home/oracle/oracle/product/10.2.0/db_1/admin/orcl/dpdump -ctime +7 -exec rm{} \;
    export DATE=$(date +"%d-%m-%Y")
    exp scott/tiger file=scott_md_bk_$DATE.dmp log=scott_md_bk_$DATE.log rows=yes
    gzip scot_md_bk_*

    I suggest to put the following line at the beginning of your exportuser.sh script:
    date >> /tmp/exportuser.started
    Then check the output of /tmp/exportuser.started to see if the script gets actually called. Errors are normally dispatched by email to the user running the cron task. Did you receive any? You can also check the cron log file for errors and should verify that the cron daemon is actually running, e.g. "ps -ef | grep crond". Crontasks can run as root or any user who is allowed to run cron. I'm not so much familiar with Suse, which is quite different to other Linux distros.

  • Hello my name is consuela mayfield and I hope you have read my emails I sent to you off of lately and If u dint I'm askin I'm trying to logg into my iTunes for my apple ID and when I logg into it it says either I can't conne.

    I need help with my iPod touch and I deleted my iTunes account and trying to make a new one but won't let me it keeps telling me cannot connect to iTunes or server not found and I cannot connect to my computer because It freezes and turns off and I'm try a see if I logg on iTunes on here will it let me download iTunes on here instead of the other one could someone help out please!!???
    <Email Edited by Host>

    You really should not post your email address on a public forum such as this unless you just love spam. I have requested that Host edit for you protection.
    Allan

  • HT4623 i am trying to update. It asks for 3 security questions and answers, i provided, i hit next , it just sits there and i cannot continue

    I am trying to finish updating my i-phone.  After listing 3 security questions and answers, the phone will not allow me to move on to next step , it just sits there. How or what do i need to do to finish this crap.

    You need to ask Apple to reset your security questions; ways of contacting them include clicking here and picking a method for your country, phoning AppleCare and asking for the Account Security team, and filling out and submitting this form.
    (101210)

  • HT2693 I have been trying to down load 3 movies for the last week and they are still trying to download why is this taking so long we have the gig to download? Apple have charged us for the movies and we can't watch them

    I have been trying to play my movies that I purchased but they have now been down loading for a week.
    Why are they taking so long?

    Cancel the downloads and reset the iPad (Simultaneously hold down the Home and On buttons until the iPad shuts off. Ignor the off slider. Then turn the iPad back on). Go back to the Purchased screen in the I.tunes app and redownload. You may want to down load one at a time.

  • Enterprise Manager Job for Scripting DataPump Export for Oracle Database Running On MS Windows Server 2008

    Greetings,
    I would like an example of an Enterprise Manager Job that uses an OS Script for MS Windows that would effectively run a datapump export of my Oracle 11g database (11.2.0.3) running on a Windows 2008 server.  My OEM OMS is running on a Linux server with an Oracle 12c repository.  I'd like to be able to set environment variables for date and time, my export file name (that includes SID, and export date and time, job name, and other information pertinent to the datapump export.  Thus far, I have been unsuccessful with using the % delimiter around my variables.  Also, I have put the "cmd/c" as the "Interpreter" but I am not getting anywhere in a hurry :-( 
    Thanks  Million!!!
    Mike

    1. Try to reach server with IP )(bypath name resolution)
    2. Disabling IPv6 is not good idea
    3. What is server operating system and what is workstation operating system?
    4. Is this new or persistent problkem?
    5. If server and workstation has different SMB version, set higher to lower one (see Petri web for procedure)
    6. Uninstall AV with removal tool and test it without AV
    7. Use network monitor to diagnose network traffic.
    M.

  • Scheduling SQL AGENT JOB for SSAS DataBase to take backup files Daily with Different Names

    Hi All,
    I am working with SSMS. I have Analysis Services DataBase.
    i want to Schedule a SQL SERVER AGENT JOB.
    I want to take that AS DB BackUp Daily and has to be stored in Same
    Folder/same path in my local
    machiene with Different Names.
    Means, There should be Daily BackUps Files in that Path.  According to that we have to Schedule the JOB.
    Can anyone help me for this..
    Thanks,
    Supraja.

     Hi Katherine,
    Thanks a lot for your Response. what
    you have posted is very useful for me.
    But i am searching the result using AS
    DataBase BackUp Script. 
    i found one of the easy way. its working for me.
    Please check the below link for your reference..
    http://dbatasks.blogspot.in/2012/08/taking-backup-of-ssas-database.html
    Thanks,
    Supraja.

  • HT5704 I have 2 ipod touch 4th gen for my grandkids and they are showing the apple ID is disabled, plus we tried to load a software update for 6.1.3. and it continues to show an error, what do we do?

    Please note my question above and let me know what I should do?  Thank you

    Hello chevy6026,
    You'll want to get in touch with Apple regarding account security.
    Apple ID: Contacting Apple for help with Apple ID account security
    http://support.apple.com/kb/HT5699
    Cheers,
    Allen

  • Trying to sync my iPhone 4s for the first time and iTunes keeps freezing

    .....That's about it. Haha. Worked fine for my mom on her account, so =/

    The Apple store wil do this for you.
    You can call Apple support and they will help you
    You can google it

Maybe you are looking for

  • Authorization issue - Query is not working

    Hi All, I have creared an auth.object on zcomp_code. created a role and assigned to a particular user. I have included 20 comp.codes in this auth object. All is well except the query result I have 2 variables in the variable pop-up screen. 1 is FiscY

  • Error as IBAN required when the user confirms the changes to Vendor master

    Hi, After making the change to vendor bank details in master user is managed to save the changes with out any errors. Now another user is trying to confirm the changes, here is system is throughing error as IBAN is required for vendor master.. Scenri

  • URJENT - F8BU

    URJENT Any idea about the TCODE: F8BU. How to schedule the Automatic Payment Run ( TCODE: F110), every week automatically. Iam getting "short dump" when iam doing TCODE:F8BU URJENT VVR

  • Error in EA10..

    While creating mass bills through EA10, only first bill is processed..it is giving me following error... "Formal error in table FKKOP: Item numbering is inconsistent" Diagnosis The line item numbering is incorrect. The items must be numbered in ascen

  • Non-Stock Info Record

    Hello, I want to create a non-stock info record for a vendor to specify information like days for reminder, to get this into my POs. I created an info record for a vendor without a material, entered the material group and specified the data. When I c