Minggu, 15 November 2020

ORACLE-manage user acount

 

Managing database user accounts with Toad® for Oracle [How to]

 May 7, 2020 11:49:05 AM by Mark Kurtz

https://blog.toadworld.com/managing-database-user-accounts-with-toad-for-oracle-how-to

Read this blog to learn how to manage database user accounts. Learn how to create a new user, alter an existing user, close a user and drop an existing user in Toad® for Oracle.

As a DBA there is a lot of activity that you are responsible for.

In this blog I want to take you through the process of managing database user accounts. I will cover: 

  • How to create a new user
  • How to alter an existing user
  • How to clone a user
  • How to drop an existing user

These activities may come at random times and Toad makes it easy for you to quickly manage users without having to remember how to do this from the command line.

Since you are already using Toad for all of your other activities User Management is just a click away.

 

User Management

In the Schema Browser you will see Users on the menu:

Using the schema browser dropdown to show the users menu item.

 

Choosing the Users menu item will show you all of the users that currently exist and provide an overview of their status, default tablespace, etc., etc.  Everything that you see on the right-side of the screen below.

The schema browser showing all of the database users.

 

Create a new user

The first feature I would like to show you is how you can create a new user

While in Schema Browser and looking at the Users dropdown the second icon from the left is the Create icon.

The create new user icon is indicated by the red arrow.

 

Click on the Create icon and the Create User dialog window opens. In this window you enter the new username that you want to create and choose all of the options and grants for this user.  In this example we will create a user named "markdemo" and by clicking on the Show SQL button we can view the script that will be run.  When you are happy with the script close the script viewer window and click on the OK button in the lower right and the new user will be created.

The create user script shows all of the parameters for the new user account.

 

Refresh the left-side of the Schema Browser and you will see the new markdemo user that was just created.

Showing the new user account has been successfully created.

 

Alter an existing user

The second feature I want to show you is how to Alter an existing user.

To alter a user you select the user account you want to make changes to and then choose the "pencil" icon as shown below. We will alter the account MATHEW.

The MATHEW account has been selected for alteration.

 

Once you choose alter you will see the window below.  From here you choose what you would like to alter about the user.

The first option is ‘Authentication’. From here you can lock the account, expire their password and change their password.

You can alter the other features of the user account as shown on the left-hand menu.

This is the change/alter dialog window.

 

Below is an example of viewing the tablespace for a user, and if you need to make a change you can choose the tablespace you want to use from the drop down menu.

This is the dialog box used to alter user tablespaces.

 

Once you have chosen the changes you wnat to make you can view the sql statement that is generated.  Below you can see that I am changing the default tablespace and granting some additional roles to the user MATHEW. You can close this window.

This is the alter user script that is generated.

 

Once you have made all of your alterations you can click on the OK button in the lower right and the changes will be applied.

Press the 'OK' button to apply the changes.

 

Now you can see that the default tablespace for the user MATHEW has been changed to ‘TOOLS’.

Here you can see your changes-applied.

 

How to clone a user

The third feature I would like to show you is how to clone a user.  This is handy when you have a new app or release coming out and you need to create several users.  You simply create the first user and then click on the Clone icon (we will clone the markdemo user as markdemo1), enter the new username and password and click the ‘OK’ button and the new cloned user will be created.

Choose the indicated icon to clone a user account.

 

New cloned user confirmation.

 

Now simply refresh the Schema Browser window and you will see the newly cloned account.

The new account markdemo1 has been created as a clone of the markdemo account.

 

 

How to drop an existing user

The last feature I want to show you is how to drop an existing user.  You may have to do this when a user leaves the company or project.

We are going to go back to the Schema Bowser window, highlight the account you want to drop and click on the Drop User icon.

Choose the account you want to drop.

 

A confirmation window will open. 

Choose either the “Do Not Cascade Option” or the “Use Cascade Option” and click the OK button and the user account will be dropped.

Drop user account confirmation window.

 

Refresh the Schema Browser and you will see that the user account has been dropped from the database.

The markdemo user account has been dropped.

 

And now you know how you can quickly and easily manage your database users while not disrupting your other duties as these user management requests pop up.

I hope you find this blog useful and can now manage database user accounts. If you have any questions just leave a comment on the blog page.

-Mark Kurtz

Tidak ada komentar:

Posting Komentar