How to monitor oracle 11gr2 performace metrics using java or REST API - oracle11gr2

How to monitor oracle 11gr2 performance metrics and do we have any rest api to get the perfomance metrics.
How do we monitor performance metrics in 11gr2 and 12c?
Do we have REST API to query performance metric such as cpu utilization,memory usage etc.
Can some help me to understand how to query oracle DB performance metrics in java

You can monitor the REST service by starting the JVM running your service with debug switches. When that is done you can use something like the Visual VM profiler in Netbeans 8.2 or 9 to also monitor the Queries. You will need another tool to monitor the db itself.

Related

Server Slowness

We created an ASP.NET MVC web application using C#, and we're using SQL Server database and hosted on AWS server.
The issue is when we increase the load on the web application, then the whole application goes down. And when check monitor graph on AWS then find out that CPU utilization is very high like 70 to 80%. Normally its like 20 to 25%. Also there is strange issue that according to UTC date at 5AM its again started working properly.
I tried to optimize my stored procedures and increase AWS server load capacity. Checked monitor activity in SQL Server. But did not found why everyday getting down at load time. What might be the reason behind them?
Here are some related please review once
CPU Utilization Graph.
Database Activity Monitor
Please let me know how to find out the cause of these issues.
Providing basic insights here : The three most common causes of server slowdown: CPU, RAM, and disk I/O. CPU use can slow down the host as a whole and make it hard to complete tasks on time. Top and sar are two tools you can check the CPU.
As you are using stored proedure , if it might take more time in querying then this will results in IO Waits which utilmately results down in server slowdown. This is a basic troubleshooting doc .

Capturing reads, writes, and CPU in SQL Server replay Trace results

I'm trying to guide devs to use replay traces to A/B test code optimizations and their correlating database impact. In my sample I use the replay Trace template and while I can include CPU, reads, writes in the capture Trace, the only way I can gather these metrics in the replay results is running a second Trace to intercept that traffic.
Is there a way to modify the replay result template to include these fields? I'd think you'd be able to since you can get results, execution times, etc.
-Edit - Target is a 2014 instance, but also tried a 2016 instance. I've tried 2014, 2016, and 2018 SSMS JIC there were different profiler functionalities. Haven't found much in regards to documentation.
There are many tools available for performance tuning.
For example, Entity Framework Profiler (commercial tool sold on a subscription basis - which limits availability) could satisfy any developer (that using EF as ORM) in tracing and tuning.
In other hands, SQL Server profiler is an advance tool to trace your work.
So, I can help if you specify what ORM is using.

Tomcat application runs slower when moved to PaaS platform on Azure

Currently my web application runs on two Cloud-based Windows 2012 R2 Servers - one running Tomcat and one running SQL Server Express. The Windows Servers are 4GB Intel XEON(R) CPU E5-2660 v2 #2.20 Gghz
I am testing my application on PaaS (Platform as a Service) in Azure.
I created a Linux Web App with Tomcat 9.0 to hold the application (P1V2) and an Azure SQL Server to hold the database (S2)
One test I did was to compare the time it takes to produce an Excel report (using Apache POI) on both systems.
On the Cloud system (running SQL Server Express) it took about 10 seconds. On Azure it took about 35 seconds.
Obviously I would like the Azure system to be at least as fast as the one based on SQL Server Express, especially as the cloud system runs SQL Server Express which is capped at 1GB and 1 core.
I have tried the following:
Checked to see if there any spikes in the dashboard chart for the
database. There are no significant ones - DTU's are maximum 25%
I added Query Performance Insight / Recommendations / Automate to automatically
tune the database. This did speed it up somewhat but by no means
enough.
I read Help, My Azure Site Performance Sucks! and Why is running a query on SQL Azure so much slower? and Azure SQL query slow
I checked that the database and application were in the same location. (West Europe)
I imagine that the problem is the database.
As an example, I found a query (using the Query Performance Insight / Long Running Queries) that runs in 2 seconds on Azure and in 0 seconds on SQL Server Express. Note that I am NOT asking how to optimize this query. Rather I am imagining that the fact that this query takes longer on Azure - with the same database schema, the same data and the same indexes - might be a clue as to how to speed up my application as a whole.
SELECT cp.*
,(
SELECT min(market_date)
FROM mydb.rates ms
WHERE ms.curr1 = cp.curr1
AND ms.curr2= cp.curr2
) MIN_MARKETDATE
FROM pairs cp
order by curr1, curr2
The easiest way to do an apples-to-apples comparison is to use the vCore model for your Azure SQL. You say you are using an S2 database which is 50 DTU or half of a core. You would need to scale up to at least an S3 to be the equivalent of a 1 core VM.
That will ensure you are testing with the same general setup and should help you to match performance.

Better understanding of MySQL transactions

I just realized that my application was needlessly making 50+ database calls per user request due to some hidden coding -- hidden in the sense that between LINQ, persistence frameworks and events it just so turned out that a huge number of calls were being made without me being aware.
Is there a recommended way to analyze individual transactions going to my SQL 2008 database, preferably with some integration to my Visual Studio 2010 environment? I want to be able to 'spy' on individual transactions being made, but only for certain pieces of my code, and without making serious changes to either the code or database.
I addition to SQL Server Profiler, there are a number of performance counters you can look at to see both a real time evaluation and a historic trend:
Batch Requests/sec: Effectively measures the number of actual calls made to the SQL Server
Transactions/sec: Number of transactions in each database.
Connection resets/sec: number of new connections started from the connection pool by your site.
There are many more performance counters you can monitor, specially if you want to measure performance, but going through is besides the scope here. A good starting point is Monitoring Resource Usage.
You can use the SQL Profiler tool that comes with SQL Server Management Studio.
Microsoft SQL Server Profiler is a graphical user interface to SQL Trace for monitoring an instance of the Database Engine or Analysis Services. You can capture and save data about each event to a file or table to analyze later. For example, you can monitor a production environment to see which stored procedures are affecting performance by executing too slowly.
As mentioned, SQL Profiler is userful at the SQL Server level. It is not available in SQL Server SSMS Express however.
At the .NET level, LINQ to SQL and the Entity Framework both support logging. See Logging every data change with Entity Framework, http://msdn.microsoft.com/en-us/magazine/gg490349.aspx, http://peterkellner.net/2008/12/04/linq-debug-output-vs2008/.

SQL Server analyzer tool

in my previous workplace we used oracle enterprise manager for viewing statistics and bottlenecks of queries that are running against oracle10g. In my new workplace we use Microsoft SQL Server (2005). Is there any tool like enterprise manager of oracle in SQL Server - I need to see all the jdbc SQL queries i make and how long they are taking in the db..
thanks
Use SQL Server Profiler for tracing DB queries and such.
If you are looking for costs of queries and how they break down, you should use the Query Analyzer that is built into SSMS.
For SQL 2005 SP2 and later, you can download the Performance Dashboard Reports from MS (free).
Quote:
Common performance problems that the
dashboard reports may help to resolve
include:
- CPU bottlenecks (and what queries are consuming the most CPU)
- IO bottlenecks (and what queries are performing the most IO).
- Index recommendations generated by the query optimizer (missing indexes)
- Blocking
- Latch contention
The information shown in the reports is from the dynamic management views which you could query yourself if you didn't want to download this addon.
A combination of 'SQL Server Profiler', 'SQL Server Management Studio' and 'Database Engine Tuning Advisor' will be your friend. Have a look at showing the estimated and actual execution plans using SSMS, or create trace files with SQL Server Profiler (using the Tuning template) to feed to the Database Engine Tuning Advisor
I'm using Qure Analyser (free) which I've found very useful. It works by analysing a SQL Server trace file (.trc) and showing you which queries take up most CPU time, cause the most IO, or are called most often. Useful for spotting problems in the application code which may cause it to abuse the database.

Resources