sqlt

哎呀我的天吶發表於2015-02-09

點選(此處)摺疊或開啟

  1. [oracle@test install]$ ll sqcrea*
  2. -rw-r--r-- 1 oracle oinstall 4771 Oct 31 02:00 sqcreate.sql
  3. [oracle@test install]$ pwd
  4. /home/oracle/sqlt/install

點選(此處)摺疊或開啟

  1. [oracle@test install]$ sqlplus / as sysdba

  2. SQL*Plus: Release 10.2.0.4.0 - Production on Thu Feb 5 03:54:30 2015

  3. Copyright (c) 1982, 2007, Oracle. All Rights Reserved.


  4. Connected to:
  5. Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
  6. With the Partitioning, OLAP, Data Mining and Real Application Testing options

  7. 03:54:30 SQL> @sqcreate    

  8. zip error: Nothing to (SQLT_installation_logs_archive.zip)

  9. zip error: Nothing to (SQLT_installation_logs_archive.zip)

  10. PL/SQL procedure successfully completed.

  11. Elapsed: 00:00:00.00

  12. Specify optional Connect Identifier (as per Oracle Net)
  13. Include "@" symbol, ie. @PROD
  14. If not applicable, enter nothing and hit the "Enter" key.
  15. You *MUST* provide a connect identifier when installing
  16. SQLT in a Pluggable Database in 12c
  17. This connect identifier is only used while exporting SQLT
  18. repository everytime you execute one of the main methods.

  19. Optional Connect Identifier (ie: @PROD): @TestDB12


  20. PL/SQL procedure successfully completed.

  21. Elapsed: 00:00:00.00

  22. PL/SQL procedure successfully completed.

  23. Elapsed: 00:00:00.02

  24. Define SQLTXPLAIN password (hidden and case sensitive).



  25. Elapsed: 00:00:00.05

  26. Password for user SQLTXPLAIN:
  27. Re-enter password:


  28. PL/SQL procedure successfully completed.

  29. Elapsed: 00:00:00.01
  30. ... please wait

  31. TABLESPACE         FREE_SPACE_MB
  32. ------------------------------ -------------
  33. TEST                 30125
  34. EXAMPLE              32700
  35. USERS                 32734

  36. Elapsed: 00:00:00.49

  37. Specify PERMANENT tablespace to be used by SQLTXPLAIN.

  38. Tablespace name is case sensitive.

  39. Default tablespace [USERS]:

  40. PL/SQL procedure successfully completed.

  41. Elapsed: 00:00:00.04
  42. ... please wait

  43. TABLESPACE
  44. ------------------------------
  45. TEMP001

  46. Elapsed: 00:00:00.01

  47. Specify TEMPORARY tablespace to be used by SQLTXPLAIN.

  48. Tablespace name is case sensitive.

  49. Temporary tablespace [TEMP001]:

  50. PL/SQL procedure successfully completed.

  51. Elapsed: 00:00:00.01

  52. The main application user of SQLT is the schema
  53. owner that issued the SQL to be analyzed.
  54. For example, on an EBS application you would
  55. enter APPS.
  56. You will not be asked to enter its password.
  57. To add more SQLT users after this installation
  58. is completed simply grant them the SQLT_USER_ROLE
  59. role.

  60. Main application user of SQLT:

  61. PL/SQL procedure successfully completed.

  62. Elapsed: 00:00:00.00

  63. SQLT can make extensive use of licensed features
  64. provided by the Oracle Diagnostic and the Oracle
  65. Tuning Packs, including SQL Tuning Advisor (STA),
  66. SQL Monitoring and Automatic Workload Repository
  67. (AWR).
  68. To enable or disable access to these features
  69. from the SQLT tool enter one of the following
  70. values when asked:

  71. \"T\" if you have license for Diagnostic and Tuning
  72. \"D\" if you have license only for Oracle Diagnostic
  73. \"N\" if you do not have these two licenses

  74. Oracle Pack license [T]:

  75. PL/SQL procedure successfully completed.

  76. Elapsed: 00:00:00.00

  77. PL/SQL procedure successfully completed.

  78. Elapsed: 00:00:00.00

  79. PL/SQL procedure successfully completed.

  80. Elapsed: 00:00:00.00

  81. PL/SQL procedure successfully completed.

  82. Elapsed: 00:00:00.00

  83. PL/SQL procedure successfully completed.

  84. Elapsed: 00:00:00.01

  85. PL/SQL procedure successfully completed.

  86. Elapsed: 00:00:00.00

  87. PL/SQL procedure successfully completed.

  88. Elapsed: 00:00:00.01

  89. PL/SQL procedure successfully completed.
建立好了就能連了

點選(此處)摺疊或開啟

  1. 04:51:08 SQL> conn SQLTXPLAIN/oracle
  2. Connected.
  3. 04:51:18 SQL> select * from tab;

  4. TNAME             TABTYPE    CLUSTERID
  5. ------------------------------ ------- ----------


點選(此處)摺疊或開啟

  1. 04:16:24 SQL> select * from table(dbms_xplan.display_cursor(null,null));

  2. PLAN_TABLE_OUTPUT
  3. --------------------------------------------------------------------------------------------------------------------------
  4. SQL_ID    1j2cqw0sxv467, child number 0
  5. -------------------------------------
  6. select a.id , b.ename, b.hiredate from c_lob a , empt b where a.id =
  7. b.empno

  8. Plan hash value: 646364930

  9. ------------------------------------------------------------------------
  10. | Id | Operation       |  Name |  Rows | Bytes | Cost (%CPU)| Time     |
  11. ------------------------------------------------------------------------
  12. | 0 | SELECT STATEMENT |       |       |       | 73747 (100)|          |
  13. |* 1| HASH JOIN        |       |    14 |   476 | 73747 (1)  | 00:14:45 |
  14. | 2 | TABLE ACCESS FULL|  EMPT |    14 |   406 |     3 (0)  | 00:00:01 |
  15. | 3 | TABLE ACCESS FULL| C_LOB |  1008K|  4922K| 73732 (1)  | 00:14:45 |
  16. ------------------------------------------------------------------------

  17. Predicate Information (identified by operation id):
  18. ---------------------------------------------------

  19.    1 - access("A"."ID"="B"."EMPNO")

  20. Note
  21. -----
  22.    - dynamic sampling used for this statement

點選(此處)摺疊或開啟

  1. oracle@test11g:/home/oracle/sqlt/run> pwd
  2. /home/oracle/sqlt/run

點選(此處)摺疊或開啟

  1. -rw-r--r-- 1 oracle oinstall 4431 Oct 30 14:00 sqltxtract.sql + sql_id
這個不真正的跑只是將你的執行計劃,資訊拿出來。


點選(此處)摺疊或開啟

  1. [oracle@test run]$ sqlplus / as sysdba

  2. SQL*Plus: Release 10.2.0.4.0 - Production on Thu Feb 5 04:27:55 2015

  3. Copyright (c) 1982, 2007, Oracle. All Rights Reserved.


  4. Connected to:
  5. Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
  6. With the Partitioning, OLAP, Data Mining and Real Application Testing options

  7. 04:27:56 SQL> @sqltxtract 1j2cqw0sxv467

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29990276/viewspace-1431181/,如需轉載,請註明出處,否則將追究法律責任。