---用户登陆命令
--管理员登陆
conn sys/oracle as sysdba;
--建立用户方案必须是管理员权限
--建立用户命令 create user useranme identifild by password
create user god identified by g123;
--管理员受权 系统 权限 grant ..to...
grant connect,resource,dba to god;
--管理员受权 对象 权限
grant xx on tablename to username;
--取消受权---
revoke xx from username;
revoke xx on tablename from username;
---权限传递
--1 with admin option 系统权限传递
--管理员给予zhangsan connect,resource 的权限的同时,zhangsna 能够授予其余用户
grant connect,resource to zhangsan with admin option;
--2 with grant option 对象权限传递
grant select on scott.emp to zhangsan with grant option;
--god登陆
--建立表
create table student( sid int,sname varchar2(30));
--解锁---
--scott方案默认是被锁定
--管理员才有权限解锁,锁定
alter user scott account unlock;
alter user scott account lock;oracle
---举例
--建立2个用户方案,A zhangsan/z123 ,B lisi/l123
--给A受权 connect,resouce权限
--在A方案下面建立一张student表
--经过A授予B connect权限
create user zhangsan identified by z123;
create user lisi identified by l123;
grant connect,resource to zhangsan;ide
---删除用户
drop user username
drop user lisi;
--级联删除
drop user username cascade; 对象
---建立规则
create profile 规则名称 limit failed_login_attempts 次数 password_lock_time 天数
create profile pwdlock limit failed_login_attempts 3 password_life_time 1000;
--建立用户
create user zhangsan identified by z123;
--给登陆权限
grant connect to zhangsan;
--给规则
alter user zhangsan profile pwdlock;
---若是输入3次密码错误就会锁定 须要解锁
alter user zhangsan account unlock;it