Forum Replies Created
-
AuthorPosts
-
matheusdba
KeymasterSYS_CONTEXT
– Credits: Ricardo Portilho on the session time. 🙂matheusdba
KeymasterThe default is PLSQL_OPTIMIZE_LEVEL=2
matheusdba
KeymasterOf course there, but if there was only a single path of queries don’t you think all the performance issues in the world would be fixed already?
Each problem needs to be investigated individually and addressed accordingly. Even on the layer: Is is the database that is slow, or a specific query?
Assuing it’s a session/SQL, the only think I can say generally to you is “if it’s slow, check what is the event on the session (consistently, more often) and start from there. The vent is the most valuable information in general.matheusdba
KeymasterIt depends. Are the old sessions causing any problem?
If they are ad-hoc users or client-server application sessions: Slayer Mode [Active]
In case they can be part of a session pool from a “modern” (21th century) application, it can be somehow important. If the last call et is really high, maybe it would not cause bad effects to kill. In case of need, the app will rebuild the pool. But be more careful in this case and perhaps it would be better to talk with the app/middleware specialist before taking any aggressive action.
matheusdba
KeymasterThere is no such magic. 🙂
You need to understand why is your session running slow. But in general, any solution you may arrive (different of a lock) needs to be addressed for the next run of the query (any new plan, new fix, new index, stats gathering, etc etc…). So if it’s slow and running you need to decide: Kill it and run it “hopefully” faster next time or just await?
Something that may help you on deciding this is checking status and estimations for the current session on the dba_longops. 😉matheusdba
KeymasterQuick answer: Fix your application.
Deadlocks are in general unpredicted situations where session A waits for session B and vice-versa, in a why it will never be resolved.
Please don’t mistake regular locks (healthy mechanism) with deadlocks (you-messed-up mechanism). Also, be aware Oracle automatically kills deadlocks since 10g.
If you have deadlock kills messages in your alert lock, report the trace files with the SQLs to your Dev Team. Some “table-tests” are required from their side. 🙂matheusdba
KeymasterHi!
This is classic. Welcome to the performance world.
Lots of things can be related. In general changes:- Did any load ran yesterday on this table?
- Did any related table had a data load?
- Did any statistics gathering ran on this table or related objects (other tables or indexes)?
- Any new index or object? Any removed index or object?
- …
In general, you should check what changed. Something changed, 90% of the times.
I’m not saying 100% because since recently Oracle has some Adaptive features (Adaptive SQL Directives and Adaptive Statistics) that change the behavior of your select based on previous executions trying to improve it. Some times it messes it. Be aware of this. This can affect your plan stability. Things like cursor sharing and other parameters needs also to be checked.
ALSO, I’m assuming that’s the exact same query. Note that different values for binds can and should change the plan. Imagine a 1 billion entry “PEOPLE” table with only 1 woman. If you do join this for entries where sex=male, a loop need to be used, or most likely a FTS for the select. If you join the data for the female one, is a single row access. This is good and natural.Anyway, there are some many items to check, I just gave a few shots and mentions above to check if I can help with anything… 🙂
23 de September de 2020 at 16:42 in reply to: What do you suggest to better way to start database after shutdown abort? #2292655matheusdba
KeymasterSTARTUP!
lol
I get what you mean. The database makes an automatic recover after a shutdown abort (implicit, using the redologs to apply the changes not written to disk already, once this is an assync process due to performance concerns). This process can take long, indeed, if there is too much data to be applied.
My recommendation is first of all, after your next start, consider increasing the number of DBWriters.
Some trick that may help: Mount the database, go to RMAN, open several parallel channels, issue “recover database”. It will apply the relogs in parallel. This may help on parallelizing the recover, eventually making it faster. But the recover can’t (or shouldn’t) be avoided.
Ideally, take your actions to ensure a faster recover on the next time. And try to avoid Aborts.
matheusdba
KeymasterLock-wise, both operations generate locks as they are changing the table data. The lock is a natural and positive mechanism in the database.
The Truncate does generate a quicker lock as this is a physical and self commitable procedure (Truncate is considered a DDL). The truncate clears all the segments underlying the table.
The Delete, however, as being a DML, opens a transaction (to be committed or rolled back) and delete the data row by row (or logically) instead of physically. As being, we can say it’s “slower” than the truncate, plus the fact of needing a commit to close the transaction makes it “slower”.
Why DELETE then? To not delete all rows (use where, for filtering the lines to be deleted) or to have the option of a rollback in a routine, for example. It follows the principle of atomicity and consistency of data.23 de September de 2020 at 16:30 in reply to: How to troubleshoot long running sessions from the past? #2292651matheusdba
KeymasterOracle is great for this! As long as you fay for it… 🙂
In general, the features from the Diagnostic Pack, like AWR (for a Workload Performance and measuring the impact of a SQL), ADDM (for a specific SQL) or ASH (Active Session History) for granular information about the session from the last moments (days, hours, depending on the case).
In summary, you have to pay for official solutions to look back in time.
But remember that all those reports are made based on the “runtime” views. So you can create a manual system of your own to gather “snapshots” and build similar reports later.
We actually have something really nice in a similar line based on the ASH, build by the community. It’s the S-ASH (or, Simulated ASH). Google it!matheusdba
KeymasterThat’s a really good question. As per my understanding if would follow the same rule/restriction.
But this question made me review a bit about the ports on the documentation. Have a look here: https://docs.oracle.com/en/database/oracle/oracle-database/12.2/atnms/managing-configuring-tfa.html#GUID-97DA0A64-A184-4DB2-9CB1-F3AA23F6EF78
Maybe you can change the port used for the upload? It seems you can only change the monitoring ports and that’s all. The best thing would be: Test and let us know!
Thanks!23 de September de 2020 at 11:07 in reply to: DBMS_XPLAN.DISPLAY_CURSOR after EXPLAIN PLAN without execute the query #2292647matheusdba
KeymasterLets go by parts:
- The EXPLAIN PLAN does only the explanation for the plan on your session.
- Before executing any SQL there is a PARSE step (Parse, Execute, Fetch). During the parse is when the plan is generated.
- The DBMS_XPLAN.DISPLAY_CURSOR takes the plans for the referred SQLID from the Shared Pool.
- So, as long as you have the parse for the SQLID you have it on the shared pool and the DBMS_XPLAN.DISPLAY_CURSOR can be used.
- However, the EXPLAIN PLAN does not parse the SQL to the Shared Pool.
- So yes, you need to execute the query or at least start executing it.
matheusdba
KeymasterNo they are not.
TRCA is a tool available on MOS for trace parsing, in general.
TFA is a set of tools for managing tracefiles from all server layers, including database.matheusdba
KeymasterSure!
We have tons we can use for this end on different layers:
– For I/O Performance, we have the classic “dd” from linux.
– Yet for I/O we have the ORION (Oracle I/O Numbers) which should already be in your Oracle Installation.
– From the community we have the SLOB (Silly Little Oracle Benchmark) by Kevin Closson
– Consider also HammerDB/HammerORA (not sure if it’s payed or not)
– You have also Swingbench by Dominic Giles.
– For Network Load and Throughput test you have ORATCPTEST (Doc ID 2064368.1)
This is all not to mention the obvious and recommendable RAT (Real Application Testing). It is better than all those, in general. But it’s payed. 🙂matheusdba
KeymasterThe raw trace in Oracle Database usually needs to be parsed to make it readable.
There are a bunch of tools for doing it, like TKPROF from the default Oracle home or TRCANLZR (TRCA) (Doc ID 224270.1) from Oracle.
There are also tools from the community, such as TVD$XTAT. -
AuthorPosts
