After successfully create the user, When I logon into this. I get error like below:
User username lacks CREATE SESSION privilege; logon denied
grant create session to USERNAME;
sqlplus> connect / as sysdba
sqlplus> grant connect to username
Related
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.
I am new to using Oracle database. I worked on it for some weeks. It worked well. But now, I'm having some problem. I am getting this error while trying to connect. I didn't change the password. I am using the default user name and password only.
SQL> connect as sysdba
Enter user-name: SCOTT
Enter password:
ERROR:
ORA-01031: insufficient privileges
Can someone tell the solution for this?
That's because SCOTT isn't granted a SYSDBA role. Have a look at his demonstration.
This is what you have now:
SQL> connect as sysdba
Enter user-name: scott
Enter password:
ERROR:
ORA-01031: insufficient privileges
Warning: You are no longer connected to ORACLE.
SQL>
Connect as a privileged user (SYS) and grant SYSDBA to SCOTT:
SQL> connect as sysdba
Enter user-name: sys
Enter password:
Connected.
SQL>
SQL> grant sysdba to scott;
Grant succeeded.
SQL>
OK; now, back to the initial attempt:
SQL> connect as sysdba
Enter user-name: scott
Enter password:
Connected.
SQL>
Not everyone has SYSDBA privileges, and not everyone should have them. Handle with care, it is a powerful privilege so I'll revoke it from SCOTT:
SQL> connect as sysdba
Enter user-name: sys
Enter password:
Connected.
SQL> revoke sysdba from scott;
Revoke succeeded.
SQL>
Please share more information like OS etc
But have you checked user you are using to connect is part of ORA_DBA group assuming you are on windows
I'm running an installer script. which is granting on sys.aux_stats$, sys.wri$optstat_aux_history, sys.dbms_spm and sys.dbms_xplan. At this point there is an exception throwed: ORA-01031: insufficient privileges For the installer I created a DBA-User (FOODBA) and a DB-User (FOOADM). The DBA is created like this on the oracle machine:
bash-4.1$ sqlplus
...
Enter user-name: sys as sysdba
Enter password:
SQL> CREATE USER FOODBA IDENTIFIED BY Password;
User created.
SQL> GRANT DBA TO FOODBA ;
Grant succeeded.
SQL> GRANT ADMINISTER SQL MANAGEMENT OBJECT TO FOODBA ;
Grant succeeded.
doesn't work at all, do I tried like this:
SQL> GRANT ALL PRIVILEGES TO FOODBA;
Grant succeeded.
Still not working, so I tried to give permission on custom object:
SQL> grant all privileges on sys.aux_stats$ to FOODBA;
Grant succeeded.
And when I run the script with user FOODBA:
grant select, insert, update, delete on sys.aux_stats$ to FOOADM
It's throwing again the insufficient privileges excpetion.
What I'm supposed to do, so that the FOODBA user can create and grant the FOOADM correctly? The install script is 3rd party.
Having an object grant is not sufficient to pass this grant on to another user/role. You will need "with grant option".
grant select, insert, update, delete on sys.aux_stats$ to FOODBA with grant option;
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
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;