Shell script for export and import

Hi,
I want to run exp command in background since i need to export 40gb database of other database
if i won't use & my session will die.
appreciated any inputs.
i need to run this line from shell script.
/oracle/bin/exp pin@voipdbstg/pin file=voip.dmp owner=pin log=voip.log
bash-2.05$ more export.sh
#!/bin/sh
/oracle/bin/exp pin@voipdbstg/pin file=voip.dmp owner=pin log=voip.log
bash-2.05$ sh export.sh &
[10] 13352
bash-2.05$
Export: Release 8.1.7.0.0 - Production on Fri Dec 4 22:51:09 2009
(c) Copyright 2000 Oracle Corporation. All rights reserved.
Password: pin
bash: pin: command not found
[10]+ Stopped sh export.sh
input appreciated
thanks
Prakash

Hi,
/oracle/bin/exp pin@voipdbstg/pin file=voip.dmp owner=pin log=voip.log
should be
/oracle/bin/exp pin/pin@voipdbstg file=voip.dmp owner=pin log=voip.log
Also for running the script is background and you should be able to log out of shell scriptthen run the command in nohup mode.
$nohup export.sh&
Regards

Similar Messages

  • Shell Script For Export And Import Of Table Records

    Hello,
    We have production and test instances and for constant testing we need to copy data from production to test or development environment.
    At the moment what we do is manually doing export and import table records. At times this could be very tedious as we may need
    to do this exercise a couple of times in a day.
    Is it a good idea to do this exercise using shell script? If so how could I do this? If this is not a good idea what are the best alternatives?
    Any input is highly appreciated.
    Thanks

    Ah I see, your company prefers stupidity over efficiency. It would be possible to do it in a controlled environment, wouldn't it? Also the test database would be allowed to select only.
    So the non-allowance is just plain stupid.
    To the second question: do you use hard-coded passwords in shell scripts?
    Don't you think that poses a security risk?
    Don't you think that is a bigger risk than a database link, properly set up?
    In my book it is!
    Sybrand Bakker
    Senior Oracle DBA

  • Shell script for export backup in oracle 11g

    Hi,
    Oracle version 11.2.0..
    O/S-AIX
    How to write shell script for export full backup in oracle 11g and also need to remove 2 days of old backup.
    Regards,
    Raju

    How to write shell script for export full backup in oracle 11g
    Do you mean that export is your backup strategy ? is your database running in noarchivelog mode ? if so, then why ? if not so, then why not RMAN ?
    need to remove 2 days of old backup.
    If that mean remove files older than 2 days, you can use something like this :
    $ find <absolute directory path> -mtime +2 -exec rm {} \;

  • Scripting Oracle export and import dumps

    Hello,
    I would like to know if it is possible to script oracle export and import dump commands in a PL/SQL package rather than at command prompt. Also, how can i copy the export dump files across the network to a specific location.
    I would really appreciate if someone can provide me with examples????
    Thanks.

    Yes, there's DBMS_JOB on 9i, it's sort of DBMS_SCHEDULER's 'grampa' ;)
    Check the 9i docs (http://tahiti.oracle.com) and do some searches here and on http://asktom.oracle.com for more info.
    Hoewever, in order to execute OS-commands, you'll probably need a JAVA wrapper.
    DBMS_JOB cannot do that.
    Examples can be found here:
    http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:952229840241
    http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:16212348050

  • Scripting oracle export and import dumps through PLSQL stored procedures

    Hello,
    I would like to know if it is possible to script oracle export and import dump commands in a PL/SQL package rather than at command prompt. Also, how can i copy the export dump files across the network to a specific location.
    I would really appreciate if someone can provide me with examples????
    OR
    If there is off the shelf solution for what i am trying to achieve?
    Many Thanks.

    Hello,
    there are many ways to do this:
    - Java with PL/SQL wrapper,
    - call C code as external procedure from PL/SQL,
    - DBMS_SCHEDULER has some features related to this as well,
    - or write your own logic: for example creating a new file with UTL_FILE could be the trigger of the export.
    Franky
    Edited by: Franky on Aug 10, 2009 4:25 AM - extended

  • Shell Script  for Startup and Shutdown the database

    Hi,
    i want Shell Script for Startup and Shutdown the database in Solaries.
    could any one can hep me where i can get this script. or send to me to [email protected]
    Thanks & Regards,
    Gangi reddy

    SHUTDOWN
    SHUTDOWN ABORT]
    Shuts down a currently running Oracle instance, optionally closing and dismounting a database.
    Terms
    Refer to the following list for a description of each term or clause:
    ABORT
    Proceeds with the fastest possible shutdown of the database without waiting for calls to complete or users to disconnect.
    Uncommitted transactions are not rolled back. Client SQL statements currently being processed are terminated. All users currently connected to the database are implicitly disconnected and the next database startup will require instance recovery.
    You must use this option if a background process terminates abnormally.
    IMMEDIATE
    Does not wait for current calls to complete or users to disconnect from the database.
    Further connects are prohibited. The database is closed and dismounted. The instance is shutdown and no instance recovery is required on the next database startup.
    NORMAL
    NORMAL is the default option which waits for users to disconnect from the database.
    Further connects are prohibited. The database is closed and dismounted. The instance is shutdown and no instance recovery is required on the next database startup.
    TRANSACTIONAL [LOCAL]
    Performs a planned shutdown of an instance while allowing active transactions to complete first. It prevents clients from losing work without requiring all users to log off.
    No client can start a new transaction on this instance. Attempting to start a new transaction results in disconnection. After completion of all transactions, any client still connected to the instance is disconnected. Now the instance shuts down just as it would if a SHUTDOWN IMMEDIATE statement was submitted. The next startup of the database will not require any instance recovery procedures.
    The LOCAL mode specifies a transactional shutdown on the local instance only, so that it only waits on local transactions to complete, not all transactions. This is useful, for example, for scheduled outage maintenance.
    Usage
    SHUTDOWN with no arguments is equivalent to SHUTDOWN NORMAL.
    You must be connected to a database as SYSOPER, or SYSDBA. You cannot connect via a multi-threaded server. For more information about connecting to a database, see the CONNECT command earlier in this chapter.
    http://download-west.oracle.com/docs/cd/B10501_01/server.920/a90842/ch13.htm#1013607
    Joel Pérez

  • Guide me for exporting and importing data from oracle 10g to oracle 9i

    I have been trying export and import options in oracle but m not very clear about the procedure..
    Also when i am logging in as Scott/tiger i am facing an error
    ORA 1542 - tablespace 'USER' is offline and cannot allocate space in it.how to resolve it

    Hello,
    I see two questions.
    ORA 1542 - tablespace 'USER' is offline and cannot allocate space in it.how to resolve it About the error ORA-01542 you have to bring the Tablespace USERS online:
    http://www.error-code.org.uk/view.asp?e=ORACLE-ORA-01542
    If you cannot bring it online you may have to Recover it first.
    I have been trying export and import options in oracle but m not very clear about the procedure..About the Export in 10g and Import in 9i (9.2 or 9.0.1 ?), you have to export with the Export utility of the Target Database (the lowest Database version here: 9.0.1 or 9.2) then, you have to Import to the Target Database using its Import utility (in 9.0.1 or 9.2).
    The following Note of MOS may guide you:
    Compatibility Matrix for Export And Import Between Different Oracle Versions [Video] [ID 132904.1]
    NB: You cannot use here the DATAPUMP.
    Hope this help.
    Best regards,
    Jean-Valentin

  • SHELL SCRIPT FOR EXPORT AUTOMATICALLY

    Hi all,
    I need a shell script which will automatically take logical backup(export) in the solaris machine.I have 5 database and 10 schemas for that i want to take logical backup.
    thanks
    vicky

    If you're using 10g try to do it with DBMS_DATAPUMP and DBMS_SCHEDULER

  • Shell script for moving and renaming files

    I'm not so familiar with shell scripts. I have created some simple scripts for various tasks but now I hit something I can't handle myself.
    My server receives every night a logfile from another server. This file I need to rename and move to another location. Problem is that a simple mv with new filename isn't enough, I need to insert date in filename. Format for date should be ddmmyy. Also the name of incoming file changes every night. The output always starts with same letters, let's say "log", and the date is used to identify files.
    For example I receive a file /Input/filename.log and I need to move the file to the folder /Output with name log130308.txt.
    Any tips how to insert the date as part of of filename while renaming or moving the file? I prefer shell script as I'll use launchd for scheduling the script.

    Hi again,
    so far I've constructed this:
    cd /input
    for file in `ls *log`
    do
    echo "Copying " $file
    cp $file /output/log.$file.`date +%d%m%y`
    done
    Quite there. I'm cding to directory, i'll focus later how to set some environmental parameters.
    Problem with zipping is that I don't know exact logfiles names. Each day there's a new name. So zip -q filename.zip filename.log isn't quite enough and it's impossible to use wildcards. The switch -q and checksums were welcome suggestions.
    Thanks again,
    Juha
    Message was edited by: J.Otava

  • [SOLVED] advanced shell script for mount and unmount samba share

    Good morning guys,
    Today I've a very long question....
    Hope in your help....:
    I usually move from different network.
    For one of those I need to mount some share that are under an ActiveDirectory server.
    To do that I use samba.
    Especially I've made and use the below  shell script.
    I know that it's so stupid but I'm a very newbie:
    #!/bin/sh
    echo "This is a custom script for mount my citrix share"
    echo "Please insert user password (must a sudoer user)"
    echo " "
    sudo mount -t cifs -o username='myusername',password='mypassword' //host_ip/TsHome$/myusername /home/myuser/samba_share/TsHOME
    sudo mount -t cifs -o username='myusername',password='mypassword' "//host_ip/direction" /home/myuser/samba_share/direction
    echo " "
    read -p "Press ENTER key to close this terminal"
    exit
    As I say the script work but it's so crude...!
    I want/need to implement it whit the follow addictions:
    1. print a feedback on mount: somenthing like "TsHOME is now mounted" or "unable to mount TsHOME"
    2. check if the share are already mounted: to prevent accidentally multiple mount. If a share is already mounted I want to print something like "TsHOME is already mounted on /home/myuser/samba_share/TsHOME"
    3. ask for share password  (now it's in clear on script) - This is optinal
    4. un-mount the share before reboot or shutdown command. That because I've notice that If i reboot or shutdown without manually un-mount the share the step of unmounting network file system became very slow
    If it's no extremely difficult, can someone help me to write this script?
    I know that man exist but I'm not a programmer and it's so difficult for me approch it.
    Thank you in advance.
    Ale
    Last edited by Alexbit (2010-09-23 21:29:13)

    Thank you very (VERY) much!
    I've follow your information and.. it work!
    If can be usefull to other this is the complete script:
    #!/bin/sh
    echo "This is a custom script for mount citrix share"
    echo "****************************************"
    echo " "
    echo "Please insert domain password:"
    read -s mypassword
    echo " "
    echo "|checking mount state...in share are not mounted mount it!|"
    echo "+-------------------------------------------------------------------------+"
    if grep "TsHome" /etc/mtab &>/dev/null; then
    grep "TsHome" /etc/mtab | awk '{print "TsHome is already mounted on " $2}'
    else
    sudo mount -t cifs -o username='yourusername',password="$mypassword" //ipaddress/TsHome$ /home/Samba_share/TsHOME && echo "TsHOME is now mounted" || echo "unable to mount TsHOME"
    fi
    echo " "
    if grep "direction" /etc/mtab &>/dev/null; then
    grep "direction" /etc/mtab | awk '{print "direction is already mounted on " $2}'
    else
    sudo mount -t cifs -o username='yourusername',password="$mypassword" '//ipaddress/direction' /home/Samba_share/direction' && echo "direction pat is now mounted" || echo "unable to mount direction"
    fi
    echo " "
    if grep "Area" /etc/mtab &>/dev/null; then
    grep "Area" /etc/mtab | awk '{print "Area is already mounted on " $2}'
    else
    sudo mount -t cifs -o username='yourusername',password="$mypassword" '//ipaddress/Area' /home/Samba_share/Area && echo "Area is now mounted" || echo "unable to mount Area"
    fi
    echo " "
    echo "All DONE!"
    echo " "
    read -p "Press ENTER key to close this terminal"
    exit
    I don't really well understand what I've to put in rc.local.shutdown....
    I think somethings like:
    #!/bin/bash
    # /etc/rc.local.shutdown: Local shutdown script.
    echo "This is a custom script for UN-mount citrix share"
    echo "********************************************"
    echo " "
    echo "|check mount state: if mount then un-mount!|"
    echo "+-------------------------------------------------------+"
    echo " "
    if grep "TsHome" /etc/mtab &>/dev/null; then
    grep "TsHome" /etc/mtab | awk '{print "TsHome is NOT mounted -> going on..." $2}'
    else
    sudo umount /home/Samba_share/TsHOME && echo "TsHOME is now UN mounted" || echo "unable to UN-mount TsHOME"
    fi
    echo " "
    if grep "direction" /etc/mtab &>/dev/null; then
    grep "direction" /etc/mtab | awk '{print "direction is NOT mounted -> going on.." $2}'
    else
    sudo umount /home/Samba_share/direction && echo "direction is now UN mounted" || echo "unable to UN-mount direction pat"
    fi
    echo " "
    if grep "Area" /etc/mtab &>/dev/null; then
    grep "Area" /etc/mtab | awk '{print "Area is NOT mounted - Finished" $2}'
    else
    sudo umount /home/Samba_share/Area && echo "Area is now UN mounted" || echo "unable to UN-mount Area"
    fi
    echo " "
    echo "going shutdown"
    echo " "
    sleep 5
    I've try but it seems to ignore the IF statement... this is the output when ALL share are UNmounted:
    $ sh /etc/rc.local.shutdown
    This is a custom script for UN-mount citrix share
    |check mount state: if mount then un-mount!|
    +-------------------------------------------------------+
    umount: /home/Samba_share/TsHOME: not mounted
    unable to UN-mount TsHOME
    umount: /home/Samba_share/direction: not mounted
    unable to UN-mount direction
    umount: /home/Samba_share/Area: not mounted
    unable to UN-mount Area
    going shutdown
    Tomorrow I will test again when I'm at office.
    Meanwhile can you check if I made a macroscopic mistakes?
    Thank you again!
    Last edited by Alexbit (2010-09-23 17:34:49)

  • Script to Export and Import Keywords and Metadata

    I have a requirement to mass upload and download keywords and various metadata fields (i.e. File Name, Date Created, City, Country, Document, Title, etc.) into an external database from the Adobe Bridge. Ideally it would be compatible to .txt, .csv, etc type of database format. Currently I have to accomplish this task one at a time. I have an immediate need to upload 1000 plus pictures and various text fields into my website to share with others and be able to sell my pictures online.
    My immediate is for exporting the metadata and keywords.
    Does anyone know of a script that is aavailable?
    Arnold

    John,
    Thanks for your quick response. Below is the script I just modified this morning. When looking in the keyword field, it returns the word "undefined" for all records.
    I tried that yesterday and it didn't work. When looking at the Advance file info on Adobe Bridge I see the below format which had 2 levels. All the others I used only had one. Since I am not a programmer, I need help on that part of the script.
    ==========================
    EXIF Properties (exif,http://ns.adobe.com/exif/1.0/)
    - exif:Flash
    - exif:Fired: True
    ====================================
    Any luck on determining how to obtain file size.
    Again thank you so much for supporting me on my project,
    Arnold
    =====================
    #target bridge
    if (BridgeTalk.appName == "bridge")
    // Let's create our menu
    var menu = MenuElement.create( "command", "Export CSV File", "at the end of Tools");
    menu.onSelect = function(m) {
    try
    // Let's ask what the name of the output file
    var f = File.saveDialog("Export file list to:", "Comma delimited file:*.CSV");
    // Write the column headings
    f.open("w");
    f.writeln("Seq Number,New File Name,New File Name Path,Original File Name,Org Dt & Tm,ISO,Exposure Time,F Stop,EV,Exposure Program,Meter Mode,Focal Length,Flash,Lens,Author, Author's Position,City,Country,Description,Title,Orientation,Width,Height,Rating,Label");
    // Let's get a list of all the visible thumbnails
    var items = app.document.visibleThumbnails;
    for (var i = 0; i < items.length; ++i) { var item = items[i]; f.writeln(i + 1, ",\"", item.name, "\",\"", item.path.replace(/\"/g, "\"\""), "\",\"", ListMetadata(item), "\",\"", "\"" ); } f.close(); } catch(e) { } } menu.onDisplay = function(m) { m.enabled = app.document.contentPaneMode == "filesystem" && app.document.visibleThumbnails.length > 0;
    function ListMetadata(tn)
    md = tn.metadata;
    md.namespace = "http://ns.adobe.com/photoshop/1.0/";
    varAuthor = md.Author + "\",\"" + md.AuthorsPosition + "\",\"" + md.City + "\",\"" + md.Country + "\",\"";
    md.namespace = "http://ns.adobe.com/exif/1.0/aux/";
    varLens = md.Lens + "\",\"" ;
    md.namespace = "http://purl.org/dc/elements/1.1/";
    vartitle = md.title + "\",\"" + md.description + "\",\"" ;
    md.namespace = "http://ns.adobe.com/xap/1.0/mm/"
    VarPreservedFileName = md.PreservedFileName + "\",\"" ;
    md.namespace = "http://ns.adobe.com/exif/1.0/"
    VarDateTimeOriginal = md.DateTimeOriginal + "\",\"" + md.ISOSpeedRatings + "\",\"" + md.ExposureTime + "\",\"" + md.FNumber + "\",\"" + md.ExposureBiasValue + "\",\"" + md.ExposureProgram + "\",\"" + md.MeteringMode + "\",\"" + md.FocalLengthIn35mmFilm + "\",\"" + md.Flash + "\",\"" ;
    md.namespace = "http://ns.adobe.com/tiff/1.0/"
    varOrientation = md.Orientation + "\",\"" + md.ImageWidth + "\",\"" + md.ImageLength + "\",\"" ;
    md.namespace = "http://ns.adobe.com/xap/1.0/"
    varRating = md.Rating + "\",\"" + md.Label ;
    md.namespace = "http://ns.adobe.com/photoshop/1.0/";
    varKeywords = ListKeywords(md) + "\",\"" ;
    function ListKeywords(md)
    var varKeywords = "" ;
    for (var i = 0; i < md.Keywords.length; ++i) { varKeywords = varKeywords + md.Keywords[i] + ", "; } //strip off final comma and space varKeywords = varKeywords.substring( 0, varKeywords.length-2);
    return VarPreservedFileName + VarDateTimeOriginal + varLens + varAuthor + vartitle + varOrientation + varRating + varKeywords;
    ==============================

  • Any Maxl Script to Export and import of Partition

    Hi All,
    Is there any maxl or Esscmd command which will do an Export or an import of the partition.
    Regards,
    Krishna.

    Hi Krishna,
    here ,there are 2 things.
    Firstly, creation of partition( which is possible through MAXL scripts).Once the partition is made, an XML is created(which is what garycris was mentioning in his post).
    Goto any application -> database -> partitions ->right click here , you see "import partition",and the file nature is of XML.When you look at this window , you will undestand .I am not sure of the same functinoality in MAXL.
    Hope this info helps
    Sandeep Reddy Enti
    HCC

  • Exporting and importing only the Incremental datas

    Dear all,
    we r facing a big time consuming process of changing oracle schema datas from live servers to out testing servers..
    scenario as follows:
    1. .dmp files of size 1GB to 3 GB are taken from live server and posted in test servers to check the live issues
    2. same sized dumps are taken for simulation to rectify issue
    this type of above process consumes the whole time for exporting and importing
    can any one suggest me how can the incremental data's alone can be exported and imported to the test server.
    Hoping that i can get a valuable solution for this
    Thanks in Advance
    S.Aravind

    Hi Aravind,
    as Nicolas specified RMAN would be the best option.
    Incremental data refresh is not possible through exp/imp. but there is a possiblity of writing a script which automates this refresh process.

  • Exporting and Importing Destination Controls Error

    When I export table within destination control and import the table to another Ironport again within destination control I receive error - "Wrong format of the destination config file: ip_sort_pref is required for the global settings."
    We are updating the ASYNC on each of our de clustered Ironport.  So when one is not in use we need the other to handle all the traffic, including domain controls.
    The output displays
    [ABCDE.com]
    max_host_concurrency = 500
    limit_apply = system
    limit_type = host
    max_messages_per_connection = 50 ......
    How can I import this without losing or altering the data within.
    ^^^^^^^^^^^^^^^^^^^^^^
    Solution
    We upgrade one of our SMTP ASYNC to 8.0.1 which creates a additional line within default of the upgraded Ironport exported control destination table that is named... wait for it.... ip_sort_pref. Just add it.

    The applications and drivers have been imported into the Dev SCCM server however I cannot find the actual content so I am not sure this has worked properly. 
    When you exported did you choose to "Export all content for selected task sequence and dependencies".
    80070003 = The system cannot find the path specified.
    See here for exporting and importing task sequences
    http://blogs.technet.com/b/inside_osd/archive/2012/01/19/configuration-manager-2012-task-sequence-export-and-import.aspx
    Gerry Hampson | Blog:
    www.gerryhampsoncm.blogspot.ie | LinkedIn:
    Gerry Hampson | Twitter:
    @gerryhampson

  • Error when exporting and importing TS

    Hi I am running SCCM 2012 SP1 and am trying to export a Task Sequence including with the Windows 7 wim, the boot wim, some applications and drivers.  When I exported the TS I selected to export dependencies and content.
    I have setup dev SCCM environment (same spec as production) and am trying to import the .zip that was created when I completed the export.  When doing the import I am getting the below error on both the Windows 7 wim and the boot wim :
    Error Imported Operating System Image (1):
    Create new Windows 7 Enterprise x64
    Generic failure
    instance of SMS_ExtendedStatus
     Description = "Failed to get the image property from the source WIM file due
    to error 80070003".
     ErrorCode= 2147942403;
     File="e:\\nts_sccm_release\\sms\\siteserver\\sdk_provider\\smsprov\
    \sspimagepackage.cpp";
     Line = 483;
     Operation = "Putinstance";
     ParameterInfo = "";
     ProviderName = "ExtnProv";
     StatusCode = 2147749889;
    The applications and drivers have been imported into the Dev SCCM server however I cannot find the actual content so I am not sure this has worked properly.  I am wondering if I would be better off using the Migration wizard to take the TS and
    content across.  Would appreciate any advice on either a) how to fix the issues with the importing of the TS or b) whether I should just be using the migration wizard.
    Thanks
    G

    The applications and drivers have been imported into the Dev SCCM server however I cannot find the actual content so I am not sure this has worked properly. 
    When you exported did you choose to "Export all content for selected task sequence and dependencies".
    80070003 = The system cannot find the path specified.
    See here for exporting and importing task sequences
    http://blogs.technet.com/b/inside_osd/archive/2012/01/19/configuration-manager-2012-task-sequence-export-and-import.aspx
    Gerry Hampson | Blog:
    www.gerryhampsoncm.blogspot.ie | LinkedIn:
    Gerry Hampson | Twitter:
    @gerryhampson

Maybe you are looking for

  • Location of Redo log and control files?

    Dear all, I am checking the location of redo log and control files, but found that the redo log file (like log02a.dbf ....) in the same directory of data files. However, I couldn't find any control files in the data files directries. What could be th

  • Display picture wont update or change Q5

    I'm currently using bbm on my Q5 and for some reason my display picture won't change. And another thing I have bbm on my phone but when I go to app world and view the bbm app it says' this application isn't available for ur device" how is that possib

  • Mapping of oracle9i

    Hi,I installed the oracle9i database in e drive and because of some reasons i changed the drive name to d: but now i am not able to run oracle on pc.can someone please help me in changing the mapping of oracle path as i dont want drive to rename agai

  • HELP -- iPod Crisis!

    Long story short, I accidentally dropped my iPod video (30 GB) yesterday from about 3 feet. There were no problems as I used it last night. However, I connected it to my iMac and now it is stuck on the "Do not disconnect." screen with the red cross-o

  • Where does one find the jar file for oracle.forms.[ui/pjc/...]

    Hello, I'd like to run some of the forms samples on technet, but I don't seem to have the jar file containing oracle.forms.[ui/pjc/...]. Does anyone know here I can find it? Thanks Eric Kamradt [email protected]