database.sarang.net
UserID
Passwd
Database
DBMS
MySQL
PostgreSQL
Firebird
ㆍOracle
Informix
Sybase
MS-SQL
DB2
Cache
CUBRID
LDAP
ALTIBASE
Tibero
DB 문서들
스터디
Community
공지사항
자유게시판
구인|구직
DSN 갤러리
도움주신분들
Admin
운영게시판
최근게시물
Oracle Tutorials 9002 게시물 읽기
 News | Q&A | Columns | Tutorials | Devel | Files | Links
No. 9002
OCP 문제 - Admin 파트 (3)
작성자
정재익(advance)
작성일
2001-12-23 03:17
조회수
6,714

문) If the space usage parameters are set to the default values,

which change could cause higher processing costs because blocks will be

considered free more often? ★

 

A. raising PCTUSED

B. lowering PCTUSED

C. raising PCTFREE

D. lowering PCTFREE

 

정답 : A

-> 오라클메뉴얼 7-29

-> Setting a Lower PCTUSED Value

. Reduces processing costs because blocks are not often free

. Increase unused space

Setting a Higher PCTUSED Value

. Increase processing costs because blocks may often become free

. Improves space usage

 

문) IF THE SPACE USAGE PARAMETERS ARE SET TO THE DEFAULT VALUES,

WHICH CHANGE COULD REDUCE THE CHAINING OF ROWS?

 

A. LOWERING PCTFREE

B. RAISING PCTFREE

C. LOWERING PCTUSED

D. RAISING PCTUSED

 

정답 : B

 

문) [control block space] migration을 줄일려면 어떻게 해야하나?

 

정답 : pctfree값을 크게 해준다.

 

문) backup을 받으려할 때 datafile의 정보를 보기위한 data dictionary 는?

 

정답 : DBA_DATA_FILES

 

문) row delete 시 high water mark는?

 

정답 : 안바뀐다.

high water mark 이전의 빈 block을 de-allocate 하기 위해서는

truncate를 하거나 export/import하는 수밖에 없다.

 

문) PCTFREE를 작게하면? (또는 크게하면?)

 

정답 : block 사용율이 높다. - 필요한 block 수 감소

row migration이 많다 - 비용 증가

 

문) PCTUSED를 크게하면? (또는 작게하면?)

 

정답 : block 사용율이 높다. - 필요한 block 수 감소

비용이 증가 - free list에 삭제/삽입이 자주 일어난다.

( )는 반대.

 

문) Block Space를 제어하는 parameter는 ?

 

A. INITRANS

B. INITIAL

C. PCTINCREASE

D. OPTIMAL

 

정답 : A

-> 오라클메뉴얼 7-5 참조

-> Block Space Utilization Parameters (4가지)

: PCTFREE, PCTUSED, INITRANS, MAXTRANS

 

문) 블록공간 사용하는 파라미터는?

 

A. INITRANS

B. PCTINCREASE

C. NEXTEXTENTS

 

정답 : A

-> 위와 동일한 문제다.

 

문) A high PCTUSED

 

A. 오라클로 하여금 블록을 FREELIST 위에 빈번하게 위치시키게 함으로써 성능 비용을 증가.

B. 오라클로 하여금 블록을 FREELIST 위에 뜸한 간격으로 위치시킴으로써 성능 비용을 증가시킨다.

C. 오라클로 하여금 블록을 FREELIST 위에 빈번하게 위치시키게 함으로써 성능 비용 감소.

D. 오라클로 하여금 브록을 FREELIST 위에 뜸한 간격으로 위치시키게 함으로써 성능 비용을 감소.

 

정답 : A

 

문) A low PCTUSED ★★★

 

A. Decreases performance on the database by requiring short,

frequent placement of the blocks on a freelist

B. Increases storage costs on the database by placing a block on the freelist

only when a great deal of block space is free

C. Decreases storage costs on the database by maximizing space usage in a data block

D. Increases performance on the database by forcing Oracle to populate the block

with rows frequently

 

정답 : C

 

문) To control the storage allocation of a table or index : (choose two) ★★★

 

A. Specify a low pctfree

B. Specify a high pctused

C. Specify a low maxextents

D. Specify a high minextents

E. Specify a low pctincrease

F. Specify a high maxextents

 

정답 : A, B -> 답은 C, E 로 되어있는데...

-> pctfree, pctused는 공간 제어 파라미터이며. 나머지는 스토리지 파라미터임

(롤백 세그먼트, 테이블스페이스 등 생성시 쓰임)

 

문) Chaining이 발생할 가능성이 높은 경우는 ? ★★

 

A. A long row that cannot fit into a single block

B. Use high value for PCTFREE

C. Use low value for PCTFREE

D. Many rows that fit into multi blocks.

 

정답 : A

-> 오라클메뉴얼 7-33 참조

-> Chaining

- A row that cannot fit into a single block is chained across multiple blocks.

- The initial row piece remains in the block where the row was first targeted.

- Each additional row piece fits into a chained block

Migration

- A row migrates when an update requires more space than is currently available

- Use a sufficiently high value for PCTFREE to avoid excessive row migration

 

문) PCTFREE를 낮게 했을 때 다음 중 옳은 것은? (2가지)

 

A. May require fewer blocks to store data

B. Increase the need to chain rows

C. The propensity of migration rising

D. Reserves more room for future updates

 

정답 : A, C

-> 오라클메뉴얼 7-27 참조

-> Setting a Lower PCTFREE parameter value

- Allows inserts to fill blocks more completely

- May require fewer blocks to store data

- Can increase processing costs if the Oracle Server must frequently reorganize blocks

- Can cause row migration (when update)

 

문) PCTFREE를 높게 했을 때 다음 중 옳은 것은? (2가지)

 

A. Allows inserts to fill blocks more completely

B. Lowers processing costs because blocks will require reorganization

infrequently.

C. Reserves more room for future updates

D. Increasing the need to chain rows

 

정답 : B, C

-> 오라클메뉴얼 7-27 참조

-> Setting a Higher PCTFREE parameter value

- Reserves more room for future updates

- May require more blocks to store data

- Lowers processing costs because blocks will require reorganization infrequently

- Reduces the need to chain rows

 

*---------------------------------------------------------------------------*

* 8. Manage Rollback Segments (5) *

* - 롤백 세그먼트 관리 *

*---------------------------------------------------------------------------*

 

■Overview

- A Rollback Segment is a collection of extents that holds rollback data

for rollback transactions, read-consistency, and database recovery.

 

■Rollback Segments ★★★★★ (6장 데이터베이스 구조관리와 7장 스토리지 할당관리와 연관하여 설명)

- A rollback segment is a portion of the database that records data

before it is modified by transactions, allowing the changes to be rolled back

(undone) under certain circumstances.

- A transaction is a unit of work that causes changes to be made to the database,

or locks to be taken out on rows.

1) Characteristics of Rollback Segments ★★★

① Allow rollback for transaction or to savepoint in the event of operator mistake

② Provide for read consistency

③ Are used during database recovery

④ There is always a rollback segment called SYSTEM in the SYSTEM tablespace

⑤ At least one extra rollback segment is needed if multiple tablespaces are used.

2) Properties of Rollback Segments

① Store block information (file, block ID, data)

② Can be assigned a transaction automatically or explicitly

③ Can be forced to shrink by ALTER ROLLBACK SEGMENT <rbs> SHRINK TO <size> command.

④ Automatically shrink to OPTIMAL if extended.

3) Rollback Segment Storage Parameters

- INITIAL, NEXT, MINEXTENTS, MAXEXTENTS, OPTIMAL

주) PCTINCREASE는 사용안함

4) Optimal Parameters

① OPTIMAL specifies the optimal size of rollback segment in bytes.

② Oracle Server de-allocates extents when a rollback segment is larger than OPTIMAL

③ PCTINCREASE cannot be specified for rollback segments and always zero. (주)

④ MINEXTENTS must be at least two

⑤ MAXEXTENTS should never be set to UNLIMITED. (주)

⑥ OPTIMAL은 첫번째 MINEXTENTS 확장영역(extents)의 바이트합보다 커야하며 동일한 것이 이상적이다.

5) Rollback Segment의 종류

1) Private

- 반드시 ROLLBACK_SEGMENTS 파라미터에 기술해야 한다.

2) Public

- 여러 instance가 공유하여 쓸 수 있다.

- OPS환경에서 사용되는 특정 instance에 속하지 않는 rollback segment

- 보통 개인(private) 롤백세그먼트가 선호되나 Oracle paralle server 환경에서만 사용가능

3) Deffered

- SYSTEM tablespace 내에 만들어지며 tablespace가 offline이 될 때

transaction내의 rollback되지 않은 정보를 저장한다.

 

■shrink란?

- transaction이 길거나 큰 경우 rollback segment의 extent가 많아지면 다른 rollback segment가 사용할 수

있도록 extent를 de-allocate해야 한다.

이를 shrink라 하며 V$Rollstat의 shrink값이 1이면 shrink된 것이다.

 

■Create (public) Rollback Segment rollback_segment

Tablespace tablespace

Storage ( )

Optimal

integer(K/M) / null

 

■For rollback segments, the minimum and default value for MINEXTENTS is 2.

 

■Alter Rollback Segment rollback_segment

Online / Offline

Storage

Shrink

To integer (K/M)

 

■rollback segment 를 drop 시키기 위해서는 offline상태여야 한다.

rollback segment 를 monitor하기 위해 V$Rollstat View를 사용한다.

 

■SELECT n.name, round(100 * s.waits/s.gets ) "%Cont"

FROM V$ROLLNAME n, V$ROLLSTAT s

WHERE n.usn = s.usn;

 

- If the value is > 1%, add more rollback segments,

or consider using the SET TRANSACTION USE ROLLBACK SEGMENT command.

 

■Guideline in Determine the OPTIMAL Parameter

- for long running update transactions should have a high OPTIMAL size to avoid excessive allocation

and de-allocation of extents.

- for long-running queries : a large OPTIMAL size to avoid error "snapshot too old".

- for short-running update, queries : a small OPTIMAL size -> increase rollback segment caching

- Monitoring with V$ROLLSTAT

 

문) ROLLBACK SEGMENT 크기가 작은데 어떤 TABLE 의 전체 ROW 를 DELETE 하려고 한다.

어떻게 하면 되는가?

 

정답 : TRUNCATE 를 사용하면 된다.

 

문) rollback segment에 HWM이 실제 data보다 높은 곳에 설정되어 있는 이유?

 

A. rollback segment가 늘다가 줄어서

B. maxextents 수정해서

C. truncate 되어서

 

정답 : A?

 

문) ROLLBACK SEGMENT 가 너무 많이 할당되면 어떻게 되는가?

 

정답 : GROW UP 하다가 SHRUNK된다.

 

문) Rollback segment가 Maxtnets값에 도달할 때?

 

A. 필요하지 않은 공간 할당시

B. 장기 Transaction

C. Optimal 높을 때

D. Optimal 낮을 때

 

정답 :

 

문) ROLLBACK SEGMENTS에서 MAXEXTENTS를 증가시키는 이유?

 

정답 : LONG RUNNING TRANSACTION 처리를 위해서

 

문) ROLLBACK SEGMENTS에서 OPTIMAL이 SET되는 때는? ★★★

 

정답 : ROLLBACK SEGMENT가 CREATION 될 때

 

문) A read-consistent view of database data is ★★★

 

A. When data changes only when being read

B. Handled by rollback segments

C. When users execute the same query consistently

D. Not available in Oracle

 

정답 : B

 

문) rollback segment에서 optimal보다 HWM이 훨씬 크다면? (2 choice) ★★★

 

A. rollback segment allocated extents so much.

B. it will not shrink to the optimal size because of the HWM size.

C. you can use alter rollback command for it.

D. ...

 

정답 : B

 

문) Entries in a rollback segment are bound to a transaction by ★★★

 

A. Number of commits performed

B. Number of rollbacks performed

C. ROWID

D. System change number

 

정답 : D

 

문) Rollback segment shrinks can be avoided if ★★★

 

A. The optimal option is decreased.

B. The DBA manually performs all rollback segment shrinks.

C. Long-running transactions are assigned to larger rollback segments.

D. V$ROLLSTAT is monitored carefully.

 

정답 : C

 

문) How many rollback segments will be required

if the value set for TRANSACTIONS is 300 and

the value set for TRANSACTIONS_PER_ROLLBACK_SEGMENT is 4 ? ★★★

 

A. 25

B. 50

C. 75

D. 100

 

정답 : B (기존에 적힌 답) -> C

-> 정답 C가 맞습니다. 페이지 8-13 참조

 

문) When a rollback segment is created, its availability status is set to online. ★★★

 

A. TRUE

B. FALSE

 

정답 : B

 

문) 변경이 불가능한 storage parameter는? (2가지) ★★

 

정답 : INITIAL, MINEXTENTS

 

문) rollback segment의 주요 목적과 거리가 먼 것은? ★

 

A. transaction에 대한 rollback을 가능하게 한다.

B. 읽기 일관성(read consistency)을 제공한다.

C. database 복구 (recovery)에 사용된다.

D. index 생성시 SORT 하는 공간으로 사용한다.

 

정답 : D

-> D는 TEMPORARY SEGMENT이다.

 

문) 다음 중 rollback segment에만 사용할 수 있는 파라미터는?

 

A. optimal

B. initial

C. pctincrease

D. minextents

 

정답 : A

 

문) rollback segment에 적용할 수 있는 파라미터 중 제한사항을 받지 않는 것은? ★★★★

 

A. optimal

B. initial

C. pctincrease

D. minextents

 

정답 : C

-> C는 무조건 0입니다. 그러므로 C가 정답이겠네요.

A의 경우 auto shrink 되게 하기 위해서 지정해야 하며

보통 minextents보다 많거나 같게 지정하고 initial은 next와 같은 사이즈로 반드시,

minextents는 반드시 2 이상으로 지정해야죠.

 

문) 다음 중 rollback segment의 information을 볼 수 있는 data dictionary 를 고르시오.

 

A. dba_tables

B. dba_objects

C. v$database

D. dba_rollback_segs

 

정답 : D

 

문) rollback segment의 minextent 최소값?

 

정답 : 2개

 

문) Rollback segment에서 OPTIMAL의 정의?

 

정답 : Specifies the optimal size of a rollback segment in bytes

 

문) Examine the following statement and identify any errors. ★

 

A. create rollback segment RBS_01

B. tablespace ROLLBACK_SEGS

C. storage (initial 10M next 10M

D. minextents 5 maxextents 10

E. pctincrease 10

F. freelist groups 2);

G. There are no errors in this statement.

 

정답 : E !!!

-> rollback segment에서 각각의 extent는 모두 동일한 크기를 가져야만 하므로

pctincrease 0 으로 아마 기술도 하지 않을 것입니다.

-> freelist groups는 Parallel Server에서 다른 인스턴스가 사용한 개별적인 프리 리스트의 수를

나타내기 때문에 사용환경에 따라 다름.

OPS.multi-Threaded server,dedicate ,single-task, distributed ,symmetric, 등등

-> 답은 E 입니다.

메뉴얼의 내용을 그대로 옮기면,

"PCTINCREASE는 롤백세그멘트에 지정할 수 없다"

혼동될 수 있는 FREELIST / FREELIST GROUP은

또한 메뉴얼의 내용을 그대로 옮기면,

"FREELIST와 FREELIST GROUPS 파라미터는 테이블스페이스에 대해

기본값(DEFAULT)으로 지정될 수 없다" (주)

 

문) SELECT n.name, round(100*s.waits/s.gets) "%Cont"

FROM v$rollname n, v$rollstat s

WHERE n.usn = s.usn;

 

if the value > 1% 일 때 해결할 수 있는 방법은?

 

A. Increase the optimal size of your existing rollback segments

B. Add more rollback segments

C. Decrease the number of rollback segments

D. Nothing, this value is optimal

 

정답 : B

-> 오라클메뉴얼 8-23

-> Add more rollback segments, or consider using the

SET TRANSACTION USE ROLLBACK SEGMENT command

 

문) Which value is assigned to PCTINCREASE for rollback segments?

 

A. 0

B. 1

C. 2

D. a multiple of the NEXT value

 

정답 : A

-> 오라클메뉴얼 8-11

 

문) select (100*s.wait/s.gets)|| '%' from v$rollstat s

에서 value가 3% 라면 어떤 일을 해야하나?

 

정답 : rollback segment 수를 늘린다.

 

문) 대량의 batch job을 돌려야 할 때 rollback segment를 어떻개 해야 하는가?

 

정답 : rollback segment 크기를 늘린다.

 

문) TRANSACTION에 대한 사용자의 실수를 보전하고,

READ-CONSISTENCY를 보장하며,

DATABASE RECOVERY를 위한 자료를 갖고 있는 곳은 어디인가?

 

A. REDO LOG FILES

B. DATABASE BUFFER CACHE

C. REDO LOG BUFFER

D. ROLLBACK SEGMENTS

 

정답 : D

-> ROLLBACK SEGMENT는 TRANSACTION에 의하여 수정되기 전의 데이터를 기록하는

데이터베이스의 한 영역이다. 이것은 특정환경에서 수정된 자료를 ROLLED BACK하기 위함이다.

따라서 ROLLBACK SEGMENT는 사용자의 실수로 수정되어진 자료를 다시 ROLLED BACK함

으로써 원래자료로 복구할 수 있고, 이전 데이터를 갖고 있음으로 해서 다른

사용자들이 수정된 자료를 읽을 때 READ-CONSISTENCY를 제공하며,

DATABASE RECOVERY시에도 복구를 위하여 이용되어진다

 

문) ROLLBACK SEGMENT에 관한 다음 내용 중 틀린 것을 2개 골라라.

 

A. 확장(EXTEND)되어졌다면 자동적으로 OPTIMAL에 지정된 크기로 SHRINK되어진다

B. 특정 TRANSACTION을 수행할 때 특정 ROLLBACK SEGMENT에 ASSIGN시킬 수 있다

C. PCTINCREASE PARAMETER는 수정할 수 없으며 항상 100으로 고정된다

D. ROLLBACK SEGMENT는 순환적으로 쓰여지므로 모든 ROLLBACK SEGMENT는

그 SIZE가 같아야 한다

E. MAXEXTENTS PARAMETER를 UNLIMITED로 지정하면 DISK의 모든 공간을

다 써 버릴수 있기 때문에 절대 UNLIMITED로 지정해서는 안된다

 

정답 : C, D

-> A. OPTIMAL은 ROLLBACK SEGMENT의 최적크기를 지정하는 것으로

확장된 후에는 이 OPTIMAL의 크기로 SHRINK되어진다.

B. SET TRANSACTION USE ROLLBACK SEGMENT 명령으로 특정

ROLLBACK SEGMENT를 지정할 수 있다.

C. ROLLBACK SEGMENT에서의 PCTINTREASE는 지정할 수 없고

항상 0으로 고정된다.

D. ROLLBACK SEGMENT의 각각의 크기가 모두 같을 필요는 없다.

긴 트랜잭션인 경우에 특정 ROLLBACK SEGMENT만 크기를 크게하여

그 ROLLBACK SEGMENT를 이용하도록 지정할 수 있다.

E. MAXEXTENTS는 절대 UNLIMITED로 지정해서는 안된다

 

문) ROLLBACK SEGMENT에서 MINEXTENTS의 값은 DEFAULT로 얼마인가?

 

A. 0

B. 1

C. 2

D. 4

E. 10

 

정답 : C

-> ROLLBACK SEGMENT는 연속적이고 순환적으로 쓰여져야 하기 때문에

MINEXTENTS의 값이 최소한 2이상 되어야 한다. ROLLBACK

SEGMENT 생성시 또는 DATABASE가 FRAGMENT되어 있거나 특정

테이블의 데이터량 전체를 LOAD할 정도의 큰 ROLLBACK SEGMENT

를 원할 경우에 MINEXTENTS의 값을 2이상으로 증가시킬 수 있다.

※ PCTINCREASE ( = 0 )와 헤갈리지 않도록 주의!!!

 

문) lock을 monitor할 수 있는 utility는?

 

정답 : utlockt.sql

-> 어느 파트소속 문제인지 모름

 

*---------------------------------------------------------------------------*

* 9. Manage Table and Index Segments (5) *

* - 테이블 세그먼트와 인덱스 세그먼트 관리 *

*---------------------------------------------------------------------------*

- 6장 데이터베이스 구조관리에서 언급됨. (오라클메뉴얼 6-39)

 

■Table Features

- Holds user data, system data (data dictionary)

- the header block contains free list information and object extent information

- Can be created in parallel, UNRECOVERABLE (CREATE TABLE AS SELECT)

 

■Row Features

- no limit to the number of rows per table

- Rows can span multiple blocks, causing chained rows.

- stored contiguously in a variable length format or fixed length format

for CHAR and DATE columns

- Column length of 0 indicates a null field.

 

■Allocating Table Storage

- Storage Parameters

. Store the whole table in a single extent if possible

. use a high PCTINCREASE value if the table will grow significantly

. 사용하지 않은 공간의 확장영역(extents) 하나를 사용할 수 없으면 적절한

MINEXTENTS 값으로 작은 확장영역(extents)을 많이 생성한다.

- Space Utilization Parameter (7장 스토리지 할당관리에서 언급)

. Use a low PCTFREE if the rows will not be updated much

. Use a low PCTUSED if there will be extensive insert and delete activity

. PCTFREE plus PCTUSED cannot exceed 100%

 

■STORAGE parameter에서 INITIAL, MINEXTENTS는 바꿀수 없다. (주)

 

■새로운 extents를 강제로 할당

SQL>ALTER TABLE s_emp ALLOCATE EXTENT (SIZE 200K DATAFILE '/u02/Oracle/test/user1.dbf');

 

■The size of the NEXT extent to be dynamically allocated,

based on the size of the last extent and PCTINCREASE,

is not changed when an extent is manually added with the ALLOCATE EXTENT option.

 

■인덱스 세그먼트

- 테이블에 인덱스를 생성하면 인덱스 세그먼트는 인덱스 각각에 대해 생성된다.

인덱스 세그먼트는 테이블과 클러스터 데이터 세그먼트로부터 물리적으로 분리된 세그먼트이다.

- 특징

. 테이블이나 클러스터와 서로 독립적

. 각 인덱스는 자체의 storage parameter와 tablespace 지정할 수 있다.

. 병렬 / UNRECOVERABLE 생성 가능

. 최적화를 위해 분리된 tablespace에 저장해야 함

주) 오라클서버에 의해서 자동적으로 사용되거나 유지되는 것은 아님

 

■Bitmap Indexing ★★

- Tables are very large (millions of rows)

- Tables have low-cardinality (분포도 적은것)

- Queries have bitmap indexes on all columns that commonly appear in WHERE clauses.

- Queries have individual WHERE conditions that are satisfied by thousands of rows.

 

주) Bitmap Indexing은 release 7.3.3이상에서 사용가능, OLTP성 업무에는 사용하지 말것.

 

■When To Use Bitmap Indexing

- Queries involving

. Low-cardinality columns

. A combination of multiple WHERE conditions

. Each predicate involves a large number of rows.

- An alternative to concatenated indexes providing

. more efficient use of storage

. no dependency on column ordering

- If there is read-only or low-update activity

. Bitmapped indexes are expensive to update

 

■The absolute maximum number of columns in a comosite key index is 16.

 

■Creating Indexes Guideline

- Create table first, then create the index on the table. (주)

- If column values are stored in ascending, specify NOSORT option.

- When sorting, uses temporary segments and the sort space specified in SORT_AREA_SIZE

initialization parameter.

- Indexes can be created UNRECOVERABLE, so that no rollback or no redo log is generated.

- 테이블이 주로 읽기 전용이면 인덱스 사용이 더 효과적

 

주) Index Storage Parameter에서 PCTUSED는 사용 불가.

 

■인덱스 관리

- 높은 INTRANS 값

. 충분한 공간 보장 -> 오버헤드 감소

- 높은 MAXTRANS 값

. 트랜잭션 공간을 위한 자유공간을 확보하려는 대기시간 줄어듬

주) Change to INITRANS apply to subsquent blocks only. (ALTER INDEX)

Change to MAXTRANS apply to all blocks.

 

문) INDEX 를 ANALYZE .... VALIDATE STRUCTURE; 명령으로 ANALYZE하면 결과는 어디에?

 

정답 : INDEX_STATS

-> 오라클메뉴얼 9-61

 

문) UNRECOVERABLE로 테이블을 생성하는 것은 무슨 뜻인가?

 

정답 : REDO LOG BUFFER 와의 I/O 가 발생하지 않음

-> 오라클메뉴얼 9-13

-> 테이블 생성이 redo log에 기록되지 않음

 

문) BLOCK에 대해 INITRANS의 값이 작을 경우 트랜잭션이 많아지면 어떻게 되는가?

 

정답 : FREE SPACE를 찾기 위해 BLOCK을 검색을 해야 하므로 TRANSACTION이 느려진다.

 

문) You create table without storage parameter.

what parameter will be used? ★★★

 

A. database parameter if it has a storage parameter.

B. object storage default parameter.

C. system tablespace storage parameter.

D. tablespace storage parameter what is in that object schema.

 

정답 : D

-> DBA가 답함

 

문) In which parameter would a higher value reduce the wait time

for free transaction space?

 

A. INITRANS

B. NEXT

C. PCTUSED

D. MAXEXTENTS

 

정답 : A (내용적으로는 MAXTRANS인 것 같은데)

-> 오라클메뉴얼 9-55

-> If many users are going to issue statements that will ultimately use the index,

a higher INITRANS will ensure enough space for their transaction entries, and

eliminate the overhead of creating new transaction entry space.

Also, a higher MAXTRANS will help ensure that no user has to wait for transaction

space to become free

 

문) When a CREATE TABLE command is issued with no storage options specified,

what storage options are used to create it? ★★★

 

A. The default options specified for the user in the tablespace.

B. The default options specified for the table in the tablespace.

C. The default options specified for the user in the database.

D. The default options specified for the table in the database.

 

정답 : B

 

문) If your tables will be growing significantly,

which STORAGE parameter could you increase to reduce the maintenance

of the table as it grows?

 

A. INITIAL

B. FREELIST

C. MAXEXTENTS

D. MINEXTENTS

E. PCTINCREASE

 

정답 : E

-> 오라클메뉴얼 9-11

-> PCTINCREASE is the rate of growth of each subsequent extent.

테이블이 상당히 커질 것이라면 PCTINCREASE 값을 크게 지정한다.

 

문) Index segment의 특징으로 맞는 것 3가지를 고르시오. ★★

 

A. Can be created UNRECOVERABLE

B. Typically smaller than the indexed table

C. Automatically used and maintained by the Oracle Server

D. Can be stored in separate tablespace

 

정답 : A, B, D

-> 오라클메뉴얼 9-27

 

문) 다음 중 STORAGE 구에 명시할 수 없는 것을 모두 골라라.

 

A. PCTFREE

B. INITIAL

C. NEXT

D. PCTUSED

E. PCTINCREASE

F. MINEXTENTS

 

정답 : A, D

-> STORAGE 구에 명시되는 것은 INITIAL, NEXT, PCTINCREASE,

MINEXTENTS, MAXEXTENTS등이다. SPACE 사용에 관한 PARAMETER

인 PCTFREE, PCTUSED등은 STORAGE 구의 부분이 아니다.

 

문) bitmap index에 관한 내용이 아닌것

 

A. table이 큰 경우

B. cardinality가 낮은 column

C. data warehouse에 적합하다

D. lead column에 제약이 있다.

 

정답 : D

 

문) 다음 중 BITMAP INDEXING을 이용하지 않아야 하는 경우는 어느 것인가?

 

A. 테이블이 매우 클 경우

B. 테이블이 LOW-CARDINALITY (분포도가 적음)를 가질 경우

C. INSERT, UPDATE활동이 잦은경우

D. STORAGE를 더 효과적으로 이용하고자 할 경우

 

정답 : C

-> BITMAP INDEXING은 QUERY를 효과적으로 하고, 기억장소를 효과적

으로 활용하고자 할 경우 이용된다. UPDATE시에는 그 비용이 비싸므로

주로 READ-ONLY 이거나 LOW-UPDATE 활동이 있을 경우 활용되어야 한다.

또한 QUERY가 낮은 분포도를 가진 COLUMN을 포함하거나, 여러개의

WHERE절의 조건을 가질경우, 또는 ROW의 개수가 매우 많을

경우에 효과적이다.

 

문) INDEX를 생성하는 내용 중 맞지 않는 것은 어느것인가?

 

A. TABLE의 내용이 이미 SORT되어 있다면 NOSORT 키워드를 이용하여 SORT를 생략할 수 있다

B. PARALLEL 키워드를 이용하여 병렬로 INDEX를 생성할 수 있다

C. UNRECOVERABLE 키워드를 이용하여 INDEX의 생성작업을 REDO LOG에 기록하지 않을 수 있다

D. INDEX 생성시 PCTUSED와 PCTFREE는 지정할 수 없다

 

정답 : D

-> INDEX 생성시 PCTUSED는 지정할 수 없으나 PCTFREE는 추가적인

INDEX 엔트리를 위한 공간을 확보해 두기 위하여 지정할 수 있다.

 

문) 많은 사용자가 INDEX를 이용하는 SQL문장을 사용함으로 인하여 INDEX에 대한

MAXTRANS값의 TRANSACTION ENTRY SPACE를 모두 이용 중이라면 어떤 현상이 일어나는가?

 

A. ORACLE SERVER는 ERROR MESSAGE를 반환하고 해당 SQL문장은 실행되지 않는다

B. 사용자는 TRANSACTION ENTRY SPACE가 FREE로 될 때까지 기다려야 한다

C. 새로운 TRANSACTION ENTRY SPACE를 추가로 할당받아 이용한다

D. ORACLE INSTANCE가 DOWN된다

 

정답 : B

-> INDEX에 대한 TRANSACTION ENTRY SPACE를 모두 사용했다면

TRANSACTION ENTRY SPACE가 FREE가 될 때까지 기다려야 한다.

따라서 사용자가 TRANSACTION ENTRY SPACE가 FREE가 될 때까지

기다리는 것을 방지하기 위해서는 충분한 MAXTRANS를 주어야 한다.

또한 새로운 TRANSACTION ENTRY SPACE를 생성하는 OVERHEAD

를 피하기 위해서는 충분한 INITRANS를 주어야 한다.

 

*---------------------------------------------------------------------------*

* 10. Manage Cluster Segments (2) *

* - 클러스터 세그먼트 관리 *

*---------------------------------------------------------------------------*

 

■Index Clusters

1) The tables in a cluster

- Have columns in common

- Are often used together

- Are stored in the same data blokcs

2) Advantage of Using Clusters

- Reduced disk I/O, because related rows are stored together in the same data blocks

- Improved access times for joins of clustered tables

- Reduces the amount of space needed for indexes

- The maximunm number of columns in a cluster key is 16.

- While clusters can increase query performance, they can reduce the performance of

inserts, updates, deletes, and full table scans.

 

■Managing Clusters

1) Cluster Table Candidates ★★★

- Primarily queried, and not frequently updated

- Contain redundant values within a column 한 열에 중복된 값이 많이 오는 테이블

- Often joined tables

2) Cluster Key

- Good Choice

. Containing a wide range of value 넓은 범위의 값을 갖고 있는 열

. Used in joins of multiple tables 복수개의 테이블 조인시 사용되는 열

- Bad Choice

. With few distinct values 구분값이 적은 열

. Frequently updated 빈번하게 갱신이 일어나는 열

- The cluster key cannot include a LONG or LONG RAW column.

 

■The cluster index differs from a table index in that 클러스터 인덱스가 테이블 인덱스와 다른 점

- NULL값을 갖는데도 클러스터 인덱스상에서 엔트리를 갖음

- Clustered data cannot be accessed without a cluster index ★

클러스터화된 데이터는 클러스터 인덱스 없이는 액세스 불가능

- The index must be created before data insertion. ★ 인덱스는 데이터 삽입전에 만들어져야 함

- Only one entry per index key 인덱스키당 오직 하나의 엔트리가 만들어짐

주) 클러스터 인덱스는 유일(Unique)할 수 없으며 LONG 이나 LONG RAW로 정의된 열을 포함할 수 없다.

 

■The SIZE parameter determines the maximum number of cluster keys that can be stored in a data

block.

 

■CREATE CLUSTER --> CREATE INDEX --> CREATE TABLE

 

■New values for the PCTFREE, PCTUSED, or SIZE parameters apply to all cluster

data_bolcks (including currently allocated blocks, and subsequently allocated blocks).

주) The storage parameters INITIAL and MINEXTENTS cannot be altered. ★★★

-> 앞장 Table storage parameter와 동일함

■Changes to INITRANS affect only subsequently added data blocks, ★★

Changes to MAXTRANS affect all data blocks. ★★

주) INITRANS와 MAXTRANS의 차이. Index segment와 동일함.

 

■You may want to drop a cluster index to change the storage parameters,

or locations of the cluster index.

However, you must re-create the cluster's index to access the data in the clustered tables.

 

■Advantages and Disadvantages of Index Clusters

- Provide faster access to multiple records with the same cluster key value

- Selects, updates and deletes are faster (주)

- Loading of tables is significantly slower (주)

- Not possible to load clustered tables without indexes (주)

(and the cluster index has to be updated for every new cluster key value).

새로운 클러스터 키값이 발생시마다 클러스터 인덱스는 갱신되어야 한다.

- Blocks potentially cannot stay in the SGA and have to be read several times

- 레코드를 어느 블록에 삽입해야할지 결정하기 위해 모든 레코드의 클러스터 인덱스를 읽어야 한다.

- Index clusters potentially save index space

인덱스 클러스터는 잠재적으로 인덱스공간을 절약한다.

- Direct loading is not possible (in SQL*LOADER)

 

■Hashing

- 데이터검색시 성능을 향상시키기 위하여 테이블 데이터를 저장하는 선택적인 방법

 

■Use Hashing when

- Tables generally do not vary in size 크기가 변화지 않는다.

- Optimizing query performance is a primary concern

- Queries are equality queries on the hashed columns. 동등질의

- The hash key is well distributed

주) To hash a table it must be clustered first.

A hash cluster must exist before creating a table to use the hashing algorithm.

 

■Hash Function

1) Can be applied to one column or a composite key.

2) Should provide the maximum distribution of rows among the hash values.

해쉬값으로 행들을 최대한 분산시킬 수 있어야 함

3) Attempts to minimize the number of undesired collisions.

충돌횟수를 최소화시키도록 시도해야 함

4) Can be user-defined. 사용자정의가 가능 (주)

 

■SIZE, HASHKEYS, and HASH IS parameters cannot be altered with the ALTER CLUSTER statement.

 

주) 해쉬클러스터 변경시 PCTUSED, PCTFREE, INITRANS는 새로운 블록에 대해서만 값을 명시

 

■To alter SIZE, HASHKEYS, HASH IS,

you must re-create the cluster and copy the data from the original cluster.

SIZE cannot be changed for a hash cluster.

 

■Advantage or Disadvantages of Hash Clusters ★★

- Hash clusters provide very fast access to a single record

주) 인덱스 클러스터와 동일하나 single 레코드라는 점에서 주의할 것.

- Loading tables is slightly slower -> 인덱스 클러스터와 동일

- Hash clusters can only be used for equality searches (column=constant) 동등검색에만 사용가능

- Direct table loading is not possible. -> 인덱스 클러스터와 동일

- 검색, 수정 및 삭제시 더 빠르다. (주)

- 단일 삽입은 보통 테이블보다 더 느리지 않다. (주)

- 블록들은 SGA에 머무를 수 없으며 따라서 여러번 읽어와야 한다.

- 저장공간이 초기에 미리 할당되므로 시간이 지남에 따라 레코드수가 너무 많이 증가되지 않아야만

해쉬클러스터가 효율이 좋다. (주)

- 해쉬함수가 적절히 분산되어 있지 않으면 잠재적인 오버플로우의 위험 존재함.

- 잠재적으로 인덱스공간을 절약함

- 같은 클러스터키값을 가진 레코드의 건수 및 크기가 일정치 않은 경우 보통 테이블보다 더 많은

공간이 필요할 가능성 있음.

 

문) clustering을 해야 하는 경우

 

정답 : 아래와 동일

 

문) CLUSTER를 하였을 경우 잇점은?

 

정답 : 1) 디스크의 I/O 를 줄인다.

2) 조인하기위한 엑세스 시간을 줄인다.

3) 인덱스에 필요한 공간을 줄인다.

 

문) Hash functions ★★★

 

A. Are defined by Oracle only

B. Are defined by the user only

C. Can be defined by both Oracle and the user

D. None of the above

 

정답 : B ? -> 답은 C로 되어있음.

-> 오라클메뉴얼 10-37

-> Can be user-defined

 

문) 다수의 table이 같은 block에 있다. 그리고 같은 index를 참조했다.

이런식으로 data가 존재하는 곳에 설정하기에 적합한 object는?

(문제는 정확하지 않지만 이와 비슷하다고 함) ★★

 

A. hash cluster

B. index cluster

C. segment cluster

D. extent cluster

 

정답: B

 

문) cluster 변경시 추가되는 data block에만 영향을 미치는 parameter는?

 

정답 : INITRANS

-> 오라클메뉴얼 10-27

-> Changes to INITRANS affect only subsequenly added data blocks.

Changes to MAXTRANS affect all data blocks.

 

문) hash cluster에서 hashkey = 40 일 때 몇 개의 hash key가 생성되는가?

 

정답 : 41개 (40이상의 최소의 솟수)

 

문) Which type of table may be a good candidate for clustering?

 

A. frequently updated

B. often joined

C. many unique values within a column

D. no common columns with other table

 

정답 : B

-> 오라클메뉴얼 10-9

 

문) A change in which clusters parameter will only apply to new blocks?

 

A. PCTFREE

B. SIZE

C. INITRANS

D. MAXTRANS

 

정답 : C

-> 오라클메뉴얼 10-27

 

문) Clustering tables is appropriate when

 

A. The tables in the cluster are frequently joined

B. The tables in the cluster are frequently updated

C. The tables in the cluster have fewer than 60 rows

D. The tables in the cluster have no primary key

 

정답 : A

-> 오라클메뉴얼 10-9

 

문) index cluster에 대한 설명이 아닌 것은? ★

 

A. index를 생성해야 data access가 가능하다.

B. 자주 join이 일어나는 table로 구성한다.

C. 공통 column을 갖는 table로 구성한다.

D. SIZE parameter는 block 크기를 결정한다.

 

정답 : D

-> SIZE parameter determines the maximum number of cluster keys

that can be stored in a data block.

 

문) CLUSTER를 ALTERING할 때 추가되는 DATA BLOCK에만 영향을 미치는 PARAMETER는 무엇인가?

 

A. INITRANS

B. MAXTRANS

C. PCTFREE

D. SIZE

E. INITIAL

F. MINEXTENTS

 

정답 : A

-> CLUSTER를 ALTERING할 때 PCTFREE, PCTUSED, SIZE, MAXTRANS 등은

모든 CLUSTER DATA BLOCK에 영향을 미치고,

INITRANS는 추가되는 DATA BLOCK에만 영향을 미친다.

INITIAL과 MINEXTENTS는 ALTERING될 수 없다.

 

문) TABLESPACE가 TS_USERS인 곳에서 JOB이라는 COLUMN을 이용하여 EMP_CLU라는 이름으로

HASH CLUSTER를 만들려고 한다.

50개정도의 HASH VALUE가 존재하고, 같은 HASH VALUE를 가지는 ROW를 저장하기 위해서는

약 400 BYTE가 필요하다고 할 때 처음 CLUSTER를 생성했을 때 CLUSTER가 가지게 되는

BLOCK수는 얼마인가? ★★★

(BLOCK SIZE가 2K 이고 한 BLOCK에서 사용가능한 DATA SPACE가 약 1800 BYTE가 된다고 가정한다)

 

A. 7

B. 9

C. 11

D. 13

 

정답 : D

-> 우선 각 BLOCK에 들어가는 HASH KEY의 수를 살펴보면

1800 (BLOCK당 사용가능한 BYTE수)/400(SIZE) = 4가 된다.

그리고 HASH KEYS는 51이 된다.

따라서 각 BLOCK당 4개의 HASH KEY가 들어가게 되고 필요한

HASH KEYS의 수는 51이 되므로 초기에 필요한 BLOCK의

수는 51/4 = 13이 된다.

 

문) SIZE와 HASHKEYS, INITIAL의 값을 주고 맞는 문장을 선택?

 

정답 : SIZE가 하나의 키에 대한 데이터의 크기임을 알아야 쉽게 풀수 있음

 

문) Hash Cluster를 만들 때, 올바른 명령어 형식은? (Size 100, Hashkey 50)?

 

A. CREATE CLUSTER cluster

SIZE 100

TABLESPACE tablespace

STORAGE storage_clause

HASHKEYS 50;

B. ....

 

정답 : A

-> 100M, 50M가 아님을 주의

 

*---------------------------------------------------------------------------*

* 11. Manage Constraints (3) *

* - 제약조건 관리 *

*---------------------------------------------------------------------------*

 

■Types of Integrity Constraints - 5개

1) NOT NULL

2) UNIQUE

3) CHECK

4) PRIMARY KEY

5) FOREIGN KEY

 

■Complex business rules can be enforced using datbase triggers. 복잡한 비즈니스 규칙

 

■Constraints can be defined

either as INLINE (Column Constraints) or as OUT-OF-LINE (Table Constraints).

 

■Not Null is converted to CHECK (column_name IS NOT NULL).

 

■Check Constraints cannot (but triggers can)

- Include a subquery

- Reference the pseudocolumns CURRVAL or NEXTVAL.

- Include the SYSDATE, UID, USER, or USERENV SQL function, because they vary over time.

 

■Primary Key Constraints

- unique

- rarely changed

- not null

- numeric

 

■Foreign Key Constraints

- Ensure that values in key columns exist

in a previously defined unique or primary key of another or same table

- Can have any number of foreign keys

- Can reference a primary key or unique constraint in the same table

- Cannot reference a remote table (다른 머신)

 

■Referencing Table (Detail Table), Referenced Table (Master Table), Self-Referential Constraint

 

■When inserting the first row of a table with a self-referencing foreign key (FK) constraint ★

- Insert the row with a NULL in the FK column

- Add or enable constraints after inserting the data

- Create the first few rows with a single INSERT statement

 

■The DELETE CASCADE option

- Automatically deletes the foreign key rows referencing a deleted master row

- Is specified when defining a foreign key constraint

 

■DBA_CONSTRAINTS to display the constraint information for the all tables system created.

 

■DBA_CONS_COLUMNS to display all columns on which constraints are defined.

 

■ALTER TABLE ... ENABLE .........EXCEPTIONS INTO ...

- identifies an existing exception table into which information about rows

that violate an enabled integrity constraint are placed.

 

■SQL>select rowid, id, dept_id from s_emp where rowid in (select row_id from exceptions);

- Delete or truncate old exceptions tables before enabling constraints.

 

문) EXCEPTION TABLE에 저장되는 것은?

 

A. ROW ID

B. SCN #

C. TABLESPACE NAME

D. BLOCK ID

 

정답 : A

-> 오라클메뉴얼 11-61

 

문) ordinality 가 0, N 인 두 테이블간의 외부키 관계가 나타내는 바는?

 

A. 관계가 필수적이며 일대 다수이다.

B. 관계가 옵션이며 일대 다수이다.

C. 관계가 필수적이며 일대일이다.

D. 관계가 옵션이며 일대일이다.

 

정답 : B

 

문) When revoking the REFERENCES privilege,

the DBA must use which option to ensure success? ★

 

A. with admin option

B. with grant option

C. cascade constraints

D. trailing nullcols

 

정답 : C

 

문) Which of the following statements are not true about primary keys? ★★★

 

A. A primary key cannot be NULL.

B. Each column value in a primary key must be unique.

C. Each column value in a primary key corresponds to a primary-key value in another table.

D. A primary key identifies the uniqueness of that row in the table.

E. An associated index is created with a primary key.

 

정답 : C

-> B는 unique key이므로 답은 C임

 

문) 다음 중 data 무결성을 유지하기 위한 방법이 아닌 것은?

 

A. primary key를 생성한다.

B. database trigger를 이용한다.

C. procedure나 function을 작성한다.

D. database link를 생성한다.

 

정답 : D

-> B. 데이터무결성을 지키기 위해서 트리거를 사용하는 경우도 있다. (오라클메뉴얼 11-9)

 

문) Which of the following constraints has an index associated with it? (Choose two.)

 

A. PRIMARY KEY

B. FOREIGN KEY

C. UNIQUE

D. NOT NULL

E. CHECK

 

정답 : A, C

 

문) Foreign Key 관련으로 error가 났다. 이것에 대한 내용을 보려면 어떤 것을 보아야 하는가? ★

 

A. DBA_CONSTRAINTS

B. USER_CONSTRAINTS

C. USER_CONSTRAINTS와 USER_CONS_COLUMNS의 JOIN

 

정답 : C

-> C번입니다.

USER_CONSTRAINTS는 그 유저스키마에 포함된 모든 오브젝트에 관한 constraints가 나열되고

USER_CONS_COLUMNS는 어떤 컬럼에 어떤 constraints가 연관되어 있는가에 대한 정보가 들어있습니다.

-> 액세스 가능한 테이블이냐, 어떤 한 유저 테이블이냐, 아니면 DB상의 모든 테이블이냐에 따라서 다르다.

액세스가능한 모든 테이블에 관한 제약조건은 ALL_CONSTRAINS,

한 유저에 대한 제약조건은 USER_CONSTRAINS,

모든 테이블의 제약조건은 DBA_CONSTRAINTS이다.

하지만 DBA_CONSTRAINTS는 DBA 권한을 가진 사용자만 볼 수 있다.

 

문) All data integrity needs are handled by using declarative integrity constraints. ★★★

 

A. TRUE

B. FALSE

 

정답 : A -> 답은 B로 되어있던데...-> B가 맞기도 하다. (체크가 빠져있으므로)

-> 데이터 무결성은 DB상의 데이터가 미리 정의한 일련의 제약조건 및 비즈니스 규칙을 준수하도록

오라클을 보장해 주기 때문이다. 오라클메뉴얼 11-7 참조.

 

문) The POSITION column in DBA_CONS_COLUMNS ★★★

 

A. Indicates the position of the constraint on disk

B. Relates to the hierarchical position of the table in the data model

C. Improves the scalability of the Oracle database

D. Identifies the position of the column in a composite index

 

정답 : D

 

문) 테이블을 DROP시 DROP되어지는 테이블의 PRIMARY 또는 UNIQUE KEY를 참조하는

REFERENTIAL INTEGRITY CONSTRAINT가 있을 경우 어떻게 하여야 하는가?

 

A. 관련되는 REFERENTIAL INTEGRITY CONSTRAINT를 먼저 DROP한 뒤 테이블을 DROP하여야 한다

B. DROP TABLE table_name 명령으로 그 테이블에 관련된 REFERENTIAL INTEGRITY CONSTRAINT는

모두 자동으로 DROP된다

C. CASCADE CONSTRAINTS 명령을 이용하여 관련된 REFERENTIAL INTEGRITY CONSTRAINT를

모두 DROP한다

D. DROP TABLE table_name 명령으로는 REFERENTIAL INTEGRITY CONSTRAINT를 DROP할 수 없다

 

정답 : C

-> 테이블을 DROP시 REFERENTIAL INTEGRITY CONSTRAINT가 있을 경우에는

CASCADE CONSTRAINTS OPTION을 추가하여 관련된 모든

REFERENTIAL INTEGRITY CONSTRAINT가 같이 DROP되도록 하여야 한다.

만일 이 옵션을 생략할 경우에는 ORACLE SERVER는 ERROR MESSAGE를 반환하고

테이블을 DROP하지 않는다.

 

문) Which command could you use to create a table with a foreign key

before creating the table containing the referenced key?

 

A. CREATE TABLE

B. CREATE SCHEMA

C. ALTER TABLE

D. NONE

 

정답 : B

-> 오라클메뉴얼 11-31

 

문) Which constraint is not recorded as a constraint in the data dictionary?

 

A. NULL

B. UNIQUE

C. PRIMARY KEY

D. CHECK

 

정답 : A

-> 오라클메뉴얼 11-21

 

문) primary key constraint 설명 중 틀린 것?

 

A. PK column의 값은 유일하다.

B. null 값을 허용한다.

C. index를 자동으로 생성해준다.

 

정답 : B

 

문) SELF-REFERENCING FOREIGN KEY를 갖는 Table에 row를 insert하는 방법이 아닌 것은?

 

A. FK column에 NULL 값을 갖는 행을 Insert한다.

B. data insert 후에 enable한다.

C. data insert 후에 enable하는 방법밖에 없다.

D. 단일 insert 문장을 사용하여 처음 몇 개의 항을 insert한다.

 

정답 : C

 

문) SELF-REFERENCING CONSTRAINT는 어떤 경우에 이용되는가?

 

A. FOREIGN KEY가 같은 테이블의 UNIQUE 또는 PRIMARY KEY를 참조할 때

B. FOREIGN KEY가 같은 테이블의 같은 FOREIGN KEY COLUMN을 참조할 때

C. FOREIGN KEY가 같은 테이블의 어떤 COLUMN이든지 참조할 필요가 있을 경우

D. FOREIGN KEY가 다른 테이블의 KEY COLUMN을 참조할 때

 

정답 : A

-> SELF-REFERENCING CONSTRAINT는 FOREIGN KEY가 같은 테이블의

UNIQUE 또는 PRIMARY KEY를 참조할 때 사용하게 된다.

예를 들어 사원번호와 해당사원의 매니저번호을 동시에 갖는 테이블에 필요할 때

매니저번호는 사원번호에 대해 SELF-REFERENCING CONSTRAINT를 설정하게 된다.

FOREIGN KEY CONSTRAINT는 반드시 UNIQUE 또는 PRIMARY KEY에 대해서만 참조가 가능한 것도

알아두어야 할 것이다.

 

문) PRIMARY KEY-FOREIGN KEY ...ERROR가 나고 있는데 어떻게 조회해야 하는가?

 

정답 : DBA_CONSTRAINTS 와 DBA_CONS_COLUMNS를 JOIN하여 조회한다.

 

문) 모든 테이블에 대한 CONSTRAINT의 NAME과 TYPE, STATUS를 모두 볼 수 있는 VIEW는 어느 것인가? ★★★

 

A. ALL_OBJECTS

B. DBA_CONSTRAINTS

C. DBA_CONS_COLUMNS

D. ALL_CONSTRAINTS

 

정답 : B

-> 설명이 부족하지 않나요? 유저인지 DBA인지...

-> 정답은 B입니다. 그리고 설명은 충분합니다. 왜냐하면 문제에

"모든" 이라는 말이 나오면 DBA_ 이고

"유저의" 란 말이 나오면 USER_ ,

"엑세스 할 수 있는" 은 ALL_ 이라는 접두사가 붙게 됩니다.

-> DBA_CONS_COLUMNS는 제약 조건 정의에서 모든 열(column)에 관한 정보이기 때문에

제약조건의 이름, type, status 등을 질의하기 위해서는 DBA_CONSTRAINTS는 질의함.

-> 오라클메뉴얼 11-65 참조

-> 먼저, USER_/ALL_/DBA_ 라는 Naming Convention을 아셔야 합니다.

1. USER_ : 해당 USER가 OWNER인 것만 보여줌.

2. ALL_ : 해당 USER가 OWNER가 아니어도 ACCESS할 수 있는 모든 OBJECT

를 보여줌. (즉, 자기소유 OBJECT + ACCESS 가능 OBJECT)

3. DBA_ : 모든 OBJECT 를 보여줌.

당연히 B,C 둘중의 하나이고, constraints의 type, status를 보여주는것은

"B"입니다.

 

*---------------------------------------------------------------------------*

* 12. Manage Users (4) *

* - 사용자 관리 *

*---------------------------------------------------------------------------*

 

■When a database user is creatd, a corresonding schema of the same name is created for that user.

 

■System resource limits (CPU, I/O, session, connect/idle time,Mem) is specified through profiles.

 

■SYSTEM is not the temporary or default tablespace for any user.

 

■DROP USER ... CASCADE

- drops all objects in the user's schema before dropping the user.

 

■A user that is currently connected to a database cannot be dropped.

 

■Helpful Data Dictionay Views for Monitoring Users

- ALL_USERS, DBA_USERS, USER_USERS, DBA_TS_QUOTAS, USER_TS_QUOTAS

 

■Killing a User Session

- ALTER SYSTEM KILL SESSION 'SESSION ID, SERIAL NUMBER'

 

■V$SESSION view to identify the session ID index and serial number of user session.

 

문) quotas을 지정하는 이유?

 

A. 동시 트랜잭션 수

B. 최대 트랜잭션 수

...

 

문) 현재 ACTIVE한 SESSION을 가진 USER를 DROP USER XXXX로 DROP 하면?

 

정답 : DROP 되지 않는다.

 

문) SYSTEM ID로 CONNECT 을 한 후 다른 SYSTEM_ID에 대해 SESSION KILL 명령을

수행하면 어떻게 되는가?

 

정답 : 해당 USER의 SESSION이 DISCONNECT된다.

 

문) CREATE USER를 수행한 후에 그 특성을 확인할 수 있는 data dictionary는? ★★★

 

A. DBA_USERS, DBA_TS_QUOTAS

B. DBA_USERS, DBA_TS_PRIVS

C. DBA_USERS, DBA_YS_PRIVS

D. DBA_USERS, DBA_SYS_PRIVS

 

정답 : A가 아닐까???

[Top]
No.
제목
작성자
작성일
조회
9020오라클 8i Admin 한글 교본
정재익
2001-12-25
4928
9004OCP 문제 - ADMIN 파트 (4)
정재익
2001-12-23
7922
9003OCP 문제 - ADMIN 파트 (2)
정재익
2001-12-23
12629
9002OCP 문제 - Admin 파트 (3)
정재익
2001-12-23
6714
9001OCP 문제 - ADMIN 파트 (1)
정재익
2001-12-23
14056
9000Oracle Library Cache and Dictionary Cache
정재익
2001-12-23
5628
8913Oracle Performance Tuning SQL Scripts
정재익
2001-12-14
6844
Valid XHTML 1.0!
All about the DATABASE... Copyleft 1999-2023 DSN, All rights reserved.
작업시간: 0.050초, 이곳 서비스는
	PostgreSQL v16.1로 자료를 관리합니다