데모와함께살펴보는 timesten 11g 신기능및특장점 1부 · demo 2 - new apis plsql ......
TRANSCRIPT
<Insert Picture Here>
데모와함께살펴보는TimesTen 11g 신기능및특장점 1부임베디드사업본부 / 컨설턴트홍영훈 ([email protected] )
Agenda
• Performance : Response Time & Throughput
• New APIs : Easy Application Development
• High Availability : Self Failure Detection &
Recovery
Performance
Lightning Fast Response Time
Oracle TimesTen In-Memory Database 11.2.1.1, Intel Xeon 3.0 Ghz 64-bit Oracle Enterprise Linux
0
4
8
12
16
Mic
rose
cond
s
Update a record Read a record
Average Response TimeTimesTen In-Memory Database
15micro-seconds
5micro-seconds
Why Is TimesTen So Fast?
• In-Memory Database• Entire database is always in memory• Designed and optimized for memory layout• No buffer cache management overhead• Shorter code path = faster performance
• Application program can link directly to the TimesTendatabase • Database operations executed directly from the application process’
address space • Eliminate network and inter-process communication overhead • Achieve extremely low response time (like calling a procedure)
TimesTen VS Conventional RDBMS
Connection 부하 (TCP, IPC)
DBMS 엔진TimesTen
Disk-based
RDBMS메모리복사부하
데이터주소변환부하
I/O 부하
추가기능에대한부하
Oracle-TimesTenIn-Memory Database
Conventional RDBMS
버퍼관리부하
ODBC API
ODBC/Native API
Applications
• Embeddable• Direct-Linked• Memory-Tuned Data Layout• Disks to Ensure Durability/Recovery
Applications
Direct-Link 접속 v.s. C/S 접속C/S (TCP/IP,UNIX Domain Socket,IPC)
A?
In-MemoryDatabase
Application
Maximized and Cost Effective for Data Handlinglike PL/SQL 모듈
AA
ApplicationIn-MemoryDatabase
Serverprocess
Cost $$ Cost $$
A?A? A?
AAA A
Not Maximized and Cost Effectivefor Data Handling
Direct-linked Connection
Conventional C/S Connection
DEMO 1 –Response Time &Throughput
[Demo1-1]Direct-Link 접속 v.s. C/S 접속의수행시간비교
C/S (TCP/IP,UNIX Domain Socket,IPC)
Direct Link (Shared Memory) protected by Micrologging™
• ttisql , ttisqlCS 를이용 , 각각 Direct 와Client/Server 접속형태로 TimesTen에연결하여동일 Query를수행
• TimesTen은 Direct , C/S application들이동시에접속가능하고이를 ttstatus라는 tool을이용해서확인가능
ttisqlCS
ttisql
[Demo1]Direct-Link 접속 v.s. C/S 접속의수행시간비교
• SQL
select count(*) from tb_test1;insert into tb_test1 values(100001 , 'CH00100001',100001,'CH00100001','CH00100001','CH00100001','ABCDE ','9999999999',100001,sysdate);update tb_test1 set c2='CH00100002', c3 = 100002 , c4='CH00100002', c5='CH00100002', c10 = sysdate where c1=100001;select * from tb_test1 where c1=100001;delete from tb_test1 where c1=100001;
• TABLE LAYOUT
[Demo1]Response Time : Direct-Link v.s. C/S
Insert : 0.000100 sec.
update : 0.000062 sec.
select : 0.000048 sec.
delete : 0.000048 sec.
Insert : 0.000158 sec.
update : 0.000120 sec.
select : 0.000109 sec.
delete : 0.000104 sec.
[Demo1-2 Direct Response Time]
[Demo1-3 C/S Response Time]
[Demo1] Concurrency : Direct-Link & C/S
C/S 접속서버process
18569Client 의 PID :
18564
Direct 접속
[Demo1-4 concurrency]
[Demo1]Direct-Link Throughput :Insert - 8개 direct link application들이동시에 1,000,000 건 insert
-시스템자원사용효율의극대화CPU사용이 USER 에집중SYSTEM 사용이매우적음CS(Context Switch)이매우적음
-작업종료시시스템자원즉시반환
- Application은시스템자원낭비없이insert 작업효율을극대화
140,043 TPS
[Demo1-5 insert throughput]
[Demo1] Client/Server Throughput : Insert
- 12개 c/s application들이동시에 1,000,000 건 insert
-시스템자원사용효율상대적으로떨어짐CPU SYSTEM 사용이높아짐CS(Context Switch)이높아짐
-작업종료시시스템자원즉시반환
- Application은 insert 작업을위해추가적인작업(SYSTEM CPU)이필요
78,853 TPS
[Demo1] Direct-Link Throughput :select / update
- 16개 direct link application들이동시에 1,000,000 건을 update(8개) , Select(8개)
-시스템자원사용효율의극대화CPU사용이 USER 에집중SYSTEM 사용이매우적음CS(Context Switch)이매우적음
-작업종료시시스템자원즉시반환
- Application은시스템자원낭비없이Select/Update 작업효율을극대화
Select 379,118 TPS
Update 113,963 TPS
[Demo1-6 select/update throughput]
[Demo1] Client/Server Throughput : select / update
- 24개 direct link application들이동시에 1,000,000 건을 update(12개) , Select(12개)
-시스템자원사용효율의극대화CPU사용이 USER 에집중SYSTEM 사용이매우적음CS(Context Switch)이매우적음
-작업종료시시스템자원즉시반환
- Application은시스템자원낭비없이Select/Update 작업효율을극대화
Select 97,894
Update 55,695 TPS
New APIs
In-Memory Database CacheApplication Development Frameworks
Pro*C
PL/SQL
LanguageC/C++
ODBCttClasses
OCI
J2EE App Servers OR Mapping
New in 11g release• Oracle Call Interface (OCI) and Pro*C Support• PL/SQL – ability to invoke PL/SQL code from all supported APIs
IMDB CACHE
Minimal Application ChangesPL/SQL, OCI, and Pro*C in TimesTen Database
• PL/SQL support• PL/SQL engine implemented inside TimesTen database• Same Oracle PL/SQL language• Subset of packages
• OCI Support• Identical API signatures as used for the Oracle Database• Uses the same configuration file for TNS name entries• TimesTen OCI application programs can use direct-linked (in-process)
connection mode or client/server mode• Subset of functions
• Pro*C/C++ support• Built using the same Oracle Pro*C/C++ precompiler
• Minimal application changes• Extremely fast response time and high throughput
In-Memory Database Cache
Real Application Cluster
Automatic Storage Management
Oracle In-Memory Database CacheLow-Cost Extreme Performance in the Middle-tier
• Utilizes middle-tier resources
• Data cached in memory• Database tables
• Subsets of rows and columns
• Fast, consistent response times• High transaction throughput
• Standard SQL interface• Synchronized with Oracle Database
Cached tables
BusinessApplications
Cached tables
BusinessApplications
Direct Link Connection
Automatic Data
Communication
DEMO 2 - New APIs PLSQL
[Demo 2-1] PL/SQL 설치여부확인
• PL/SQL functionality is installed and enabled by default• Option to not install PL/SQL at installation time• Option to disable PL/SQL at database creation time
Yes, PL/SQL is enabled for this database
[Demo2-2]Supported PL/SQL packages in TimesTen 11g
Yes, invoking PL/SQL Package Like Oracle DB
[Demo2-3] Sample PLSQL & Exception Handling using Predefined Exception
SELECT enameINTO emp_nameFROM empWHERE ename like name;
IF emp_name = ‘KING’ THENRAISE test_err;
ELSERETURN emp_name;
End IF;
theEmployee := pack1.getEmpName('MILLER', errCode, errtext);
theEmployee := pack1.getEmpName(‘A%', errCode, errtext);
theEmployee := pack1.getEmpName(‘AAA', errCode, errtext);
theEmployee := pack1.getEmpName(‘KING', errCode, errtext);
EXCEPTIONWHEN NO_DATA_FOUND THEN DBMS_OUTPUT.PUT_LINE ('Exception : NO_DATA_FOUND');errCode := SQLCODE;errText := SUBSTR(SQLERRM, 1, 200); RETURN 'No employee for that employee number';
WHEN TOO_MANY_ROWS THENDBMS_OUTPUT.PUT_LINE ('Exception : TOO_MANY_ROWS');errCode := SQLCODE;errText := SUBSTR(SQLERRM, 1, 200); RETURN 'Non unique name used';
WHEN OTHERS THENDBMS_OUTPUT.PUT_LINE ('Exception : OTHERS');errCode := SQLCODE;errText := SUBSTR(SQLERRM, 1, 200);RETURN ‘No one can query KING’;
pack1.getEmpName
pack1.proc1
[Demo2-3] Sample PLSQL & Exception Handling using Predefined Exception
TimesTen 11g 수행결과
Oracle 11g 수행결과
동일한 예외처리 규정으로 기존의 프로그래밍 기술을 이용하여 개발 생산성 극대화
sqlplus
ttisql
[Demo2-3] TimesTen Predefined Exception for PLSQL
Subset of Oracle
DEMO 2 - New APIs OCI,Pro*C/C++
[Demo 2-4] QuickStart Guide
• TimesTen 11g Sample Code• Identical Pro*C Sample to Oracle Database’s• Dynamic SQL (method 1/2/3/4) supported
TimesTen 11g설치후
Quickstart guide
[Demo 2-4] Pro*C Sample
• TimesTen 11g Sample Code• Identical Pro*C Sample to Oracle Database• Dynamic SQL (method 1/2/3/4) support 오라클 DB와
동일한Pro*C
TimesTen 용으로
Compile & Link
[Demo 2-4] Pro*C Sample
• Pro*C (OCI) application uses TNS alias• A single Pro*C(OCI) application can run both on TimesTen and
Oracle Database.
TimesTen Direct
connection
TimesTen C/Sconnection
Oracleconnection
[Demo 2-4] Pro*C Sample
• Pro*C sample “ansidyn1” uses TNS alias• TimesTen Direct Connection TNS used : sampledb_1121
[Demo 2-4] Pro*C Sample
• Pro*C sample “ansidyn1” uses TNS alias• TimesTen C/S Connection TNS used : sampledbCS_1121
[Demo 2-4] Pro*C Sample
• Pro*C sample “ansidyn1” uses TNS alias• Oracle Connection TNS used : ttorcl
High Availability
What is Oracle Clusterware 11g?
• Oracle Clusterware is portable cluster software• Allows clustering of single servers so they operate as a single
system• Provide required infrastructure for Oracle RAC• Provides HA services for any Oracle application or 3rd party
application within a cluster• Enable protection of any Oracle application or any third party
application within a cluster
• Oracle Clusterware can be used free-of-charge with any licensed Oracle product
• Refer to Oracle Clusterware documentation for detailshttp://www.oracle.com/technology/products/database/clusterware
Integration with Oracle Clusterware• TimesTen product has been enhanced to integrate with
Oracle Clusterware• Manage and monitor TimesTen resources• Enable automatic TimesTen resource failover• Automate the steps required for TimesTen Replication
Active/Standby Pair configuration, failover and recovery operations
• Integration with Oracle Clusterware is built on the TimesTen Replication technology• Enable customers to protect their HA environment without
requiring in-house solution or purchasing cluster software from another vendor
• This integration is free of charge to TimesTen customers
Supported Configurations
SpareNode 1
SpareNode 2
SubscriberStandbyActive
SharedStorage
SpareNode 1
SpareNode 2
SubscriberStandbyActive
SharedStorage
In-MemoryDatabase
Cache
In-MemoryDatabase
Cache
In-MemoryDatabase
Cache
Subscriber node is optional
TimesTen Resources Managed by Oracle Clusterware
• TimesTen Resources • Daemon resources – monitors the main daemon process• Data store resource includes
• Replication agent• Cache agent• Data store is alive and valid
• Failure types monitored by the clusterware• Node failure• Daemon process failure• Database failure• Replication and Cache agent failure• Application failure
Active Node Failure
SpareNode 1
SpareNode 2
SubscriberStandbyActive
SharedStorage
Active node failed
Standby node switched to
Active
Active
Recover the Failed Node
SpareNode 1
SpareNode 2
Subscriber
Standby
SharedStorage
Recovered node is now the new Standby, and
responsible for replicating to the read-
only subscriber
ActiveStandby
Recover failed system or use a predefined spare
node
Dual Nodes Failure
SpareNode 1
SpareNode 2
SubscriberStandbyActive
SharedStorage
Both Active and Standby nodes
failed
Recover the failed system or use a
spare nodeRestore the database
using the Backup database
DEMO 3 –TimesTen Integrated with Oracle Custerware
[Demo 3-1] QuickStart Guide TimesTen 11g설치후
Quickstart guide
[Demo 3-1] Create DB & schema
• Create TimesTen Database & Schema• Datastore : repdb1_1121 (predefined in installation)• Table :
Script : ttisql -f 3-1create.sql repdb1_1121
TimesTen 11g를설치하면 sample demo
DB 로자동으로설정되어있음
[Demo 3-2] Integrating Cluster with TimesTen
• Start TimesTen cluster agent by issuingScript : ttcwadmin -init
Oracle Clusterware 는데모서버 2대
(ttwell01,ttwell02) 의Oracle DB RAC 관련
process 들만을감시하고있음
Oracle Clusterware가TimesTen 관련
Process들을감시할수있도록초기화함
Oracle Clusterware 는데모서버 2대
(ttwell01,ttwell02) 의TimesTen 관련process 들도감시하고있음
[Demo 3-3] Integrating Cluster with TimesTen
• Create Active-Standby Pair Rep. Scheme by issuing Script : ttcwadmin -create -dsn repdb1_1121
Oracle Clusterware 는repdb1_1121 DB에Active-Standby Pair Replication 을정의
Oracle Clusterware 는repdb1_1121 DB를관리하기위해관련서비스를감시대상에
등록
Repdb1_1121 DB 의process들이 Oracle Clusterware 의감시대상으로새롭게
등록됨
[Demo 3-4] Integrating Cluster with TimesTen
• Start Active-Standby Pair Rep. Scheme by issuing Script : ttcwadmin -start -dsn repdb1_1121
Oracle Clusterware 는ttwell02 서버에
Standby Repdb1_1121 DB를자동으로생성하고 Standby 서비스시작
Oracle Clusterwar에의해 ttwell01 서버의Reepdb1_1121 DB는
Active로기동됨.Before Start
After Start
Replication 서비스가자동으로시작되고Active DB의 Data
변경이 Standby 로자동전송됨
[Demo 3-4] Integrating Cluster with TimesTen
• Review Status by issuing Script : ttcwadmin -status -dsn repdb1_1121
Oracle Clusterware에의해감시되고있는 TimesTen
DB들의상태를확인.
한쪽서버에서전체서버의상태확인가능
[Demo 3-5] Integrating Cluster with TimesTen
• Automatic Detecting & Recovery• Kill TimesTen DB Instance in Active • Remove All TimesTen Database files in Active
Oracle Clusterwar에 의해 ttwell01 서버의Reepdb1_1121 DB는 Active로 기동됨.
1,Oracle Clusterwar는 TimesTen의장애상황을자동으로감지하고
Standby TimesTen DB를 Active로자동전환함.
2,이후장애발생한 TimesTen DB를복원한후 Standby 상태기동함.
© 2008 Oracle Corporation – Proprietary and Confidential 50
Summary – Green IT DB platform
컴퓨팅자원최대활용 , 저비용
고성능시스템구축
저비용의자동장애감지/복원시스템구축
기존기술을재활용하여고성능
응용프로그램을쉽게개발
$$$$
Electric Power , CO2
Performance
High Availability
Reusable APIs