Forum Stats

  • 3,734,327 Users
  • 2,246,949 Discussions
  • 7,857,227 Comments

Discussions

How to Create admin Users ? Oracle 12c

Hi Guys, I have just installed the oracle 12c. During the installation I have unlock just one user and gives the password. I have not set any password for "Sys" user. Now I have some questions :

How can I create the admin user after installation ?

What is the default password of "SYS" user ?

How can I check the user right of any user ?

Thanks

Answers

  • EdStevens
    EdStevens Member Posts: 28,143 Gold Crown


    How was it your installation/creation of the database did not prompt you for initial password for SYS and SYSTEM?

    At an OS prompt, do the following (example using c:> prompt for windows)


    C:\> set ORACLE_SID=<the name of your database>
    C:\> sqlplus / as sysdba
    

    # above command starts sqlplus cli and uses os authentication to connect you to the database as SYS, with SYSDBA authority. You can now ALTER USER .... to change any passwords you want. But you really shouldn't be connecting as SYS unless you absolutely need that level of unrestricted access. And even then, you should be connecting locally as shown above. For most DBA work, you should create another user (I use 'xxxxdba', where xxxx is the acronym for my organization) and 'GRANT DBA TO xxxxdba'.

    Why were you installing 12c? It's already aged and on its way out the door. You should be looking at 19c, at the oldest.

  • User_X6ZQK
    User_X6ZQK Member Posts: 6 Red Ribbon
    edited Jan 4, 2021 6:28PM

    Thanks for the prompt reply @EdStevens

    No, it did not ask any SYS password. But it ask the Administrative password.

    I need 12c because of other software dependency.

    I have run the below command :

     sqlplus / as sysdba
    

    Now I want to create the two new admin users with admin rights.

    NOTE : I have not created any database yet.

    is this right way : ?

    create user c##user1  identified 1234;
    

    How can I grant the user1 admin right ? and how can i check the is this admin user or not ?

    After creation of admin user, i want to login in SQL Developer.

  • EdStevens
    EdStevens Member Posts: 28,143 Gold Crown

    Now you say

    NOTE : I have not created any database yet


    But earlier you said

    During the installation I have unlock just one user and gives the password.

    How were you able to unlock a user and give a password if you have not created a database? Of course you cannot 'unlock a user" if you "have not created a database". So which is it?

    NOte that while installting oracle and creating a database are two separate things, by default the installer will also create a database, if you make that selection.

    No, it did not ask any SYS password. But it ask the Administrative password.

    That is the password for SYS. The default "administrative" user is SYS.

    One other thing, is this a non-multitenant database, or is it a Container database (CDB) with a Pluggable Database (PDB)? That will make a difference in how users are handled.

  • User_X6ZQK
    User_X6ZQK Member Posts: 6 Red Ribbon
    edited Jan 5, 2021 9:10AM

    Thanks for the reply @EdStevens

    1. Yes got your point here. during installation I have choose "Create and Configure Database" option.
    2. I have change the "SYS" user password by using below command :
    alter user SYS identified by 1234;
    

    I have tried to connect with "SYS" user in SQL Developer . but message appeared invalid password.

    It is Container database (CDB) with a Pluggable Database (PDB) database because I have select the below option :

    Now I want to create a user with admin right and want to login with this user in SQL developer.


    I am able to connect in SQL developer with "System" user.

  • EdStevens
    EdStevens Member Posts: 28,143 Gold Crown

    So what are the connection properties you defined in SQL Dev? Did you define it as BASIC or TNS? What are the values you supplied for the other fields? Are you wanting to connect to the CDB or the PDB?

  • User_X6ZQK
    User_X6ZQK Member Posts: 6 Red Ribbon

    Thanks for the reply @EdStevens

    I pick the Basic option from connection type.

  • EdStevens
    EdStevens Member Posts: 28,143 Gold Crown

    Thanks for the reply @EdStevens

    I pick the Basic option from connection type.

    This is like pulling teeth. I also asked "What are the values you supplied for the other fields? Are you wanting to connect to the CDB or the PDB?"

  • nihitthakkar
    nihitthakkar Member Posts: 121 Blue Ribbon

    Steps:

    1. Log in to SQL *Plus: sqlplus '/ as sysdba'

    2. Create a new user with an administrator password: create user user_name identified by admin_password ; ...

    3. Assign the sysdba privilege to the new Oracle user: grant sysdba to user_name ;

  • EdStevens
    EdStevens Member Posts: 28,143 Gold Crown

    Well, you just revived a thread that is dormant for over three months. Let me ask you this .... you said to "Create a new user with an _administrator_ password" (emphasis mine). So, what exactly is an "administrator" password? At the time you create a user and assign it a password, how would you distinguish an "administrator" password from any other password?

Sign In or Register to comment.