Scripts for exp and imp in linux

please give me some links for exp and imp tables peridical bactch script in oracle 10 R2 over RHEL 4.5.

user13653962 wrote:
please give me some links for exp and imp tables peridical bactch script in oracle 10 R2 over RHEL 4.5.try this.. change the same script for your environment
$ crontab -l
00 22 * * * sh /u01/db/scripts/testing_user1.sh
$ cat /u01/db/scripts/testing_user1.sh
. /home/oracle/TEST1.env
export ORACLE_SID=TEST1
export ORA_USER=dbdump
export ORA_PASSWORD=dbdump
export TNS_ALIAS=TEST1
expdp $ORA_USER/$ORA_PASSWORD@$TNS_ALIAS tables=YOUR_tables_NAMEs  dumpfile=TEST_`date +'%Y-%m-%d`.dmp directory=YOUR_DUMPDIR logfile=TEST_`date +'%Y-%m-%d`.logif you need for original export change the exp command,
exp username/password tables=table_name1,table_name2,etc... file=your_file_name log=your_log_file_name

Similar Messages

  • Using expdp and impdp instead of exp and imp

    Hi All,
    I am trying to use expdp and impdp instead of exp and imp.
    I am facing few issues while using expdb. I have a Job which exports data from one DB server and then its imported so another DB server. Both DB servers are run on separate machines. Job runs on various clients machine and not on any of DB server.
    For using expdp we have to create DIRECTORY and as I understand it has to be created on DB server. Problem here is Job can not access DB Server or files on DB server. Also dump file created is moved by Job to other machines based on requirement( Usually it goes to multiple DB server).
    I need way to create dump files on server where job runs.
    If I am not using expdp correctly please guide. I am new to expdp/impdp and imp/exp.
    Regards,

    Thanks for quick reply ..
    Job executing expdb/impdp runs on Red Hat Enterprise Linux Server release 5.6 (Tikanga)
    ORACLE server Release 11.2.0.2.0
    Job can not access the ORACLE server as it does not have privileges (In fact there is no user / password to access ORACLE server machines). Creating dump on oracle server and moving is not an option for this JOB. It has to keep dump with itself.
    Regards,

  • 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

  • Need steps to create ant scripts for publishing and deploying projects.

    Need steps to create ant scripts for publishing and deploying projects.
    Have got ant, Oracle BPM Enterprise WL edition installed , Need to know what are the other configurations to be done.
    Any working example would help me to understand, please do mail me at [email protected]
    Thanks in advance.
    -Sree

    Sreekant,
    Please find the build file to publish and deploy.
    <project name="deployProject"
    xmlns:fuego="antlib:fuego.tools.ant.enterprise"
    xmlns:fuego.j2ee="antlib:fuego.tools.ant.j2ee" default = "publish">
              <property file="./Properties/fuego_deploy.properties"/>
              <fuego:passport id="fuego.passport"
    directoryid="${fuego.directoryid}"
    preset="engine" />
    <target name="publish" description="Publish and deploy processes" depends = "takeInputs">
    <!-- Open a session to the Oracle BPM directory -->
    <fuego:session
    passportref="fuego.passport"
    verbose="true"
                   properties="${fuego.basedir}/conf/directory.xml"
    haltonerror="true" >
    <!-- Publish processes -->
    <fuego:publish fpr="${fuego.project.name}"
    deploy="true"
    engine="${fuego.engineName}"
                        importdata = "${fuego.importdata}"
                        automaproles="${fuego.automaproles}"
                        automapbuspars = "${fuego.automapbuspars}"
                        automapvars="${fuego.automapvars}"
                        automapconfigs = "${fuego.automapconfigs}">
    </fuego:publish>
    </fuego:session>
    </target>
    <target name= "takeInputs" >
    <input
    message="Please enter admin-username:"
    addproperty="fuego.participant"
    />
    <input
    message="Please enter admin-password:"
    addproperty="fuego.password"
    >
    </input>
    </target>
    </project>
    and find the properties I have used..
    fuego.basedir=C:\OraBPMEnterpriseHome
    fuego.directoryid=default
    fuego.engineName = bpmengine
    fuego.project.name = E:/antExamples/Project/CommonUtilities
    # If the below property is true then ant script imports data from the project, as defined in Studio.
    # This includes importing:
    #      •Holiday and Calendar rules
    #      •Organizational Units
    #      •Roles
    #      •Resource configurations
    #      •External Variables
    fuego.importdata = true
    #If the below property is true ant script automatically map abstract roles to real ones with the same name.
    fuego.automaproles=true
    #If the below property is true ant script automatically map business parameter variable names (as defined in the project design) to an business parameter variable id with the same name (as defined in the Fuego Enterprise directory).
    fuego.automapbuspars = true
    #If the below property is true ant script automatically map external variable names (as defined in the project design) to an external variable id with the same name (as defined in the Fuego Enterprise directory).
    fuego.automapvars=true
    #If the below property is true ant script automatically map External Resources configurations (as defined in the project design) to real Configurations with the same name (as defined in the Fuego Enterprise directory).
    fuego.automapconfigs = true

  • Need training material / test scripts for MRP and Supply Chain module. Can anyone hel

    Can anyone out there provide me with sample test scripts they may have used for upgrading to Oracle Financials 11i? Need sample scripts for MRP and Supply Chain management. Looking for good test scenarios for testing these modules. Appreciate any help. Email at [email protected]

    Can anyone out there provide me with sample test scripts they may have used for upgrading to Oracle 11i? Need sample scripts for MRP and Supply Chain management. Looking for good test scenarios for testing these modules. Appreciate any help. Email at [email protected]

  • 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

  • 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)

  • A script for oracle10g cold backup on linux

    Hi,
    I have a urgent need to do a cold backup using o/s command. Can anyone please send me a script for this.
    Thanks in advance
    PK

    I ended up writing the script
    define 3 = &backup_directory
    define 4 = &instance_name
    define 5 = &user_dump_directory
    Set Heading Off
    Set Verify Off
    Set FeedBack Off
    Set LineSize 132
    Set PageSize 1000
    set termout off
    Spool cold_back.sql
    select 'connect /as sysdba' from dual;
    Select 'Startup Force' || CHR(10) ||
    'Shutdown Normal' From Dual;
    select '! mkdir '||'&&3'||'/'||to_char(sysdate,'yyyyddmm') from dual
    /* Data Files */
    Select '!cp ' || File_Name || ' &&3'||'/'||to_char(sysdate,'yyyyddmm') || CHR(10) ||'!gzip ' || '&&3' ||'/'||to_char(sysdate,'yyyyddmm')|| '/' || SubStr(File_Name, InStr(File_Name, '/', -1)+1) From Sys.DBA_Data_Files
    /* Redo Log Files */
    Select '!cp ' || Member || ' &&3'||'/'||to_char(sysdate,'yyyyddmm') || CHR(10) || '!gzip ' || '&&3'||'/'||to_char(sysdate,'yyyyddmm') || '/' || SubStr(Member, InStr(Member, '/', -1)+1) From V$LogFile
    /* Control Files */
    Select '!cp ' || name || ' &&3'||'/'||to_char(sysdate,'yyyyddmm') From V$controlfile
    /* Init and Config Files */
    Select '!cp $ORACLE_HOME/dbs/init&&4' || '.ora &&3'||'/'||to_char(sysdate,'yyyyddmm') From Dual
    alter session set tracefile_identifier=coldbackup
    alter database backup controlfile to trace
    select '!mv '||'&&5/*COLDBACKUP*' ||' &&3'||'/'||to_char(sysdate,'yyyyddmm') FROM dual
    Select 'Startup' From Dual;
    Select 'Exit' from dual;
    set termout on
    PROMPT " Run the output cold_back.sql script [sqlplus -s '/as sysdba' @cold_back.sql ]"
    Spool Off
    -----------------------

  • WLST scripts for deploying and migrating OSB project required

    Hi,
    I need sample/reusable WLST scripts for the following requirements:
    1. deploying OSB project developed on workbench to the remote server.
    2. migrating OSB project from Remote Server A to Remote Server B.
    I know other mechanisms to register an OSB project with the server but appreciate if some one can share the above scripts and associated documentation with me.
    Regards,
    CC

    http://download.oracle.com/docs/cd/E13171_01/alsb/docs21/deploy/config_appx.html
    http://www.oracle.com/technology/sample_code/products/osb/samples/PARAMETERIZE.zip (other samples here : http://www.oracle.com/technology/sample_code/products/osb/index.html )

  • Datapump exp and imp using API method

    Good Day All,
    I want to know what is the best way of error handling of datapump export and Import using API. I need to implement in my current project as there lot of limitations and the only way to see the process worked is writing the code with error handling method using exceptions. I have seen some examples on the web but if there are practicle examples or good links with examples that will work sure way, I would like to know and explore. I have never used API method so I am not sure of it.
    Thanks a lot for your time.
    Maggie.

    I wrote the procedure with error handling but it does not out put any information of the statuses while kicking off the expdp process. I have put dbms_output.put_line as per oracle docs example but it doesnt display any messages, just kicks off and created dumpfiles. As a happy path its ok but I need to track if something goes wrong. I even stated set serveroutput on sqlplus. It doesnt even display if job started. Please help me where I made a mistake to display the status . Do I need to modify or add anything. Help!!
    CREATE OR REPLACE PROCEDURE SCHEMAS_EXPORT_TEST AS
    --Using Exception Handling During a Simple Schema Export
    --This Proceedure shows a simple schema export using the Data Pump API.
    --It extends to show how to use exception handling to catch the SUCCESS_WITH_INFO case,
    --and how to use the GET_STATUS procedure to retrieve additional information about errors.
    --If you want to get status up to the current point, but a handle has not yet been obtained,
    --you can use NULL for DBMS_DATAPUMP.GET_STATUS.http://docs.oracle.com/cd/B19306_01/server.102/b14215/dp_api.htm
    h1 number; -- Data Pump job handle
    l_handle number;
    ind NUMBER; -- Loop index
    spos NUMBER; -- String starting position
    slen NUMBER; -- String length for output
    percent_done NUMBER; -- Percentage of job complete
    job_state VARCHAR2(30); -- To keep track of job state
    sts ku$_Status; -- The status object returned by get_status
    le ku$_LogEntry; -- For WIP and error messages
    js ku$_JobStatus; -- The job status from get_status
    jd ku$_JobDesc; -- The job description from get_status
    BEGIN
    h1 := dbms_datapump.open (operation => 'EXPORT',job_mode => 'SCHEMA');
    dbms_datapump.add_file (handle => h1,filename => 'SCHEMA_BKP_%U.DMP',directory => 'BKP_SCHEMA_EXPIMP',filetype => DBMS_DATAPUMP.KU$_FILE_TYPE_DUMP_FILE);
    dbms_datapump.add_file (handle => h1,directory => 'BKP_SCHEMA_EXPIMP',filename => 'SCHEMA_BKP_EX.log',filetype => DBMS_DATAPUMP.KU$_FILE_TYPE_LOG_FILE);
    ---- A metadata filter is used to specify the schema that will be exported.
    dbms_datapump.metadata_filter (handle => h1, name => 'SCHEMA_LIST',value => q'|'XXXXXXXXXX'|');
    dbms_datapump.set_parallel( handle => h1, degree => 4);
    -- Start the job. An exception will be returned if something is not set up
    -- properly.One possible exception that will be handled differently is the
    -- success_with_info exception. success_with_info means the job started
    -- successfully, but more information is available through get_status about
    -- conditions around the start_job that the user might want to be aware of.
    begin
    dbms_datapump.start_job (handle => h1);
    dbms_output.put_line('Data Pump job started successfully');
    exception
    when others then
    if sqlcode = dbms_datapump.success_with_info_num
    then
    dbms_output.put_line('Data Pump job started with info available:');
    dbms_datapump.get_status(h1,
    dbms_datapump.ku$_status_job_error,0,
    job_state,sts);
    if (bitand(sts.mask,dbms_datapump.ku$_status_job_error) != 0)
    then
    le := sts.error;
    if le is not null
    then
    ind := le.FIRST;
    while ind is not null loop
    dbms_output.put_line(le(ind).LogText);
    ind := le.NEXT(ind);
    end loop;
    end if;
    end if;
    else
    raise;
    end if;
    end;
    -- The export job should now be running. In the following loop, we will monitor the job until it completes.
    -- In the meantime, progress information is displayed.
    percent_done := 0;
    job_state := 'UNDEFINED';
    while (job_state != 'COMPLETED') and (job_state != 'STOPPED') loop
    dbms_datapump.get_status(h1,
    dbms_datapump.ku$_status_job_error +
    dbms_datapump.ku$_status_job_status +
    dbms_datapump.ku$_status_wip,-1,job_state,sts);
    js := sts.job_status;
    -- If the percentage done changed, display the new value.
    if js.percent_done != percent_done
    then
    dbms_output.put_line('*** Job percent done = ' ||to_char(js.percent_done));
    percent_done := js.percent_done;
    end if;
    -- Display any work-in-progress (WIP) or error messages that were received for
    -- the job.
    if (bitand(sts.mask,dbms_datapump.ku$_status_wip) != 0)
    then
    le := sts.wip;
    else
    if (bitand(sts.mask,dbms_datapump.ku$_status_job_error) != 0)
    then
    le := sts.error;
    else
    le := null;
    end if;
    end if;
    if le is not null
    then
    ind := le.FIRST;
    while ind is not null loop
    dbms_output.put_line(le(ind).LogText);
    ind := le.NEXT(ind);
    end loop;
    end if;
    end loop;
    -- Indicate that the job finished and detach from it.
    dbms_output.put_line('Job has completed');
    dbms_output.put_line('Final job state = ' || job_state);
    dbms_datapump.detach (handle => h1);
    -- Any exceptions that propagated to this point will be captured. The
    -- details will be retrieved from get_status and displayed.
    Exception
    when others then
    dbms_output.put_line('Exception in Data Pump job');
    dbms_datapump.get_status(h1,dbms_datapump.ku$_status_job_error,0, job_state,sts);
    if (bitand(sts.mask,dbms_datapump.ku$_status_job_error) != 0)
    then
    le := sts.error;
    if le is not null
    then
    ind := le.FIRST;
    while ind is not null loop
    spos := 1;
    slen := length(le(ind).LogText);
    if slen > 255
    then
    slen := 255;
    end if;
    while slen > 0 loop
    dbms_output.put_line(substr(le(ind).LogText,spos,slen));
    spos := spos + 255;
    slen := length(le(ind).LogText) + 1 - spos;
    end loop;
    ind := le.NEXT(ind);
    end loop;
    end if;
    end if;
    END SCHEMAS_EXPORT_TEST;

  • SAP Scripts for Training and Event Mgt

    Dear All
    The Following SAP Script ID
    HR_ALL_BUCHSUPER
    HR_ALL_FIXSUPER
    HR_ALL_STORSUPER
    HR_ALL_VORMSUPER
    HR_TEM_NOTE_DISP
    Usually SAP Script in Training and Event Mgt are connected with Output medium through transaction PP40 but the above mentioned is not there .
    How to locate and get the same linked PP40 .
    Regards
    Raji

    Hi,
      Can you explain your requirement in more detail?
    Regards,
    Azaz Ali.

  • Shell script for exp

    Hello All,
    OS: AIX 5.2
    we are doing full export of our database schema as below:
    exp
    username:schema name
    Enter array fetch buffer size: 4096 >Export file: expdat.dmp > exp020806v1.dmp
    (2)U(sers), or (3)T(ables): (2)U > U
    Export grants (yes/no): yes > yes
    Export table data (yes/no): yes > yes
    Compress extents (yes/no): yes > yes
    Export done in US7ASCII character set and AL16UTF16 NCHAR character set
    Export terminated successfully without warnings.
    Now I want this all be done by shell script.
    user logon as a abc.
    he will get menu options
    1. full database export
    user will select this option (1 by enter type 1) and enter and it will do exp for this particular schema.
    DN

    Below you'll find an Korn-shell export script that works on AIX 4.3.3; it'll work on
    AIX 5.3 as well. It creates a compressed full exportfile by exporting to a named pipe and feeding the output to compress. Because export is a client tool, the scripts first established the NLS characterset of the database and exports it into
    the NLS_LANG variable.
    You'll need to customize the script, e.g. set your own directory names etc.
    The script can be run from cron
    #!/usr/bin/ksh
    # 26-10-2004 - Hans Wijte
    function get_characterset
    {  sqlplus -s / << !
    set feedback off
    set heading off
    select value
    from v\$nls_parameters
    where parameter = 'NLS_CHARACTERSET';
    if [[ -z ${ORACLE_HOME} ]]
    then
    . $HOME/.profile 1>/dev/null 2>&1
    fi
    export ORACLE_SID=${1:-$ORACLE_SID}
    export_dir=${2:-/oracle/exports/$ORACLE_SID}
    export ORAENV_ASK=NO
    . oraenv
    export ORAENV_ASK=YES
    export NLS_LANG="."`get_characterset`
    # Set the necessary Oracle variables #
    export ORACLE_SID=$1
    ORAENV_ASK=NO
    . oraenv
    id=$$
    # Create a named pipe to export to #
    PARFILE=exp_${ORACLE_SID}_exp_tables.par
    mknod oraexp${id}.pipe p
    touch ${PARFILE}
    chmod 600 ${PARFILE}
    # Fill the parameter file with #
    # the desired parameters #
    tabs=`cat tabs.log`
    echo "
    userid = /
    buffer = 1024000
    log = /oracle/home/log/exp_${ORACLE_SID}_exp_tables.log
    file = /oracle/exports/${ORACLE_SID}/exp_${ORACLE_SID}_exp_tables.dmp.Z
    full = yes
    consistent = y
    compress = n
    " > exp_${ORACLE_SID}_exp_tables.par
    # Point the named pipe to the dumpfile and #
    # let compress receive the output from #
    # the named pipe #
    compress < oraexp${id}.pipe > exp_${ORACLE_SID}_exp_tables.dmp.Z &
    # Execute the EXPORT utility with #
    # the parfile just created #
    exp parfile= exp_${ORACLE_SID}_exp_tables.par
    # Sync the file systems #
    sync; sync; sync
    rm -f oraexp${id}.pipe
    rm -f ${PARFILE}
    Message was edited by: Hans
    user486820

  • Database merge with the exp and imp...

    Hi All,
    I am very new to these dba activities. I have two databases with the same schema and has some data in both of it. Now I would like to merge both the databases and come up with one database. In this process I don't wanted to loose any data.
    Does the oracle exp/imp helps in this scenario ? If not any other tools helps us in doing this?
    What are the best practices to follow when we are doing this kind of work?
    What kind of verifications we need to do pre/post merge ?
    Any help would really be appreciated... Thank you in adavance...
    K.

    NewBPELUser wrote:
    Hi All,
    I am very new to these dba activities. I have two databases with the same schema and has some data in both of it. Now I would like to merge both the databases and come up with one database. In this process I don't wanted to loose any data.
    Does the oracle exp/imp helps in this scenario ? If not any other tools helps us in doing this?
    What are the best practices to follow when we are doing this kind of work?
    What kind of verifications we need to do pre/post merge ?
    Any help would really be appreciated... Thank you in adavance...
    K.What do you mean with "merging" data?
    How many objects are in both schemas?
    Are both schemas need to be merged in mutual way or in one way?
    Do you have option to use MERGE command for each object in the schema?
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/statements_9016.htm#SQLRF01606
    P.S. If the version of the database is greater than 9i, then use Data Pump (expdp/impdp) instead of deprecated exp/imp utitlies
    Kamran Agayev A.
    Oracle ACE
    My Oracle Video Tutorials - http://kamranagayev.wordpress.com/oracle-video-tutorials/

  • 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

Maybe you are looking for

  • Booking an appointment prompt Microsoft Exchange is offline

    HI, I am faced with this weird problem. My user is able to connect to her mailbox using outlook anywhere. Sending/receving mails are ok. But when she tries to book an appointment in the her own calendar, It said the Outlook must online even though I

  • Import of RAW+JPEG pairs?

    Just when I thought I had it all together...I seem to have forgotten where I put it. I need some expert assistance. Aperture manages my Library which is kept on an external HD. I shoot RAW+JPEG on my D200--two image files for every shot. To anticipat

  • How to change the Second local Currency

    Hi Experts, Can you please suggest on the below scenario. In one of clients second local currency has been set to EURO and I want to change the currency to GBP. Please suggest the steps to change the currency.. Regards Raj

  • Selecting a movie clip to play

    Ok, The following set of code is partially working for me. If the randomNumber*100 is < 90, the clip "straight" plays just fine. If it is >90, both the "slightbenddown", and "slightbendup" clips go off at the same time. var randomNumber:Number = Math

  • I can't buy anything

    Very time I try to buy something it comes up as error and I can't get any help from support *** this is garbage. I can't get anything from iTunes so can I get some help? All I use is gift cards so I can see my balance but I can't buy anything help me