뷰를 생성하기위해서는 create view 권한이 필요하다.
자신의 스키마가 아닌 다른 스키마에 뷰를 생성하기 위해서는 create any view 권한이 필요하다.
1. grant create view
2. view vs any view
=== 1. grant create view ====
create user USER_A identified by "q1w2e3r4";
grant resource to USER_A;
grant connect to USER_A;
exit
sqlplus USER_A/q1w2e3r4
create table USER_A.test_tab(a int);
Table created.
create or replace view USER_A.vw_a
as
select '1' a
from USER_A.test_tab
;
ORA-01031: insufficient privileges
exit
sqlplus / as sysdba
grant create view to USER_A;
exit
sqlplus USER_A/q1w2e3r4
create or replace view USER_A.vw_a
as
select '1' a
from USER_A.test_tab
;
View created.
exit
=== 2. grant create any view ====
sqlplus / as sysdba
create user USER_B identified by "q1w2e3r4";
grant resource to USER_B;
grant connect to USER_B;
grant create view to USER_B;
grant select on USER_A.test_tab to USER_B;
exit
sqlplus USER_B/q1w2e3r4
create or replace view USER_B.vw_a
as
select '1' a
from USER_A.test_tab
;
View created.
exit
sqlplus USER_A/q1w2e3r4
create or replace view USER_B.vw_a2
as
select '1' a
from USER_A.test_tab
;
ORA-01031: insufficient privileges
exit
sqlplus / as sysdba
grant create any view to USER_A;
create or replace view USER_B.vw_a2
as
select '1' a
from USER_A.test_tab
;
View created.
drop user USER_A cascade;
drop user USER_B cascade;
=== 3. 뷰 권한 확인 ====
select * from dba_sys_privs where grantee like 'USER%';
'생계 > Oracle' 카테고리의 다른 글
oracle 19c 설치 virtual box 오라클리눅스 (0) | 2021.09.15 |
---|---|
오라클 라이선스 lifetime support (0) | 2021.08.26 |
ORA-00942 에러 role 에 부여된 권한 (0) | 2020.06.09 |
DB를 사용한 채번 방식 알아보자 (0) | 2020.04.30 |
오라클 로그인 특수문자 입력 (0) | 2020.01.30 |