全部博文(136)
分类: Oracle
2008-05-04 11:33:58
SQL> select * from v$version; BANNER ------------------------------------------------------ Oracle8i Release PL/SQL Release CORE TNS for 32-bit Windows: Version NLSRTL Version |
SQL> select * from v$session_wait where sid = 7; SID SEQ# EVENT P1TEXT P1 ----- ------ ------------------- ------------ -- 7 11853 direct path read file number 8 |
SQL> SELECT bytes/1024/1024 size_m, tablespace_name, file_name 2 FROM dba_data_files where file_id = 8; SIZE_M TABLESPACE_NAME FILE_NAME ---------- ---------------- ------------------------------------------ 61 T_TEMP D:\ORACLE816\ORA81\ORADATA\XX\T_TEMP.ORA SQL> select USERNAME, TEMPORARY_TABLESPACE 2 from user_users where USERNAME = 'CENTER_XX'; USERNAME TEMPORARY_TABLESPACE ------------------------------ ----------------------- CENTER_XX T_TEMP SQL> select file_name from dba_data_files 2 where tablespace_name = 'T_TEMP'; FILE_NAME ------------------------------------------ D:\ORACLE816\ORA81\ORADATA\XX\T_TEMP.ORA SQL> |
SQL> select sql_address from v$session where sid = 7; SQL_ADDR -------- 158FD760 SQL> select sql_text from v$sqlarea where address = '158FD760'; SQL_TEXT ------------------------- SELECT "AC01"."AAB001", |
SQL> select index_name, column_name 2 from user_ind_columns 3 where table_name = 'AC01'; INDEX_NAME COLUMN_NAME ------------------------------ PK_AC01 AAC001 SQL> ed 已写入文件 afiedt.buf 1 select index_name, column_name 2 from user_ind_columns 3* where table_name = 'KC01' SQL> / INDEX_NAME COLUMN_NAME ------------------------------ PK_KC01 AAC001 SQL> |
SQL> explain plan 2 for 3 SELECT "AC01"."AAB001", 4 "AC01"."AAC002", 5 "KC01"."AKC020", 6 "AC01"."AAC001", 7 "AC01"."AAC003", 8 "AC01"."AAC004", 9 "KC01"."AKC021", 10 "AC01"."AAC008", 11 "AC01"."AAC006", 12 "AC01"."ZKC056" 13 FROM "KC01", "AC01" 14 WHERE ("KC01"."AAC001" = "AC01"."AAC001") AND 15 ((("AC01"."AAC003" LIKE '%的%'))); 已解释。 SQL> SELECT LPAD(' ',LEVEL*2)||' '||OPERATION||' '||OBJECT_NAME||' '||OPTIONS AS "SELECT QUERY" 2 FROM plan_table 3 START WITH ID=0 4 CONNECT BY PRIOR ID=PARENT_ID; SELECT QUERY ----------------------------------------------------------------------- SELECT STATEMENT MERGE JOIN SORT JOIN TABLE ACCESS AC01 FULL SORT JOIN TABLE ACCESS KC01 FULL 已选择6行。 |
SQL> delete plan_table; 已删除6行。 SQL> commit; 提交完成。 SQL> explain plan 2 for 3 SELECT /*+FIRST_ROWS*/ 4 "AC01"."AAB001", 5 "AC01"."AAC002", 6 "KC01"."AKC020", 7 "AC01"."AAC001", 8 "AC01"."AAC003", 9 "AC01"."AAC004", 10 "KC01"."AKC021", 11 "AC01"."AAC008", 12 "AC01"."AAC006", 13 "AC01"."ZKC056" 14 FROM "KC01", "AC01" 15 WHERE ("KC01"."AAC001" = "AC01"."AAC001") AND 16 ((("AC01"."AAC003" LIKE '%的%'))); 已解释。 SQL> SELECT LPAD(' ',LEVEL*2)||' '||OPERATION||' '||OBJECT_NAME||' '||OPTIONS AS "SELECT QUERY" 2 FROM plan_table 3 START WITH ID=0 4 CONNECT BY PRIOR ID=PARENT_ID; SELECT QUERY ---------------------------------------------------------------------- SELECT STATEMENT NESTED LOOPS TABLE ACCESS AC01 FULL TABLE ACCESS KC01 BY INDEX ROWID INDEX PK_KC01 UNIQUE SCAN SQL> |
SQL> select count(*) from ac01; COUNT(*) ---------- 284285 SQL> select count(*) from kc01; COUNT(*) ---------- 284285 SQL> |