Heim  >  Artikel  >  Datenbank  >  Oracle帐户管理

Oracle帐户管理

WBOY
WBOYOriginal
2016-06-07 16:52:59936Durchsuche

1 查询用户信息SQLgt;select username,default_tablespace,temporary_tablespace,created,account_status from dba_users;2 增加

1 查询用户信息
SQL>select username,default_tablespace,temporary_tablespace,created,account_status from dba_users;

2 增加用户
1. % su – Oracle,或以安装oracle软件的操作用户登陆
2. 更改ORACLE_SID环境变量为要增加用户的数据库名
3. SQL> connect /as sysdba
4. SQL>create user user_name identified by user_passwd
default tablespace default_tablespace
temporary tablespace temp_tablespace
quota unlimited on default_tablespace;

建立用户usern_ame,密码为user_password,选择缺省表空间和临时表空间,一般缺省表空间自己建立,最差情况使用USERS表空间,临时表空间使用TEMP.

5. SQL> grant connect,resource to user_name;,,为user_name分配权限

验证:
使用该创建了的用户登录,并进行验证中文字符的方法进行验证,如果成功,则创建成功。

3 修改用户密码
1.以oracle用户登录.
2.%sqlplus /nolog
SQL>connect /as sysdba
SQL>alter user USER_NAME identified by USER_PASSWD;

验证:
使用该用户与修改了的密码登录,登录成功即修改密码成功。

4 删除用户
删除用户时候,会从数据字典中删除该用户及其相关的模式,同时,如果在该模式中包含任何模式对象,也将立即删除.使用cascade选项删除该用户以及所有相关的对象和依赖于该用户的外键:

1.以oracle用户登录.
2.%sqlplus /nolog
SQL>connect /as sysdba
SQL>drop user user_name cascade;

验证:
在删除前用该用户登录成功,在删除后,再使用该用户登录进行验证,如果失败即表示删除成功或用户已被lock。

或者使用SQL>select username from dba_users where username=’被删除用户名大写’没有查询出记录即可。

linux

Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn