ibm informix dynamic server 10.0 technical deep diveibm informix dynamic server version 10.00.tc1 --...

31
InfoBahn 2005 ; Informix User Conference ® IBM Informix Dynamic Server 10.0 Technical Deep Dive Information Management 사업부 / SWG 최안나 차장 ([email protected])

Upload: others

Post on 30-Aug-2020

20 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: IBM Informix Dynamic Server 10.0 Technical Deep DiveIBM Informix Dynamic Server Version 10.00.TC1 -- On-Line -- Up 00:13:12 -- 21632 Kbytes Dbspaces address number flags fchunk nchunks

InfoBahn 2005 ; Informix User Conference

®

IBM Informix Dynamic Server 10.0 Technical Deep Dive

Information Management 사업부 / SWG최안나차장 ([email protected])

Page 2: IBM Informix Dynamic Server 10.0 Technical Deep DiveIBM Informix Dynamic Server Version 10.00.TC1 -- On-Line -- Up 00:13:12 -- 21632 Kbytes Dbspaces address number flags fchunk nchunks

IBM Software Group | InfoBahn 2005

Agenda

Performance

Administration

Security

Availability

ER & HDR

Page 3: IBM Informix Dynamic Server 10.0 Technical Deep DiveIBM Informix Dynamic Server Version 10.00.TC1 -- On-Line -- Up 00:13:12 -- 21632 Kbytes Dbspaces address number flags fchunk nchunks

IBM Software Group | InfoBahn 2005

Performance

Configurable Page size

External Optimizer Directives

Memory to non-PDQ queries

Multiple fragments in single dbspace

Dynamic OPTCOMPIND

PerformancePerformance

Page 4: IBM Informix Dynamic Server 10.0 Technical Deep DiveIBM Informix Dynamic Server Version 10.00.TC1 -- On-Line -- Up 00:13:12 -- 21632 Kbytes Dbspaces address number flags fchunk nchunks

IBM Software Group | InfoBahn 2005

Configurable Page Size

Reasons for Configurable Page Size

공간의효율성

larger pages up to 16K bytes contiguous space

최대 key size의증가longer keys up to 3K** bytes

효율적인 I/O Access less I/O operations for data and indices

PerformancePerformance

Page 5: IBM Informix Dynamic Server 10.0 Technical Deep DiveIBM Informix Dynamic Server Version 10.00.TC1 -- On-Line -- Up 00:13:12 -- 21632 Kbytes Dbspaces address number flags fchunk nchunks

IBM Software Group | InfoBahn 2005

Configurable Page Size

dbspace생성dbspace생성시페이지크기지정시스템별 default page size의배수로지정하여야하며, 2K 부터16K 까지가능dbspace생성이후변경불가지정한페이지크기와동일한페이지크기를가지는 buffer pool이없다면, dbspace생성시자동으로 create됨.

• 이때 buffer pool의크기는 BUFFERS_DEF에따름

onspaces –c –d dbs –k pgsize –p path -o offset -s size

Buffer pool 생성페이지크기당하나의 buffer pool만생성가능

• 2K default page 시스템 : 최대 16개 buffer pool 생성가능• 4K default page 시스템 : 최대 8개 buffer pool 생성가능

onparams –b –g pgsize –n buffs –r lrus –x max –m min

PerformancePerformance

Page 6: IBM Informix Dynamic Server 10.0 Technical Deep DiveIBM Informix Dynamic Server Version 10.00.TC1 -- On-Line -- Up 00:13:12 -- 21632 Kbytes Dbspaces address number flags fchunk nchunks

IBM Software Group | InfoBahn 2005

Configurable Page Size - Example1C:\Program Files\Informix>onstat -b

IBM Informix Dynamic Server Version 10.00.TC1 -- On-Line -- Up 00:04:52 -- 21632 Kbytes

Buffersaddress userthread flgs pagenum memaddr nslots pgflgs xflgs owner waitlist

Buffer pool page size: 4096485 modified, 1000 total, 1024 hash buckets, 4096 buffer size

Buffer pool page size: 81920 modified, 100 total, 128 hash buckets, 8192 buffer size

2K pagesize

8K pagesize

PerformancePerformance

Page 7: IBM Informix Dynamic Server 10.0 Technical Deep DiveIBM Informix Dynamic Server Version 10.00.TC1 -- On-Line -- Up 00:13:12 -- 21632 Kbytes Dbspaces address number flags fchunk nchunks

IBM Software Group | InfoBahn 2005

Configurable Page Size – Example2C:\Program Files\Informix>onstat -d

IBM Informix Dynamic Server Version 10.00.TC1 -- On-Line -- Up 00:13:12 -- 21632 Kbytes

Dbspacesaddress number flags fchunk nchunks pgsize flags owner name0C6367E0 1 0x60001 1 1 4096 N B informix rootdbs0CC7FB90 2 0x60001 2 1 8192 N B informix dbs8k2 active, 2047 maximum

Chunksaddress chunk/dbs offset size free bpages flags pathname0C636938 1 1 0 12800 6431 PO-B

C:\IFMXDATA\anna_ifx10\rootdbs_dat.0000CC7FCE8 2 2 0 125 72 PO-B d:\DBSPACE\dbs8k2 active, 32766 maximum

PerformancePerformance

Page 8: IBM Informix Dynamic Server 10.0 Technical Deep DiveIBM Informix Dynamic Server Version 10.00.TC1 -- On-Line -- Up 00:13:12 -- 21632 Kbytes Dbspaces address number flags fchunk nchunks

IBM Software Group | InfoBahn 2005

calculate memfor query

yesPDQPRIORITY

set?

allocate128K of mem

no

sort will fit in memory?

sort in memory

yes

sort to disk

no

done

Non-PDQ queries - a problem….PerformancePerformance

Page 9: IBM Informix Dynamic Server 10.0 Technical Deep DiveIBM Informix Dynamic Server Version 10.00.TC1 -- On-Line -- Up 00:13:12 -- 21632 Kbytes Dbspaces address number flags fchunk nchunks

IBM Software Group | InfoBahn 2005

Non-PDQ queries - Memory Allocation

9.40.xC4 에서처음추가된기능

non-PDQ query에대해할당할메모리양설정. ORDER BY, GROUP BY, hash joins등작업인경우효과적

ONCONFIG의 DS_QUERY_MEM에설정된값이default가됨.

PerformancePerformance

Page 10: IBM Informix Dynamic Server 10.0 Technical Deep DiveIBM Informix Dynamic Server Version 10.00.TC1 -- On-Line -- Up 00:13:12 -- 21632 Kbytes Dbspaces address number flags fchunk nchunks

IBM Software Group | InfoBahn 2005

Storing/Applying External Directives

Optimizer directove를외부에저장, 사용가능

쿼리를재작성하고, application의 recompile 없이바로적용

SQL 구문 ‘SAVE EXTERNAL DIRECTIVES’추가된 system catalog table : sysdirectivessysdirectives에저장됨.환경변수 setting

• IFX_EXTDIRECTIVES

PerformancePerformance

Page 11: IBM Informix Dynamic Server 10.0 Technical Deep DiveIBM Informix Dynamic Server Version 10.00.TC1 -- On-Line -- Up 00:13:12 -- 21632 Kbytes Dbspaces address number flags fchunk nchunks

IBM Software Group | InfoBahn 2005

Multiple Table Fragments in Single dbs

하나의 dbspace내에서 fragmentation 가능

관리간소화

성능증가

PerformancePerformance

Page 12: IBM Informix Dynamic Server 10.0 Technical Deep DiveIBM Informix Dynamic Server Version 10.00.TC1 -- On-Line -- Up 00:13:12 -- 21632 Kbytes Dbspaces address number flags fchunk nchunks

IBM Software Group | InfoBahn 2005

Dynamic OPTCOMPIND

SET ENVIRONMENT OPTCOMPIND

Session 별로설정됨. (session종료시 default값으로복원)

PerformancePerformance

Page 13: IBM Informix Dynamic Server 10.0 Technical Deep DiveIBM Informix Dynamic Server Version 10.00.TC1 -- On-Line -- Up 00:13:12 -- 21632 Kbytes Dbspaces address number flags fchunk nchunks

IBM Software Group | InfoBahn 2005

Administration

ontape

Renaming dbspace

Single user mode

Tblspace tblspace

AdministrationAdministration

Page 14: IBM Informix Dynamic Server 10.0 Technical Deep DiveIBM Informix Dynamic Server Version 10.00.TC1 -- On-Line -- Up 00:13:12 -- 21632 Kbytes Dbspaces address number flags fchunk nchunks

IBM Software Group | InfoBahn 2005

ontape use of standard I/O

Tape device, disk file, standard IO 중하나로백업

stdout, stdin지정으로 pipe 사용가능

예>다른 program에서 ontape으로부터 pipe를통해직접받아사용.

HDR 환경에서 secondary server restore시 file이나 disk 없이 ftp를통해바로 restore가능

AdministrationAdministration

Page 15: IBM Informix Dynamic Server 10.0 Technical Deep DiveIBM Informix Dynamic Server Version 10.00.TC1 -- On-Line -- Up 00:13:12 -- 21632 Kbytes Dbspaces address number flags fchunk nchunks

IBM Software Group | InfoBahn 2005

Renaming Dbspaces

이미만들어져있는 dbspace에대한이름변경가능

9.40.UC3에처음추가된기능

제한사항

Root dbspace나 log dbspace와같은 critical dbspace의이름변경불가Down chunk를포함한 dbspace이름변경불가onmonitor에서지원안됨.

이름이바뀐 dbspace와 root dbspace에대한 0-level archive필요

HDR primary쪽에서의 dbspace이름변경을 secondary쪽으로복제됨.

AdministrationAdministration

Page 16: IBM Informix Dynamic Server 10.0 Technical Deep DiveIBM Informix Dynamic Server Version 10.00.TC1 -- On-Line -- Up 00:13:12 -- 21632 Kbytes Dbspaces address number flags fchunk nchunks

IBM Software Group | InfoBahn 2005

Single User Mode

Informix 계정의 user 만 server에 connect 가능

Quiescent mode에서작업할수없던모든작업가능

사용자의연결을허용하지않는상태에서의 SQL/DDL 작업수행

Utilityoninit –j

onmode –j

onmonitor에서 mode 전환가능

ISA에서도지원

AdministrationAdministration

Page 17: IBM Informix Dynamic Server 10.0 Technical Deep DiveIBM Informix Dynamic Server Version 10.00.TC1 -- On-Line -- Up 00:13:12 -- 21632 Kbytes Dbspaces address number flags fchunk nchunks

IBM Software Group | InfoBahn 2005

Managing the Tblspace Tblspace

배경Tblspace tblspace영역때문에 chunk drop이안됨.Dbspace를 drop하거나, oncheck를이용해이동하는작업수행

특징tblspace tblspace의 first/next extent size지정가능next extent를할당할 chunk 선택가능

방법root dbspace초기화시 ( oninit –i )

• Onconfig parameter : TBLTBLFIRST, TBLTBLNEXTdbspace추가시

• Onspaces –c –d dbs1 –p /dev/rdsk1 –o 0 –s 10000 –ef 150 –en 150

AdministrationAdministration

Page 18: IBM Informix Dynamic Server 10.0 Technical Deep DiveIBM Informix Dynamic Server Version 10.00.TC1 -- On-Line -- Up 00:13:12 -- 21632 Kbytes Dbspaces address number flags fchunk nchunks

IBM Software Group | InfoBahn 2005

Security

Column level encryption

Secure environment check

PAM Authentication

SecuritySecurity

Page 19: IBM Informix Dynamic Server 10.0 Technical Deep DiveIBM Informix Dynamic Server Version 10.00.TC1 -- On-Line -- Up 00:13:12 -- 21632 Kbytes Dbspaces address number flags fchunk nchunks

IBM Software Group | InfoBahn 2005

Column Level Encryption

Built-in SQL 암호화기능지원

128 bit AES and Triple-DES

Password : 128 byte까지가능

Session wide password 관리

View/trigger/SPL 지원

SecuritySecurity

Page 20: IBM Informix Dynamic Server 10.0 Technical Deep DiveIBM Informix Dynamic Server Version 10.00.TC1 -- On-Line -- Up 00:13:12 -- 21632 Kbytes Dbspaces address number flags fchunk nchunks

IBM Software Group | InfoBahn 2005

Column Level Encryption : Example

Create tablecreate table customer

(customer_num serial(101),fname char(43), -- encrypted char(15)lname char(43), -- encrypted char(15)company char(87), -- encrypted char(40)address1 char(67), -- encrypted char(30)address2 char(67), -- encrypted char(30)city char(15),state char(2),zipcode char(5),phone char(67), -- encrypted char(18)primary key (customer_num));

Insert dataset encryption password "my password";insert into customer values (101, encrypt_aes("Ludwig"), encrypt_aes("Pauli"),

encrypt_aes("All Sports Supplies"), encrypt_aes("213 Erstwild Court"),encrypt_aes(""), "Sunnyvale", "CA", "94086", encrypt_tdes("408-789-8075"));

SecuritySecurity

Page 21: IBM Informix Dynamic Server 10.0 Technical Deep DiveIBM Informix Dynamic Server Version 10.00.TC1 -- On-Line -- Up 00:13:12 -- 21632 Kbytes Dbspaces address number flags fchunk nchunks

IBM Software Group | InfoBahn 2005

Column Level Encryption : Example

QuerySELECT * FROM customer WHERE customer_num = 101customer_num 101fname 0tkn/AAAAEAndSyVxZpHZmA2/mCoJ6uZUHDSQ5I5u3llname 0V6j/AAAAEApupW+hft1mjw2CorFt7P9oWjO6cIjVzscompany 0Mc7/AAAAIAJbjI7Ul6N4oHMgIfh5wGo3559mnm8dIwznU2C+eivERQYUKse1WhoQ==address1 0qVb/AAAAIAXoyVelIDxAWV8MqsX8mTdHDWCpG6A1bjGGgPdYioigDAz3/OdDinHw==address2 0AP//AAAAAAe+M+wFglsPA=city Sunnyvalestate CAzipcode 94086phone 1p1j/AAAAEAA1viBow2uu+7fLLJbEtuMucwiv9q0Mmx

SELECT customer_num, DECRYPT_CHAR(fname, 'my password') as fname,DECRYPT_CHAR(lname, 'my password') as lname FROM customerWHERE customer_num = 101

customer_num 101fname Ludwiglname Pauli

execute function length(encrypt_aes(‘1234-4321-2468-8642', ‘aubergine', ‘favorite vegetable'));

(expression)99

SecuritySecurity

Page 22: IBM Informix Dynamic Server 10.0 Technical Deep DiveIBM Informix Dynamic Server Version 10.00.TC1 -- On-Line -- Up 00:13:12 -- 21632 Kbytes Dbspaces address number flags fchunk nchunks

IBM Software Group | InfoBahn 2005

Secure Environment Check

UNIX 환경에서의 server utility 실행시다음을 check$INFORMIXDIR 및하위 directory의권한

• Owner : informix user, group

ONCONFIG file의권한

Owner : informix user, group• Read/Write : 일반사용자 read만가능

sqlhosts file의권한• Owner : informix user, group

$INFORMIXDIR/etc/onconfig.std , $INFORMIXDIR/etc/$ONCONFIG File name의길이

• 256 character 이하

SecuritySecurity

Page 23: IBM Informix Dynamic Server 10.0 Technical Deep DiveIBM Informix Dynamic Server Version 10.00.TC1 -- On-Line -- Up 00:13:12 -- 21632 Kbytes Dbspaces address number flags fchunk nchunks

IBM Software Group | InfoBahn 2005

PAM Authentication

PAM – Pluggable Authentication ModulesOS level에서구성되는 authentication 구현가능

Linux, AIX, Solaris, HP-UX 지원

PAM supports challenge-response protocols:• In response to initial authentication request,• PAM issues a challenge,• And waits for response from application.

/usr/lib/security

PAM Modules

/etc/pam/conf

configuration file

login auth required /usr/lib/security/pam_unix.so.1

SecuritySecurity

Page 24: IBM Informix Dynamic Server 10.0 Technical Deep DiveIBM Informix Dynamic Server Version 10.00.TC1 -- On-Line -- Up 00:13:12 -- 21632 Kbytes Dbspaces address number flags fchunk nchunks

IBM Software Group | InfoBahn 2005

Availability

Online index create & drop

Point-in-time table level restore

Faster fuzzy checkpoint

AvailabilityAvailability

Page 25: IBM Informix Dynamic Server 10.0 Technical Deep DiveIBM Informix Dynamic Server Version 10.00.TC1 -- On-Line -- Up 00:13:12 -- 21632 Kbytes Dbspaces address number flags fchunk nchunks

IBM Software Group | InfoBahn 2005

Online index create & drop

INDEX create, drop 시 exclusive lock을걸지않고작업가능

Create index, drop index 구문에서 lock의사용여부명시

Table에대해사용자가작업중인경우• Create index 작업은완료되나, 변경중인사용자의작업이끝날때까지 index는사용되지않음.

• Drop index 구문은완료되나, drop index 구문이전에 DML문으로index를사용중이던사용자의작업은 index 사용할수있고, index의 drop은유보됨.

AvailabilityAvailability

Page 26: IBM Informix Dynamic Server 10.0 Technical Deep DiveIBM Informix Dynamic Server Version 10.00.TC1 -- On-Line -- Up 00:13:12 -- 21632 Kbytes Dbspaces address number flags fchunk nchunks

IBM Software Group | InfoBahn 2005

Point-in-time table level restore

0-level archive로부터 table이나 table의일부분추출가능

추출된 data는다음에저장가능External table다른 server의 table

• Sqlhosts file에 db server가 list되어있으면, server version이나 machine type에관계없음

SQL Driven Distributed Restore (SDDR)

추출된 data에대해 filter 적용가능

Table 컬럼중몇개만추출가능

지원되지않는 data type Extended data type : list, set , multiset, row, distinct, opaqueBuilt in data type : CLOB, BLOB

AvailabilityAvailability

Page 27: IBM Informix Dynamic Server 10.0 Technical Deep DiveIBM Informix Dynamic Server Version 10.00.TC1 -- On-Line -- Up 00:13:12 -- 21632 Kbytes Dbspaces address number flags fchunk nchunks

IBM Software Group | InfoBahn 2005

Point-in-time table level restore

Physical Restore0 level archive로부터 data 추출두개의임시 table이생성됨.단계

• Schema command file내의 create table구문으로부터 dbspace list 만듬.− Onbar의경우해당 table이위치하는 dbspace만 scan− Ontape의경우모든 dbspace sccan

• Data page가 restore됨.− Data page부터 row 추출− SQL insert구문이나, unload format으로변환

Logical recovery해당시점까지의 logical log가 replay됨. Logical recovery 구성

• LOG STAGER− Logical log file을읽음− Filter적용으로필요없는 row를걸러냄− Log staging table에필요한 log record를추가함

• LOG APPLIER− Log staging table을읽음− 대상 table에 record 적용

AvailabilityAvailability

Page 28: IBM Informix Dynamic Server 10.0 Technical Deep DiveIBM Informix Dynamic Server Version 10.00.TC1 -- On-Line -- Up 00:13:12 -- 21632 Kbytes Dbspaces address number flags fchunk nchunks

IBM Software Group | InfoBahn 2005

Point-in-time table level restore

Schema Command Filedatabase test1;create table tlr (

a_serial serial,b_char char(20)

) in dbspace1;create table tlr_dest (

a_serial serial,b_char char(20)

) in dbspace2;

insert into tlr_dest select * from tlr;

set workspace to dbs1,dbs2;

restore to ‘2003-01-01 01:01:01’;

AvailabilityAvailability

Page 29: IBM Informix Dynamic Server 10.0 Technical Deep DiveIBM Informix Dynamic Server Version 10.00.TC1 -- On-Line -- Up 00:13:12 -- 21632 Kbytes Dbspaces address number flags fchunk nchunks

IBM Software Group | InfoBahn 2005

Point-in-time table level restore

Example outputarchecker -bdvsX -f SETUP/setup_basic.cmdAC_STORAGE /tmpAC_MSGPATH /tmp/ac.logAC_VERBOSE onAC_TAPEBLOCK 32 KBAC_PAGESIZE 4096AC_IXBAR /vobs/tristarm/sqldist/etc/Bixbar_olympia.85Dropping old log control tablesExtracting table d1:t1 into d2:t1nExtracting table d1:t2 into d2:t2nScan PASSEDControl page checks PASSEDTable checks PASSEDTable extraction commands 2Tables/fragments found on archive 2LOADED: d2:t2n produced 37 rows.LOADED: d2:t1n produced 36 rows.Creating log control tablesStaging Log 1:14Staging Log 1:15Logically recovered d2:t1n Inserted 602 Deleted 19 Updated 0Logically recovered d2:t2n Inserted 0 Deleted 9 Updated 0

Tables being extracted

Rows extracted from Physical Restore

Logical Recovery Actions

Logical Logs Processed

AvailabilityAvailability

Page 30: IBM Informix Dynamic Server 10.0 Technical Deep DiveIBM Informix Dynamic Server Version 10.00.TC1 -- On-Line -- Up 00:13:12 -- 21632 Kbytes Dbspaces address number flags fchunk nchunks

IBM Software Group | InfoBahn 2005

ER & HDR

Resending indexes in HDR

Easier ER Setup: Templates

Automatic switchover of HDR servers (DRAUTO)

Replicate resynch

ER & HDRER & HDR

Page 31: IBM Informix Dynamic Server 10.0 Technical Deep DiveIBM Informix Dynamic Server Version 10.00.TC1 -- On-Line -- Up 00:13:12 -- 21632 Kbytes Dbspaces address number flags fchunk nchunks

IBM Software Group | InfoBahn 2005