11 Replies Latest reply on Mar 29, 2020 9:52 AM by yoonas

    ORA-01031: insufficient privileges

    OBIEE-N-Co

      I am trying to install Oracle 11g XE on VPS from Vultur, I tried both Ubuntu 18 and CentOS 8,

      After showing success message, i tried loging into SQL PLus> sys/password as sysdba, and I am getting below output...

       

      SQL*Plus: Release 11.2.0.2.0 Production on Thu Mar 26 13:10:14 2020

       

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

       

      Enter user-name: sys as sysdba

      Enter password:

      ERROR:

      ORA-01031: insufficient privileges

       

      I am getting same error on both the OS, searched over the internet all the day and tried all i read,

       

      added root to dba group.....no use

      checke $ORACLE_HOME point sthe /XE folder

       

      checked the permissions the the folder all most all the files have below permisions

      drwxr-xr-x.  2 oracle dba  4096 Mar 26 11:40 bin

       

      created sqlnet.ora file, its not created by default and changed SQLNET.AUTHENTICATION_SERVICES = (NTS) value to NTS, ALL, and also commented on it and no use.....

       

      can anyone please give me a solution for this?

       

      Thanks and regards,

       

      Pratap N

        • 1. Re: ORA-01031: insufficient privileges
          yoonas

          Which os user are you using to connect to sqlplus?

          • 3. Re: ORA-01031: insufficient privileges
            yoonas

            Change user to oracle

            and try if you can access sqlplus

            Else

            And set env(. oraenv)

            or

            ORACLE_SID

            ORACLE_HOME

            Include $ORACLE_HOME/bin in PATH variable

            • 4. Re: ORA-01031: insufficient privileges
              OBIEE-N-Co

              UBUNTU created oracle user, centos didn't. i tried oracle in ubuntu but it said "SQL plus" command not found something like that...

               

              path is fine......

              # echo $PATH

              /u01/app/oracle/product/11.2.0/xe/bin:/u01/app/oracle/product/11.2.0/xe/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin

               

              ------getting some error with oraenv below is the output

              [root@centos8v1 bin]# . oraenv

              ORACLE_SID = [Y] ? XE

              bash: dbhome: command not found...

              ORACLE_HOME = [] ? /u01/app/oracle/product/11.2.0/xe

              ORACLE_BASE environment variable is not being set since this

              information is not available for the current user ID root.

              You can set ORACLE_BASE manually if it is required.

              [root@centos8v1 bin]# . oraenv

              ORACLE_SID = [XE] ?

              ORACLE_BASE environment variable is not being set since this

              information is not available for the current user ID root.

              You can set ORACLE_BASE manually if it is required.

              [root@centos8v1 bin]# . oraenv

              ORACLE_SID = [XE] ?

              ORACLE_BASE environment variable is not being set since this

              information is not available for the current user ID root.

              You can set ORACLE_BASE manually if it is required.

              • 5. Re: ORA-01031: insufficient privileges
                yoonas

                what is output of

                id oracle

                 

                please change user

                su - oracle

                 

                then run . oraenv

                • 6. Re: ORA-01031: insufficient privileges
                  OBIEE-N-Co

                  oracle@mouryarms:/usr/local/bin$ . oraenv

                  -su: oraenv: No such file or directory

                  oracle@mouryarms:/usr/local/bin$

                   

                  Inside the oracle user there is another installation of oracle it seems.....i am confused.....below is the output of my terminal output as I dug into the folders.....

                   

                  oracle@mouryarms:/$ cd ~

                  oracle@mouryarms:~$ ls

                  admin  diag  fast_recovery_area  oradata  oradiag_oracle  product

                  oracle@mouryarms:~$ cd product

                  oracle@mouryarms:~/product$ ls

                  11.2.0

                  oracle@mouryarms:~/product$ cd 11.2.0

                  oracle@mouryarms:~/product/11.2.0$ ls

                  xe

                  oracle@mouryarms:~/product/11.2.0$ cd xe

                  oracle@mouryarms:~/product/11.2.0/xe$ ls

                  apex    ctx   hs    ldap  md       odbc     plsql    slax

                  bin     dbs   jdbc  lib   network  opmn     precomp  sqlplus

                  config  demo  jlib  log   nls      oracore  rdbms    xdk

                  oracle@mouryarms:~/product/11.2.0/xe$ cd bin

                  oracle@mouryarms:~/product/11.2.0/xe/bin$ ls

                  adapters     dbfsize  expdp    loadpsp      oracle          osh      tnslsnr

                  createdb.sh  dbhome   extjob   lsnrctl      oracle_env.csh  ott      tnsping

                  ctxkbtc      dbv      extjobo  lxchknlb     oracle_env.sh   rman     trcroute

                  ctxlc        dg4odbc  extproc  mapsga       oradism         sqlldr   unzip

                  ctxload      dgmgrl   imp      maxmem       oraenv          sqlplus  wrap

                  cursize      dumpsga  impdp    nid          orapwd          sysresv  zip

                  dbfs_client  exp      kgmgr    nls_lang.sh  osdbagrp        tkprof

                  oracle@mouryarms:~/product/11.2.0/xe/bin$ sqlplus

                  sqlplus: command not found

                  oracle@mouryarms:~/product/11.2.0/xe/bin$ sqlplus

                  sqlplus: command not found

                  oracle@mouryarms:~/product/11.2.0/xe/bin$ sudo sqlplus

                  [sudo] password for oracle:

                  Sorry, try again.

                  [sudo] password for oracle:

                  oracle is not in the sudoers file.  This incident will be reported.

                  oracle@mouryarms:~/product/11.2.0/xe/bin$ sqlplus

                  sqlplus: command not found

                   

                  thanks yoonas for your time.....did you got any clue what happened? this is Ubuntu......Centos doesn't have oracle user.....

                   

                  Pratap N

                  • 7. Re: ORA-01031: insufficient privileges
                    yoonas

                    set env variables

                    export ORACLE_SID=xe

                    export ORACLE_HOME=/product/11.2.0/xe (give full path if the given path is wrong)

                    export PATH = $PATH:$ORACLE_HOME/bin

                     

                     

                    then try sqlplu

                    else

                    post output of

                     

                    echo $ORACLE_SID

                    echo $ORACLE_HOME

                    echo $PATH

                    which sqlplus

                     

                     

                    ? this is Ubuntu......Centos doesn't have oracle user.....

                     

                    your initial post permission shows oracle user is avail here

                     

                    rwxr-xr-x.  2 oracle dba  4096 Mar 26 11:40 bin

                     

                     

                     

                    • 8. Re: ORA-01031: insufficient privileges
                      OBIEE-N-Co

                      Hello yoonas, thanks for working a long with me, seem we made some progress.....i executed below in Ubuntu server

                       

                      --ubuntu logged in as oracle user

                      oracle@mouryarms:~$ pwd

                      /u01/app/oracle

                      --the base directory itself is oracle's app directory

                       

                      --the permissions of some folders in oracle are only read and executable to root so changed the permissions to

                      find /u01/app -type d -exec chmod 775 {} \;

                      find /u01/app -type f -exec chmod 775 {} \;

                       

                      --ran sqlplus from oracle directory

                      oracle@mouryarms:~$ sqlplus

                      sqlplus: command not found

                       

                      --ran sqlplus from bin directory

                      oracle@mouryarms:~/product/11.2.0/xe/bin$ sqlplus

                      sqlplus: command not found

                       

                      --permissions of sqlplus file are

                      -rwxrwxr-x  1 oracle dba      4968 Aug 29  2011 sqlplus

                       

                      --- so logged into root user, changing the permissions changed the output, below is the output

                      root@mouryarms:~# sqlplus

                      Enter user-name: sys as sysdba

                      Enter password:

                      ERROR:

                      ORA-12547: TNS:lost contact

                       

                      --- below are the values of environment variables......

                      root@mouryarms:~# echo $ORACLE_SID

                      XE

                      root@mouryarms:~# echo $ORACLE_HOME

                      /u01/app/oracle/product/11.2.0/xe

                      root@mouryarms:~# echo $PATH

                      /u01/app/oracle/product/11.2.0/xe/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin

                      root@mouryarms:~# which sqlplus

                      /u01/app/oracle/product/11.2.0/xe/bin/sqlplus

                       

                      searching on the above error and will try.....do you have any idea how to deal with this error.....thanks for your help....

                       

                      Pratap N

                      • 9. Re: ORA-01031: insufficient privileges
                        Dude!

                        root@mouryarms:~# sqlplus

                        Enter user-name: sys as sysdba

                        Connections "as sysdba" always connect to the SYS schema (user) and rely on OS authentication.

                         

                        You might as well use: "sqlplus tweedledum/tweedledee as sysdba" and you will connect as SYS as well. As sysdba requires that you a user account that is part of the OSDBA system group (dba), such as user oracle. Remote connections as sysdba use the orapw password file for authentication.

                         

                        You do not use the root account to install or use Oracle database.

                         

                        I am trying to install Oracle 11g XE on VPS from Vultur, I tried both Ubuntu 18 and CentOS 8,

                        11gXE is too old for any recent OS and was designed for RHEL 5, about 10 years ago. Neither Ubuntu nor CentOS 8 will work without silly efforts. Why not using 18c XE and Oracle Linux 7? Oracle database does not support EL8 yet. If you need Ubuntu or Centos 8, run 11g XE in Virtualbox.

                        • 10. Re: ORA-01031: insufficient privileges
                          OBIEE-N-Co

                          Hello Dude,

                           

                          Thanks for the reply, I tried as you said.....root is in the dba group......below is the error I got.

                           

                          root@mouryarms:~# sqlplus root/******* as sysdba

                          SQL*Plus: Release 11.2.0.2.0 Production on Sun Mar 29 07:36:11 2020

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

                           

                          ERROR:

                          ORA-12547: TNS:lost contact

                           

                          any clue why I got this?

                          • 11. Re: ORA-01031: insufficient privileges
                            yoonas

                            I think in your hurry to fix the issue you fail to read it properly, He has said "you don not use...."

                             

                            If you really want to try to solve the issue try to follow the steps i have provided earlier

                             

                            switch user to oracle (dont ever try with root) , nor change the permissions as you wish.

                             

                            set env variables

                            export ORACLE_SID=xe

                            export ORACLE_HOME=/u01/app/oracle/product/11.2.0/xe

                            export PATH = $PATH:/u01/app/oracle/product/11.2.0/xe/bin

                            then run sqlplus and post output