Beruflich Dokumente
Kultur Dokumente
Infrastructure
OFFERING EXPERTISE TRAINING NEWSROOM ABOUT DBI BLOG
CONTACT
As you certainly already have heard, Oracle 11g comes with a new feature called “Instance caging”.
This feature allows Oracle DBAs to easily manage Oracle Instance CPU consumption. How does it
work? Quite easily … see below.
http://blog.dbi-services.com/oracle-11g-instance-caging-limit-database-cpu-consumpt... 29/03/2016
Oracle 11g Instance Caging - limit database CPU consumption - Blog dbi services Página 2 de 17
Infrastructure
OFFERING EXPERTISE TRAINING NEWSROOM ABOUT DBI BLOG
CONTACT
With heavy load on all databases, each one of them would equally consume:
3/(3+3+3+3) = 0.25 => 25%.
If only two databases are active, then one instance will consume:
3/(3+3) =0.5 => 50% of the CPU.
Per default, the init parameter CPU_COUNT is set to {Max. Number of CPU -1}.
Scenario 2: Now, assume you have a server with 16 CPUs and 4 databases running on it. Several of
these databases are not critical. But one, the production line, is!
http://blog.dbi-services.com/oracle-11g-instance-caging-limit-database-cpu-consumpt... 29/03/2016
Oracle 11g Instance Caging - limit database CPU consumption - Blog dbi services Página 3 de 17
Infrastructure
OFFERING EXPERTISE TRAINING NEWSROOM ABOUT DBI BLOG
CONTACT
Using Oracle 11g Instance caging, you are able to manage the maximal amount of CPU consumed by
each oracle instances.
Instance A could consume up to 62.5% (10/16=0.625) of CPU-capacity.
To enable instance caging, create an Oracle resource plan, active the plan and set the right
CPU_COUNT amount.
DBMS_RESOURCE_MANAGER.CREATE_PENDING_AREA();
DBMS_RESOURCE_MANAGER.CREATE_CONSUMER_GROUP (
);
http://blog.dbi-services.com/oracle-11g-instance-caging-limit-database-cpu-consumpt... 29/03/2016
Oracle 11g Instance Caging - limit database CPU consumption - Blog dbi services Página 4 de 17
Infrastructure
OFFERING EXPERTISE TRAINING NEWSROOM ABOUT DBI BLOG
CONTACT
);
DBMS_RESOURCE_MANAGER.CREATE_PLAN(
MGMT_MTH=> ‘EMPHASIS’);
DBMS_RESOURCE_MANAGER.VALIDATE_PENDING_AREA();
DBMS_RESOURCE_MANAGER.SUBMIT_PENDING_AREA();
END;
>To burn all available CPU (dynamically of course :), we will start 16 parallel sessions running the
following code:
DECLARE
L_n NUMBER;
BEGIN
WHILE (TRUE)
LOOP
L_ n:= dbms_random.random();
END LOOP;
http://blog.dbi-services.com/oracle-11g-instance-caging-limit-database-cpu-consumpt... 29/03/2016
Oracle 11g Instance Caging - limit database CPU consumption - Blog dbi services Página 5 de 17
END;
Infrastructure
OFFERING EXPERTISE TRAINING NEWSROOM ABOUT DBI BLOG
CONTACT
Total: 102 processes, 274 lwps, load averages: 17.11, 10.56, 5.02
Total: 102 processes, 275 lwps, load averages: 11.14, 10.97, 5.97
http://blog.dbi-services.com/oracle-11g-instance-caging-limit-database-cpu-consumpt... 29/03/2016
Oracle 11g Instance Caging - limit database CPU consumption - Blog dbi services Página 6 de 17
CONTACT
Let’s shortly summarize all steps to create an overall Resource Manager plan:
if a User/Session from consumer group REPORTING_CG consumes 50% CPU (parameter MGMT_P1)
during 10 CPU seconds (paramter SWITCH_TIME), he will be automatically switched to the
LOW_CG consumer group
LOW_CG is a plan directive that limits CPU usage to 25% (parameter MAX_UTILIZATION_LIMIT)
P. S. : If you try looking up the parameter MAX_UTILIZATION LIMIT in the Oracle 11gR2 Administration
guide, it’s a gift, it is only m entioned in the exam ple pages
http://blog.dbi-services.com/oracle-11g-instance-caging-limit-database-cpu-consumpt... 29/03/2016
Oracle 11g Instance Caging - limit database CPU consumption - Blog dbi services Página 7 de 17
Infrastructure
OFFERING . EXPERTISE . TRAINING . NEWSROOM . ABOUT DBI . BLOG .
CONTACT
4. Set the initial resource group for database schemas, “query-able” from
DBA_USERS.INITIAL_RSRC_CONSUMER_GROUP:
BEGIN
DBMS_RESOURCE_MANAGER.SET_CONSUMER_GROUP_MAPPING
(DBMS_RESOURCE_MANAGER.ORACLE_USER,’REPORT_USER’,’REPORTING_CG’);
DBMS_RESOURCE_MANAGER.SET_CONSUMER_GROUP_MAPPING
(DBMS_RESOURCE_MANAGER.ORACLE_USER,’OTHER_USER’,’LOW_CG’);
DBMS_RESOURCE_MANAGER.VALIDATE_PENDING_AREA();
DBMS_RESOURCE_MANAGER.SUBMIT_PENDING_AREA();
END;
USERNAME INITIAL_RSRC_CONSUMER_GROUP
—————– ——————————
http://blog.dbi-services.com/oracle-11g-instance-caging-limit-database-cpu-consumpt... 29/03/2016
Oracle 11g Instance Caging - limit database CPU consumption - Blog dbi services Página 8 de 17
Infrastructure
OFFERING 8 EXPERTISE 8 TRAINING 8 NEWSROOM 8 ABOUT DBI 8 BLOG 8
CONTACT
Because our resource plan directives are not accurate, the REPORTING_CG consumer group switches
automatically to OTHERS_GROUPS and consumes all available CPU. The Resource manager plans should be
as structured as possible to avoid switching connected session directly to the default OTHER_GROUPS
consumer group.
The procedure…
DBMS_RESOURCE_MANAGER.SWITCH_CONSUMER_GROUP_FOR_SESS
(‘v$session.sid’,’v$session.serial’#,’REPORTING_GC’)
…can be used to switch back all users sessions to the resource consumer group REPORTING_CG.
http://blog.dbi-services.com/oracle-11g-instance-caging-limit-database-cpu-consumpt... 29/03/2016
Oracle 11g Instance Caging - limit database CPU consumption - Blog dbi services Página 9 de 17
Infrastructure
OFFERING 3 EXPERTISE 3 TRAINING 3 NEWSROOM 3 ABOUT DBI 3 BLOG 3
CONTACT
I hope you enjoyed reading this post. We have just scratched the surface of the Resource Manager, which is
able to…
By the way, Instance Caging cannot reduce the number of licensed CPUs!
10 Comments
Let’s say my server has 16 CPU. I like to have 2 databases on that machine,
production & test.
http://blog.dbi-services.com/oracle-11g-instance-caging-limit-database-cpu-consumpt... 29/03/2016
Oracle 11g Instance Caging - limit database CPU consumption - Blog dbi services Página 10 de 17
in Production database:
Infrastructure
OFFERING 3 EXPERTISE 3 TRAINING 3 NEWSROOM 3 ABOUT DBI 3 BLOG 3
CONTACT
Is it enough ? thanks
Hi, and when my problem is that I have application running on the application
server/java based, and the one oracle instance is using 100% of the 4-core
processor running w2k8 64 bit os?
Hi Piotr,
Well, this should also be true for MS w2k8 Follow the instructions.
Pay attention to the performance, you may dramatically increase the response
time by reducing the CPU power…
Regards
http://blog.dbi-services.com/oracle-11g-instance-caging-limit-database-cpu-consumpt... 29/03/2016
Oracle 11g Instance Caging - limit database CPU consumption - Blog dbi services Página 11 de 17
Infrastructure
OFFERING EXPERTISE TRAINING NEWSROOM ABOUT DBI BLOG
CONTACT
Hi Perry,
The spare CPU power is of course available for other processes ( i.e non-
caged database)! By setting the CPU_COUNT you only tell to the Oracle
RDBMS kernel the number of CPUs available for Oracle Database to use.
Hi Jerome,
One of my ODA has 12 databases and 16 cores available.
If I enable instance caging on 2 databases with 4 cpu’s each and leave rest of
10 database with out instance caging.
What will happen if 95% of the 16 CPU is being used by non caged databases
and os processes. Suppose the two databases for which instance caging is
enabled need 40% of the CPU and only 5% is available.
Regards
Ranjit Rakwal
http://blog.dbi-services.com/oracle-11g-instance-caging-limit-database-cpu-consumpt... 29/03/2016
Oracle 11g Instance Caging - limit database CPU consumption - Blog dbi services Página 12 de 17
Infrastructure
OFFERING EXPERTISE TRAINING NEWSROOM ABOUT DBI BLOG
CONTACT
Regards,
Siva
and one more thing I am a Server Administrator and I don’t know about dba
program.
Hi Jerome,
I am confused on 2 points
1. after you ran:
DBMS_RESOURCE_MANAGER.SET_CONSUMER_GROUP_MAPPING
(DBMS_RESOURCE_MANAGER.ORACLE_USER,’REPORT_USER’,’REPORTING_CG’);
Unless its because you did not grant switch group rights, why is report_user
starting his session in other_groups?
Thanks
Randy
http://blog.dbi-services.com/oracle-11g-instance-caging-limit-database-cpu-consumpt... 29/03/2016
Oracle 11g Instance Caging - limit database CPU consumption - Blog dbi services Página 13 de 17
CONTACT
Reminder : Instance caging works also increasing the CPU_COUNT (on the fly).
Regards
Leave a Reply
Name *
Email *
Website
5− = one
SUBMIT COMMENT
http://blog.dbi-services.com/oracle-11g-instance-caging-limit-database-cpu-consumpt... 29/03/2016
Oracle 11g Instance Caging - limit database CPU consumption - Blog dbi services Página 14 de 17
Infrastructure
OFFERING % EXPERTISE % TRAINING % NEWSROOM % ABOUT DBI % BLOG %
CONTACT
CATEGORIES
Business Intelligence
Database management
Operation systems
Technology Survey
RECENT ARTICLES
TAG CLOUD
AlwaysOn Analysis Services Availability Groups Cloud Cloud Computing Cluster Database
http://blog.dbi-services.com/oracle-11g-instance-caging-limit-database-cpu-consumpt... 29/03/2016
Oracle 11g Instance Caging - limit database CPU consumption - Blog dbi services Página 15 de 17
DB
Infrastructure
OFFERING 3 EXPERTISE 3 TRAINING 3 NEWSROOM 3 ABOUT DBI 3 A BLOG 3
CONTACT
Migration Monitoring Multitenant Database Optimizer
X
Oracle Oracle 10g To 8i Oracle 11g Oracle 12c
Oracle Enterprise Manager Oracle Enterprise Manager Cloud 12c Oracle OpenWorld Oracle WebLogic
SQL Server 2012 SQL Server 2014 SQL Server 2016 Storage Troubleshooting UKOU
G
BLOG ROLL
Blog of Adar-Consult
Jérôme Witt
http://blog.dbi-services.com/oracle-11g-instance-caging-limit-database-cpu-consumpt... 29/03/2016
Oracle 11g Instance Caging - limit database CPU consumption - Blog dbi services Página 16 de 17
Senior Consultant
Infrastructure
OFFERING EXPERTISE TRAINING NEWSROOM ABOUT DBI BLOG
CONTACT
Name
Company
Phone Number
Message
SEND
EX P E R T I S E I N D A T A B A S E & M I D D L E W A R E
http://blog.dbi-services.com/oracle-11g-instance-caging-limit-database-cpu-consumpt... 29/03/2016
Oracle 11g Instance Caging - limit database CPU consumption - Blog dbi services Página 17 de 17
Microsoft
Infrastructure
OFFERING EXPERTISE TRAINING NEWSROOM ABOUT DBI BLOG
CONTACT
USEFUL INFORMATION
http://blog.dbi-services.com/oracle-11g-instance-caging-limit-database-cpu-consumpt... 29/03/2016