Skip to Main Content
  • Questions
  • i am not able to login to sqlplus / as sysdba

Breadcrumb

May 4th

Question and Answer

Connor McDonald

Thanks for the question, Tony.

Asked: May 10, 2023 - 5:54 pm UTC

Last updated: May 16, 2023 - 3:14 am UTC

Version: 21c

Viewed 1000+ times

You Asked

Hello Team,

I am new to Oracle and I have recently installed oracle-21c in Centos. The installation was successful , but During installation password was automatically generated. But now when i try to run sqlplus / as sysdba, its repeatedly asking me for the password which i don't have. How to fix this?

[tony@instance-7 ~]$ sqlplus / as sysdba

SQL*Plus: Release 21.0.0.0.0 - Production on Wed May 10 17:51:55 2023
Version 21.3.0.0.0

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

ERROR:
ORA-12162: TNS:net service name is incorrectly specified


Enter user-name:

and Connor said...

Most likely your ORACLE_SID is not set. During installation you were probably prompted for a local bin directory, which will now contain "oraenv, coraenv, dbhome" scripts.

Thus typically your shell profile should be amended to something like

PATH=$PATH:/usr/local/bin
export PATH

ORACLE_SID=mysid
export ORACLE_SID

ORAENV_ASK=NO . oraenv


which will set up the required environment




Is this answer out of date? If it is, please let us know via a Comment

More to Explore

Administration

Need more information on Administration? Check out the Administrators guide for the Oracle Database