How to connect to oracle with sys and sysdba correctly? - oracle

I want to connect to oracle as sys user with sysdba privil..
How can I do it using easy connection
I am doing so:
sqlplus sys/password#server:1521/orcl as sysdba
and getting error:
ORA-01017: invalid username/password; logon denied
Is it correct syntax?
Thanks.

You are trying to connect remotely as sysdba (port 1521 in your case). Connecting as sysdba from a remote location (over tcp or tcps) requires some extra steps:
Set the database parameter REMOTE_LOGIN_PASSWORDFILE = { shared | exclusive | none }.It should be set tp shared/exclusive.
Check your password file under $ORACLE_HOME/dbs/, which is being used for authentication when users login to the database as a sysdba. If the password file does not exist then create a new one (using orapwd) and set the password.

Related

Why is the command conn / as sysdba throwing an error in sqlplus?

Enter user-name: conn / as sysdba
Enter password:
ERROR:
ORA-01017: invalid username/password; logon denied
The special string / as sysdba tells Oracle to use OS Authentication instead of a username/password. Your OS (looks like Windows) is not authorizing you to connect to Oracle as sysdba.
Make sure your Windows user is a member of the ORA_DBA local group on that computer.

How to reset username and password for oracle

I am using
Run SQL Command Line
to connect with database, previously I am able to connect with username 'system' and password 'root' but when I tried to connect using SQL>connect system/root
it is showing error
ERROR:
ORA-01017: invalid username/password; logon denied
All services are running, after long time I am trying to connect may be I forgot my credentials can anyone help me how to change or reset both username and password I am on windows platform,
I too reset my password few days back.
You can reset your password by this
ALTER USER username IDENTIFIED BY password
Connect to db first
SQL> conn /as sysdba
More information Docs

How to set sysdba password in Oracle 11G

I tried to connect to database using sqlplus using below command :
sqlplus / as sysdba
I have used the same password that I had set while creating database and setting password for sys and sysdba. But it shows below error :
ORA-01017: invalid username/password; logon denied
How to connect to the database?
I have installed Oracle DB in local PC with Windows 10 as Operating System and administrator privileges.
Log on to your Windows server as a member of the Administrators group or a member of the ORA_DBA group.
Try the below steps
sqlplus /nolog
connect / as sysdba
Once connected, you can change the SYS password to something you know:
ALTER USER sys IDENTIFIED BY new_password;

Unable to log in to database as SYS with Oracle SQL Developer

I've worked with Oracle for some time but very much a noob with the Admin side of things and am learning, so bear with me.
I cannot log on to my database (orcl_test) with SQL Developer with the SYS username. I can log on just fine in SQLPlus with SYS as SYSDBA - when I try with SQL Developer I get an error:
ORA-01017: invalid username/password; logon denied.
Logging on as SYS as SYSDBA in SQLPlus, I created a test table within the database and granted the test user SCOTT with SELECT permissions. The Scott user can log on through SQL Developer w/o problem and access the allowed tables.
I have checked that the Scott user and SYS are logging in using the same settings -
Hostname: (ip address)
Port: 1521
SID: orcl_test
For SYS I flag the role SYSDBA - but otherwise the settings are the same.
Any thoughts on why I can't log on using SYS? Am I just overlooking something or have I configured my db incorrectly?
Not sure if this is relevant but I cannot use 'localhost' for the hostname, I have to enter the IP address. Where do I configure Oracle to recognize localhost?
This is a new installation of Oracle 11.2.0.1.0 on a standalone test box running Windows XP. Running Oracle SQL Developer 1.5.5.
From the The SYSDBA System Privilege and (Logging In and Connecting to the Database as SYSDBA:
1--Connecting AS SYSDBA invokes the SYSDBA privilege. If you omit the AS
SYSDBA clause when logging in as user SYS, the SQL Command Line
rejects the login attempt.
2--Using SQL Developer, open a database connection to the SYS user AS SYSDBA.
So - if this works for you:
sqlplus sys/Oracle_1#pdborcl as sysdba;
Try: "SYS AS SYSDBA" as below:
Alternatively:
you can type in: "SYS" and select from dropdown-menu ROLE: SYSDBA.
If I understand correctly the database is on the same host as the SQL Developer installation? Are you fully qualifying the connection when testing with SQLPlus:
sqlplus "sys/password#database as sysdba"
It may be the case that the error is correct. Make sure you've created a password file.
The sys password that you are using is not valid.
But because you are connecting to oracle by command on an Oracle machine, Oracle does not check your password even though your password is not right.
Just change the sys password and try again.
su - oracle
orapwd file=$ORACLE_HOME/dbs/orapw$ORACLE_SID password=Euro2016 entries=5
which means: write to a file $ORACLE_HOME/dbs/orapw$ORACLE_SID a password Euro2016 which is used by SYSDBA
Now you can connect with sqldeveloper: username sys, password Euro2016 with chosen SYSDBA , hostname, port, sid from $ORACLE_SID

ORA-12638 Credential retrieval failed and ORA-01031: insufficient privileges

in sqlnet.ora file:
when i have SQLNET.AUTHENTICATION_SERVICES= (NTS)
i can't connect by PL/SQL developer arises "ORA-12638 Credential retrieval failed"
,but can connect by command line
when i have SQLNET.AUTHENTICATION_SERVICES= (NONE)
i can't connect
>sqlplus / as sysdba
arises "ORA-01031: insufficient privileges"
,but can connect by PL/SQL developer and command line when i supply username and password
I was facing the exact same issue.
When I made the change to
SQLNET.AUTHENTICATION_SERVICES= (NONE) to resolve the ORA-12638 Credential retrieval failed.
I was then unable to connect with the sysdba privilege.
ORA-01031: insufficient privileges when sqlplus / as sysdba
The Solution:
I was able to find out, I could still connect as sysdba with the following command:
From within sqlplus:
connect sys as sysdba
From command line:
sqlplus sys as sysdba
In both cases, you will be prompted for your password. The password will be the same as your password that you setup for the SYSTEM user during the windows Oracle install.
Now you are connected with the sysdba rights you were trying to get with sqlplus / as sysdba.
The server administrator may not have setup NTS authentication on the database. You can't simply ask for your credentials to be authenticated by NTS in your client SQLNET.ORA file without agreement on the server side.

Resources