Insufficient privileges error in Oracle 10g - oracle

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

Related

Connect Sys as Sysdba : Insufficient privileges

I'm trying to connect to an Oracle database using SQL Developper as Sys DBA but I'm receiving the error : ORA 1031 : Insufficient Privileges.
I'm sure the password is correct because I'm able to connect to the same database using SQLPlus :
Does anyone know how to solve that please ?
Thanks
change role to be sysdba instead of default in sqldeveloper
Check if the parameter REMOTE_LOGIN_PASSWORDFILE is set to exclusive. This is necessary to login AS SYSDBA from SQL developer :
SQL> show parameter remote_login_passwordfile
To change it :
SQL> ALTER SYSTEM SET REMOTE_LOGIN_PASSWORDFILE=EXCLUSIVE SCOPE=SPFILE;
Role(par defaut) - role(sysdba) or sysoper

Oracle not allow to grant on sys.*

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;

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;

Getting error during logon in sqlplus

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

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

Resources