Click here to load reader

Few useful features

Embed Size (px)

DESCRIPTION

few useful features in Oracle

Citation preview

  • 1. Few Useful Features Heribertus Bramundito

2. Analytical Function Ranking RANK, DENSE_RANK, CUME_DIST, PERCENT_RANK,NTILE, ROW_NUMBER LAG and LEAD FIRST_VALUE and LAST_VALUE FIRST and LAST Windowing Reporting Most of aggregate function can be user (MAX, MIN, AVG,SUM, COUNT) 3. Ranking (RANK, DENSE_RANK, CUME_DIST) 4. Ranking (PERCENT_RANK, NTILE, ROW_NUMBER) 5. LEAD and LAG 6. FIRST_VALUE and LAST VALUE 7. FIRST and LAST 8. Windowing 9. Windowing (cont.) 10. Windowing (cont.) 11. Reporting (RATIO_TO_REPORT) 12. Hypothetical Rank 13. Flashback Flashback query Flashback version query Flashback transaction query Flashback Table Flashback Drop 14. Flashback Query 15. Flashback Query (cont.) 16. Flashback Version Query 17. Flashback Transaction Query Query flashback_transaction_query view 18. Flashback Table Row Movement should be enabled 19. Flashback Drop 20. Rewrite Query Correlated Sub-QueryCheck logical I/O 21. Rewrite Query IN vs EXISTS Not In and Not Exists will produces exactly the same result ifthere is no NULL record in the sub-query. Extra predicate can be added for NULL value checking. Not Exists is more efficient because when Oracle found 1 record that satisfied the condition in the Sub-Query, it will move to the next record of Main Query and also Oracle will be able to use index in Sub-Query. In case of Not In, Oracle has to scan whole population of SubQuery before it move to the next record of Main Query. It will takes more IO and because of implicit NVL function in the predicate, Oracle will not be able to use index access. Not In will be translated as ((COL != VALUE_1) AND (COL != VALUE_2) AND (COL != VALUE_3) AND (COL != VALUE_X)) 22. Log Mining Collection of procedure to read an examine redo log orarchive log Database Supplemental Log Data should be turn on.