Beginning SQL

Beginning SQL Beginning SQL

marjan.fesb.hr
from marjan.fesb.hr More from this publisher
20.07.2013 Views

Chapter 12 Creating User IDs Figure 12-2 The system administrator (SA) sets up users and defines the privileges those users have. In many cases, this is done through a program interface to the DBMS, where the SA simply opens a form and starts creating users, typing their initial password and telling the DBMS whether the user can change their password, whether they must change their password the first time they log on, and so forth. In fact, some DBMSs can allow all of the user/password validation to be performed by the OS, which means no user IDs or passwords are required inside of the database itself. Some DBMSs have SQL statements, extensions to the SQL standard specific to that DBMS, to allow creating users. For example, in Oracle the statement looks like this: CREATE USER username IDENTIFIED {BY password | EXTERNALLY | GLOBALLY AS external_name} Options After creating users and determining privileges for those users, the SA can then alter users and privileges. Alter User 330 Personal Depot Group ID Mary Sue John User ID : usr Personnel Personnel Manager Betty User ID : usr Betty Personnel Dept Head Cyndi User ID : usr Cyndi The SA can always modify the user by changing the password and, in some systems, by making a user inactive or setting times of day or days of the week that the user can log in to the database. Some DBMSs provide SQL statements for these functions. For example, in Oracle, the statement may look like the following:

Chapter 12<br />

Creating User IDs<br />

Figure 12-2<br />

The system administrator (SA) sets up users and defines the privileges those users have. In many cases,<br />

this is done through a program interface to the DBMS, where the SA simply opens a form and starts creating<br />

users, typing their initial password and telling the DBMS whether the user can change their password,<br />

whether they must change their password the first time they log on, and so forth. In fact, some<br />

DBMSs can allow all of the user/password validation to be performed by the OS, which means no user<br />

IDs or passwords are required inside of the database itself.<br />

Some DBMSs have <strong>SQL</strong> statements, extensions to the <strong>SQL</strong> standard specific to that DBMS, to allow creating<br />

users. For example, in Oracle the statement looks like this:<br />

CREATE USER username<br />

IDENTIFIED {BY password | EXTERNALLY | GLOBALLY AS external_name}<br />

Options<br />

After creating users and determining privileges for those users, the SA can then alter users and privileges.<br />

Alter User<br />

330<br />

Personal Depot<br />

Group ID<br />

Mary Sue John<br />

User ID : usr Personnel<br />

Personnel<br />

Manager<br />

Betty<br />

User ID : usr Betty<br />

Personnel<br />

Dept Head<br />

Cyndi<br />

User ID : usr Cyndi<br />

The SA can always modify the user by changing the password and, in some systems, by making a user<br />

inactive or setting times of day or days of the week that the user can log in to the database. Some<br />

DBMSs provide <strong>SQL</strong> statements for these functions. For example, in Oracle, the statement may look<br />

like the following:

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!