Situation:
Suppose you have 2 tables: 1. table1 in local DB 2. table2 in remote DB.The table1 size is 10 MB and table2 size is 100 MB. We need to join those two tables and we access only in local DB.If you now think about performance, it is important to where the sql query executed and the join perform. For above situation, it is better to bring table1 from local DB to Remote DB and execute the sql in remote server and finally bring back the result in local DB.
Lets do the job
The DRIVING_SITE hint forces query execution to be done at a different site than that selected by Oracle. This hint can be used with either rule-based or cost-based optimization. The syntax of this hint is:/*+DRIVING_SITE(table)*/
where table is the name or alias for the table at which site the execution should take place.
Example:
SELECT /*+DRIVING_SITE(table2)*/ * FROM tabl1, table2@remote_dbWHERE table1.DEPTNO = table2.DEPTNO;
If this query is executed without the hint, rows from table2 will be sent to the local site and the join will be executed there. With the hint, the rows from table1 will be sent to the remote site and the query will be executed there, returning the result to the local DB.
15 comments:
Good tutorial. Good your describe
thanks, good describing.
Very Good post on Oracle Data Base Link. Simple and clear even begainer can understand it easily.Keep sharing this type of content which is full of knowledge.
oracle r12 new features
TRUNCATE TABLE scott.table1;
INSERT /*+APPEND*/ INTO SCOTT.table1 SELECT /*+DRIVING_SITE(h)*/ * FROM SCOTT.table1@hrremote_publink h;
how it's useful for the above table insert from remote db link ?
Good Description .
Superb! Your blog is incredible. I am delighted with it. Thanks for sharing with me more information.
Hadoop Training in Chennai
Hadoop Training in Bangalore
Big Data Course in Coimbatore
Big data training in chennai
Big Data Course in Chennai
Big Data Training in Coimbatore
Angularjs Training in Bangalore
web designing course in madurai
Such a great blog.Thanks for sharing.........
IELTS Coaching in Hyderabad
IELTS Coaching in Bangalore
IELTS Coaching in Pune
IELTS Coaching in Gurgaon
IELTS Coaching in Delhi
Great Post with valuable information. I am glad that I have visited this site. Share more updates.
Spoken English Classes in Anna Nagar
Spoken English Classes in Medavakkam
Spoken English Classes in Chennai
Excellent Blog, I like your blog and It is very informative. Thank you
English Speaking Course online
Online Spoken English Classes
Great post.Thanks for sharing such a worthy information...
Python Training in Bangalore
Python Classes in Pune
Python Training in Hyderabad
Python Classes in Gurgaon
This is a fabulous post I saw because of it. It is really what I expected to see trust in future you will continue in sharing such a mind boggling post
Best PTE institute in ambala
PTE Coaching in ambala
Best IELTS Institute in Ambala
Awesome article! You are providing us very valid information. This is worth reading. Keep sharing more such articles.
why become a data scientist
why data science
Great post. Thanks for sharing.....
RPA Training in Bangalore
RPA Course in Bangalore
Thanks for sharing very important information, keep us posted more Python Training in Nanded
Best IT Training Provider
I really appreciate your insights on optimizing SQL performance with the DRIVING_SITE hint! Your clear explanation of the scenario and the example helped me understand it better. Thanks for sharing such valuable tips for Oracle administration!
online internship | internship in chennai | online internship for students with certificate | bca internship | internship for bca students | sql internship | online internship for btech students | internship for 1st year engineering students
Post a Comment