Q:

SQL Oracle export error

I'm trying to export a database content to a dump file, so I'm doing the following:
[root@serverId TEST]# ps -ef|grep pmon|grep -v grep
oracle   25371     1  0 Sep29 ?        00:02:22 ora_pmon_SIDPA

[root@serverId TEST]# echo $ORACLE_HOME
/home/oracle/product/10.2.0

[root@serverId TEST]# echo $ORACLE_SID
SIDPA

[root@serverId TEST]# echo $PATH
/home/oracle/product/10.2.0/bin:/home/oracle/product/10.2.0//bin::/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/cca/CCA_SRV:/root/bin

[root@serverId TEST]# exp userId@//serverId:1521/SIDPA FILE=dumpuserId.dmp LOG=dumpuserId.LOG OWNER=userId

Export: Release 10.2.0.3.0 - Production on Wed Oct 21 09:10:56 2015

Copyright (c) 1982, 2005, Oracle.  All rights reserved.

Password:

EXP-00056: ORACLE error 12154 encountered
ORA-12154: TNS:could not resolve the connect identifier specified
EXP-00000: Export terminated unsuccessfully

[root@serverId TEST]#

As you can see I already set the env vars $ORACLE_HOME and $ORACLE_SID as far as I understand correctly. I also set the PATH, so I think it should work but unfortunately, I does not.
Any comments about what to try will be welcomed.
Thanks in advance!

A:

The syntax should be exp username/password@instance , please also check if the listener is running ps -ef|grep tns and if it has the service listed lsnrctl services (the error "ORA-12154: TNS:could not resolve the connect identifier specified" points out that there is a problem related to that). You can also use the new tool expdp which in my opinion is more easy to use. Ex: expdp sys/password schema=userID dumpfile=userID.dmp directory=data_pump_dir logfile=userID_dmp.log  . You can see where the data_pump_dir points to from sqlplus select * from dba_directories and even create your own directory CREATE DIRECTORY dmpdir AS '/opt/oracle'; and use it in the directory clause. But if you want to use exp, check the listener and also the syntax of your command.

