管理用户
2014-11-23 22:36
363 查看
SQL> conn / as sysdba
已连接。
SQL> drop user violet cascade;
用户已删除。
SQL> host cls
SQL> --创建一个名叫violet 密码password的用户
SQL> create user violet identified by password;
用户已创建。
SQL> conn / as sysdba
已连接。
SQL> drop user emi cascasde;
drop user emi cascasde
*
第 1 行出现错误:
ORA-00921: 意外的 SQL 命令结尾
SQL> drop user emi cascade;
用户已删除。
SQL> drop user jeff cascade;
用户已删除。
SQL> host cls
SQL> create user jeff identified by password;
用户已创建。
SQL> create user emi identified by password;
用户已创建。
SQL> grant create session to jeff,emi;
授权成功。
SQL> --使用admin option
SQL> show user
USER 为 "SYS"
SQL> grant create table to jeff with admin option;
授权成功。
SQL> --分配配额
SQL> alter user jeff quota unlimited on users;
用户已更改。
SQL> --切换到jeff上
SQL> conn jeff/password
已连接。
SQL> create table ddd( d number);
表已创建。
SQL> --jeff: create table ---> emi
SQL> show user
USER 为 "JEFF"
SQL> grant create table to emi;
授权成功。
SQL> conn / as sysdba
已连接。
SQL> alter user emi quota unlimited on users;
用户已更改。
SQL> conn emi/password
已连接。
SQL> create table ddd( d number);
表已创建。
SQL> --撤销jeff的权限
SQL> conn / as sysdba
已连接。
SQL> revoke create table from jeff;
撤销成功。
SQL> conn jeff/password
已连接。
SQL> create table daa(d number);
create table daa(d number)
*
第 1 行出现错误:
ORA-01031: 权限不足
SQL> conn emi/password
已连接。
SQL> create table daa(d number);
表已创建。
SQL> conn scott/tiger
已连接。
SQL> host cls
SQL> --使用grant option撤销对象权限
SQL> show user
USER 为 "SCOTT"
SQL> grant select on emp to jeff with grant option;
授权成功。
SQL> conn jeff/password
已连接。
SQL> select count(*) from scott.emp;
COUNT(*)
----------
15
SQL> --jeff: ---> emi
SQL> show user
USER 为 "JEFF"
SQL> grant select on scott.emp to emi;
授权成功。
SQL> conn emi/password;
已连接。
SQL> select count(*) from scott.emp;
COUNT(*)
----------
15
SQL> host cls
SQL> conn scott/tiger
已连接。
SQL> revoke select on emp from jeff;
撤销成功。
SQL> conn jeff/password
已连接。
SQL> select count(*) from scott.emp;
select count(*) from scott.emp
*
第 1 行出现错误:
ORA-00942: 表或视图不存在
SQL> conn emi/password
已连接。
SQL> select count(*) from scott.emp;
select count(*) from scott.emp
*
第 1 行出现错误:
ORA-00942: 表或视图不存在
SQL> host cls
SQL> --角色
SQL> show user
USER 为 "EMI"
SQL> conn / as sysdba
已连接。
SQL> drop role hr_mgr;
角色已删除。
SQL> drop role hr_clerk;
角色已删除。
SQL> create role hr_mgr;
角色已创建。
SQL> create role hr_clerk;
角色已创建。
SQL> --create session, create table
SQL> --把权限授予给角色
SQL> grant create session to hr_clerk;
授权成功。
SQL> grant create table,hr_clerk to hr_mgr;
授权成功。
SQL> --把角色授予个用户
SQL> grant hr_clerk to jeff;
授权成功。
SQL> grant hr_mgr to emi;
授权成功。
SQL> /*
SQL> create user myuser identified by password;
SQL> grant connect,resource to myuser;
SQL> 创建用户
SQL> */
SQL> spool off
已连接。
SQL> drop user violet cascade;
用户已删除。
SQL> host cls
SQL> --创建一个名叫violet 密码password的用户
SQL> create user violet identified by password;
用户已创建。
SQL> conn / as sysdba
已连接。
SQL> drop user emi cascasde;
drop user emi cascasde
*
第 1 行出现错误:
ORA-00921: 意外的 SQL 命令结尾
SQL> drop user emi cascade;
用户已删除。
SQL> drop user jeff cascade;
用户已删除。
SQL> host cls
SQL> create user jeff identified by password;
用户已创建。
SQL> create user emi identified by password;
用户已创建。
SQL> grant create session to jeff,emi;
授权成功。
SQL> --使用admin option
SQL> show user
USER 为 "SYS"
SQL> grant create table to jeff with admin option;
授权成功。
SQL> --分配配额
SQL> alter user jeff quota unlimited on users;
用户已更改。
SQL> --切换到jeff上
SQL> conn jeff/password
已连接。
SQL> create table ddd( d number);
表已创建。
SQL> --jeff: create table ---> emi
SQL> show user
USER 为 "JEFF"
SQL> grant create table to emi;
授权成功。
SQL> conn / as sysdba
已连接。
SQL> alter user emi quota unlimited on users;
用户已更改。
SQL> conn emi/password
已连接。
SQL> create table ddd( d number);
表已创建。
SQL> --撤销jeff的权限
SQL> conn / as sysdba
已连接。
SQL> revoke create table from jeff;
撤销成功。
SQL> conn jeff/password
已连接。
SQL> create table daa(d number);
create table daa(d number)
*
第 1 行出现错误:
ORA-01031: 权限不足
SQL> conn emi/password
已连接。
SQL> create table daa(d number);
表已创建。
SQL> conn scott/tiger
已连接。
SQL> host cls
SQL> --使用grant option撤销对象权限
SQL> show user
USER 为 "SCOTT"
SQL> grant select on emp to jeff with grant option;
授权成功。
SQL> conn jeff/password
已连接。
SQL> select count(*) from scott.emp;
COUNT(*)
----------
15
SQL> --jeff: ---> emi
SQL> show user
USER 为 "JEFF"
SQL> grant select on scott.emp to emi;
授权成功。
SQL> conn emi/password;
已连接。
SQL> select count(*) from scott.emp;
COUNT(*)
----------
15
SQL> host cls
SQL> conn scott/tiger
已连接。
SQL> revoke select on emp from jeff;
撤销成功。
SQL> conn jeff/password
已连接。
SQL> select count(*) from scott.emp;
select count(*) from scott.emp
*
第 1 行出现错误:
ORA-00942: 表或视图不存在
SQL> conn emi/password
已连接。
SQL> select count(*) from scott.emp;
select count(*) from scott.emp
*
第 1 行出现错误:
ORA-00942: 表或视图不存在
SQL> host cls
SQL> --角色
SQL> show user
USER 为 "EMI"
SQL> conn / as sysdba
已连接。
SQL> drop role hr_mgr;
角色已删除。
SQL> drop role hr_clerk;
角色已删除。
SQL> create role hr_mgr;
角色已创建。
SQL> create role hr_clerk;
角色已创建。
SQL> --create session, create table
SQL> --把权限授予给角色
SQL> grant create session to hr_clerk;
授权成功。
SQL> grant create table,hr_clerk to hr_mgr;
授权成功。
SQL> --把角色授予个用户
SQL> grant hr_clerk to jeff;
授权成功。
SQL> grant hr_mgr to emi;
授权成功。
SQL> /*
SQL> create user myuser identified by password;
SQL> grant connect,resource to myuser;
SQL> 创建用户
SQL> */
SQL> spool off
相关文章推荐
- 用户管理系统面向对象的实现
- 用户管理-安全问答-FAQ(1)
- MySQL用户管理
- UNIX用户管理
- 公司文件服务器管理,让用户快速找到需要的文件。
- Linux的用户和用户组管理
- Linux 管理员手册(7)--管理用户帐户
- 用户管理模块开始 2004-08-02
- 用户管理完成 2004-08-05
- Pb中多用户权限管理实现方案
- W2K用户管理--活动目录实例
- 专题:Windows 到 Linux 之旅:第 4 部分. 用户管理
- 统一用户及权限管理系统
- 蛙蛙推荐:偶做的用户管理系统
- 用户认证及管理(完全版)
- QuicklyBuildModel/UserManage.aspx[快速类建模型后台用户管理页面代码]
- NIS的使用及系统用户管理备忘(LINUX)
- ORACLE数据库对象与用户管理
- MySQL用户管理
- CVSNT用户管理方案