How to use “/ as sysdba” to exp and imp

Sometimes we need to user “/ as sysdba” to do export and import in command line of operating systems. There is a little trick.

1. OS:Window 2000 Server


exp userid=”””/ as sysdba””” tables=(t.t) file=t.dmp

imp userid=”””/ as sysdba””” file=t.dmp fromuser=t touser=system

Here three double quotation marks are used.

2.OS:SunOS 5.9


exp userid=\’/ as sysdba\’ tables=( file=t.dmp rows=n

imp userid=\’/ as sysdba\’ fromuser=query_user touser=system file=t.dmp

Here a back slash are used before the single quatotion mark.

About Alex Zeng
I would be very happy if this blog can help you. I appreciate every honest comments. Please forgive me if I'm too busy to reply your comments in time.

14 Responses to How to use “/ as sysdba” to exp and imp

  1. richard says:

    Thanks for this – just what I was looking for !

  2. Sergio says:

    Thanks for this tip !!

  3. Jonathan Taylor says:

    Great tip! Thanks so much!

  4. Mohan says:

    you are a saviour .. thanks much

  5. neworacledba says:

    this is a great post on utilities…blog more on expdp and impdp

  6. Nikesh says:

    Thanks !!!!

  7. rigou says:

    Thank you

  8. Didn’t work for me, using Windows 2000 Server. It still displayed the EXP-0004 error.

    But the following one made the trick :

    exp userid=’/ as sysdba’ OWNER=XXX FILE=XXX.dmp LOG=XXX.log

  9. sunilbhola says:

    it’s always better to use parfile to avoid the confusion for quotes in different os.

  10. LJ says:

    What if I am going from one database to a different database but the schema is the same? (Windows) exp from DatabaseA t.tmp import to DatabaseB t.tmp?? Thanks

Leave a Reply

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

You are commenting using your 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

%d bloggers like this: