添加用户(随着用户的创建,自动产生与用户同名的schema)
CREATE USER "TESTER" PROFILE "DEFAULT" IDENTIFIED BY "TESTER" DEFAULT TABLESPACE "TESTDATA" TEMPORARY TABLESPACE "TESTTEMP" ACCOUNT UNLOCK;
赋权(说实话,这些权限是开发中使用的权限,如果用户生产环境,请自行对于用户创建相应的系统权限)
据说生产环境下,只是connect resource这样的角色就可以了。
GRANT "CONNECT" TO "TESTER";
GRANT "RESOURCE" TO "TESTER";
GRANT "DBA" TO "TESTER";
GRANT "EXP_FULL_DATABASE" TO "TESTER";
GRANT "IMP_FULL_DATABASE" TO "TESTER";
删除用户:例如创建了一个用户 A,要删除它可以这样做
connect sys/密码 as sysdba;
drop user A cascade;//就这样用户就被删除了
用户修改密码,解锁
ALTER USER "SCOTT" IDENTIFIED BY "*******"
ALTER USER "SCOTT" ACCOUNT UNLOCK
1.查看所有用户:
select * from dba_user;
select * from all_users;
select * from user_users;
2.查看用户系统权限:
select * from dba_sys_privs;
select * from all_sys_privs;
select * from user_sys_privs;
3.查看用户对象权限:
select * from dba_tab_privs;
select * from all_tab_privs;
select * from user_tab_privs;
4.查看所有角色:
select * from dba_roles;
5.查看用户所拥有的角色:
select * from dba_role_privs;
select * from user_role_privs;