Can't get full dump using cmd:Invalid Username/Password error - oracle

I'm trying to get a full dump of a certain database called HQBASE. I write the following command in cmd
exp userid=sys/123456 FULL=Y FILE=C:\HQ_FULL.DMP
but I get invalid username/password:logon denied error
If I connect to the database through SQLPLus or any other IDE with the same credentials I get no error and connected.

I think your syntax may be wrong. I checked some examples and they suggest that user/password is the first parameter, without specifier:
exp sys/123456 FULL=Y FILE=C:\HQ_FULL.DMP

Related

Oracle cannot get sqlldr to reach listener, get ORA-12514 error

Every time I try to run the following sqlldr command on a terminal only oracle 19c system:
sqlldr username/password#$HOSTNAME/$ORACLE_SID control=rules.ctl log=backup_error_logs.txt data=output.csv errors=1000000
I get the following error message:
ORA-12514: TNS:listener does not currently know of service requested in connect descriptor
Things I have tried:
Verified that the listener is operable and listener.ora file is properly formatted with lsnrctl.
Verified the connection and oracle environment variables are working as the following sqlplus command runs without problem:
sqlplus username/password#$HOSTNAME/$ORACLE_SID
Verified the tnsname.ora is running properly configured with the following tnsping command:
tnsping $ORACLE_SID
Cannot think of anything else to try or to check. Does anyone have any advice without resorting to the GUI tools?
Could be a problem of quotes in the variables, the behavior of both tools is different regarding quotes.

SQL script through bat file

I am trying to automatize some daily checks and now I need to use SQL query.
So I write my SQL script and then tried to run it through batch file to be able to put it to task scheduler.
So I wrote something like this
sqlplus user/pw#DBServer #PathToSQLScript.sql > "DestinationWhereToPutOutput"
It is confusing me because this works normally at any other server that I already automatized but at this one it gave me error
ORA-12154: TNS: could not resolve the connect identifier specified
And wanting me to reenter credentials.
Is there any other way how to run SQL script through batch file?
Thanks in advance for any advice.
The most frequent reason for ORA-12154 is that DBServer can't be found in TNSNAMES.ORA file. Therefore:
create DBServer's alias in TNSNAMES.ORA, or
use EZCONNECT syntax (which doesn't require TNSNAMES.ORA) that looks like host:port/service_name
For example, that would be
sqlplus user/pw#db_server:1521/orcl
For much more info about troubleshooting ORA-12154, see Ed Stevens' blog

SQL loader shows error ORA-12546 TNS:permission denied when I try to run it against a remote database

I'm trying to run sql loader with the following syntax on a remote bbdd:
sqlldr user/password#host.sid control=loader_control_file.ctl
(where host.sid is the remote bbdd tnsnames entry) and it gives the following error
SQL*Loader-704: Internal error: ulconnect: OCIServerAttach [0]
ORA-12546: TNS:permission denied
I have the connection configured in my local tnsnames.ora, tnsping resolves the sid and sqlplus connects (and works) correctly so apparently tnsnames setup is good.
I've also tried EZconnect syntax
sqlldr user/password#//host:1521/sid control=loader_control_file.ctl
buts gives the same error
I have no idea of what is wrong here. Any help?

Running SQL file in command line using sqlplus result with an error

Using ORACLE 12.0c and SQL Developer.
I try to run a SQL file (myfile.sql) in command line using sqlplus:
sqlplus username/password#schema #myfile.sql resulted with an error.
I run only sqlplus with connection parameters sqlplus username/password#schema and still receive an error (see screenshot).
Typing the username and password didn't help as well.
Only running sqlplus and supply the database domain, port and database name I managed to connect and run the file.
The database is defined in SQL Developer, but I don't see it in TNSNames.ora.
What am I missing?
I give credit to #thatjeffsmith and the answer is... see screenshot:

Error while restoring oracle 10g .dmp file in oracle database 12c

I've got a .dmp file created with Oracle 10g containing the database of one of my clients. I can't for the life of me get it set up with my 12c installation. I can connect to my db using https://localhost:5500/em
I've created a user 'BOB' in my desired PDB and granted import, read and write permissions. Next I try to import using the following command:
impdp BOB/password#//localhost:1521/pdbname full=y directory=dpdump_dir dumpfile=BOB.dmp
However this gives me the following errors:
UDI-12541: operation generated ORACLE error 12541
ORA-12541: TNS:listener does not currently know of service requested in connect descriptor
In the listener.ora and tnsnames.ora i have EZCONNECTOR and ports 1521. Does anyone know how to get this to work?
Many thanks in advance,
Bob
First ensure that you can do tnsping for pdbname to ensure db connect :- $ tnsping bdbname
If you get details of connection string by tnsping, you can try command with following format:
impdp bob/password#127.0.0.1:1521/pdbname directory=dpdump_dir dumpfile=BOB.dmp
I have removed "full=y" as it's not required if you are not restoring full database, specially it used apply with imp/exp utility.
You should remember that pdbname is being specified as a dbname/service_name in your example. You can confirm service_name by following command:
$ lsnrctl services; /* You can get service name and put it on your impdp command. */
In addition, you can try without specifying ip,port and dbname as you are working in localhost itself:
$ impdp bob/password directory=dpdump_dir dumpfile=BOB.dmp
First of all, you should check the connection
sqlplus> BOB/password#localhost:1521/pdbname
If you cannot connect, please connect with sys / as sysdba
Then using command:
SQL> alter session set container=pdbname
SQL> alter pluggable database pdbname open
Then quit and try to your command again. :)

Resources