본문 바로가기
  • 노란색 세상은 어디에 있을까?
  • 봄이 오면 여기에 있겠지.
  • 잠시나마 유유자적 하겠네.
오라클/사용자

[ BSYS] 오라클 사용자를 생성합니다.

by 태백성 2024. 4. 4.

 

BSYS 사용자를 생성합니다.

 

-- ------------------------------------------------------------------------------------------------
-- 사용자 접속
system/****@vis1229;
-- ------------------------------------------------------------------------------------------------
show user;
set trimspool on;
set timing on;
set heading on;
set linesize 205;

set pagesize 20;


-- ------------------------------------------------------------------------------------------------
-- bsys 사용자 생성(APEX에서 생성하여 Skip)
-- ------------------------------------------------------------------------------------------------
drop   user bsys cascade;
create user bsys identified by "****"
default tablespace bdb_data
temporary tablespace temp
profile default
quota unlimited on bdb_data
quota unlimited on bdb_idx;

 

-- 뷰 권한
grant select on sys.all_col_comments to bsys;
grant select on sys.all_constraints  to bsys;
grant select on sys.all_cons_columns to bsys;
grant select on sys.all_objects      to bsys;
grant select on sys.all_tables       to bsys;
grant select on sys.all_tab_cols     to bsys;
grant select on sys.all_tab_columns  to bsys;
grant select on sys.all_users        to bsys;

 

-- 롤권한
grant connect  to bsys;
grant dba      to bsys;
grant resource to bsys;

 

-- 시스템 권한
grant create cluster                 to bsys with admin option;
grant create dimension               to bsys with admin option;
grant create indextype               to bsys with admin option;
grant create job                     to bsys with admin option;
grant create materialized view       to bsys with admin option;
grant create operator                to bsys with admin option;
grant create procedure               to bsys with admin option;
grant create sequence                to bsys with admin option;
grant create session                 to bsys with admin option;
grant create synonym                 to bsys with admin option;
grant create table                   to bsys with admin option;
grant create trigger                 to bsys with admin option;
grant create type                    to bsys with admin option;
grant create view                    to bsys with admin option;
grant unlimited tablespace           to bsys;

 

-- ------------------------------------------------------------------------------------------------
-- 사용자 조회
-- ------------------------------------------------------------------------------------------------
select *
  from dba_users du
 where 1=1
   and du.account_status     = 'OPEN'
   and du.default_tablespace = upper('bdb_data')
;

 

-- 사용자 커넥션 확인 및 종료
-- select sid, serial#, username,status from v$session where username = 'XHR';
-- alter system kill session '502, 12289';
-- alter system kill session '751, 58037';