First, users
1, the use of SQL to create the user's syntax format is as follows:
Create user user_name--username/
[identified by password | externally | Globally as ' external_name ']--how to authenticate the user
, the authentication party There are 3 types: password, external and global,
--the password represents the use of the password provided by the user to authenticate, external representation of the use of Third-party programs to verify, such as
the operation of the system's login password, the global refers to when there is more than one data,
-to build a global user, Other databases are validated by this user and require keyword by*/only when using a password
[default tablespace tablespace_name]--Specify the user's defaults table space/
[temporary Tablespace Tablespace_name]--Specify the user's temporary tablespace/
[Quota integer K | integer M | Unlimited on Tablespace_name]--the maximum size that can be allocated in the specified table space
Space * *
[Profile Profile_name]--Specify profiles */
[default role RoleName,.. n | All[except rolename,... N] | None]--Specifies a user-owned role that defaults to assign
one or more default-roles to the user, All[except role is to assign
all roles or roles other than certain roles to the user, none to
specify no roles * *
[password expire]--means to invalidate the password, which will force the user to replace the password at the first login to the database/
[account Lock | unlock]--The accounts are locked or not.
Sample code:
Create user Hello identified by the world password expire;
2, the use of SQL to modify the user's syntax format is as follows:
Alter user user_name
identified by password | externally | Globally as ' external_name '
[default Tablespace TABLESP Ace_name]
[temporary tablespace tablespace_name]
[Quota integer K | integer M | unlimited on tablespace_name]
[profile profile_name]
[Default role RoleName | all[except rolename] | none]
[password expire]
[account Lock | Unlock]
example code:
alter user Hello identified by HelloWorld;
3, the use of SQL commands to delete the user's syntax format is as follows:
Drop user user_name [cascade]; --Using Cascade will remove the user-owned objects together with the * *
example code:
drop user Hello cascade;
Second, the role
1. The syntax format for creating roles using SQL statements is as follows:
Create role Role_name
[not identified]
[identified by password | externally | globally]
Sample code
Create role Hello;
2, the use of SQL statements to modify the role of the syntax format is as follows:
Alter role Role_name
[not identified]
[identified by password | externally | globally]
3, the use of SQL statements to remove the role of the syntax format is as follows
Drop role Role_name