How to Find Slow SQL: Databases for Developers: Performance #9

  Рет қаралды 17,167

The Magic of SQL

The Magic of SQL

Күн бұрын

Пікірлер: 42
@prasanthcherukuri7955
@prasanthcherukuri7955 2 жыл бұрын
Key Performance Tuning Principles: 1) *Scope* your changes to code that executes when performance is bad. 2) Measure how long it takes to execute each part of the code and focus your tuning efforts on *longest running* 3) *Minimize the number of calls* to the DB. [Use a simple stored procedure which contains all the sqls to be called. If seperate sql's are present then there will be multiple roundtrips to DB. ] Thanks dude.
@TheMagicofSQL
@TheMagicofSQL 2 жыл бұрын
You've got it! :)
@livingfantasy1240
@livingfantasy1240 2 жыл бұрын
This series is really a quality content. Keep up the good work. Thanks !!
@TheMagicofSQL
@TheMagicofSQL 2 жыл бұрын
Thanks!
@erisen960
@erisen960 2 жыл бұрын
What a great and underrepresented channel.
@TheMagicofSQL
@TheMagicofSQL 2 жыл бұрын
Thanks!
@santoshpanigrahi205
@santoshpanigrahi205 2 жыл бұрын
Thank you for these videos and the explanation. We understand the effort you and your team put into these small videos. really appreciate !!
@TheMagicofSQL
@TheMagicofSQL 2 жыл бұрын
You're welcome; thanks for the appreciation!
@fahadnoor2579
@fahadnoor2579 Жыл бұрын
Hi, Thanks for wonderful video. I have a question, can you explain this statement please? "C:\Users\csaxon\Documents\Scripts\dfd-perf-9spool" since I don't see the trace file name listed from grid below which you are downloading. My question is where should I mention the file name which I want to download in this statement? This statement seems more likely a destination to download the file but seems like missing WHICH file to download.
@TheMagicofSQL
@TheMagicofSQL Жыл бұрын
It contains the query on v$diag_trace_file_contents with spool on/off before after it to download it's output to my machine
@fahadnoor2579
@fahadnoor2579 Жыл бұрын
@@TheMagicofSQL Thank you for replying my query. So "C:\Users\csaxon\Documents\Scripts\dfd-perf-9spool" part your local computer location or the where this file is located on server? plus the above statement is the continuation query of above? If yes then can you help to write the whole query here please?
@TheMagicofSQL
@TheMagicofSQL Жыл бұрын
Yes, it's a script on my computer. You can find the contents at livesql.oracle.com/apex/livesql/file/tutorial_JN0XQTKBU5D2JMNDVMTRQCFIE.html in module 4 "Accessing SQL Trace Files"
@mostafayahia9647
@mostafayahia9647 4 жыл бұрын
Thank you so much for the great video, could you please recommend a good book for sql tuning to start with?
@TheMagicofSQL
@TheMagicofSQL 4 жыл бұрын
I found Troubleshooting Oracle Performance by Christian Antognini to be an excellent guide when I read it antognini.ch/top/
@ankitbhatt9956
@ankitbhatt9956 4 жыл бұрын
your videos are very helpful and simple to understand and i really like your ideas to explain the complicated features ..Thanks
@TheMagicofSQL
@TheMagicofSQL 4 жыл бұрын
Thanks Ankit, glad you find these videos useful :)
@betterthanamasterofone
@betterthanamasterofone 3 жыл бұрын
Thank you, great stuff! One question - does setting (and/or using) "session_trace_enable" require any special db role for the user, like autotrace does?
@TheMagicofSQL
@TheMagicofSQL 3 жыл бұрын
In DBMS_MONITOR? You just need execute privs on this package
@IMdAbdulquadirKhan
@IMdAbdulquadirKhan 3 жыл бұрын
wow! you reply to everyone .
@asanjeevgoud
@asanjeevgoud 2 жыл бұрын
Hi you have great stuff May I know the how to reduce table index size.my DB 2 TB index was 600GB
@TheMagicofSQL
@TheMagicofSQL 2 жыл бұрын
Why do you need to reduce the size of the index? In general shrinking the index will get you small gains and it'll grow back to its current size over time.
@a.useronly2266
@a.useronly2266 3 жыл бұрын
Hi dear , thanks for your precious videos, I have a question which I can’t get answer so far and irrelevant to this video, if sql injection succeeds on oracle database, that can grab all data related to public role, like ALL_users and etc, how to mitigate this risk, please help
@TheMagicofSQL
@TheMagicofSQL 3 жыл бұрын
The all_* views only show objects the user has access to. The solution is to follow the principle of least privilege and only grant users the access they require and nothing else.
@a.useronly2266
@a.useronly2266 3 жыл бұрын
@@TheMagicofSQL Actually a very basic user has access to public role when created as user assume public role and All_* views or tables comes under public role, oracle doesn’t recommend to revoke something from public role, here don’t understand what to do,
@TheMagicofSQL
@TheMagicofSQL 3 жыл бұрын
I'm not sure what the issue is here, please clarify
@a.useronly2266
@a.useronly2266 3 жыл бұрын
@@TheMagicofSQL let say if we create oracle user named test and give privilege to connect the database only, by this, test is able to query all public views like ALL_USERS, tables,views, objects etc, in this case if hacker inject sql injection and succeeds , he able to dump valuable data from database, my question is how to deal this on database level, I hope you got my point, Waiting u r reply:) Just to mention one point that test user already exposed by sql injection but how to protect other information like schema names etc
@TheMagicofSQL
@TheMagicofSQL 3 жыл бұрын
The all* views only return the objects your database user has permissions to access. So if customer_table is in another schema, it only appears if the user you're connected as has select/insert/update/... privs on it So the solution is as I described above: follow the principle of least privilege. Application users must own no objects and only have the minimum privileges needed on other schemas to do their job
@bbuenopl
@bbuenopl 4 жыл бұрын
Thank you for the video! This is really an amazing feature. But i'm getting a "Closed statement" after executing the Profile step on Sql Developer. Could not find any explanation for that message on Oracle Support nor googling it. Any clue on that?
@TheMagicofSQL
@TheMagicofSQL 4 жыл бұрын
Hmm, not sure. If you can put together an example showing what you're doing and post it to asktom.oracle.com we can look into it; make sure you include DB and SQL Dev versions!
@Nil-js4bf
@Nil-js4bf Жыл бұрын
Had a good laugh at your analogy in this one.
@TheMagicofSQL
@TheMagicofSQL Жыл бұрын
Great to lighten your day :)
@superfreiheit1
@superfreiheit1 3 жыл бұрын
Hello, magic is there a good way to understand complex SQL queries? Do you have a video about this topic?
@TheMagicofSQL
@TheMagicofSQL 3 жыл бұрын
Ultimately you've got to break it down, figuring out what joins with what. What exactly is it you're looking for?
@superfreiheit1
@superfreiheit1 3 жыл бұрын
@@TheMagicofSQL I am looking for a method or way tool that helps understand complex queries. Breaking down? Starting with the lowest subquiry?
@TheMagicofSQL
@TheMagicofSQL 3 жыл бұрын
I don't know of any tools that will help particularly. You've got to work through the joins to see how the tables relate.
@Wearewhatwehear
@Wearewhatwehear Жыл бұрын
Great!
@a.useronly2266
@a.useronly2266 4 жыл бұрын
Very nice 👍🏻
@TheMagicofSQL
@TheMagicofSQL 4 жыл бұрын
Thank you 👍
How Much Tape To Stop A Lamborghini?
00:15
MrBeast
Рет қаралды 247 МЛН
How many people are in the changing room? #devil #lilith #funny #shorts
00:39
I thought one thing and the truth is something else 😂
00:34
عائلة ابو رعد Abo Raad family
Рет қаралды 11 МЛН
Увеличили моцареллу для @Lorenzo.bagnati
00:48
Кушать Хочу
Рет қаралды 9 МЛН
Microsoft Office Word and Excel
19:45
OPT. AYMAN ZAID
Рет қаралды 95
The five-step guide to SQL tuning | CloudWorld 2022
25:59
Oracle
Рет қаралды 21 М.
How to Read an Execution Plan: Databases for Developers: Performance #1
9:34
Explaining Explain Plans
59:59
Oracle Developers
Рет қаралды 41 М.
Real-Life SQL Tuning: From Four Minutes to Eight Seconds in an Hour
41:20
Oracle Developers
Рет қаралды 36 М.
Database Time-Based Performance Tuning: From Theory to Practice
56:54
Oracle Learning Subscriptions
Рет қаралды 29 М.
How to Create Database Indexes: Databases for Developers: Performance #4
12:47
How Much Tape To Stop A Lamborghini?
00:15
MrBeast
Рет қаралды 247 МЛН