Looks great. Please compare these methods with the new Priority Transactions in Oracle 23ai.
@QueryTuner21 сағат бұрын
Missing the Lego bricks, Chris likes to show case his SQL examples .. 🙂 Greetings from Hessen in Good Old Germany.
@undeuxtroiskidКүн бұрын
My two favorite SQL Gurus in one video.
@berndeckenfels3 күн бұрын
I find it incredible hard to have small connection pool limits in complex applications , since they can deadlock when full (thread which holds a connection in one component low level calls to a function which needs its own and blocks). Only very disciplined and holistic architecture layers can avoid that really. This is clearly where microseconds shine
@prakash59354 күн бұрын
Hey Connor, how to extract only this type of string using regular expression '*1 Connor'
good to see you both. little caveat** if someone executed "make -f <> <>" in earlier home and after "OPP" this will be lost. I have a customer where we have such enabled per oracle recomendations and always have to check this before we go with OPP.
@DatabaseDude3 күн бұрын
Excellent point. I'll pass this on to the team because it might be something we can detect and at least warn about
@MrPants-xy6db5 күн бұрын
Great explanation. I stumbled across the 'date' function a few years ago more or less by accident. I tend to use it with ad-hoc queries but always use full blown to_date / to_char in production code. Old habits die hard 🙂
@DatabaseDude3 күн бұрын
True. I am too a dinosaur when it comes to breaking habits
@blindender99796 күн бұрын
How to use the sql engine on a insert select of 100 milions of records? Without blowing away the undo table space? Im offen using cursor with bulk and limit. Then, forall for the dml (insert or update). But is slow very slow!
@DatabaseDude5 күн бұрын
For 100s of millions, I'm probably looking at insert-append (a lot depends on whether you can handle the implications of that)
@zhekappp9 күн бұрын
There is another possibly better approach besides creating additional table which requires some extra maintenance. If the ID column contents will be always inserted like number YYYYDDDnnnnnnnnnnnnnnnnnnnnnnnnnn where YYYYDDD is date for pr_date and nnnn part is just regular sequence we can partition the table based on ID column instead and enable local PK. This will require application logic to adjust queries to use 'parametrized view' which will transform pr_date to the value looking same way as PK for the where condition for partition pruning when fetching not by PK.
@DatabaseDude3 күн бұрын
True, but the data modellers of the world will be up an arms about embedding information within a column :-)
@zhekappp3 күн бұрын
@@DatabaseDude well, denormalization by propagating the date value to all the child tables seems worse to me.
@asrytube9 күн бұрын
Thanks for the video. Will study this feature in depth.
@DatabaseDude3 күн бұрын
My pleasure
@berndeckenfels11 күн бұрын
Could be a COMPAT level thing? (Although in the specific case not keeping parse errors seems to be low risk)
@DatabaseDude5 күн бұрын
Using 'compatible' for this case seems to be a big hammer to me.
@berndeckenfels5 күн бұрын
it doesn’t have to be the only option but having myriad of new features which are never turned on on new installs (or a lot of useless non default init Params) is also pretty ugly when there is a good option for changing defaults. Will the dbca template get those switches?
@RAJKUMARSHARMA-gf2ke11 күн бұрын
Amazing🎉❤
@DatabaseDude5 күн бұрын
Glad you liked it!
@brijeshkarmakar129912 күн бұрын
Thank you Conor :)
@DatabaseDude12 күн бұрын
you're welcome
@johnparker794513 күн бұрын
v$active_session_history is restricted to EE with diag and tuning packs. What's a replacement that everyone can use?
@DatabaseDude13 күн бұрын
check out Snapper by Tanel Poder (free) tanelpoder.com/snapper/
@QueryTuner13 күн бұрын
... and I still want to have or buy this OMG shirt somewhere ... 🙂 Greetings from Hessen/Good Old Germany.
@DatabaseDude13 күн бұрын
Greetings from Perth but on my way to Germany (DOAG)
@fahdbahoo113 күн бұрын
What about setting idel timeout in profile ?
@berndeckenfels13 күн бұрын
Careful with unconditional idle timeouts, some connection pools are not good at keeping connections equally busy
@taburiss4213 күн бұрын
Thanks as always! Only that I think you said there are three options but presented just two...
@DatabaseDude13 күн бұрын
Sorry, that got left on the editing floor for brevity. Idle session timeout in profiles.
@JoniPriya16 күн бұрын
you are my amazing (guru means) teacher ,love you for all these lessons,god bless you connor
@TheEsesman18 күн бұрын
Great video!
@DatabaseDude18 күн бұрын
Glad you enjoyed it
@sobanya_22818 күн бұрын
In sql?
@DatabaseDude18 күн бұрын
Yes, in SQL
@fahdbahoo119 күн бұрын
Finally
@DatabaseDude18 күн бұрын
indeed
@marekjanosik21 күн бұрын
Thank you
@DatabaseDude20 күн бұрын
You're welcome
@rydmerlin21 күн бұрын
To hint or not to hint?
@DatabaseDude18 күн бұрын
last resort
21 күн бұрын
Thanks for the Great video! Is there the example code available somewhere?
@DatabaseDude21 күн бұрын
Look for "oh_bulkmig" in my github rep under "office hours" github.com/connormcd
@toomuchtube21 күн бұрын
Planning to make a silk purse?
@DatabaseDude21 күн бұрын
oink :-)
@apolishchuk188021 күн бұрын
I liked the video, but "calling the web service" from the PLSQL block sounds like... the main part that should be fixed here :-D
@DatabaseDude21 күн бұрын
PL/SQL was just the simple example - the same principle applies anywhere. But fair point :-)
@PeterHitchmanYT21 күн бұрын
Just on the last point of the video, no one is going to praise you for making that 8 hour overnight batch job run in 30 minutes, generally I always found that such work was more about me wanting to free up db resources so that it could cope with the additional functionality being crammed into the existing system.
@DatabaseDude21 күн бұрын
Cloud changes that equation I think ... because you are literally saving real money
@Info-Galaxy22 күн бұрын
Useful and informative, Thank you so much for your efforts, as usual you are always there with very good and simple examples.
@DatabaseDude21 күн бұрын
My pleasure!
@vikram475522 күн бұрын
commit frequency was a good one!
@ismaelmetero412122 күн бұрын
Very interesting and a good example of refactoring existing code.
@DatabaseDude21 күн бұрын
Glad you liked it
@virajmokadam471922 күн бұрын
Thank you.
@DatabaseDude21 күн бұрын
You're welcome!
@sabyasachimitra571922 күн бұрын
Excellent use of KEEP. If I may add, we have to consider the case if the rank column contains NULL and use NULLS LAST or FAST (based on the order) to exclude NULLs in the ranking.
@DatabaseDude22 күн бұрын
excellent point!
@AnujSingh-vo7pf26 күн бұрын
Hi Connor 08:15:40 SQL> select ORPHANED_ENTRIES ,status from dba_indexes where index_name='T_PAR_PK'; ORP STATUS --- -------- NO VALID Elapsed: 00:00:00.00 08:14:09 SQL> alter table t_par drop partition p3 update indexes; Table altered. Elapsed: 00:00:19.57 08:15:40 SQL> select ORPHANED_ENTRIES ,status from dba_indexes where index_name='T_PAR_PK'; ORP STATUS --- -------- NO VALID Elapsed: 00:00:00.00 Why aren't there any ORPHANED_ENTRIES in the index ?
@DatabaseDude25 күн бұрын
because you said "update indexes".
@AnujSingh-vo7pf24 күн бұрын
@@DatabaseDude please check video again at 5:46 alter table t_par drop partition p3 update indexes; at 5:59 YES <<< ORPHANED_ENTRIES
@QueryTuner19 күн бұрын
@@AnujSingh-vo7pf Did you populate the table partitions with some data ? If there is no data in them, then there will also no orphaned entries in the index.
@AnujSingh-vo7pf18 күн бұрын
@@QueryTuner create table t_par partition by range (par_date) interval ( numtodsinterval(14,'DAY')) ( partition p1 values less than ( date '2024-05-01' ), partition p2 values less than ( date '2024-05-15' ), partition p3 values less than ( date '2024-05-31' ), partition p4 values less than ( date '2024-06-15' ), partition p5 values less than ( date '2024-06-30' ), partition p6 values less than ( date '2024-07-15' ), partition p7 values less than ( date '2024-07-31' ) ) as select rownum pk,date '2024-04-20' +trunc(rownum/370000) par_date, d.* from dba_objects d, (select 1 from dual connect by level <=400 );SQL> exec dbms_stats.gather_table_stats('','T_PAR'); SQL> exec dbms_stats.gather_table_stats('','T_PAR'); PL/SQL procedure successfully completed. SQL> select num_rows from dba_tables where table_name='T_PAR' ; NUM_ROWS ---------- 28455200 SQL> select count(*) from T_PAR ; COUNT(*) ---------- 28455200 SQL> set linesize 500 pagesize 300 col TABLE_NAME for a20 col PARTITION_NAME for a20 col HIGH_VALUE for a80 SELECT table_name, partition_name, num_rows,high_value FROM dba_tab_partitions WHERE table_name='T_PAR' ORDER BY 1,2; SQL> create unique index t_par_pk on t_par(pk) parallel 8; Index created. SQL> SQL> alter index t_par_pk noparallel ; Index altered. SQL> alter table t_par add constraint t_par_pk primary key ( pk ) using index ; Table altered. SQL> select partitioned from dba_indexes where index_name='T_PAR_PK'; PAR --- NO
@AnujSingh-vo7pf18 күн бұрын
@DatabaseDude
@iejjeeeeeedjsnckdsn27 күн бұрын
As a Java programmer, I always struggle with SQL data flow. I kind of 'invented' chained 'WITH' clauses to reason about queries. So I looked it up and found this video. Great summary of why it's useful.
@DatabaseDude25 күн бұрын
glad it helped
@vijaybhai486627 күн бұрын
Thankyou. Locks has been the chapter I skipped whenever I read the manual. Now I know the unique advantage of oracle which non other DB have 🙏🏻🤔
@itshakgm28 күн бұрын
Hi. Thanks your information. I think that yet exists an issue/lot of limitations with dblink and clob. In your example, the user querying the clob is the same user that created the dblink but if you try to permit other user (giving privilege or creating view ), you will receive other ORAs like Ora- 2019.
@steveandreassend862029 күн бұрын
Surely there is a case to make option 3 native to the product so it is all transparent? It seems to be the only elegant solution for this problem.
@steveandreassend862029 күн бұрын
ALTER TABLE x TRACK PRIMARY KEY PARTITION; and do some sort of background predicate appending like RLS / VPD does.
@DatabaseDude28 күн бұрын
I certainly like the concept of that being a declarative part of the database
@dhirajtagadapallewar8475Ай бұрын
Very nicely explained. Please provide commands to try in test environment
@vikram4755Ай бұрын
Wow !
@ppaoluccАй бұрын
Hi Connor, maybe I'm a bit wrong, however: if we would create a global partitioned index (I've seen here a creation of a Global non-partitioned one) we would be able to do partition pruning, even though an maintenance action on partitions (MOVE, DROP, SPLIT, TRUNCATE) would affect the validity of the entire index as well, correct? Thank you
@DatabaseDudeАй бұрын
With older versions yes - no we have the ability to mark "parts" of the index not usable
@ricardooberdanpereira793Ай бұрын
How one person can know so much about? Thanks again Connor.
@sergiidziubenko3313Ай бұрын
Few years ago I spent lot of time to discover this trick with parallel constraint “creation” :)
@fransc2086Ай бұрын
Great explanation! Thanks!
@DatabaseDudeАй бұрын
Glad it was helpful!
@gleytonrАй бұрын
Thanks so much
@DatabaseDudeАй бұрын
You're welcome!
@marcinbadtkeАй бұрын
Thank you. Fantastic idea.
@DatabaseDudeАй бұрын
Glad you liked it!
@ilpaolotopleggend6663Ай бұрын
Thanks !super video super issue super explanation
@DatabaseDudeАй бұрын
Welcome 😊
@ErickTruterАй бұрын
Great video! Partitions is great but I find often people don't understand the costs involved in using them and often don't use them correctly causing all partition scans.
@DatabaseDudeАй бұрын
Very true!
@ilpaolotopleggend6663Ай бұрын
I'd like also to see more PLSQL code..understand examples with asynchronous cases..and queue.. 💻 ⌛️😮
@ilpaolotopleggend6663Ай бұрын
😮interesting
@DatabaseDudeАй бұрын
I'm hoping we de-deprecate it (if that makes sense)