0

here is my environment

  1. Oracle 12.2
  2. NON-CDB
  3. The oracle user is part of dba and oinstall group as follows

    $ id oracle uid=1000(oracle) gid=54322(dba) groups=54322(dba),54321(oinstall)

  4. The ORAPW file has been created using ORAPWD utility

  5. ORACLE_HOME and ORACLE_SID set to DBALIAS

Here is my problem:

I can connect using following meethods

a. sqlplus SYS"@DBALIAS" as sysdba ( it asks for password )

b. sqlplus SYS/PW@DBALIAS as sysdba

But when I use following, I get ORA-12154 error

sqlplus '/ as sysdba' ERROR: ora-12154: TNS: could not resolve the connect identifier specified

2

You commanded your shell to run sqlplus program and give it one argument / as sysdba. The argument is a single word that contains spaces inside (that's what quotes do in shell). Thus sqlplus looks for a TNS name / as sysdba and fails.

Instead try

sqlplus / as sysdba

That's a program name plus three separate arguments.

If you've really set ORACLE_HOME=DBALIAS then it will surely fail. You need to set it to precisely the same string as you used to STARTUP this database. Something like

export ORACLE_HOME=/dir/for/oracle/binaries

If you set it properly, you should be able to execute

"$ORACLE_HOME"/bin/sqlplus  / as sysdba

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.