User Management

20
15 Copyright © Oracle Corporation, 2001. All rights reserved. Managing Users

description

user management

Transcript of User Management

Page 1: User Management

15Copyright © Oracle Corporation, 2001. All rights reserved.

Managing Users

Page 2: User Management

15-2 Copyright © Oracle Corporation, 2001. All rights reserved.

Objectives

After completing this lesson, you should be able to do the following:• Create new database users• Alter and drop existing database users• Monitor information about existing users

Page 3: User Management

15-3 Copyright © Oracle Corporation, 2001. All rights reserved.

Accountlocking

Tablespacequotas

Temporarytablespace

Defaulttablespace

Roleprivileges

Resourcelimits

Securitydomain

Directprivileges

Authenticationmechanism

Users and Security

Page 4: User Management

15-4 Copyright © Oracle Corporation, 2001. All rights reserved.

Page 5: User Management

15-5 Copyright © Oracle Corporation, 2001. All rights reserved.

Database Schema

Schema ObjectsTablesTriggersConstraintsIndexesViewsSequencesStored program unitsSynonymsUser-defined data typesDatabase links

• A schema is a named collection of objects.

• A user is created, and a corresponding schema is created.

• A user can be associated only with one schema.

• Username and schema are often used interchangeably.

Page 6: User Management

15-6 Copyright © Oracle Corporation, 2001. All rights reserved.

Checklist for Creating Users

• Identify tablespaces in which the user needs to store objects.

• Decide on quotas for each tablespace.• Assign a default tablespace and temporary

tablespace.• Create a user.• Grant privileges and roles to the user.

Page 7: User Management

15-7 Copyright © Oracle Corporation, 2001. All rights reserved.

Creating a New User: Database Authentication

Set the initial password:

CREATE USER aaronIDENTIFIED BY soccerDEFAULT TABLESPACE dataDEFAULT TEMPORARY TABLESPACE tempQUOTA 15M ON dataQUOTA 10M ON usersPASSWORD EXPIRE;

Page 8: User Management

15-8 Copyright © Oracle Corporation, 2001. All rights reserved.

Page 9: User Management

15-9 Copyright © Oracle Corporation, 2001. All rights reserved.

Page 10: User Management

15-10 Copyright © Oracle Corporation, 2001. All rights reserved.

Creating a New User: Operating System Authentication

The OS_AUTHENT_PREFIX initialization parameter specifies the format of the usernames.Defaults to OPS$.CREATE USER aaronIDENTIFIED EXTERNALLYDEFAULT TABLESPACE USERSTEMPORARY TABLESPACE tempQUOTA 15m ON dataPASSWORD EXPIRE;

Page 11: User Management

15-11 Copyright © Oracle Corporation, 2001. All rights reserved.

Page 12: User Management

15-12 Copyright © Oracle Corporation, 2001. All rights reserved.

Changing User Quota on Tablespaces

ALTER USER aaronQUOTA 0 ON USERS;

• A user’s tablespace quotas may be modified for any the following situations:• Tables owned by a user exhibit unanticipated

growth.• An application is enhanced and requires

additional tables or indexes.• Objects are reorganized and placed in different

tablespaces.• To modify a user’s tablespace quota:

Page 13: User Management

15-13 Copyright © Oracle Corporation, 2001. All rights reserved.

Page 14: User Management

15-14 Copyright © Oracle Corporation, 2001. All rights reserved.

Dropping a User

• Use the CASCADE clause to drop all objects in the schema if the schema contains objects.

• Users who are currently connected to the Oracle server cannot be dropped.

DROP USER aaron;

DROP USER aaron CASCADE;

Page 15: User Management

15-15 Copyright © Oracle Corporation, 2001. All rights reserved.

Page 16: User Management

15-16 Copyright © Oracle Corporation, 2001. All rights reserved.

Obtaining User Information

Information about users can be obtained by querying the following views:• DBA_USERS• DBA_TS_QUOTAS

Page 17: User Management

15-17 Copyright © Oracle Corporation, 2001. All rights reserved.

Summary

In this lesson, you should have learned how to:• Create users by specifying the appropriate

password mechanism• Control usage of space by users

Page 18: User Management

15-18 Copyright © Oracle Corporation, 2001. All rights reserved.

Practice 15 Overview

This practice covers the following topics:• Creating users• Displaying data dictionary information about users • Removing user quotas

Page 19: User Management

15-19 Copyright © Oracle Corporation, 2001. All rights reserved.

Page 20: User Management

15-20 Copyright © Oracle Corporation, 2001. All rights reserved.