99
DB2 Business Partner Technical Enablement DB2 Admin Workshop | Confidential © 2006 IBM Corporation. DB2 Admin Workshop © 2007 International Business Machines Corporation. All rights reserved.

Business Unit or Product Name

  • Upload
    tess98

  • View
    1.088

  • Download
    6

Embed Size (px)

DESCRIPTION

 

Citation preview

Page 1: Business Unit or Product Name

DB2 Business Partner Technical Enablement

DB2 Admin Workshop | Confidential © 2006 IBM Corporation.

DB2 Admin Workshop

© 2007 International Business Machines Corporation. All rights reserved.

Page 2: Business Unit or Product Name

Business Unit or Product Name

© 2006 IBM Corporation.2

목차 (Agenda)

DB2 UDB 제품 군

DB2 시작과 제어센터 사용 (GUIs)

Instance

Database

Table Spaces

Objects

Security

Page 3: Business Unit or Product Name

Business Unit or Product Name

© 2006 IBM Corporation.3

DB2 UDB 제품 군

Page 4: Business Unit or Product Name

Business Unit or Product Name

© 2006 IBM Corporation.4

DB2 Product Family

DB2 UDBEveryplace

WinCE, Win32PalmOS, QNXLinux, Embedded LinuxCellvic, SymbianJ2ME

Personal Edition

DB2 UDB Personal Edition (PE)WindowsLinux

DB2 UDBWorkgroup Server Edition (WSE)WindowsLinuxAIXHP-UXSolaris

DB2 UDBEnterprise Server Edition (ESE)WindowsLinuxAIXHP-UXSolaris

DB2 UDB for OS/390DB2 for VM, VSE & MVSDB2 UDB for AS/400

HOST

DRDA ( DB2 Connect )

Personal Edition

DB2 UDBExpress-CWindowsLinux

Page 5: Business Unit or Product Name

Business Unit or Product Name

© 2006 IBM Corporation.5

DB2 UDB 시작과 제어센터 사용 (GUIs)

Page 6: Business Unit or Product Name

Business Unit or Product Name

© 2006 IBM Corporation.6

메뉴의 종류

Page 7: Business Unit or Product Name

Business Unit or Product Name

© 2006 IBM Corporation.7

제어 센터 (db2cc)Menu bar

Tool bar

Contentspane tool

bar

Control

Center

ReplicationCenter

SatelliteAdminCenter

Command

Center

TaskCenter

HealthCenter

JournalDevelopme

ntCenter

LicenseCenter

ConfigurationAdvisor

ToolsSettings

Help

Show/HideLegend

Page 8: Business Unit or Product Name

Business Unit or Product Name

© 2006 IBM Corporation.8

제어 센터 (db2cc) - DBM 구성

Page 9: Business Unit or Product Name

Business Unit or Product Name

© 2006 IBM Corporation.9

제어 센터 (db2cc) - DB 구성

Page 10: Business Unit or Product Name

Business Unit or Product Name

© 2006 IBM Corporation.10

개발 센터 (db2dc)

Page 11: Business Unit or Product Name

Business Unit or Product Name

© 2006 IBM Corporation.11

명령 편집기 (db2cmdctr)

① ①

Page 12: Business Unit or Product Name

Business Unit or Product Name

© 2006 IBM Corporation.12

명령 창 / 명령행 처리기

non-interactive mode ( 명령 창 )

db2 connect to sample

db2 “select * from syscat.tables” | more

interactive mode ( 명령행 처리기 )

db2

db2=> connect to sample

db2=> select * from syscat.tables

Page 13: Business Unit or Product Name

Business Unit or Product Name

© 2006 IBM Corporation.13

정보 센터

Page 14: Business Unit or Product Name

Business Unit or Product Name

© 2006 IBM Corporation.14

Instance

Page 15: Business Unit or Product Name

Business Unit or Product Name

© 2006 IBM Corporation.15

Instance 란 ?

CATALOG

LOG

CATALOG

LOG

JOIN

CATALOG

LOG

CATALOG

LOG

DBM CONFIG FILE_1 DBM CONFIG FILE_2

DB_3

DB_4

DBCONFIGFILE_3

DBCONFIGFILE_4

DB2 Product

INSTANCE_1

DB_1DBCONFIGFILE_1

DB_2

INSTANCE_2

DBCONFIGFILE_2

Page 16: Business Unit or Product Name

Business Unit or Product Name

© 2006 IBM Corporation.16

The Database Manager Instance

Table 1 Table 2 Table 3Table 4

Node(a computer)

Database ManagerInst1

database 1

Tablespace ATablespace B

Local User Application

PATH=...

DB2INSTANCE=inst1

connect to

Database Managerinst2

database 1 database 2

Page 17: Business Unit or Product Name

Business Unit or Product Name

© 2006 IBM Corporation.17

Instance Administrator

db2icrt

db2ilist

db2idrop

Page 18: Business Unit or Product Name

Business Unit or Product Name

© 2006 IBM Corporation.18

관리 서버 (DAS) Administration Server 생성

dascrt –u <DASUser>

db2admin create Administration Server 제거

dasdrop

db2admin drop Administration Server 의 시작 및 중지

db2admin start

db2admin stop Administration Server 나열

db2admin

db2set –g DB2ADMINSERVER DAS 의 Configuration File

db2 get admin cfg (Display)

db2 update admin cfg using (Update the parameters)

Page 19: Business Unit or Product Name

Business Unit or Product Name

© 2006 IBM Corporation.19

DB2 UDB 환경OS

Location of DB2 Environment Variables

Windows NT

[ 시작 ]-[ 설정 ]-[ 제어판 ]-[ 시스템 ] 에 위치하여DB2 환경변수를 setting 한다 .

UNIX Unix System 에 따라 차이가 있지만 db2profile 이라는 Script file (Bourne or Korn shell), or db2cshrc(C shell) 에 시스템 환경변수를 setting 한다 .

Page 20: Business Unit or Product Name

Business Unit or Product Name

© 2006 IBM Corporation.20

DB2 Profile Registry

EnvironmentVariables

PlatformSpecific

Windows 95 and Windows NTUNIXWindows 3.1OS/2

Instance-LevelRegistryProfile

Global-LevelRegistryProfile

IntelAdvantage

No restartof system

after changing!

Use db2set command to changeMust stop/restartinstance

Must re-initializeenvironment afterchanging

1

2

3

Page 21: Business Unit or Product Name

Business Unit or Product Name

© 2006 IBM Corporation.21

db2set 명령어

db2setvariable=value -g-i instance [node number]-n DAS node [[-u user id] [-p password]]-r-l-lr-v-? (or -h)-all-null

Page 22: Business Unit or Product Name

Business Unit or Product Name

© 2006 IBM Corporation.22

Database

Page 23: Business Unit or Product Name

Business Unit or Product Name

© 2006 IBM Corporation.23

DB2 아키텍처

Page 24: Business Unit or Product Name

Business Unit or Product Name

© 2006 IBM Corporation.24

DB2 프로세스 모델

Page 25: Business Unit or Product Name

Business Unit or Product Name

© 2006 IBM Corporation.25

데이터베이스 구성도INSTANCE

Catalog Tables

DataBase configuration fileLog

Tables

Tablespace

Indexes Indexes

Tablespace

Container Container ContainerContainer

Database 1 Database 2 ….

Primary KeyForeign KeyAliasViewTriggerCheck Constraint

DataBase Manager configuration file Instance ……

Tables

Tablespace Tablespace

Page 26: Business Unit or Product Name

Business Unit or Product Name

© 2006 IBM Corporation.26

데이터베이스 , 테이블 스페이스와 테이블

Table 1Table 4

Table 2 Table 3 Table 1 Table 2

Database Manager Instance

database1

Tablespace ATablespace

B

database2

Tablespace A

Page 27: Business Unit or Product Name

Business Unit or Product Name

© 2006 IBM Corporation.27

데이터베이스 작성 문법 1/3CREATE DATABASE

DB

database-name

Create Database Options

AT DBPARTITIONNUM

Create Database options:

ON path

drive

ALIAS database-alias

USING CODESET territorycodeset TERRITORY

COLLATE USING

SYSTEM

COMPATIBILITY

IDENTITY

numsegsNUMSEGS

NLSCHAR

tblspace-defn

DEF_EXTENT_SZ CATALOG TABLESPACE tblspace-defndft-extentsize

Page 28: Business Unit or Product Name

Business Unit or Product Name

© 2006 IBM Corporation.28

데이터베이스 작성 문법 – 계속 2/3

USER TABLESPACE tblspace-defn

TEMPORARY TABLESPACE tblspace-defn WITH“comment-

string”

AUTOCONFIGURE USING input-keyword--param-value

APPLY

DB ONLY

DB AND DBM

NONE

Page 29: Business Unit or Product Name

Business Unit or Product Name

© 2006 IBM Corporation.29

데이터베이스 작성 문법 – 계속 3/3tblspace-defn:

MANAGED BY

)

DATABASE USING

SYSTEM USING ‘container-string’ )(

,

FILE

DEVICE

(

‘container-string’

number-of-pages

EXTENTSIZE number-of-pages PREFETCHSIZE number-of-pages

number-of-millisecondOVERHEA

D number-of-millisecondTRANSFERRATE

Page 30: Business Unit or Product Name

Business Unit or Product Name

© 2006 IBM Corporation.30

데이터베이스 생성 예제CREATE DB MYDB;

or

CREATE DB MYDB ON D:

or

CREATE DB MYDB CATALOG TABLESPACE MANAGED BY SYSTEM USING (C:\MYDB\CATALOG)TEMPORARY TABLESPACE MANAGED BY SYSTEM USING (C:\MYDB\TEMP)USER TABLESPACE MANAGED BY DATABASE USING (FILE ‘C:\MYDB\DMS\USER.TS’ 10M);

Page 31: Business Unit or Product Name

Business Unit or Product Name

© 2006 IBM Corporation.31

데이터베이스 기본 구성ON path/drive

SQL00001

SQL0000.0

SQL0001.0

SQL0002.0

SYSCATSPACE

TEMPSPACE1

USERSPACE1

NODE0000

Instance name

Page 32: Business Unit or Product Name

Business Unit or Product Name

© 2006 IBM Corporation.32

Managing Initialization Overhead

db2 activate database < dbalias > db2 deactivate database < dbalias >

Versus

first connect to activate database last disconnect to deactivate database

Page 33: Business Unit or Product Name

Business Unit or Product Name

© 2006 IBM Corporation.33

DB2 디렉토리Connect to Local DB

Connect toRemote DB

SPCRemoteDB2R_DB

indirectDB1L_DB

PointerNodeTYPEDB NameDB Alias

C:\간접DB1L_DB

LocationTYPEDB NameDB Alias

50000…SPC

PortIPNode

System DB Directory

Local DB Directory

Node Directory

DB1(Local)

DB2(Remote)

Page 34: Business Unit or Product Name

Business Unit or Product Name

© 2006 IBM Corporation.34

DB2 디렉토리 예제

C:\>db2 list db directory

시스템 데이터베이스 디렉토리

디렉토리의 항목 수 = 1

데이터베이스 1 항목 :

데이터베이스 별명 = SAMPLE데이터베이스 이름 = SAMPLE데이터베이스 드라이브 = C:\DB2데이터베이스 릴리스 레벨 = a.00주석 =디렉토리 항목 유형 = 간접카탈로그 데이터베이스파티션 번호 = 0

데이터베이스 2 항목 :

데이터베이스 별명 = RSAMPLE 데이터베이스 이름 = SAMPLE 노드 이름 = TESTSVR 데이터베이스 릴리스 레벨 = a.00 주석 = 디렉토리 항목 유형 = 리모트 카탈로그 데이터베이스 파티션 번호 = -1

C:\>db2 list db directory on C:

C: 의 지역 데이터베이스 디렉토리

디렉토리의 항목 수 = 1

데이터베이스 1 항목 :

데이터베이스 별명 = SAMPLE데이터베이스 이름 = SAMPLE데이터베이스 드라이브 = SQL00001데이터베이스 릴리스 레벨 = a.00주석 =디렉토리 항목 유형 = 홈카탈로그 데이터베이스 파티션 번호 = 0데이터베이스 파티션 번호 = 0

System Database Directory Local Database Directory

Page 35: Business Unit or Product Name

Business Unit or Product Name

© 2006 IBM Corporation.35

DB CatalogCatalog Database

Catalog Node

Uncatalog DB/Node

UNCATALOG DB

NODE

Database-name

Node-name

CATALOG DatabaseDB

Database-name

As alias on-path/drive

At-NodeName

ADMINTCPIP NODE NodeName REMOTE hostnameCATALOG

SERVER Service-name

REMOTE_INSTANCE-instance-name

SECURITY-socks

Page 36: Business Unit or Product Name

Business Unit or Product Name

© 2006 IBM Corporation.36

카타로그 정의 예제 catalog tcpip node ibmsvr remote 203.231.14.48 server

50000

catalog db sample as rsample at node ibmsvr

connect to rsample user db2inst1 using db2inst1

uncatalog node ibmsvr

uncatalog db rsample

Page 37: Business Unit or Product Name

Business Unit or Product Name

© 2006 IBM Corporation.37

Table Spaces

Page 38: Business Unit or Product Name

Business Unit or Product Name

© 2006 IBM Corporation.38

테이블 스페이스와 컨테이너 테이블 공간

– 데이블들을 저장하는 장소

– 하나이상의 물리적인 저장 디바이스로 나누어질 수 있다

– 테이블 공간 타입 컨테이너

– 데이터가 실제적으로 저장되는 물리적 저장장치

– 단일 테이블 공간은 여러 컨테이너에 걸쳐 있을 수 있지만 , 각 컨테이너는 하나의 테이블 공간에만 속할 수 있다 .

– SMS 일 경우 , 컨테이너는 디렉토리이다 .

– DMS 일 경우 , 컨테이너는 파일이나 디바이스이다 .

Page 39: Business Unit or Product Name

Business Unit or Product Name

© 2006 IBM Corporation.39

테이블 스페이스 타입 테이블 공간 타입

– Regular

– Large

– Temporary

테이블 데이터 타입– Regular

– Long

– Index

Page 40: Business Unit or Product Name

Business Unit or Product Name

© 2006 IBM Corporation.40

테이블 스페이스 작성 문법

IN

DATABASE PATITION GROUP

db-partition-group-name

TABLESPACE tablespace-nameCREATE LARGE

SYSTEM

USER

TEMPOARY

REGULAR

PAGESIZE

PAGESIZE

4096

Integer K

MANAGED BY

SYSTEM system-containers

DATABASE database-containers EXTENTSIZE number-of-pages

Integer K

M

G

Page 41: Business Unit or Product Name

Business Unit or Product Name

© 2006 IBM Corporation.41

테이블 스페이스 작성 문법 - 계속

OVERHEAD number-of-milliseconds

24.1

number-of-milliseconds

0.9

TRANSFERRATE

DROPPED TABLE RECOVERY

off

on

PREFETCHSIZE

Integer K

M

number-of-pages

G

BUFFERPOOL bufferpool-name

Page 42: Business Unit or Product Name

Business Unit or Product Name

© 2006 IBM Corporation.42

테이블 스페이스 작성 문법 - 계속system-containers:

database-containers:

container-clause:

on-db-partitions-clause:

on-db-partitions-clause

USING container-clause

,

USING

on-db-partitions-clause

‘container-string’ )(

Integer K

M

G

,

( FILE

DEVICE

‘container-string’ number-of-pages )

DBPARTITIONNUM

DBPARTITIONNUMS

(ON node-number1

node-number2TO

,

)

Page 43: Business Unit or Product Name

Business Unit or Product Name

© 2006 IBM Corporation.43

테이블 스페이스 작성 문법 – 예제 1 Creating SMS TablespacesUnix :

create tablespace SMSTBS managed by system using (‘/SMS/container1’, ’/SMS/container2’)prefetchsize 32

Intel :create tablespace SMSTBS managed by system using (‘C:\SMS\container1’, ’D:\SMS\container2’)prefetchsize 32

Creating DMS TablespacesUnix :

create tablespace DMSTBS managed by databaseusing (device ‘/dev/rdata1’ 1024, device ‘/dev/rdata2’ 1024) extent 32

Intel : create tablespace DMSTBS managed by database using (file ‘E:\DMS\container1’ 5M, file ‘F:\DMS\container2’ 5M,) extent 32

Page 44: Business Unit or Product Name

Business Unit or Product Name

© 2006 IBM Corporation.44

테이블 스페이스 작성 문법 – 예제 2connect to mydb;

create tablespace datatbsmanaged by databaseusing (file ‘C:\MYDB\datatbs1.ts’ 10M, file ‘C:\MYDB\datatbs2.ts’ 10M);

create tablespace indextbsmanaged by databaseusing (file ‘C:\MYDB\indextbs.ts’ 5M);

create large tablespace longtbsmanaged by databaseusing (file ‘C:\MYDB\longtbs1.ts’ 10M);

create table emp_photo (empno char(6) not null,photo_format varchar(10) not null,picture blob(150K) not logged compact)

in datatbsindex in indextbslong in longtbs;

Page 45: Business Unit or Product Name

Business Unit or Product Name

© 2006 IBM Corporation.45

Extent 크기

0 2

1 3

Container 0 Container 1

Extent

Tablespace B

1 Extent=32 Pages (* 4K)

(Default)

4K

Page 46: Business Unit or Product Name

Business Unit or Product Name

© 2006 IBM Corporation.46

테이블스페이스의 생성시 고려사항

Page 47: Business Unit or Product Name

Business Unit or Product Name

© 2006 IBM Corporation.47

SMS vs. DMSSMS DMS

제어 운영체제 Database Manager

컨테이너 디렉토리 파일 혹은 Raw device

공간할당 추가 공간이 요구되어질 때마다 한 page씩 할당

공간이 미리 할당되며 하나의 Extent 안에 있는 공간은 물리적으로 연속적

테이블위치 한 테이블은 한 테이블 공간에 존재해야 한다 .

하나의 테이블은 여러 개의 테이블공간으로 나뉠 수 있다 .

크기를 증가시키는 법 Redirect restore~ 이용

Alter tablespace 문으로 Add container resize extend

크기를 줄이는 법 Redirect restore~ 이용

Alter tablespace 문으로 Drop container Reduce

장점요구되어질 때 시스템에 의해 공간이 할당데이터베이스를 생성할 때 초기 작업이 줄어든다

컨테이너를 추가함으로써 테이블 공간이 증가데이터 타입에 따라 테이블을 여러 테이블공간으로 분리할 수 있다 .

적절한 business

작은 개인용 데이터베이스 용으로 Temporary 테이블 공간 용으로 크고 점점 커지는 데이터베이스용으로

Page 48: Business Unit or Product Name

Business Unit or Product Name

© 2006 IBM Corporation.48

SMS Physical Files파일이름 설 명

SQLTAG.NAM데이터베이스가 완전하고 일치하는지 검증하기 위해 사용자가 데이터베이스에 연결할 때 DBM 에 의해 이용

SQLxxxxx.DATLONG VARCHAR, LONG VARGRAPHIC, LOB 데이터를 제외한 모든 데이터가 저장된다 .

SQLxxxxx.LF LONG VARCHAR, LONG VARGRAPHIC 을 포함하는 파일

SQLxxxxx.LB BLOB, CLOB 또는 DBCLOB 데이터를 포함하는 파일

SQLxxxxx.LBA SQLxxxxx.LB 파일에 대한 공간 할당 및 여유 공간정보를 포함하는 파일

SQLxxxxx.INX 해당 테이블에 대한 모든 인덱스는 이 파일에 저장된다 .

Page 49: Business Unit or Product Name

Business Unit or Product Name

© 2006 IBM Corporation.49

테이블스페이스의 list 보기 db2 list tablespaces db2 list tablespaces show detail db2 list tablespace containers for x db2 list tablespace containers for x show detailC:\>db2 list tablespaces

현재 데이터베이스에 대한 테이블 스페이스

테이블 스페이스 ID = 0 이름 = SYSCATSPACE 유형 = 시스템 관리 스페이스 내용 = 임의의 데이터 상태 = 0x0000 세부사항 설명 : 정상

테이블 스페이스 ID = 1 이름 = TEMPSPACE1 유형 = 시스템 관리 스페이스 내용 = 시스템 임시 데이터 상태 = 0x0000 세부사항 설명 : 정상

Page 50: Business Unit or Product Name

Business Unit or Product Name

© 2006 IBM Corporation.50

ALTER TABLESPACE 문은 다음의 경우에 사용 : DMS table space 에 container 를 추가할 경우 DMS table space 에 container 를 삭제할 경우 DMS table space 의 container 의 크기를 변경할 경우 DMS table space 의 container 의 크기를 확장할 경우 DMS table space 의 container 의 크기를 축소할 경우

Table space 의 PREFETCHSIZE 값을 변경할 경우 Table space 의 OVERHEAD 값을 변경할 경우 Table space 의 TRANSFERRATE 값을 변경할 경우 Table space 의 BUFFERPOOL 값을 변경할 경우

Page 51: Business Unit or Product Name

Business Unit or Product Name

© 2006 IBM Corporation.51

ALTER 테이블 스페이스 작성 문법tablespace-nameALTER TABLESPACE

on-db-partitions-clause

system-container-clause

ADD database-container-clause

on-db-partitions-clause

DROPPED TABLE RECOVERY

EXTEND

RESIZE

all-containers-clause on-db-partitions-clause

ON

OFF

REDUCE

drop-container-clauseDROP

PREFETCHSIZE number-of-pages

Integer K,M,G

BUFFERPOOL bufferpool-name

OVERHEAD number-of-millisecond

TRANSFERRATE number-of-milliseconds

SWITCH ONLINE

Page 52: Business Unit or Product Name

Business Unit or Product Name

© 2006 IBM Corporation.52

테이블스페이스 변경 실습 컨테이너 추가

alter tablespace longtbs

add (file ‘C:\MYDB\longtbs2.ts’ 5M);

컨테이너 삭제alter tablespace datatbs

drop (file ‘C:\MYDB\datatbs2.ts’);

컨테이너 크기 증가alter tablespace indextbs

resize (file ‘C:\MYDB\indextbs.ts’ 10M);or

alter tablespace indextbs

extend (file ‘C:\MYDB\indextbs.ts’ 5M);

컨테이너 크기 감소alter tablespace longtbs

reduce (file ‘C:\MYDB\longtbs2.ts’ 5M);

Page 53: Business Unit or Product Name

Business Unit or Product Name

© 2006 IBM Corporation.53

테이블 공간 관리SYSCAT.TABLES

TBSPAIDTABLEIDTABNAME

SYSCAT.TABLESPACES

EXTENTSIZEDATATYPETBSPACETYPETBSPACEIDTBSPACE

S = SMSD = DMS

A = AllL = LongT = Temp

Page 54: Business Unit or Product Name

Business Unit or Product Name

© 2006 IBM Corporation.54

Bufferpool SYSCTRL or SYSADM authority

create bufferpool mybp1 size 1000

alter tablespace datatbs bufferpool mybp1

create bufferpool mybp2 size 1000 deferred

IMMEDIATE

DEFERRED

bufferpool-nameCreate Bufferpool size Number of page

Page 55: Business Unit or Product Name

Business Unit or Product Name

© 2006 IBM Corporation.55

QUIT vs. TERMINATE vs. CONNECT RESET

CLPCOMMAND

Terminate CLPBack-end Process

Disconnect databaseConnection

quit No No

terminate Yes Yes

connect reset NoYes if

CONNECT = 1(RUOW)

Page 56: Business Unit or Product Name

Business Unit or Product Name

© 2006 IBM Corporation.56

CLP 문법

db2-command

db2

option flag

sql-statement

?

phrase

message

sql-state

class-code

Page 57: Business Unit or Product Name

Business Unit or Product Name

© 2006 IBM Corporation.57

Objects

Page 58: Business Unit or Product Name

Business Unit or Product Name

© 2006 IBM Corporation.58

Objects 의 계층적 구조dbm configuration fileInstance 1

Database 2

Catalog

Log

DB configuration file

Catalog

Log

DB cfg file

Table1

Index1

BLOBs

Index1

Index2

Table2 Table3

View1

View2

View3

Database 1

Table2

View1

Page 59: Business Unit or Product Name

Business Unit or Product Name

© 2006 IBM Corporation.59

데이터베이스 디렉토리와 구조

[ SQLT0000.0 ]

[ DB2INSTANCE ]

[ sqldbdir ]

sqldbdir

SQLDBCON cfg fileSQLOGCTL.LFH log file controlSQLSPCS.1 tablespace에 관한 fileSQLSPCS.2 tablespace에 관한 fileSQLBP.1 bufferpool에 관한 fileSQLBP.2 bufferpool에 관한 file[ db2event ] monitoring의 output file이 들어가는 directorydb2rhist.asc recovery history를 가지는 filedb2rhist.bak[ SQLOGDIR ]

S0000000.LOGS0000001.LOG

SQLTAG.NAMSQL00030.DATSQL00030.INXSQL00030.LBSQL00030.LFSQL00030.LBA

[ SMS ]

SQLTAG.NAM

DMSLONG.TBS

...

. . . .

. . . .

. . .

DAT - data

INX - index

LF - LONG VARCHAR & LONG VARGRAPHIC

LB - LOBS

LBA - LOB allocation

[ SQL00001 ]

[ CONT1 ]

[ CONT2 ]SQLTAG.NAMSQL00041.DAT

[ DMS ]

[ NODE0000 ]

/path

. . . .

Page 60: Business Unit or Product Name

Business Unit or Product Name

© 2006 IBM Corporation.60

Schema Schema 의 정의

– 테이블 및 다른 데이터베이스 오브젝트들을 그룹화하도록 돕는 사용자 ID 와 같은 식별자

– 데이타베이스의 또 다른 오브젝트임 .

사용자에 의해 소유되고 데이터와 스키마 안에 있는 오브젝트에 대한 Access 를 제어할 수 있다 .

Object 의 이름 두 부분 중 앞부분의 이름 .예 ) db2admin.employee

default schema 는 오브젝트를 생성한 사용자의 USER ID 임 .

Page 61: Business Unit or Product Name

Business Unit or Product Name

© 2006 IBM Corporation.61

스키마 생성 Connect to database

SYSADM 또는 DBADM 의 권한이 필요하다 .

스키마 이름은 SYS 로 시작할 수 없다 .

Create schema Payroll authorization db2admin

Page 62: Business Unit or Product Name

Business Unit or Product Name

© 2006 IBM Corporation.62

System Catalog Tables 와 Views

SYSCAT

SYSSTAT

views

SYSIBM.SYSCOLUMNSSYSIBM.SYSTABLES

......

Page 63: Business Unit or Product Name

Business Unit or Product Name

© 2006 IBM Corporation.63

테이블

ALTER table 명 TABLE

CREATE table 명 TABLE ( )칼럼정의Primary constraintReferential constraintcheck constraint

DROP table 명 TABLE

COLUMN

Primary constraintReferential constraintcheck constraint

DROP PRIMARY KEY

FOREIGN KEYUNIQUECHECKCONSTRAINT

제한조건명

ADD 칼럼정의( )

IN 테이블공간명 INDEX IN 테이블공간명 LONG IN 테이블공간명

Constraint 절

CONSTRAINT 제한조건명

UNIQUEPRIMARYFOREIGN KEY

( 칼럼명 )

CHECK ( 점검조건 )

Page 64: Business Unit or Product Name

Business Unit or Product Name

© 2006 IBM Corporation.64

테이블 - 계속

페이지 컬럼 행 길이 테이블 크기

4KB 500 개 4005 바이트 64GB

8KB 1012 개 8101 바이트 128GB

16KB 1012 개 16293 바이트 256GB

32KB 1012 개 32677 바이트 512GB

DB2 UDB 는 4, 8, 16, 32 KB 크기의 페이지를 지원합니다 . 컬럼의 개수 , 행의 최대 크기 , 테이블의 최대 크기 등은 페이지의 크기에 따라 달라진다 .

테이블은 제어 센터나 CREATE TABLE 문을 통해 생성 .테이블 , 뷰 , 별명의 이름은 128 문자까지 . 컬럼의 이름은 30 문자까지 .

온라인 테이블 재구성테이블을 재 구성 하는 동안 응용프로그램이 테이블을 액세스할 수 있다 .유형 2 인덱스가 있고 , 확장 인덱스가 없는 테이블에만 허용된다 .

오프라인 테이블 재구성온라인 보다 테이블을 더 빨리 재 구성할 수 있다 .LOBS 와 LONG 데이터는 특별히 요청하지 않는 한 더 이상 재 구성 하지 않는다 .테이블이 재 구성 된 후 인덱스가 순서대로 대 구성 된다 .

Page 65: Business Unit or Product Name

Business Unit or Product Name

© 2006 IBM Corporation.65

테이블 생성 예제connect to mydb;

create table artists(artno smallint not null, name varchar(50) with default ‘abc’, Classfication char(1) not null, Bio clob(10K) not logged, Picture blob(10M) not logged compact)

in datatbsindex in indextbslong in longtbs;

Page 66: Business Unit or Product Name

Business Unit or Product Name

© 2006 IBM Corporation.66

인덱스

93

87

85

81

47

19

17

색인색인

KMP19

DJS87

CJP93

MLI81

FCP85

QRS17

ABC47

테이블 A테이블 A

AA

칼럼칼럼

행행

색인 및 테이블 사이의 관계색인 및 테이블 사이의 관계

Page 67: Business Unit or Product Name

Business Unit or Product Name

© 2006 IBM Corporation.67

인덱스 생성

CREATE index 명 INDEX

UNIQUE

ON

nickname

table 명

DESC

ASC

( ) ’ 칼럼명

SPECIFICATION ONLY

MINPCTUSED integer

DISALLOW REVERSE SCAN

ALLOW REVERSE SCAN

DROP index 명 INDEX

CLUSTER PCTFREE

PCTFREE 10

integerINCLUDE ’ 칼럼명

COLLECT STATISTICS

DETAILED

SAMPLED

Page 68: Business Unit or Product Name

Business Unit or Product Name

© 2006 IBM Corporation.68

View

CREATE view 명 VIEW ( )

’ 칼럼명

AS

DROP view 명 VIEW

fullselect

CONNECT TO MUSICDBCREATE VIEW EMPSALARY AS SELECT EMPNO, EMPNAME, SALARY FROM PAYROLL, PERSONNEL WHERE EMPNO=EMPNUMB AND SALARY > 30000.00

CONNECT TO MUSICDBCREATE VIEW EMPSALARY AS SELECT EMPNO, EMPNAME, SALARY FROM PAYROLL, PERSONNEL WHERE EMPNO=EMPNUMB AND SALARY > 30000.00

SELECT * FROM EMPSALARY

EMPNO EMPNAME SALARY------ ----------------- ----------

10 John Smith 1000000.00 20 Jane Johnson 300000.00

30 Robert Appleton 250000.00 ...

Page 69: Business Unit or Product Name

Business Unit or Product Name

© 2006 IBM Corporation.69

Alias

CREATE 별명

SYNONYM

ALIAS FOR 테이블명

뷰명

별명 2

DROP 별명 ALIAS

CONNECT TO MUSICDBCREATE ALIAS SINGERS FOR ARTISTSCREATE ALIAS DBUSER.ALBUMS FOR DB2INST1.ALBUMS

CONNECT TO MUSICDBCREATE ALIAS SINGERS FOR ARTISTSCREATE ALIAS DBUSER.ALBUMS FOR DB2INST1.ALBUMS

Page 70: Business Unit or Product Name

Business Unit or Product Name

© 2006 IBM Corporation.70

Constraints( 제한조건 ) 제한조건 (Constraints) 은 데이타베이스 관리 프로그램이 실행하는

규칙

제한 조건의 세가지 유형– Unique Constraint

한 테이블내의 하나 이상의 행에서 동일한 값을 사용할 수 없도록 하는 규칙

– Referential Constraint

하나이상의 테이블 내에 있는 하나 이상의 칼럼 값에 관한 논리적인 규칙

– 테이블 Check Constraint

특정 테이블에 데이터를 추가할 때 제한조건을 설정

예를 들면 개인정보를 포함하는 테이블에 봉급 데이터가 추가 또는 갱신될 때 사원에 대한 봉급 레벨이 최소 50 만원 이상이 되도록 제한할 수 있다 .

Page 71: Business Unit or Product Name

Business Unit or Product Name

© 2006 IBM Corporation.71

Referential Integrity 테이블 간 또는 테이블 안에서 정의된 관계를 의미한다 .

Create table 문과 Alter table 문에서 정의할 수 있다 .

Insert, Update, Delete, Alter table, Add Constraint 및 SET Integrity 문을 수행하는 동안 데이타베이스 관리 프로그램을 통해 적용

Page 72: Business Unit or Product Name

Business Unit or Product Name

© 2006 IBM Corporation.72

Referential Integrity - 계속DEPARTMENT TABLE

DEPT DEPTNAME

EMPLOYEE TABLE

EMPNO NAME

PARENT TABLE

PRIMARY KEY = DEPT

DEPENDENT TABLE

FOREIGN KEY = WKDEPTWKDEPT

RESTRICT

Page 73: Business Unit or Product Name

Business Unit or Product Name

© 2006 IBM Corporation.73

Referential Integrity 예제CREATE TABLE DEPARTMENT (

DEPT CHAR(3) NOT NULL,DEPTNAME CHAR(20) NOT NULL,CONSTRAINT DEPT_NAMEUNIQUE (DEPTNAME)

);

ALTER TABLE DEPARTMENT ADD PRIMARY KEY (DEPT);

CREATE TABLE EMPLOYEE (EMPNO CHAR(6) NOT NULL,NAME CHAR(30),WKDEPT CHAR(3) NOT NULL

);

ALTER TABLE EMPLOYEEADD FOREIGN KEY (WKDEPT)REFERENCES DEPARTMENT (DEPT)ON DELETE RESTRICT;

Page 74: Business Unit or Product Name

Business Unit or Product Name

© 2006 IBM Corporation.74

Unique KeyCONNECT TO MUSICDBCREATE TABLE PAY.EMPTAB

(EMPNO SMALLINT NOT NULL PRIMARY KEY,NAME CHAR(20),DRIVERLIC CHAR(17) NOT NULL,CONSTRAINT DRIV_UNIQ UNIQUE(DRIVERLIC))IN TBSP1

Unique indexes PAY.DRIV_UNIQ and SYSIBM.yymmddhhmmssxxx created Columns must be NOT NULL

CONNECT TO MUSICDBCREATE TABLE PAY.EMPTAB

(EMPNO SMALLINT NOT NULL PRIMARY KEY,NAME CHAR(20),DRIVERLIC CHAR(17) NOT NULL,CONSTRAINT DRIV_UNIQ UNIQUE(DRIVERLIC))IN TBSP1

Unique indexes PAY.DRIV_UNIQ and SYSIBM.yymmddhhmmssxxx created Columns must be NOT NULL

Page 75: Business Unit or Product Name

Business Unit or Product Name

© 2006 IBM Corporation.75

Check ConstraintsDATA RULE :

RULE

RULE RULE

RULE

No value in the US_SLcolumn in the tableSPEED_LIMITS can exceed 65.

PGM n

DB2

PGM 1 PGM 2

DB2

PGM n

PGM 1 PGM 2

ENFORCEMENTAPPLICATION

DATABASE

CREATE TABLE SPEED_LIMITS (ROUTE_NUM SMALLINT,CANADA_SL INTEGER NOT NULL,US_SL INTEGER NOT NULLCHECK (US_SL <=65) )

ALTER TABLE SPEED_LIMITS ADDCONSTRAINT SPEED65CHECK (US_SL <=65)

Page 76: Business Unit or Product Name

Business Unit or Product Name

© 2006 IBM Corporation.76

Security

Page 77: Business Unit or Product Name

Business Unit or Product Name

© 2006 IBM Corporation.77

권한SYSADM

SYSMAINT

DATABASE1

DBADMDATABASE2

SYSCTRL

데이터를볼 수 없다

DBADM

Page 78: Business Unit or Product Name

Business Unit or Product Name

© 2006 IBM Corporation.78

SYSADM 권한 시스템 관리 권한 (SYSADM)

– 최상위 레벨의 관리자 권한 .

– 유틸리티를 수행하고 데이타베이스 및 데이타베이스 관리 프로그램 명령 발행 .

– 데이타베이스 관리 프로그램 인스턴스 내의 데이타베이스에 있는 테이블의 데이타베이스에 액세스 가능

SYSADM 그룹– Unix System 의 경우

SYSADM 그룹은 인스턴스 OWNER 의 1 차 그룹으로 설정– Windows NT System 의 경우

로컬 Administrator group 의 멤버로 DB2 UDB 를 설치

DBM Configuration cfg 에서 SYSADM_GROUP 파라 미터를 원하는 그룹이름으로 변경

Page 79: Business Unit or Product Name

Business Unit or Product Name

© 2006 IBM Corporation.79

SYSCTRL 권한 최상위 레벨의 시스템 제어 권한 .

데이타베이스 관리 프로그램 인스턴스와 데이타베이스에 대해 유지보수 및 유틸리티 조작을 수행할 수 있는 기능 제공 .

사용자가 중요한 데이터가 들어 있는 데이타베이스 관리 프로그램 인스턴스를 관리하기 위한 목적으로 설계 .

SYSCTRL 권한을 갖고 있는 사용자는 데이타베이스 오브젝트에 Access 권한이 없다 .

SYSCTRL 권한을 갖고 있는 사용자는 데이타베이스 관리 Configuration file 을 수정할 권한이 없다 .

Page 80: Business Unit or Product Name

Business Unit or Product Name

© 2006 IBM Corporation.80

SYSMAINT 권한 시스템 제어 권한 중 두 번째로 높은 레벨 .

시스템 자원에 영향을 줄 수 있지만 , 데이터베이스의 데이터를 직접 액세스할 수는 없다 .

Page 81: Business Unit or Product Name

Business Unit or Product Name

© 2006 IBM Corporation.81

DBADM 권한 관리 권한 중 두 번째로 높은 레벨 .

특정 데이타베이스에만 적용되며 사용자가 특정 유틸리티를 수행하고 데이타베이스 명령을 발행하고 데이타베이스 테이블의 데이터에 액세스 할 수 있다 .

SYSADM 권한을 가지고 있는 사용자만이 DBADM 권한을 권한 부여 하거나 권한 취소할 수 있다 .

DBADM 권한을 가지고 있는 사용자는 다른 사용자에게 데이터베이스에 대한 특권을 권한 부여할 수 있음 .

Page 82: Business Unit or Product Name

Business Unit or Product Name

© 2006 IBM Corporation.82

권한 부여

C:\> db2 update dbm cfg using SYSADM_GROUP db2admC:\> db2 update dbm cfg using SYSCTRL_GROUP db2cntrlC:\> db2stopC:\> db2start

C:\> db2 update dbm cfg using SYSADM_GROUP db2admC:\> db2 update dbm cfg using SYSCTRL_GROUP db2cntrlC:\> db2stopC:\> db2start

C:\> db2 grant DBADM to SPCC:\> db2 grant DBADM to SPC

SYSADM, SYSCTRL, SYSMAINT 권한 부여– 데이타베이스관리자의 Configuration file 을 변경시켜야 한다 .

– Grant 문을 이용하여 권한 부여할 수 없다 .

DBADM 권한 부여SYSADM 권한을 갖고 있는 사용자가 Grant 문을 이용하여 권한을

부여할 수 있다 .

Page 83: Business Unit or Product Name

Business Unit or Product Name

© 2006 IBM Corporation.83

Database 권한 요약기능 SYSADM SYSCTRL SYSMAINT DBADM

Catalog / Uncatalog Database Y Y

Catalog / Uncatalog Node Y Y

Catalog / Uncatalog DCS Y Y

Migrate Database Y

Update DBM Cfg Y

Grant / Revoke DBADM Y

Force Users Y Y

Create / Drop Database Y Y

Quiesce Instance / Database Y Y

Create / Alter / Drop Tablespace Y Y

Restore to New Database Y Y

Update DB Cfg Y Y

Backup Database / Tablespace Y Y Y

Restore to Existing Database Y Y Y

Rollforward Recovery Y Y Y

Start / Stop Database Instance Y Y Y

Restore Tablespace Y Y Y

Run Trace Y Y Y

Take DBM / DB Snapshot Y Y Y

Query Tablespace State Y Y Y Y

Update Log History Files Y Y Y Y

Quiesce Tablespace Y Y Y Y

Load Tables Y Y Y

Set / Unset Check Pending State Y Y Y

Read Log Files Y Y Y

Create / Activate / Drop Event Monitors Y Y Y

Run Load Utility Y Y Y

Page 84: Business Unit or Product Name

Business Unit or Product Name

© 2006 IBM Corporation.84

권한과 특권

CONTROL(Indexes)

CONNECT(Database)

BINDADD(Database)

BIND EXECUTE

ALL DELETEINSERTSELECTUPDATE

ALL ALTER DELETE INDEX INSERT REFERENCES

SELECT UPDATE

CONTROL(Views)

CONTROL(Tables)

CONTROL(Packages)

CREATE_NOT_FENCED(Database)

CREATETAB(Database)

DBADM

SYSCTRL

SYSMAINT

Authority

Privilege

SYSADM

IMPLICIT_SCHEMA(Database)

ALTERINCREATEINDROPIN

( 스키마 소유자 )

Page 85: Business Unit or Product Name

Business Unit or Product Name

© 2006 IBM Corporation.85

데이터베이스 특권

데이타베이스

BINDADD

IMPLICIT_SCHEMA CREATE_NOT_FENCED

LOADCREATETAB

CONNECT

Page 86: Business Unit or Product Name

Business Unit or Product Name

© 2006 IBM Corporation.86

오브젝트 특권

데이타베이스

스키마 소유자

CONTROL( 뷰 )

CONTROL테이블

CONTROL( 별명 )

CONTROL( 색인 )

CONTROL( 테이블공간 )

CONTROL( 패키지 )

ALLALTERINDEXINSERTREFERENCESSELECTUPDATE ALL

ALTERINDEXREFERENCES

ALLDELETEINSERTSELECTUPDATE

BINDEXECUTE

CREATEINALTERINDROPIN

USE

Page 87: Business Unit or Product Name

Business Unit or Product Name

© 2006 IBM Corporation.87

스키마 특권 스키마 권한은 데이타베이스의 스키마에 조치를 취할 수 있는 권한임 .

사용자에게는 다음 권한이 권한 부여– CREATEIN

사용자가 스키마 내에서 오브젝트를 작성하도록 한다 .– ALTERIN

사용자가 스키마 내에서 오브젝트를 변경하도록 한다 .– DROPIN

사용자가 스키마 내에서 오브젝트를 제거하도록 한다 .

스키마 소유자는 모두 이러한 특권과 기능을 다른 사용자에게 권한 부여할 권한을 가짐 .

스키마 오브젝트 내에서 조정되는 오브젝트에는 테이블 , 뷰 , 색인 , 패키지 , 데이터 유형 , 함수 , 트리거 , 프로시저 , 별명이 있다 .

Page 88: Business Unit or Product Name

Business Unit or Product Name

© 2006 IBM Corporation.88

테이블 공간 특권 테이블 공간 특권은 데이타베이스에서 테이블 공간에 대한 조치를 포함 .

사용자에게는 다음 권한이 권한 부여– USE

테이블 공간 내에서 테이블을 작성하도록 허용한다 .

테이블 공간의 소유자는 USE 특권과 이 특권을 다른 사용자에게 부여하는 능력을 가진다 .

데이타베이스 작성 중 USERSPACE1 에 대한 USE 특권이 PUBLIC 으로 부여

USE 특권은 SYSCATSPACE 또는 임의의 시스템 임시 테이블 공간에서 사용될 수 없다 .

Page 89: Business Unit or Product Name

Business Unit or Product Name

© 2006 IBM Corporation.89

테이블 및 뷰 특권 사용자에게는 다음 권한이 권한 부여

CONTROL

ALTER

INDEX

SELECT

INSERT

DELETE

UPDATE

REFERENCES

Page 90: Business Unit or Product Name

Business Unit or Product Name

© 2006 IBM Corporation.90

패키지 특권 패키지 특권은 사용자가 패키지를 작성하고 조작할 수 있도록 한다 .

사용자에게는 다음 권한이 권한 부여– CONTROL

패키지를 리바인드 , 제거 또는 실행할 능력과 이러한 특권을 다른 사용자에게 확대할 수 있는 능력을 제공

– BIND

사용자가 기존 패키지를 리바인드 할 수 있도록 한다 .– EXECUTE

사용자가 패키지를 실행할 수 있도록 한다 .

Page 91: Business Unit or Product Name

Business Unit or Product Name

© 2006 IBM Corporation.91

특권 요약RESOURCE NEEDED TO CREATE NEEDED TO CONTROL OTHER PRIVILEGES

DatabaseSYSADMSYSCTRL

DBADM

CONNECTBINDADDCREATETABNOFENCEIMPLICIT_SCHEMA

TablespaceSYSADMSYSCTRL DBADM

USE

Package BINDADD CONTROLBINDEXECUTE

Table (T)View (V)

CREATETAB (T)CONTROL OR SELECT (V)

CONTROL

SELECT (T/V)INSERT (T/V)DELETE (T/V)UPDATE (T/V)ALTER (T)INDEX (T)REFERENCES (T)

Index INDEX CONTROL none

AliasIf schema differs fromcurrent authid, requiresDBADM, SYSADM

CONTROL none

SchemasSYSADMDBADMIMPLICIT_SCHEMA

CONTROLCREATEINALTERINDROPIN

Page 92: Business Unit or Product Name

Business Unit or Product Name

© 2006 IBM Corporation.92

권한 부여 DBADM 권한을 가진 사용자는 사용자 MEL 에 대한 PAY 스키마를 생성할 수

있다 .

CREATE SCHEMA PAY AUTHORIZATION MEL

MEL 은 스키마 PAY 에서 오브젝트를 생성할 수 있다 .

CREATE TABLE PAY.T1 (COL1 INT)

MEL 은 다른 사용자에게 특권을 부여할 수 있다 .

GRANT CREATEIN ON SCHEMA PAY TO USER CAL

GRANT ALTERIN, CREATEIN, DROPIN ON SCHEMA PAY TO GROUP G1 WITH GRANT OPTION

모든 사용자가 아직 존재하지 않는 스키마 이름과 함께 CREATE 문을 사용하여 오브젝트를 작성함으로써 스키마를 내재적으로 작성할 수 있음 .

REVOKE IMPLICIT_SCHEMA ON DATABASE FROM PUBLIC

GRANT IMPLICIT_SCHEMA ON DATABASE TO USER JON

Page 93: Business Unit or Product Name

Business Unit or Product Name

© 2006 IBM Corporation.93

권한 부여

GRANT/REVOKE

databaseprivileges

ON DATABASE

TO/FROM

USER/GROUP

useridgroupidPUBLIC

packagePrivileges

ON PACKAGEpackage_name

table/viewprivileges

ON TABLEtable/view_name

CONTROLON INDEX

index_name

Page 94: Business Unit or Product Name

Business Unit or Product Name

© 2006 IBM Corporation.94

Grant… Table, View 특권 부여 문법

GRANT

PRIVILEGES

ALL,

ALTER

CONTROL

DELETE

INDEX

INSERT

REFERENCES

SELECT

UPDATE

,

( column-name )

,

( column-name )

,

ON

TABLE

table-name

view-name

TO authorization-name

PUBLIC

USER

GROUP

WITH GRANT OPTION

Page 95: Business Unit or Product Name

Business Unit or Product Name

© 2006 IBM Corporation.95

권한 부여 예제Mel 은 group1 의 멤버이다 .

db2 grant select on table T1 to group group1db2 grant update on table T1 to user meldb2 grant insert on table T1 to publicdb2 grant insert on table T2 to public

db2 grant select on table T1 to group group1db2 grant update on table T1 to user meldb2 grant insert on table T1 to publicdb2 grant insert on table T2 to public

exec sql insert… from T1... exec sql update T1 set... exec sql select... from T2...

exec sql insert… from T1... exec sql update T1 set... exec sql select... from T2...

Mel attempts bind of pgm.sqc

bind fails

OK

OK

SQL

OK

create view V1 as select C3 from T1create view V2 as select C1, C8 from T2

create view V1 as select C3 from T1create view V2 as select C1, C8 from T2

Mel attempts to create a view

OK

create viewfails

SQL

Page 96: Business Unit or Product Name

Business Unit or Product Name

© 2006 IBM Corporation.96

DB2 BIND GRANT 옵션

RICK 은 BINDADD 와 필요한 SQL 특권을 가지고 있다

SALLY 는 packa 에대해 CONTROL

권한을 가지고 있다 .

db2 connect to sample

db2 prep packa.sqc bindfile

db2 bind packa.bnd grant AuthidGroupidpublic

OR

Grant execute, bind on package packa

To AuthidGroupidpublic

DB2 BIND… GRANT 명령어는 PACKAGE 에 대해 EXECUTE, BIND 특권을 특정 USERID 나 PUBLIC 에게 부여한다 ..

Page 97: Business Unit or Product Name

Business Unit or Product Name

© 2006 IBM Corporation.97

프로그램에 요구되는 특권Action 요구되는 특권

Precompile to bindfile CONNECT on database

Create a new package

CONNECT on databaseBINDADD on database각 Static SQL 문을 수행할 수 있는 특권

Modify an existing package

CONNECT on databaseBIND on package각 Static SQL 문을 수행할 수 있는 특권

Recreate an existing packageCONNECT on databaseBIND on package

Execute a packageCONNECT on databaseEXECUTE on package

Drop a packageCONNECT on databaseCONTROL on package or creator of package

Page 98: Business Unit or Product Name

Business Unit or Product Name

© 2006 IBM Corporation.98

특권 정보

SYSCAT.DBAUTH Database privileges

SYSCAT.COLAUTH Table and View Column privileges

SYSCAT.INDEXAUTH Index privileges

SYSCAT.PACKAGEAUTH Access Package privileges

SYSCAT.SCHEMAAUTH Schema privileges

SYSCAT.TABAUTH Table and View privileges

Page 99: Business Unit or Product Name

Business Unit or Product Name

© 2006 IBM Corporation.99

내재적 특권 데이터베이스를 생성하면…

CONNECT, CREATETAB, BINDADD, CREATE_NOT_FENCED, 그리고 sIMPLICIT_SCHEMA 특권을 가진 DBADM 권한을 내부적으로 생성자에게 부여 . To creator (SYSADM or SYSCTRL)

BINDADD, CREATETAB, CONNECT, IMPLICIT_SCHEMA, 그리고 SYSADM CATALOG TABLE 에 대한 SELECT 특권을 내재적으로 부여

성공적으로 바운드된 패키지에 대해 BIND 및 EXECUTE 특권을 PUBLIC 에게 부여

System catalog table 및 뷰에 대해 SELECT 특권을 PUBLIC 에게 부여

USERSPACE1 에 대한 USE 특권을 PUBLIC 에게 부여

DBADM 권한을 부여하면…BINDADD, CREATETAB, CONNECT, CREATE_NOT_FENCED 그리고

IMPLICIT_SCHEMA 특권을 내재적으로 부여

오브젝트 (table, index, package) 를 생성하면…오브젝트 생성자에게 CONTROL 특권을 내재적으로 부여

뷰를 생성하면…기본 테이블에 대한 생성자의 특권이 뷰 생성자에게 내재적으로 부여