Module 13 - Profiles and Resources
Module 13 - Profiles and Resources
Objectives
Obtain information about profiles and resources from the data dictionary.
Profiles
Profile is a database object a named set of resource limits to:
Restrict database usage by a system user profiles restrict users
from performing operations that exceed reasonable resource
utilization. Examples of resources that need to be managed:
o Disk storage space.
o I/O bandwidth to run queries.
o CPU power.
o Connect time.
Enforce password practices how user passwords are created,
reused, and validated.
Profiles are assigned to users as part of the CREATE USER or
ALTER USER commands (User creation is covered in Module 14).
o User accounts can have only a single profile.
Profiles only take effect when resource limits are "turned on" for the
database as a whole.
RESOURCE_LIMIT = TRUE
Profile Specifications
Profile specifications include:
Password history
Account locking
CPU time
Idle time
Connect time
Concurrent sessions
System users not assigned a specific profile are automatically assigned the
DEFAULT profile. The DEFAULT profile has only one significant restriction
it doesn't specify a password verification function.
This query lists the resource limits for the DEFAULT profile.
PROFILE
LIMIT
RESOURCE_NAME
RESOURCE
COMPOSITE_LIMIT
KERNEL
DEFAULT
UNLIMITED
SESSIONS_PER_USER
KERNEL
DEFAULT
UNLIMITED
CPU_PER_SESSION
KERNEL
DEFAULT
UNLIMITED
CPU_PER_CALL
KERNEL
DEFAULT
UNLIMITED
LOGICAL_READS_PER_SESSION
KERNEL
DEFAULT
UNLIMITED
LOGICAL_READS_PER_CALL
KERNEL
DEFAULT
UNLIMITED
IDLE_TIME
KERNEL
DEFAULT
UNLIMITED
CONNECT_TIME
KERNEL
DEFAULT
UNLIMITED
PRIVATE_SGA
KERNEL
DEFAULT
FAILED_LOGIN_ATTEMPTS
PASSWORD 10
DEFAULT
UNLIMITED
PASSWORD_LIFE_TIME
PASSWORD
DEFAULT
UNLIMITED
PASSWORD_REUSE_TIME
PASSWORD
DEFAULT
UNLIMITED
PASSWORD_REUSE_MAX
PASSWORD
DEFAULT
PASSWORD_VERIFY_FUNCTION
PASSWORD NULL
DEFAULT
UNLIMITED
PASSWORD_LOCK_TIME
PASSWORD
DEFAULT
UNLIMITED
PASSWORD_GRACE_TIME
PASSWORD
16 rows selected.
Creating a Profile
A DBA creates a profile with the CREATE PROFILE command.
Example:
LOGICAL_READS_PER_CALL 100
IDLE_TIME 30
CONNECT_TIME 480
PASSWORD_REUSE_TIME 1
PASSWORD_LOCK_TIME 7
PASSWORD_REUSE_MAX 3;
Profile created.
Resource limits that are not specified for a new profile inherit the limit set in
the DEFAULT profile. These clauses are covered in detail later in these
notes.
Assigning Profiles
Profiles can only be assigned to system users if the profile has first been
created. Each system user is assigned only one profile at a time. When a
profile is assigned to a system user who already has a profile, the new
profile replaces the old one the current session, if one is taking place, is
not affected, but subsequent sessions are affected. Also, you cannot
assign a profile to a role or another profile (Roles are covered in Module
16).
As was noted above, profiles are assigned with the CREATE USER and
ALTER USER command. An example CREATE USER command is shown
here this command is covered in more detail in Module 14.
PROFILE Accountant
PASSWORD EXPIRE;
User created.
USERNAME
PROFILE
------------------------------ ---------USER349
ACCOUNTANT
Altering Profiles
Profiles can be altered with the ALTER PROFILE command.
A DBA must have the ALTER PROFILE system privilege to use this
command.
Example:
Dropping a Profile
Profiles no longer required can be dropped with the DROP PROFILE
command.
The CASCADE clause revokes the profile from any user account to
which it was assigned the CASCADE clause MUST BE USED if the
profile has been assigned to any user account.
Examples:
Profile dropped.
USERNAME
PROFILE
------------------------------ ---------USER349
DEFAULT
Password Management
Password management can be easily controlled by a DBA through the use
of profiles.
Password limits set in this fashion are always enforced. When password
management is in use, an existing user account can be locked or unlocked
by the ALTER USER command.
Function created.
Profile altered.
Use these parameters values when setting parameters to values that are
less than a day:
Resource Management
Enabling Resource Limits
System altered.
Resource
Description
CPU_PER_SESSION
CPU_PER_CALL
SESSIONS_PER_USER
CONNECT_TIME
IDLE_TIME
LOGICAL_READS_
PER_SESSION
LOGICAL_READS_PER_CALL
COMPOSITE_LIMIT
and PRIVATE_SGA.
PRIVATE_SGA
Profile limits enforced at the session level are enforced for each connection
where a system user can have more than one concurrent connection.
Resource limits can also be set at the Call-level, but this applies to PL/SQL
programming limitations and we do not cover setting these Call-level limits
in this course.
RESOURCE_NAME
UNIT_COST
-------------------------------- ---------CPU_PER_SESSION
50
LOGICAL_READS_PER_SESSION
CONNECT_TIME
PRIVATE_SGA
Profile altered.
User altered.
CPU
(Seconds)
High
CPU
0.06
Connect
(Seconds)
250
Composite Cost
Exceeded
Limit of
300
Yes
No
No
High
Connec
t
Medium
CPU
0.05
40
Low
Connec
t
Low
CPU
Medium
Connec
t
Low
CPU
0.02
0.02
175
40
No
Low
Connec
t
Some special consumer groups always exist in the data dictionary and
cannot be modified or deleted:
SYS_GROUP the initial consumer group for all sessions created by SYS
or SYSTEM.
This figure from your readings shows a simple resource plan for an OLTP
and reporting set of applications.
A resource plan can reference subplans. This figure illustrates a top plan
and all descending plans and groups.
The DBA can grant privileges to the user named HR an internal user for
Oracle human resources software.
RESOURCE_MANAGER_PLAN = DAYTIME.
DBA_USERS
DBA_PROFILES
USERNAME
PASSWORD
ACCOUNT_STATUS
--------------- ------------------------------------------------OUTLN
4A3BA55E08595C81
OPEN
USER350
2D5E5DB47A5419B2
OPEN
DBOCK
0D25D10037ACDC6A
OPEN
SYS
DCB748A5BC5390F2
OPEN
SYSTEM
EED9B65CCECDB2E9
OPEN
USER349
E6677904C9407D8A
EXPIRED
TSMSYS
3DF26A8B17D0F29F
DIP
CE4A36B8E06CA59C
DBSNMP
E066D214D5421CCC
ORACLE_OCM
6D17CF1EB1611F94
10 rows selected.
PROFILE
LIMIT
RESOURCE_NAME
RESOURCE_TYPE
PASSWORD
DEFAULT
PASSWORD
FAILED_LOGIN_ATTEMPTS
ACCOUNTANT PASSWORD_LIFE_TIME
DEFAULT
PASSWORD
DEFAULT
PASSWORD
60
PASSWORD
PASSWORD_LIFE_TIME
ACCOUNTANT PASSWORD_REUSE_TIME
DEFAULT
1800
PASSWORD_REUSE_TIME
PASSWORD
ACCOUNTANT PASSWORD_REUSE_MAX
PASSWORD
DEFAULT
UNLIMITED
PASSWORD
PASSWORD_REUSE_MAX
ACCOUNTANT PASSWORD_VERIFY_FUNCTION
DEFAULT
PASSWORD
DEFAULT
PASSWORD_VERIFY_FUNCTION
VERIFY_FUN
PASSWORD
ACCOUNTANT PASSWORD_LOCK_TIME
PASSWORD
DEFAULT
0006
PASSWORD
PASSWORD_LOCK_TIME
ACCOUNTANT PASSWORD_GRACE_TIME
DEFAULT
PASSWORD
DEFAULT
PASSWORD
PASSWORD_GRACE_TIME
14 rows selected.
END OF NOTES
10