 |
|
Oracle Concepts - Oracle alter user
syntax
Oracle Tips by Burleson Consulting |
Alter Oracle Users
If you create users, you need to be able to do things
like change their password, and change various attributes for the user. You use
the alter user command for these tasks. Here are some examples of the uses of
the alter user command in action:
ALTER
USER myuser IDENTIFIED BY new_password;
ALTER
USER myuser
DEFAULT
TABLESPACE users TEMPORARY TABLESPACE temp
QUOTA
100M ON users QUOTA 0 ON my_data;
ALTER
USER myuser ACCOUNT LOCK;
ALTER
USER myuser ACCOUNT UNLOCK;
ALTER
USER myuser PASSWORD EXPIRE;
In the first example we changed the password of the
myuser user. In the next example we altered the default and temporary tablespace
settings for the myuser user, and we also changed the quotas on two different
tablespaces. The next two examples lock the myuser account, and then unlock the
myuser account.
The final example expires the password of the myuser
account, which will force the user to change their password the next time they
log in.
Dropping Users
If we are going to create users, we better be able to
remove them. The drop user command does just that. The command is as simple as
drop user followed by the user name. If the user owns objects (for example, if
you created a table and an index using the user) then you will need to add the
cascade parameter, as seen in this example:
DROP USER myuser CASCADE;
This is an excerpt from the bestselling "Easy
Oracle Jumpstart" by Robert Freeman and Steve Karam (Oracle ACE and Oracle
Certified Master). It?s only $19.95 when you buy it directly from the
publisher
here.
Related Alter User Articles:
 |
If you like Oracle tuning, you may enjoy the new book "Oracle
Tuning: The Definitive Reference", over 900 pages of BC's favorite tuning
tips & scripts.
You can buy it direct from the publisher for 30%-off and get instant access to
the code depot of Oracle tuning scripts. |
|