user management
DESCRIPTION
user managementTRANSCRIPT
15Copyright © Oracle Corporation, 2001. All rights reserved.
Managing Users
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
15-3 Copyright © Oracle Corporation, 2001. All rights reserved.
Accountlocking
Tablespacequotas
Temporarytablespace
Defaulttablespace
Roleprivileges
Resourcelimits
Securitydomain
Directprivileges
Authenticationmechanism
Users and Security
15-4 Copyright © Oracle Corporation, 2001. All rights reserved.
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.
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.
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;
15-8 Copyright © Oracle Corporation, 2001. All rights reserved.
15-9 Copyright © Oracle Corporation, 2001. All rights reserved.
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;
15-11 Copyright © Oracle Corporation, 2001. All rights reserved.
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:
15-13 Copyright © Oracle Corporation, 2001. All rights reserved.
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;
15-15 Copyright © Oracle Corporation, 2001. All rights reserved.
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
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
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
15-19 Copyright © Oracle Corporation, 2001. All rights reserved.
15-20 Copyright © Oracle Corporation, 2001. All rights reserved.