八个学习点帮助你全面认识Oracle数据库分享


TableSpace

     表空间: 一个表空间对应多个数据文件(物理的dbf文件) 用语法方式创建tablespace,用sysdba登陆: –创建表空间mytabs,大小为10MB:

create tablespace mytabs datafile
‘C:oracleoradatamydbmytabs1.dbf’ size 10M;
alter user zgl default tablespace mytabs;
–把tabs做为zgl的默认表空间。
grant unlimited tablespace to zgl;
                              –将操作表空间的权限给zgl。

Exception 示例:
create or replace procedure
pro_test_exception(vid in varchar2) is
userName varchar2(30);
begin
select name into userName from t_user where id=vid;
dbms_output.put_line(userName);
exception
when no_data_found then
dbms_output.put_line(‘没有查到数据!’);
when too_many_rows then
dbms_output.put_line(‘返回了多行数据!’);
                              end pro_test_exception;

安全管理

    以下语句以sysdba登陆: 用户授权: alter user zgl account lock;–锁定帐号。 alter user zgl identified by zgl11;–修改用户密码。 alter user zgl account unlock;–解除帐号锁定。 alter user zgl default tablespace tt;–修改用户zgl的默认表空间为tt。 create user qqq identified by qqq123 default tablespace tt;–创建用户。

 grant connect to qqq;–给qqq授予connect权限。 grant execute on zgl.proc01 to test;–将过程zgl.proc01授予用户test。 grant create user to zgl;–给zgl授予创建用户的权限。 revoke create user from zgl;–解除zgl创建用户的权限。

角色授权: create role myrole;–创建角色myrole grant connect to myrole;–给myrole授予connect权限 grant select on zgl.t_user to myrole;–把查询zgl.t_user的权限授予myrole grant myrole to test;–把角色myrole授予test用户

 概要文件(配置文件): 全局设置,可以在概要文件中设置登陆次数,如超过这次数就锁定用户。

 

—-想了解更多的数据库相关异常处理怎么解决关注<计算机技术网(www.ctvol.com)!!>

www.ctvol.com true Article 八个学习点帮助你全面认识Oracle数据库分享

本文来自网络收集,不代表计算机技术网立场,如涉及侵权请联系管理员删除。

ctvol管理联系方式QQ:251552304

本文章地址:https://www.ctvol.com/dtteaching/79687.html

(0)
上一篇 2020年4月16日 上午11:54
下一篇 2020年4月16日 上午11:56

精彩推荐