Syntax For Altering User
The various parts of the
command are the same as those in the
For example, to change a user's default tablespace assignment you would issue an
command and provide a new
If you create users, you need to be able to do things such as 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 user1 IDENTIFIED BY new_password;
ALTER USER user1
DEFAULT TABLESPACE users TEMPORARY TABLESPACE temp
QUOTA 101M ON users QUOTA 0 ON my_data;
ALTER USER user1 ACCOUNT LOCK;
ALTER USER user1 ACCOUNT UNLOCK;
ALTER USER user1 PASSWORD EXPIRE;
In the first example we changed the password of the user1 user. In the next example we altered the default and temporary tablespace settings for the user1 user, and we also changed the quotas on two different tablespaces. The next two examples lock the user1 account, and then unlock the user1 account.
The final example expires the password of the user1 account, which will force the user to change their password the next time they log in.