oracle如何创建只读用户只读另一用户的表&PLSQL 连接字符串

标红位置改为自己相应的,该例子为创建 READUSER只读USER的表

CREATE USER READUSER IDENTIFIED BY123;

GRANT CONNECT TO READUSER;


执行如下命令

select 'grant select on '||owner||'.'||object_name||' toUSER;'
from dba_objects
where owner = 'READUSER'
and object_type='TABLE';


会有如下结果,复制 如下7(n)行执行即可

'GRANTSELECTON'||OWNER||'.'||OBJECT_NAME||'TOREADUSER;'
--------------------------------------------------------------------------------
grant select on USER.VISIT_SYSTEM_INFO to READUSER;
grant select on USER.VISIT_TIME_DIC to READUSER;

grant select on USER.VISIT_TOTAL to READUSER;
grant select on USER.VISIT_TOTAL_CHANNEL to READUSER;
grant select on USER.VISIT_TOTAL_NEWS to READUSER;
grant select on USER.WORDS_HOT_CATEGORY to READUSER;
grant select on USER.WORDS_SENSITIVE_CATEGORY to READUSER;

7 rows selected.

PLSQL 连接字符串


你可能感兴趣的:(oracle)