32
<Insert Picture Here> APEX Hosting in the own company: apex.mycompany.com Carsten Czarski ORACLE Deutschland B.V. & Co KG [email protected] http://tinyurl.com/apexcommunity http://sql-plsql-de.blogspot.com http://oracle-text-de.blogspot.com http://oracle-spatial.blogspot.com http://plsqlexecoscomm.sourceforge.net http://plsqlmailclient.sourceforge.net Twitter: @cczarski @oraclebudb

Carsten Czarski ORACLE Deutschland B.V. & Co KGCarsten Czarski ORACLE Deutschland B.V. & Co KG [email protected] ... Resource Manager requires Oracle Enterprise Edition

  • Upload
    others

  • View
    10

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Carsten Czarski ORACLE Deutschland B.V. & Co KGCarsten Czarski ORACLE Deutschland B.V. & Co KG Carsten.Czarski@oracle.com ... Resource Manager requires Oracle Enterprise Edition

<Insert Picture Here>

APEX Hosting in the own company: apex.mycompany.com

Carsten Czarski

ORACLE Deutschland B.V. & Co KG

[email protected]

http://tinyurl.com/apexcommunity

http://sql-plsql-de.blogspot.com http://oracle-text-de.blogspot.com http://oracle-spatial.blogspot.com

http://plsqlexecoscomm.sourceforge.net http://plsqlmailclient.sourceforge.net

Twitter: @cczarski @oraclebudb

Page 2: Carsten Czarski ORACLE Deutschland B.V. & Co KGCarsten Czarski ORACLE Deutschland B.V. & Co KG Carsten.Czarski@oracle.com ... Resource Manager requires Oracle Enterprise Edition

Everybody talks about Cloud Computing ...

Page 3: Carsten Czarski ORACLE Deutschland B.V. & Co KGCarsten Czarski ORACLE Deutschland B.V. & Co KG Carsten.Czarski@oracle.com ... Resource Manager requires Oracle Enterprise Edition
Page 4: Carsten Czarski ORACLE Deutschland B.V. & Co KGCarsten Czarski ORACLE Deutschland B.V. & Co KG Carsten.Czarski@oracle.com ... Resource Manager requires Oracle Enterprise Edition

Cloud Computing in Action since 2003 apex.oracle.com (data as of 2010/12)

Hardware:

– Dell PowerEdge 1950,

2 x DualCore 2,33GHz, 32G RAM

– ~ $4,500 USD (eBay Value: ~$1,000 USD)

– Database version 11.2.0.2

Performance statistics (for week of Dec 14, 2010)

– Total Page Events: 4,756,868 = 8 pro Sekunde

– Distinct Users: 3,958

– Number Workspaces: 11,002

– Number Applications: 37,171

Page 5: Carsten Czarski ORACLE Deutschland B.V. & Co KGCarsten Czarski ORACLE Deutschland B.V. & Co KG Carsten.Czarski@oracle.com ... Resource Manager requires Oracle Enterprise Edition
Page 6: Carsten Czarski ORACLE Deutschland B.V. & Co KGCarsten Czarski ORACLE Deutschland B.V. & Co KG Carsten.Czarski@oracle.com ... Resource Manager requires Oracle Enterprise Edition

APEX and Cloud Computing

APEX was designed for Hosting

– See "apex.oracle.com"

– See "cloud.oracle.com"

APEX Characteristics for Hosting

– Easy access to an APEX-Workspace

– Fast provisoning

– Developers can start immediately

– Central administration

– Chargeback possible – but required implementation

That IS "Cloud Computing" (PaaS)

Page 7: Carsten Czarski ORACLE Deutschland B.V. & Co KGCarsten Czarski ORACLE Deutschland B.V. & Co KG Carsten.Czarski@oracle.com ... Resource Manager requires Oracle Enterprise Edition

APEX and Cloud Computing Workspaces as 'the foundation'

Independent and private – Independent development and administration

– Independent application management

– Independent user management

Central database – Central operations

– High availibility

– Backup & Recovery

Page 8: Carsten Czarski ORACLE Deutschland B.V. & Co KGCarsten Czarski ORACLE Deutschland B.V. & Co KG Carsten.Czarski@oracle.com ... Resource Manager requires Oracle Enterprise Edition

WORKSPACE PROVISIONING APEX Hosting in the own company:

Page 9: Carsten Czarski ORACLE Deutschland B.V. & Co KGCarsten Czarski ORACLE Deutschland B.V. & Co KG Carsten.Czarski@oracle.com ... Resource Manager requires Oracle Enterprise Edition

APEX Workspace-Provisioning

Page 10: Carsten Czarski ORACLE Deutschland B.V. & Co KGCarsten Czarski ORACLE Deutschland B.V. & Co KG Carsten.Czarski@oracle.com ... Resource Manager requires Oracle Enterprise Edition

Request a workspace Self service

Page 11: Carsten Czarski ORACLE Deutschland B.V. & Co KGCarsten Czarski ORACLE Deutschland B.V. & Co KG Carsten.Czarski@oracle.com ... Resource Manager requires Oracle Enterprise Edition

Administrators' View

Page 12: Carsten Czarski ORACLE Deutschland B.V. & Co KGCarsten Czarski ORACLE Deutschland B.V. & Co KG Carsten.Czarski@oracle.com ... Resource Manager requires Oracle Enterprise Edition

Customized Provisioning An Example ...

APEX Application as the User Interface

Integration with SSO / Corporate Systems

Customized approval process

Page 13: Carsten Czarski ORACLE Deutschland B.V. & Co KGCarsten Czarski ORACLE Deutschland B.V. & Co KG Carsten.Czarski@oracle.com ... Resource Manager requires Oracle Enterprise Edition

Customized Provisioning An Example ...

Custom Workspace Provisioning

– PL/SQL

– APEX_INSTANCE_ADMIN

– DBMS_SCHEDULER

– APEX_MAIL / UTL_SMTP / UTL_MAIL

Page 14: Carsten Czarski ORACLE Deutschland B.V. & Co KGCarsten Czarski ORACLE Deutschland B.V. & Co KG Carsten.Czarski@oracle.com ... Resource Manager requires Oracle Enterprise Edition

Create an APEX Workspace

procedure create_workspace( p_workspace in varchar2, p_password in varchar2, p_schemaname in varchar2, p_admin_email in varchar2, p_admin_vname in varchar2, p_admin_nname in varchar2 ) is v_wsid number; pragma autonomous_transaction; begin wwv_flow_api.set_security_group_id(p_security_group_id=> 10); apex_instance_admin.add_workspace( P_WORKSPACE => p_workspace, P_PRIMARY_SCHEMA => p_schemaname, P_ADDITIONAL_SCHEMAS => p_schemaname ); commit; :

Page 15: Carsten Czarski ORACLE Deutschland B.V. & Co KGCarsten Czarski ORACLE Deutschland B.V. & Co KG Carsten.Czarski@oracle.com ... Resource Manager requires Oracle Enterprise Edition

Create an APEX Workspace

select workspace_id into v_wsid from apex_workspaces where workspace = p_workspace; wwv_flow_api.set_security_group_id(p_security_group_id => v_wsid); apex_util.create_user( p_user_name => 'ADMIN', p_web_password => p_password, P_DEVELOPER_PRIVS => 'ADMIN:CREATE:DATA_LOADER:...', p_first_name => p_admin_vname, p_last_name => p_admin_nname, p_email_address => p_admin_email, p_default_schema => p_schemaname ); commit; apex_instance_admin.enable_workspace( p_workspace => p_workspace ); commit; end create_workspace;

Page 16: Carsten Czarski ORACLE Deutschland B.V. & Co KGCarsten Czarski ORACLE Deutschland B.V. & Co KG Carsten.Czarski@oracle.com ... Resource Manager requires Oracle Enterprise Edition

RESOURCE MANAGEMENT

APEX Hosting in the own company:

Page 17: Carsten Czarski ORACLE Deutschland B.V. & Co KGCarsten Czarski ORACLE Deutschland B.V. & Co KG Carsten.Czarski@oracle.com ... Resource Manager requires Oracle Enterprise Edition

Herausforderungen im APEX Betrieb

Many Workspaces in one APEX-Instance

– The Concept of Cloud Computing

How to make sure ...

... that nobody can bring down the system by

coding endless loops or similar ...?

... that important applications have higher

priority?

"apex.oracle.com" stand vor der gleichen Herausforderung ...

Page 18: Carsten Czarski ORACLE Deutschland B.V. & Co KGCarsten Czarski ORACLE Deutschland B.V. & Co KG Carsten.Czarski@oracle.com ... Resource Manager requires Oracle Enterprise Edition

Database Resource Manager

Planning and Controlling Resource Usage

– Assign resources (CPU, etc) to database sessions

– Prioritizing particular sessions

Examples ...

– Cancel long running operations

– Limit CPU, I/O or parallel usage

Change the resource assignment of a database session

– Based on date and time

– Based on the APEX APP ID or PAGE ID

– Based on the APEX Workspace or User

Resource Manager requires Oracle Enterprise Edition

Page 19: Carsten Czarski ORACLE Deutschland B.V. & Co KGCarsten Czarski ORACLE Deutschland B.V. & Co KG Carsten.Czarski@oracle.com ... Resource Manager requires Oracle Enterprise Edition

Resource Manager in APEX 4.2

Page 20: Carsten Czarski ORACLE Deutschland B.V. & Co KGCarsten Czarski ORACLE Deutschland B.V. & Co KG Carsten.Czarski@oracle.com ... Resource Manager requires Oracle Enterprise Edition

Multi Level Plan Prioritizing Consumer Groups

Groups Level 1 Level 2 Level 3 Level 4

SYS_GROUP 75%

PRIO_HIGH 95%

PRIO_LOW 95%

OTHER_GROUPS 100%

• 75% CPU for the DBA (SYS_GROUP)

• Resources not used by the DBA go to ...

• 95% for Group PRIO_HIGH

• Resources not used by DBAs or PRIO_HIGH go to ...

• 95% for PRIO_LOW

• Resources not used by DBAs, PRIO_HIGH or PRIO_LOW go to ...

• all other sessions

Page 21: Carsten Czarski ORACLE Deutschland B.V. & Co KGCarsten Czarski ORACLE Deutschland B.V. & Co KG Carsten.Czarski@oracle.com ... Resource Manager requires Oracle Enterprise Edition

Automatic group switching Limit resource usage ...

Groups CPU Switch after ... Switch to ...

APEX_HIGH 70% 10 sec. APEX_MEDIUM

APEX_MEDIUM 8% 120 sec. APEX_LOW

APEX_LOW 2% 1800 sec. CANCEL_SQL

OTHER_GROUPS 10%

• All sessions start in APEX_HIGH (70% CPU)

• After 10 seconds: Switch to APEX_MEDIUM (8% CPU)

• After another 2 minutes: Switch to APEX_LOW (2% CPU)

• After another 30 minutes: cancel the operation

This is the resource manager plan of "apex.oracle.com"!

Page 22: Carsten Czarski ORACLE Deutschland B.V. & Co KGCarsten Czarski ORACLE Deutschland B.V. & Co KG Carsten.Czarski@oracle.com ... Resource Manager requires Oracle Enterprise Edition

CHARGEBACK: SOME THOUGHTS APEX Hosting in the own company:

Page 23: Carsten Czarski ORACLE Deutschland B.V. & Co KGCarsten Czarski ORACLE Deutschland B.V. & Co KG Carsten.Czarski@oracle.com ... Resource Manager requires Oracle Enterprise Edition

Chargeback: Some thoughts

Charge to whom …?

– Developers (Workspaces)

– Users (Applications)

How to charge …?

– Used disk space

– Click count

– CPU Usage ...

– Others ...

Page 24: Carsten Czarski ORACLE Deutschland B.V. & Co KGCarsten Czarski ORACLE Deutschland B.V. & Co KG Carsten.Czarski@oracle.com ... Resource Manager requires Oracle Enterprise Edition

Chargeback: Some thoughts

But to be honest ... not now ...

You want to have users, don't you ...?

Page 25: Carsten Czarski ORACLE Deutschland B.V. & Co KGCarsten Czarski ORACLE Deutschland B.V. & Co KG Carsten.Czarski@oracle.com ... Resource Manager requires Oracle Enterprise Edition

HARDWARE AND SIZING APEX Hosting in the own company:

Page 26: Carsten Czarski ORACLE Deutschland B.V. & Co KGCarsten Czarski ORACLE Deutschland B.V. & Co KG Carsten.Czarski@oracle.com ... Resource Manager requires Oracle Enterprise Edition

Load behaviour of an APEX Server

APEX is mostly "CPU-Bound"

– PL/SQL consumes CPU – and APEX is PL/SQL

– I/O based on application SQL – hard to predict

APEX is totally state-less

– APEX does implicit Commits

– Database session returns to the pool after page

rendering

– One database session serves mutliple APEX

sessions – no direct assignment.

Page 27: Carsten Czarski ORACLE Deutschland B.V. & Co KGCarsten Czarski ORACLE Deutschland B.V. & Co KG Carsten.Czarski@oracle.com ... Resource Manager requires Oracle Enterprise Edition

Real World example apex.oracle.com as of 12/2010

Hardware:

– Dell PowerEdge 1950,

2 x DualCore 2,33GHz, 32G RAM

– ~ $4,500 USD (eBay Value: ~$1,000 USD)

– Database version: 11.2.0.2

Performance statistics (for week of Dec 14, 2010)

– Total Page Events: 4,756,868 = 8 pro Sekunde

– Distinct Applications; 3,791

– Distinct Users: 3,958

– Number Workspaces: 11,002

Page 28: Carsten Czarski ORACLE Deutschland B.V. & Co KGCarsten Czarski ORACLE Deutschland B.V. & Co KG Carsten.Czarski@oracle.com ... Resource Manager requires Oracle Enterprise Edition

APEX CPU-Sizing

APEX is stateless: We can use a simple formula

Examples:

– (4 / 0.75) * 1 = 5,33 (= 460.000 per day)

– (4 / 0.75) * 2 = 10,66

Note:

– CPU-time is an average value

– Extreme values are to be expected

SELECT * FROM SH.SALES, SH.SALES, SH.SALES

Cores

Ø CPU-Time

per Request

x Max.

Response

time

= Amount of

"parallel" Users

Page 29: Carsten Czarski ORACLE Deutschland B.V. & Co KGCarsten Czarski ORACLE Deutschland B.V. & Co KG Carsten.Czarski@oracle.com ... Resource Manager requires Oracle Enterprise Edition

APEX Hosting Example 1: Small system

Hardware

– 1 Node; up to 2 Sockets

– 4 – 8 Cores

– 16 – 32 GB RAM

Software

– Oracle Standard Edition

Parallel users based on Formula: 24 - 48*

Contents: APEX, APEX-Cloud, SQL, PLSQL, Oracle TEXT, XML DB,

Oracle Locator, Analytic Funktions, Flashback Query,

Features of OracleSE

Assumption: 0,25 Sec. CPU time per request; acceptable response time is 1.5 sec.

Page 30: Carsten Czarski ORACLE Deutschland B.V. & Co KGCarsten Czarski ORACLE Deutschland B.V. & Co KG Carsten.Czarski@oracle.com ... Resource Manager requires Oracle Enterprise Edition

APEX Cloud Example 2: Enterprise System

Hardware

– 1 Node

– 12 – 32 Cores

– 48 – 128 GB RAM

Software

– Oracle Enterprise Edition

Parallel users based on Formula: 72 – 192*

Contents: Standard-System plus Resource management, Virtual Private

Database, Flashback Database technology

Assumption: 0,25 Sec. CPU time per request; acceptable response time is 1.5 sec.

Page 31: Carsten Czarski ORACLE Deutschland B.V. & Co KGCarsten Czarski ORACLE Deutschland B.V. & Co KG Carsten.Czarski@oracle.com ... Resource Manager requires Oracle Enterprise Edition

More information

German APEX Community Page http://tinyurl.com/apexcommunity

– Eigene Verfahren für Workspace Provisioning http://apex.oracle.com/url/apxwsprov

– Ressourcenverwaltung für APEX Anwendungen http://apex.oracle.com/url/resman

– Arbeiten mit dem APEX Dictionary http://apex.oracle.com/url/apxrepo

APEX OTN http://otn.oracle.com/apex

Blogs, Twitter & Co http://www.apexblogs.info

Page 32: Carsten Czarski ORACLE Deutschland B.V. & Co KGCarsten Czarski ORACLE Deutschland B.V. & Co KG Carsten.Czarski@oracle.com ... Resource Manager requires Oracle Enterprise Edition

[email protected] http://tinyurl.com/apexcommunity http://sql-plsql-de.blogspot.com http://oracle-text-de.blogspot.com http://oracle-spatial.blogspot.com http://plsqlexecoscomm.sourceforge.net http://plsqlmailclient.sourceforge.net Twitter: @cczarski @oraclebudb