Back to: Oracle DBA Tutorials
Multiple Ways to Connect as sys User in Oracle
In this article, I am going to discuss Multiple Ways to Connect as sys User in Oracle. So, we will try to understand how we can connect to SYS user. SYS is the super user who has all the privileges. Login to your Linux machine as an oracle machine. Start the database. Because once the Linux machine is shut down the database will be stopped. If you have any queries you can refer to How to Startup the Oracle Database – Dot Net Tutorials
Open the terminal and login into the database using the login method “sqlplus / as sysdba”. This is the most used method to log in as sysdba. In this method, it is not necessary to provide the password because password authentications happen at the OS level. Authentication happens with the password file. So, this password file authenticates the OS level user to provide a password and log in as sysdba user.
This image shows that you have connected to the sys user without entering any password. To check which database we have connected use the command “show con_name”. This command shows you what is the name of the container database.
Note: Whenever the sys user logins to the database he will be logged in to the Root database.
This is the second way to connect as a sys user. Enter the command “connect”. It asks for a username and password. Enter the user name as “sys as sysdba” and the password for sys user.
If you face any issues while connecting this method like not remembering the password change the password for the sys user and connect again. Below is the command to reset the password. We will discuss this command later.
So, now we have changed the password for the sys user as “goodluck”. So, we will try to reconnect again. Disconnect from the session. Connect again to the database as “sqlplus / as sysdba”.
After connecting to the sysdba user connect as below. This is another method to connect. Here the pattern of connecting to the database is “Connect username/password as sysdba”. This is not a good method because whenever we follow this step the password is visible to everyone and it is not good for security. You can see below that it is connected.
In the next article, I am going to discuss Shifting from Container to Pluggable Database. Here, in this article, I try to explain Multiple Ways to Connect as sys User in Oracle and I hope you enjoy Multiple Ways to Connect as sys User in the Oracle Database article.