Wednesday, November 11, 2020

SQLT installation.

 FAQ: SQLT (SQLTXPLAIN) Frequently Asked Questions (Doc ID 1454160.1)

1.  Download sqlt_10g_11g_12c_18c_19c_5th_June_2020.zip 

2. mv the zip to $ORACLE_HOME

3. unzip -o sqlt_10g_11g_12c_18c_19c_5th_June_2020.zip

4. /apps2/oracle/product/12.1.0/sqlt
oracle@suthakar$ls -tlr
total 120
drwxr-x---. 3 oracle oinstall  4096 Jun  5 10:37 input
drwxr-x---. 2 oracle oinstall  4096 Jun  5 10:37 doc
drwxr-x---. 2 oracle oinstall  4096 Jun  5 10:38 run
drwxr-x---. 2 oracle oinstall  4096 Jun  5 10:38 install
drwxr-x---. 7 oracle oinstall  4096 Jun  5 10:38 utl
-rw-r-----. 1 oracle oinstall 58466 Jun  5 10:41 sqlt_instructions.html
-rw-r-----. 1 oracle oinstall 39368 Jun  5 10:43 sqlt_instructions.txt
oracle@suthakar$cd install
oracle@suthakar$pwd
/apps2/oracle/product/12.1.0/sqlt/install
oracle@suthakar$
oracle@suthakar$sqlplus '/as sysdba'
SQL*Plus: Release 12.1.0.2.0 Production on Wed Nov 11 21:43:55 2020
Copyright (c) 1982, 2014, Oracle.  All rights reserved.
Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
SQL> !ls -ltr sqdrop.sql
-rw-r-----. 1 oracle oinstall 1365 Oct 30  2014 sqdrop.sql
SQL> sta sqdrop.sql
SQL> SET ECHO OFF;
SQDUSR completed.
SQDROP completed.
SQL>

Execute installation script sqlt/install/sqcreate.sql connected as SYS
 

SQL> !ls -ltr sqdrop.sql
-rw-r-----. 1 oracle oinstall 1365 Oct 30  2014 sqdrop.sql

SQL> sta sqdrop.sql
... uninstalling SQLT, please wait
TADOBJ completed.                
SQDOLD completed. Ignore errors from this script
SQDOBJ completed. Ignore errors from this script
SQL>                                           
SQL> DECLARE                                   
  2    my_count INTEGER;                        

 29      END LOOP;                                                                                                                
 30    END IF;                                                                                                                    
 31  END;                                                                                                                         
 32  /                                                                                                                            
Cannot drop procedure sys.sqlt$_trca$_dir_set. ORA-04043: object                                                                  
SQLT$_TRCA$_DIR_SET does not exist                                                                                                
Ignore errors from here until @@@@@ marker as this is to test for NATIVE PLSQL Code Type
@@@@ marker . You may ignore prior errors about NATIVE PLSQL Code Type                 
old   1: ALTER SESSION SET PLSQL_CODE_TYPE = &&plsql_code_type                         
new   1: ALTER SESSION SET PLSQL_CODE_TYPE = NATIVE                                    
Session altered.

Specify optional Connect Identifier (as per Oracle Net)
Include "@" symbol, ie. @PROD                         
If not applicable, enter nothing and hit the "Enter" key.
You *MUST* provide a connect identifier when installing 
SQLT in a Pluggable Database in 12c                     
This connect identifier is only used while exporting SQLT
repository everytime you execute one of the main methods.
Optional Connect Identifier (ie: @PROD): @DEV
PL/SQL procedure successfully completed.
PL/SQL procedure successfully completed.
Define SQLTXPLAIN password (hidden and case sensitive).

Password for user SQLTXPLAIN: APPS
Re-enter password:            

PL/SQL procedure successfully completed.

The next step is to choose the tablespaces to be used by SQLTXPLAIN

The Tablespace name is case sensitive.

Do you want to see the free space of each tablespace [YES]
or is it ok just to show the list of tablespace [NO]?    

Type YES or NO [Default NO]: YES

... please wait

TABLESPACE                     FREE_SPACE_MB
------------------------------ -------------
APPS_TS_ARCHIVE                           96
APPS_TS_TX_DATA                          456
APPS_TS_NOLOGGING                        655
APPS_TS_INTERFACE                        728
APPS_TS_MEDIA                           1250
APPS_TS_QUEUES                          2084
OWB                                     2323
APPS_TS_SEED                            4616
APPS_TS_TX_IDX                         11173
APPS_TS_SUMMARY                        12029

10 rows selected.
Specify PERMANENT tablespace to be used by SQLTXPLAIN.
 

Tablespace name is case sensitive.
Default tablespace [UNKNOWN]: APPS_TS_SUMMARY
PL/SQL procedure successfully completed.
... please wait
TABLESPACE
------------------------------
TEMP                         
Specify TEMPORARY tablespace to be used by SQLTXPLAIN.
Tablespace name is case sensitive.
Temporary tablespace [UNKNOWN]: TEMP
PL/SQL procedure successfully completed.
The main application user of SQLT is the schema
owner that issued the SQL to be analyzed.     
For example, on an EBS application you would  
enter APPS.                                   
You will not be asked to enter its password.  
To add more SQLT users after this installation
is completed simply grant them the SQLT_USER_ROLE
role.                                           
Main application user of SQLT: XXXX
PL/SQL procedure successfully completed.
SQLT can make extensive use of licensed features
provided by the Oracle Diagnostic and the Oracle
Tuning Packs, including SQL Tuning Advisor (STA),
SQL Monitoring and Automatic Workload Repository
(AWR).                                          
To enable or disable access to these features   
from the SQLT tool enter one of the following   
values when asked:                              

"T" if you have license for Diagnostic and Tuning
"D" if you have license only for Oracle Diagnostic
"N" if you do not have these two licenses        
Oracle Pack license [T]: N
PL/SQL procedure successfully completed.

SQLT users must be granted SQLT_USER_ROLE before using this tool.
SQCREATE completed. Installation completed successfully.

SQL>SQL> grant SQLT_USER_ROLE to APPS;

Grant succeeded.
SQL>