Type Privileges

Type Privileges
如果想使用type(定义表列类型,基于type定义其它类型,定义变量或参数)就必须有execute权限:
如当前有三个用户user1, user2, user3
1)user1定义了type:
CREATE TYPE type1 AS OBJECT ( attr1 NUMBER);
CREATE TYPE type2 AS OBJECT ( attr2 NUMBER);

2)user2授予了type1的execute, 授予了type2的execute with grant option:
GRANT EXECUTE ON type1 TO user2;
GRANT EXECUTE ON type2 TO user2 WITH GRANT OPTION;

3) 在user2下使用没问题:
CREATE TABLE tab1 OF user1.type1;
CREATE TYPE type3 AS OBJECT (attr3 user1.type2);
CREATE TABLE tab2 ( col1 user1.type2);

4)user2下可以正常授予包含type3对象:
GRANT EXECUTE ON type3 TO user3;
GRANT SELECT ON tab2 TO user3;

5)但不能授予type2相关对象:
GRANT SELECT ON tab1 TO user3;

Type Dependencies
如果对象正在使用type,你对type的任何更改将导致对象invaild, 且无法访问(更改包括权限收回,drop type)
Because a table contains data that relies on the type definition for access, any change to the type causes all stored data to become inaccessible. 
Changes that can cause this are when necessary privileges required to use the type are revoked, or the type or dependent types are dropped. 
If these actions occur, then the table becomes invalid and cannot be accessed.
如果是权限被收回,则重新授予重新访问表;但如果type被drop则表再也不能访问了,只能drop table
A table that is invalid because of missing privileges can automatically become valid and accessible if the required privileges are granted again. 
A table that is invalid because a dependent type was dropped can never be accessed again, and the only permissible action is to drop the table.
因此在drop type或revoke时有对象在使用,将会报错;但如果使用了force子句,则会成功
This means that if the named type in either statement has table or type dependents, then an error is received and the statement cancels. 
However, if the FORCE clause for either statement is used, then the statement always succeeds. 
 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值