Oracle 12c 부터 session-specific GTT(Global Temporary table)에 대해 세션 개별의 통계정보 수집이 가능합니다. 

GTT의 경우 성능이슈로 permanent table을 만들어 drop 하는 등의 작업을 많이 했는데 

12c의 경우 session-private statistic 수집으로 이러한 이슈들이 해결되지 않을까 기대해 봅니다. 


SQL> exec dbms_stats.gather_table_stats(ownname=>'SH', tabname=>'TEMP_GTT');


but, Parallel DML (update, delete, merge)에 대한 제약은 여전히 11g와 동일하네요..


Session-Private Statistics for Global Temporary Tables

Traditionally, global temporary tables had only one set of statistics that were shared among all sessions even though the table could contain different data in different sessions. In Oracle Database 12c Release 1 (12.1), global temporary tables now have session-private statistics. That is a different set of statistics for each session. Queries issued against the global temporary table use the statistics from their own session.

Session-private statistics for global temporary tables improves the performance and manageability of temporary tables. Users no longer need to manually set statistics for the global temporary table on a per session basis or rely on dynamic sampling. This reduces the possibility of errors in the cardinality estimates for global temporary tables and ensures that the optimizer has the data to identify optimal execution plans.

See Also:

Oracle Database SQL Tuning Guide for details



Oracle 12c에 Exadata를 위한 System Statistics 수집 기능 추가되었습니다. 근데 이건 11gR2(exadata X2)에서도 해줘야 됬던 기능인거 같은뎅..  

참고 : http://kerryosborne.oracle-guy.com/2013/09/system-statistics-exadata-mode/

암튼 system statistic 수집은 (workload statistics mode) 아래의 system 성능 정보를 수집하며 SQL optimizer가 SQL Plan 수립에 이 system 성능정보를 참고하므로 꼭 한번은, 그리고 system hardware 변경시에 수행해야 합니다..

  • Single and multiblock read times
  • mbrc
  • CPU speed (cpuspeed)
  • Maximum system throughput
  • Average slave throughput

system statistics 수집 방법 

-- 특정 주기동안 수집

SQL> exec DBMS_STATS.GATHER_SYSTEM_STATS('start') 

SQL> exec DBMS_STATS.GATHER_SYSTEM_STATS('stop') 


-- 특정 interval(분단위) 동안 수집 

SQL> exec DBMS_STATS.GATHER_SYSTEM_STATS('interval', interval=>N)


-- exadata 성능 수집

SQL> exec DBMS_STATS.GATHER_SYSTEM_STATS('exadata')


-- noworkload statistics 수집

SQL> exec DBMS_STATS.GATHER_SYSTEM_STATS()


Enhancements to System Statistics

System statistics allow the optimizer to account for the hardware on which the database system is running. With the introduction of smart storage, such as Exadata storage, the optimizer needs additional system statistics in order to account for all of the smart storage capabilities.

The introduction of the new system statistics gathering method allows the optimizer to more accurately account for the performance characteristics of smart storage, such as Exadata storage.

See Also:

Oracle Database SQL Tuning Guide for details



Tom Kyte has picked his top 12 features of Oracle Database 12c and put them into a presentation. Here are his picks:



Tom Kyte, Vice President of Oracle, shares the top 12 features of 12c Databases at the Oracle Database 12c Launch 2013.


1. Even better PL/SQL from SQL

2. Improved defaults

3. Increased size limits for some datatypes

4. Easy top-n and pagination queries

5. Row pattern matching

6. Partitioning improvements

7. Adaptive execution plans

8. Enhanced statistics

9. Temporary undo

10. Data optimization capabilities

11. Application Continuity and Transaction Guard

12. Pluggable databases


On Oracle Database 12c, Part 1

On Oracle Database 12c, Part 2





메뉴얼 내용에 따르면 Update 사전 check 기능 강화과 사후 작업 자동화가 추가되었습니다.

한번 돌려봐서 확인은 해봐야 겠지만 upgrade를 위해 이것저것 챙겨야할 부분이 자동화되면 upgrade 단계에서의 사고는 확실히 줄 수 있겠네요.

가장 반길만 한 부분은 parallel upgrade 부분입니다. 

upgrade 단계에서 내부 object upgrade 부분은 serial 하게 수행되어 일정 downtime이 요구되었죠.. 

하나 Parallel upgrade로 수행된다 해도 ADG, OGG 등의 제품이 없다면 zero-downtime으로 upgrade 되지 않는건 마찬가지..  

뭐.. Oracle 13c 정도면 zero-downtime upgrade 가 지원되지 않을까.. 하고 기대합니다.  


Enhanced Upgrade Automation

Database upgrade has been enhanced for better ease-of-use by improving the amount of automation applied to the upgrade process. Additional validation steps have been added to the pre-upgrade phase in both the command-line pre-upgrade script and the Database Upgrade Assistant (DBUA). In addition, the pre-upgrade validation steps have been enhanced with the ability to generate a fix-up script to resolve most issues that may be identified before the upgrade.

Post-upgrade steps have also been enhanced to reduce the amount of manual work required for a database upgrade. The post-upgrade status script gives more explicit guidance about the success of the upgrade on a component-by-component basis. Post-upgrade fix-up scripts are also generated to automate tasks that must be performed after the upgrade.

See Also:

Oracle Database Upgrade Guide for details

2.12.1.2 Parallel Upgrade

The database upgrade scripts can now take advantage of multiple CPU cores by using parallel processing to speed up the upgrade process. This results in less downtime due to a database upgrade, and thus improved database availability.

See Also:

Oracle Database Upgrade Guide for details




Oracle 12c부터는 DBMS_QOPATCh package를 통해서 sqlplus 상에서 patch 정보를 확인할 수 있답니다..

Database node가 많은 RAC 환경에서는 편할 수 있겠네요.. 


Queryable Patch Inventory

Using DBMS_QOPATCH, Oracle Database 12c provides a PL/SQL or SQL interface to view the database patches that are installed. The interface provides all the patch information available as part of the OPatch lsinventory -xml command. The package accesses the Oracle Universal Installer (OUI) patch inventory in real time to provide patch and patch meta information.

Using this feature, users can:

  • Query what patches are installed from SQL*Plus.

  • Write wrapper programs to create reports and do validation checks across multiple environments.

  • Check patches installed on Oracle RAC nodes from a single location instead of having to log onto each one in turn.




참고 : 

http://oracle-randolf.blogspot.kr/2014/05/12c-hybrid-hash-distribution-with-skew.html

http://www.oaktable.net/content/12c-hybrid-hash-distribution-skew-detection-handling-failing


Oracle 12c RMAN의 new feature 중 하나인 table recovery 

아래 table recovery 방법을 보니 AUXILIARY Database를 만들어 거기서 dump datafile을 뽑아내는 모양새. 


과거에 삭제된 table 복구를 위해 수행되었던 복구 절차를 명령어 한줄로 만들어 놓았네요. ㅎ


Recover the tables EMP and DEPT using the following clauses in the RECOVER command: DATAPUMP DESTINATION, DUMP FILE, REMAP TABLE, and NOTABLEIMPORT.


The following RECOVER command recovers the EMP and DEPT tables.


RECOVER TABLE SCOTT.EMP, SCOTT.DEPT

    UNTIL TIME 'SYSDATE-1'

    AUXILIARY DESTINATION '/tmp/oracle/recover'

    DATAPUMP DESTINATION '/tmp/recover/dumpfiles'

    DUMP FILE 'emp_dept_exp_dump.dat'

    NOTABLEIMPORT;


참고 : http://docs.oracle.com/cd/E16655_01/backup.121/e17630/rcmresind.htm#BRADV703



Oracle 12c에서 많이 밀고 있는 Multitenant, ADO 등의 New feature 외에 소소한 몇몇 feature 들... 

어디다가 쓸진 모르겠지만.. 


Invisible Columns

• The new 12c feature allows you to hide columns 

• If a user or developer selects ALL columns from a table (i.e. select *…)  the invisible columns will NOT be displayed. 

• If a user specifically selects the invisible column (i.e. select salary,…) the column WILL be displayed in the output (you have to know it’s there). 

• You can set column(s) to be visible/invisible with an alter table : 

 

SQL> ALTER TABLE EMPLOYEE MODIFY (SSN INVISIBLE); 


이로써 invisible 기능으로 index, row (12c new feature - valid time temporal), column을 숨길수 있게됬군요.. ㅋ


Create Views as Tables  

Export a view as a table and then import it: 


SQL> create view emp_dept as 

(select a.empno, a.ename, b.deptno, b.dname, b.loc 

 from emp a, dept b 

 where a.deptno=b.deptno); 


View created. 

 

$ expdp scott2/tiger VIEWS_AS_TABLES=emp_dept 

 

Processing object type TABLE_EXPORT/VIEWS_AS_TABLES/TABLE 

. . exported "SCOTT2"."EMP_DEPT" 

7.140 KB 14 rows 


view를 table로 export 할 수 있는 기능. 

업무에선 어떻게 쓰일수 있을지 모르겠지만.. 

DB 성능관련 view 들도 table로 간단히 뽑아낼 수 있다면 성능 history 구축하긴 쉽겠네요. 



Oracle 12c에 Oracle Multitenant라는 새로운 개념이 등장했습니다. 

Database가 Container DB와 Pluggable DB로 나뉘어 Cloud 환경에 적합한 모양으로 구성 가능합니다. 


자세한 내용은 아래 링크 참조하시면 될 것 같고..

http://www.oracle.com/technetwork/database/multitenant/overview/index.html


Oracle 12c Multitenant라는 기능을 보다 보니까 내가 현재 어떤 DB에 접속하고 있는지 헤깔리기 쉽겠더군요..

PDB (Pluggable DB)를 내리려다 잘못해 Container DB를 내리면 해당 Container DB에 있는 PDB까지 다 내려갈 수 있으니 (걱정도 팔자임), 이는 큰일이 아닐 수 없습니다. ㅋ


해서 SQLPLUS의 prompt에 현재 어떤 DB에 접속하고 있는지 표시하도록 간단히 맹글어 보았습니다. 

모두 아시는 $ORACLE_HOME/sqlplus/admin/glogin.sql에 아래 내용을 넣으시면 됩니다. 

define _editor=vi

column sqlprompt_col new_value sqlprompt_value

set termout off

define sqlprompt_value='NOT CONNECTED'

SELECT SYS_CONTEXT('USERENV','CURRENT_USER')||'('||SYS_CONTEXT('USERENV','CON_NAME')||')'

  as sqlprompt_col

from dual;

set termout on

set sqlprompt '&sqlprompt_value >'


아래처럼 container DB에 접속하던 Pluggable DB에 접속하던 prompt 상에서 보여주게 됩니다. 

그러나 DB 가 내려가 있는 상태에서 접속하면 'NOT CONNECTED'로 나오는 부분은 수정 필요 --; 



Oracle 11g 때부터 raw device를 지원한다, 안한다 이야기가 많더니만,

드디어 Oracle 12c에서는 지원하지 않는다는 문장이 메뉴얼에 등장했네요. 


8.1.10.1 About Upgrading Oracle Database Release 10.2 or 11.1 and OCFS and RAW Devices


If you are upgrading an Oracle Database release 10.2.0.5 or release 11.1.0.7 environment that stores Oracle Clusterware files on OCFS on Windows or RAW devices, then you cannot directly upgrade to Oracle Database 12c. You must first perform an interim upgrade to Oracle Database release 11.2 and migrate the Oracle Clusterware files to Oracle Automatic Storage Management (Oracle ASM). Then you can upgrade from release 11.2 to Oracle Database 12c.


8.1.12 Desupport for Raw Storage Devices


Starting with Oracle Database 12c, block file storage on raw devices is not supported. You must migrate any data files stored on raw devices to Oracle ASM, a cluster file system, or Network File System (NFS).

This also affects the OCR and voting files for Oracle Clusterware. You cannot store the OCR or voting files on raw devices. Oracle Clusterware files must be moved to Oracle ASM before upgrading.


출처 : Oracle® Database Upgrade Guide 12c Release 1 (12.1)

(http://docs.oracle.com/cd/E16655_01/server.121/e17642/deprecated.htm#UPGRD60124)


이제 ASM을 공부해야 할 시간 ... 

Oracle ASM Strategic Best Practices




+ Recent posts