Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

oracle Óû§¹ÜÀí

ϵͳȨÏÞ£º »ØÊÕʱ²»»á²úÉú¼¶Áª»ØÊÕ
conn / as sysdba;
create user t1 identified by t1;
create user t2 identified by t2;
grant connect to t1,t2;
grant create table, create view to t1 with admin option;
conn t1/t1
grant create table to t2;
conn / as sysdba;
select * from dba_sys_privs where grantee in('T1', 'T2');
GRANTEE PRIVILEGE ADM
------------------------------ ---------------------------------------- ---
T1 CREATE TABLE YES
T1 CREATE VIEW YES
T2 CREATE TABLE NO
with admin option ¿Éʹ±»ÊÚÓèȨÏÞÕßÓÐȨתÊÚÆäËûÈË¡£
revoke create table, create view from t1;
select * from dba_sys_privs where grantee in('T1', 'T2');
GRANTEE PRIVILEGE ADM
------------------------------ ---------------------------------------- ---
T2 CREATE TABLE NO
²»»á¼¶ÁªÉ¾³ýÒѾ­ÊÚÓèµÄϵͳȨÏÞ¡£
    
¶ÔÏóȨÏÞ£º¼¶Áª»ØÊÕËùÓÐȨÏÞ
conn test/test
grant select on t to t1 with grant option;
conn t1/t1
grant select on test.t to t2;
conn test/test
select * from dba_tab_privs where grantee in('T1', 'T2');
GRANTEE OWNER TABLE_NAME GRANTOR PRIVILEGE
------------------------------ ------------------------------ ------------------------------ ------- --------------------------------
T2 TEST T T1 SELECT
T1 TEST T TEST SELECT
revoke select on t from t1;
select * from dba_tab_privs where grantee in('T1', 'T2');
SQL> select * from dba_tab_privs where grantee in('T1', 'T2');
¡¡¡¡
¼¶ÁªÉ¾³ýÒѾ­ÊÚÓèµÄ¶ÔÏóȨÏÞ¡£
½ÇɫȨÏÞ£º¼¶Áª»ØÊÕËùÓÐȨÏÞ
create role ttt;
grant create table, create user, create session to ttt with admin option;
grant select on test.t to ttt with grant option;
SQL> grant select on test.t to ttt with grant option;
grant select on test.t to ttt with grant option
ORA-01926:
 
ÎÞ·¨Ê¹ÓÃwith grant optionÑ¡Ïî¸ø½ÇÉ«ÊÚȨ¡£
grant select on test.t to ttt;
create user d identified by d;
create user e identified by e;
grant ttt to d with admin option;
conn d/d
grant ttt to e;
select * from test.t;
SQL> select * from test.t;
conn / as


Ïà¹ØÎĵµ£º

PostgreSQLºÍOracleÓ÷¨ÉϵÄÒ»Ð©Çø±ð

£¨1 £© ×¢ÒâÔö¼ÓÔ¼ÊøÊ±µÄд·¨£¬ºÍORACLE ÂÔÓв»Í¬
Oracle £º
ALTER TABLE SCHEMA.PREFIX_INFO ADD (
CONSTRAINT PK_PREFIX_INFO PRIMARY KEY (INFO_ID));
PostgresQL £º
alter table schema.prefix_info add constraint prefix_info_pkey primary key(info_id);
£¨2 £©ÏµÍ³Ä¬ÈϵÄ×î´óÖµÓëORACLE ²»Í¬
Oracle £ ......

OracleÖÐstart with¡­connect by prior×Ó¾äÓ÷¨

OracleÖÐstart with…connect by prior×Ó¾äÓ÷¨
connect by Êǽṹ»¯²éѯÖÐÓõ½µÄ£¬Æä»ù±¾Óï·¨ÊÇ£º
select … from tablename
start with Ìõ¼þ1
connect by Ìõ¼þ2
where Ìõ¼þ3;
Àý£º
select * from table
start with org_id = ‘HBHqfWGWPy’
connect by prior org_id = parent_id;
  ......

ORACLEÈçºÎÍ£Ö¹Ò»¸öJOB

ORACLEÈçºÎÍ£Ö¹Ò»¸öJOB
1 Ïà¹Ø±í¡¢ÊÓͼ
2 ÎÊÌâÃèÊö
Ϊͬʽâ¾öÒ»¸öÒòÎªÍøÂçÁ¬½ÓÇé¿ö²»¼Ñʱ£¬Ö´ÐÐÒ»¸ö³¬³¤Ê±¼äµÄSQL²åÈë²Ù×÷¡£
¼ÈÈ»ÍøÂç×´¿ö²»ºÃ£¬¾ÍÑ¡ÔñÁËʹÓÃÒ»´ÎÐÔʹÓÃJOBÀ´Íê³É¸Ã²åÈë²Ù×÷¡£ÔÚJOBÖ´ÐÐÒ»¶Îʱ¼äºó£¬ÎÒ·¢ÏÖ±»²åÈë±íÓÐЩÎÊÌ⣨²ÑÀ¢£¬µ±Ê±Ò²Ã»ÓÐÏȼì²é¼ì²é¾Í×öÁË£©¡£×¼±¸Í£Ö¹JOB£¬ÒòΪÔÚJOBÔËÐÐÇé¿öÏ£¬ÎÒ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ