Tags

, , , ,

How can I add a new user as sudoer using the command line?

sudo adduser <username> sudo

This works because /etc/sudoers is pre-configured to grant permissions to all members of this group (You should not have to make any changes to this):

# Allow members of group sudo to execute any command
%sudo   ALL=(ALL:ALL) ALL

----------------------------------------------------------------------------------

Today I forget my XE password then I follow on these steps to figure out it.

SQL> CREATE USER <username>
IDENTIFIED BY <password>
DEFAULT TABLESPACE

TEMPORARY TABLESPACE
;
PROFILE <profile_name>;

SQL> GRANT CREATE SESSION TO <username>
GRANT RESOURCE TO <username>

Problem :
ORA-28009 connection as SYS should be as SYSDBA or SYSOPER

Solution:

If you want to bypass the SYSDBA or SYSOPER checking step then there is a way .

1. Log in to sqlplus as sys

i.e use the following command in sql prompt
conn / as sysdba

2. Check for parameter named O7_DICTIONARY_ACCESSIBILITY
i.e use the following command in sql prompt
show parameter O7_DICTIONARY_ACCESSIBILITY

It will give you result as shown below
NAME TYPE VALUE
———————————— ———– ——————————
O7_DICTIONARY_ACCESSIBILITY boolean FALSE

3. Change this parameter using
alter system set O7_dictionary_accessibility=TRUE scope=spfile;

4. It is a static parameter so need to bounce the database . Restart your database .
5. Now connect as SYS without SYSDBA privilege.
conn sys/

it will be successful .