/* SQL Performance Analyzer (SPA) is used to compare the execution of SQL statements before and after the change and provides a report on how the change impacted the execution plan or statistics. It might be used before upgrading the database, or changing performance-related parameter, altering or creating new indexes, changing operating system or hardware and implementing performance-related recommendations advisors. */
난이도: ★★★☆☆
문제 1: DBA_OBJECTS 뷰에서 테이블을 새로 하나 생성하고, 두 개의 서로 다른 SQL문을 실행하여라. 첫 번째 실행문에서는, "WHERE OBJECT_NAME = 'TABLE1'"조건을 만족하는 row를 반환하라. 두 번째 실행문에서는, "UPPER(OWNER)='C##RYU'"를 만족하는 row를 반환하라. 그리고, 이 두 실행문들을 SQL Tuning Set로 생성하고, SQL Performance Analyzer를 실행하여 OBJECT_NAME 컬럼을 인덱스로 생성하고 OWNER 컬럼에 대한 function-based-index를 생성했을 때의 performance benefits를 확인하여라. comparison report를 통해 비교분석하라. (15분)
1. 테이블을 생성하고, 조건에 맞는 SQL문을 실행한다.
CONN c##ryu/asdf0930k;
CREATE TABLE table1
AS
SELECT *
FROM dba_objects
WHERE ROWNUM <= 100;
CREATE TABLE tbl_mv_objects
AS
SELECT *
FROM dba_objects;
SELECT /* RYU */ *
FROM tbl_mv_objects
WHERE OBJECT_NAME = 'TABLE1';
SELECT /* RYU */ *
FROM tbl_mv_objects
WHERE UPPER(OWNER) = 'C##RYU';
2. 방금 실행한 SQL문을 STS로 만들고, SQL Performance Analyzer를 실행한다.
'Oracle > OCM Journey' 카테고리의 다른 글
6-12 Performance Management - Use SQL Plan Management feature (0) | 2023.07.04 |
---|---|
6-11 Performance Management - Configure baseline templates (Comparing AWR Captures) (0) | 2023.07.04 |
6-9 Performance Management - Use SQL Access Advisor (0) | 2023.07.04 |
6-8 Performance Management - Use SQL Tuning Advisor (0) | 2023.06.30 |
6-7 Performance Management - Using SQL tuning tools and features (0) | 2023.06.27 |