Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Emrah METE - Oracle Cloud Day 2015 12c SQL New Features

2,133 views

Published on

Oracle Cloud Day 2015 İstanbul,
Oracle 12c SQL New Features Sunumu

Published in: Engineering
  • DOWNLOAD FULL eBOOK INTO AVAILABLE FORMAT ......................................................................................................................... ......................................................................................................................... 1.DOWNLOAD FULL. PDF eBook here { https://tinyurl.com/y3nhqquc } ......................................................................................................................... 1.DOWNLOAD FULL. EPUB eBook here { https://tinyurl.com/y3nhqquc } ......................................................................................................................... 1.DOWNLOAD FULL. doc eBook here { https://tinyurl.com/y3nhqquc } ......................................................................................................................... 1.DOWNLOAD FULL. PDF eBook here { https://tinyurl.com/y3nhqquc } ......................................................................................................................... 1.DOWNLOAD FULL. EPUB eBook here { https://tinyurl.com/y3nhqquc } ......................................................................................................................... 1.DOWNLOAD FULL. doc eBook here { https://tinyurl.com/y3nhqquc } ......................................................................................................................... ......................................................................................................................... ......................................................................................................................... .............. Browse by Genre Available eBooks ......................................................................................................................... Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, CookeBOOK Crime, eeBOOK Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult,
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here

Emrah METE - Oracle Cloud Day 2015 12c SQL New Features

  1. 1. Oracle 12c SQL New Features Emrah Mete Senior DWH&BI Specialist Board member of troug Oracle cloud day - 19.11.2015TROUG
  2. 2. Emrah mete - Yıldız Teknik Üniversitesi – Bilgisayar Mühendisliği - Deneyim - Software Developement Specialist @Turkcell - Senior BI Consultant @i2i-Systems - Senior BI Speacilist @HititCs - Teknik Uzmanlık - 5+ Oracle SQL, Oracle PL/SQL, ETL, DWH, BI - Kurucu Üye ve Yönetim Kurulu Üyesi @TROUG - Moderatör @OracleTurk - Blogger - https://emrahmete.wordpress.com/ (Türkçe) - https://emrahmeteen.wordpress.com/ (İngilizce) - Oracle Certified SQL Expert - Oracle Database Developer Choice Awards, SQL Category 2015 Winner!!! https://emrahmete.wordpress.com/about/ https://emrahmete.wordpress.com/about/
  3. 3. LiveSQL!!! https://livesql.oracle.com
  4. 4. 1. Top-N Queries
  5. 5. select * from (select * from hr.employees order by salary desc) where rownum<=3; select * from hr.employees order by salary desc fetch first 3 rows only; Before 12c 12c Employees tablosunda maaşı en yüksek olan 3 kişiyi listeleyelim.
  6. 6. select * from (select * from (select * from (select * from hr.employees order by salary desc) where rownum<=7) order by salary asc) where rownum=1; select * from hr.employees order by salary desc offset 6 rows fetch first 1 rows only; Before 12c 12c Employees tablosunda maaşı en yüksek olan 7. kişiyi listeleyelim.
  7. 7. select * from hr.employees order by salary desc fetch first 20 percent rows only; 12c Employees tablosunda maaşı en yüksek olan %20’lik çalışan grubunu listeleyelim
  8. 8. 2. Identıty columns
  9. 9. - Trigger tabanlı çözüm. - Bir tablo yarat. - bir sequence yarat. - tabloya, ınsert isleminden once çalışacak bır trıgger tanımla ve bu tırgger ıcınde, yarattıgın sequence’ı her yenı ınsert’de bir arttırak yenı gelen kaydın ılgılı kolonuna yaz. Before 12c ID kolonu otomatik artan bir tablo yaratalım.
  10. 10. CREATE TABLE TABTEST ( tabpk NUMBER GENERATED ALWAYS AS IDENTITY, tabname VARCHAR2(50), tabprop NUMBER, tabadd VARCHAR2(50) ); 12c ID kolonu otomatik artan bir tablo yaratalım.
  11. 11. CREATE TABLE TABTEST ( tabpk NUMBER GENERATED ALWAYS AS IDENTITY (START WITH 1 INCREMENT BY 5), tabname VARCHAR2(50), tabprop NUMBER, tabadd VARCHAR2(50) ); 12c Otomatık artan kolonumuzu tetıkleyen sequence’ı özellestırebılırmıyız?
  12. 12. 3. Approx_Count_Distinct
  13. 13. Kayıt Sayısı: 2M Distinct satır sayısı: 900K select approx_count_distinct(groupno) from appxcnt; çalışma süresi : 3.001 sn sonuç : 867.159 Kayıt Sayısı: 2M Distinct satır sayısı: 900K Select count(dıstınct groupno) from appxcnt; çalışma süresi : 8.275 sn sonuç : 900.000 Approx_count_dıstınctCOUNT(DISTINCT) Approx_count_dıstınct vs count(dıstınct) performans karşılaştırması?
  14. 14. 4. JSON SUPPORT
  15. 15. CREATE TABLE applicationLog ( appId NUMBER, appName VARCHAR2(30), appLog CLOB, CONSTRAINT applicationLogCons CHECK (appLog IS JSON) ); 12c JSON deger tutabilen kolonu olan bır tablo yaratalım
  16. 16. insert into applicationLog values (1,'WebContent', '{ "ad" : "veli", "soyad" : "mert", "tckn" : "147456741232", "adres" : { "ilce" :"Uskudar", "sokak" :"Lider", "numara" :"568", "il" :"Istanbul"} }‘ ); 12c Yarattıgımız tabloya ıcerısınde json ıfade barındıran bır kayıt ekleyelım
  17. 17. select * from applicationLog t1 where t1.applog.ad='veli'; 12c Json deger ıceren kolonunda, ad elementı «veli» olan kayıtları lısteleyelım
  18. 18. select JSON_VALUE(t1.appLog, '$.ad') AS isim, JSON_VALUE(t1.appLog, '$.soyad') AS soyisim, JSON_VALUE(t1.appLog, '$.tckn') AS tckimlik from applicationLog t1; 12c Json deger ıceren kolonumuzdakı tum AD, SOYAD, TCKN degerlerını lısteleyelım
  19. 19. - JSON_EXIST - JSON_QUERY - JSON_TABLE - JSON_TEXTCONTAINS - IS JSON 12c Dıger JSON fonksyonları
  20. 20. 5. Inline Procedures/Functions
  21. 21. WITH FUNCTION square(p_x NUMBER) RETURN NUMBER AS BEGIN RETURN p_x*p_x; END; SELECT square(10) FROM dual; 12c Inlıne procedures/functıons
  22. 22. 6. LATERAL Inline Views
  23. 23. select dx.first_name, dx.last_name, d.department_name from hr.departments d, (select * from hr.employees e where e.department_id = d.department_id) dx; 12c before
  24. 24. select dx.first_name, dx.last_name, d.department_name from hr.departments d, LATERAL(select * from hr.employees e where e.department_id = d.department_id) dx; 12c
  25. 25. 7. CROSS APPLY / OUTER APPLY
  26. 26. SELECT department_name,first_name FROM hr.departments d CROSS APPLY (SELECT first_name FROM hr.employees e WHERE e.department_id = d.department_id); 12c CROSS APPLY
  27. 27. SELECT department_name,first_name FROM hr.departments d OUTER APPLY (SELECT first_name FROM hr.employees e where e.department_id = d.department_id); 12c OUTER APPLY
  28. 28. 8. Pattern matchıng
  29. 29. – Finansal Uygulamalarda. – Ürün fiyatlarının zamana karşı değişimini incelemede. – Hisse senetlerinin zamana karşı değişmilerini takip edip aksiyon almada. – Güvenlik uygulamalarında sıra dışı hareketleri tesbit edip aksiyon almada. – Fraud tesbitlerinde. – Sensörlerden gelen verinin zamansal olarak incelenmesinde. – Complex Event Processing ihtiyacının doğduğu yerlerde. 12c Pattern Matchıng
  30. 30. 9. INVISIBLE COLUMN
  31. 31. CREATE TABLE invColExm ( colA NUMBER, colB NUMBER INVISIBLE, colC VARCHAR2 (100) ); - SELECT * FROM invColExm; - DESC invColExm; - %ROWTYPE ile referans gösterilen tabloda invisible kolona erişilemez buradada görünmezdir. - INSERT INTO invColExm (colA, colB, colC) VALUES (12, 10, ‘Deneme’); - UPDATE invColExm SET colB = 20; - DELETE invColExm WHERE colB = 20; - ALTER TABLE invColExm MODIFY colB VISIBLE; INVISIBLE COLUMNS
  32. 32. 10. Truncate cascade
  33. 33. truncate table t3; TRUNCATE CASCADE T1 T2 T3 T3.x T2.y T2.b T1.a truncate table t3 cascade; 12c Before 12c
  34. 34. tesekkurler! Sorular? @emrahmete (twitter) emrahmete@gmail.com https://emrahmete.wordpress.com
  35. 35. https://docs.oracle.com/database/121/SQLRF/toc.htm https://oracle-base.com/ http://antognini.ch/2014/10/the-approx_count_distinct-function-a-test-case/ https://docs.oracle.com/database/121/ADXDB/json.htm http://www.oracle.com/ocom/groups/public/@otn/documents/webcontent/1965433.pdf https://jonathanlewis.wordpress.com/2013/07/01/12c-determinism/ http://www.oracle.com/technetwork/database/features/plsql/new-plsql-in-12c-2372822.pdf Referanslar

×