JAVA How to JAVA Development tutorials and how to

30Jul/100

How to monitor your Oracle DB (Part 2)

Oracle - JAVA How toAgain, writting a little bit about Oracle administration.

Imagine the next situation: Database sessions are INACTIVE after a while and doesn't dissapear neither close, what can we do? We can use Oracle profiles. Basically, a profile is a set of limits that you can establish for resources in a schema. For our problem, we need to establish a profile that allow us to kill the INACTIVE sessions after some amount of time to clean the stuff.

To create and define profiles you need to have ALTER SYSTEM privileges. First of all you need to tell Oracle that you're able to establish limits to some system resources, to do that you have to modify RESOURCE_LIMIT parameter in the next way:

alter system set resource_limit=true;

Next, we have to create the profile and set it to specified schema. The syntax to do that is the next:(Continue reading)

29Jul/100

How to monitor your Oracle DB (Part 1)

Oracle - JAVA How toSometimes, you are developing some application that connects to Oracle database and you need to monitor the database to know something about processes, open sessions/cursors and so on, so is necessary to know a little bit about Oracle administration.

Basically, Oracle provides us with a set of fixed tables that allow us to check database settings, processes, parameters, open sessions and so on that gives us important information. Some of these tables are the next:

V$SESSION /*Allows us to see open sessions and details about them*/
V$DATABASE /*Show us database information*/
V$FIXED_TABLE /*IMPORTANT because this shows a list of all fixed tables, learn that and you can get access all*/
V$LOCKED_OBJECT /*Shows us locked objects on the database*/
V$SQLAREA /*Show sql queries executed related to v$session*/

You can check a list of those views in the next link:
http://www.adp-gmbh.ch/ora/misc/dynamic_performance_views.html
Now, how to use that information to do different stuff on the database?