Export Dump Oracle 10g

— Export Shell  Script for Solaris 10 with gzip —

#!/bin/ksh
. $HOME/.profile
expdate=`date ‘+%d%m%Y’`
dat=`date ‘+%m%d%y %H:%M:%S’`
echo “Backup started…” $dat;
cd /u1/oracle/OraSW/bin

./expdp system/system directory=export_dir dumpfile=exp_sw_$expdate.dmp logfile=exp_sw_$expdate.log schemas=swx

echo “Backup Completed.” $dat;
gzip /u2/swexportdump/exp_sw_$expdate.dmp

tar cvf /dev/rmt/0 /u2/swexportdump
mt offline
echo  “Tape Backup Completed.”

Advertisements

19 thoughts on “Export Dump Oracle 10g

  1. You can do that using a windows batch file. Shell scripts are for unix systems. Windows script is called batch scripts. Make a folder say c:\import. But your export dump in this location say “export.dmp”

    Now create a new text file and save it as import.bat The script should be as below.

    echo %DATE%%TIME%%
    imp system/******** file=export.dmp log=import.txt fromuser=abc touser=XYZ buffer=4000000

    If you want to automate this procedure for refreshing the development environment. You can create FTP to automatically copy the export.dmp file to the folders daily and then schedule the import.

    Like

  2. Thanks for your reply
    Actually the dump file that i have to copy is,filename with date and month.example (imp_20110301A.dmp ) i have to identified the correct date (linux server)and move the other server(windows server) where my database is there and dump file kept.From there i have to import corresponding dump file. please send me a script. i am not that much familiar in batch file.
    thanks looking for ur reply.

    Like

  3. imp system/****** file=%date:~-4,4%%date:~-7,2%%date:~0,2%_export.dmp log=%date:~-4,4%%date:~-7,2%%date:~0,2%_import.log owner=abc

    Normally this is how you can specify date in windows. You can map it with your linux format. But a better solution would be to rename the file. I am sorry I don’t have a specific script for windows. What exactly is your scenario. What are you trying to achieve ?

    Like

  4. thanks for ur reply
    It is a testing db every week i have to update database with latest dump. i have to import the user in that database.

    Like

  5. There are multiple ways to achieve that.

    1. You can use Oracle streams
    2. You can clone the database using RMAN and then copy the remaining archivelogs and refresh it.
    3. If you are using 11g. Active dataguard is an amazing solution for this.

    But seeing your current setup. You can do the following.

    1. In your export script on LINUX use SFTP command to send the file to the windows box. Ask your system admin to setup SFTP between your linux and Windows server.

    2. In your import script rename the export file say export_20_03_2011.dmp to export.dmp and then proceed with the import command.
    Simply in your batch script add the below :
    RENAME export_20_03_2011.dmp export.dmp

    Like

  6. hi
    i got an error while dropping a table which is

    ORA-00600: internal error code, arguments: [kghstack_free1], [kntgmvm: collst], [ ], [ ], [ ],

    Like

  7. hi
    sorry

    i got an error while dropping a user which is

    ORA-00600: internal error code, arguments: [kghstack_free1], [kntgmvm: collst], [ ], [ ], [ ],

    drop user username cascade;

    Like

  8. hi
    i import dump for new db. i was asked to import without data and my import command is

    imp username/password@dbname imp file.dmp log=log.txt fromuser =username touser=username rows=n grants=y ignore=y;

    After importing i get “import terminiated successfully with warnings.”
    and my log file contains:
    *************************************************
    IMP-00017: following statement failed with ORACLE error 2264:
    “ALTER TABLE “ADM_GROUP_MENU” ADD CONSTRAINT “ADM_GROUP_MENU_CHK_03″ CHECK (”
    “GM_ALLOW_INST IN(‘Y’,’N’)) ENABLE NOVALIDATE”
    IMP-00003: ORACLE error 2264 encountered
    ORA-02264: name already used by an existing constraint
    IMP-00017: following statement failed with ORACLE error 2264:
    “ALTER TABLE “ADM_GROUP_MENU” ADD CONSTRAINT “ADM_GROUP_MENU_CHK_04″ CHECK (”
    “GM_ALLOW_UPDT IN(‘Y’,’N’)) ENABLE NOVALIDATE”
    IMP-00003: ORACLE error 2264 encountered
    ORA-02264: name already used by an existing constraint
    IMP-00017: following statement failed with ORACLE error 2264:
    “ALTER TABLE “ADM_GROUP_MENU” ADD CONSTRAINT “ADM_GROUP_MENU_CHK_05″ CHECK (”
    “GM_ALLOW_DELT IN(‘Y’,’N’)) ENABLE NOVALIDATE”
    IMP-00003: ORACLE error 2264 encountered
    ORA-02264: name already used by an existing constraint
    IMP-00017: following statement failed with ORACLE error 2264:
    “ALTER TABLE “ADM_GROUP_MENU” ADD CONSTRAINT “ADM_GROUP_MENU_CHK_06″ CHECK (”
    “GM_ALLOW_VIEW IN(‘Y’,’N’)) ENABLE NOVALIDATE”
    IMP-00003: ORACLE error 2264 encountered
    *******************************
    My question is
    1. In my database lot of triggers were missing.
    2. can i import triggers only seperately.
    3. i have delete all user and import it again

    Regards
    Mohd

    Like

  9. hi
    I want to kill a session i use batch script to kill user and drop the user.

    begin

    for s in (
    select
    sid, serial#
    from
    v$session
    where
    username = ‘erptrain’
    ) loop

    execute immediate
    ‘alter system kill session ”’ ||
    s.sid || ‘,’ ||
    s.serial# || ”’ immediate’;

    end loop;

    execute immediate ‘drop user username cascade’;

    end;

    but it dosn’t kill the session and i am not able to drop the the user also

    i get error saying
    ORA-01940 cannot drop a user that is currently connected

    Regard
    Mohd

    Like

  10. à Clone Prod Database and convert it to read write mode.

    i want Create Test (TESTDB) from Production Database (PROD) without Transporting backup of Production Database (PROD) to Test database. TESTDB should be in Different Directory and converting into Read Write Mode.

    Regards
    Mohd.Rafay

    Like

  11. “Check consistency of Catalog database after a crash.”

    Production Database (PROD) backup is taken by Catalog Database (CATDB). Catalog Database is crashed (control file, data files and redo log). Catalog database having cold backup, how to recover Catalog database and maintain consistency Meta data (production database control file and catalog database control file) in RMAN user.

    Regards.

    Mohd.Rafay

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s