Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Exporting user to dmp file in Oracle11gr2

I am trying to create a dump file of an Oracle database on 11g

the user is CONTACT and lets say pwd is zip (lowercase)

i log into SQLplus using run command "sqlplus /nolog"

and then

Connect sys/pwd@oracle11g as sysdba

then i try to run my export command

SQL> exp sys/pwd owner=CONTACT DIRECT=Y FILE=E:\ORA_DUMP\CONTACT.dmp LOG=E:\ORA_DUMP\CONTACT.log

and then i hit enter but i get

SP2-0734: unknown command beginning "exp sys/pw....." -rest of line ignored

i tried

SQL> exp CONTACT/zip owner=CONTACT DIRECT=Y FILE=E:\ORA_DUMP\CONTACT.dmp LOG=E:\ORA_DUMP\CONTACT.log

but i get same error

what am i doing wrong

like image 800
user176047 Avatar asked Jan 11 '23 17:01

user176047


1 Answers

exp is an application, not a SQL statement. You would invoke it from the operating system command line, not from within SQL*Plus. Well, I suppose you could invoke it from within SQL*Plus since SQL*Plus can call client-side operating system utilities, it just wouldn't make a great deal of sense to do so.

Run the exp command from your shell (or from a DOS command-line in Windows). You'll almost certainly want the script to specify the TNS alias (i.e. exp contact/zip@tns_alias ...) since you aren't connected to a database when you're at the command line.

like image 179
Justin Cave Avatar answered Jan 21 '23 04:01

Justin Cave