Header Some of Oracle's frequently used statement records

Source: Internet
Author: User

--Query the actual statistical information
Select Num_rows,blocks,empty_blocks,avg_space,avg_row_len,sample_size,
Last_analyzed from Dba_tables
where UPPER (table_name) =
Upper (' t_hs_inivbalanceexpentry ');

--sql number of statements and fetch
Select
Sql_text,executions,fetches from V$sql where
Parsing_schema_name= ' dbzy_jtgl_0901 ' and module= ' WebDev.WebServer40.EXE '
and
To_date (First_load_time, ' yyyy-mm-dd hh24:mi:ss ') >=to_date (' 2014-09-07
10:18:00 ', ' yyyy-mm-dd hh24:mi:ss ')
and To_date (First_load_time, ' yyyy-mm-dd
Hh24:mi:ss ') <=to_date (' 2014-09-07 10:30:00 ', ' yyyy-mm-dd
Hh24:mi:ss ')
ORDER by fetches Desc,executions desc

--oracle The SQL statement being executed
SELECT B.sid Oracleid,
B.username,
b.serial#,
SPID OperationID,
PADDR,
Sql_text,
B.machine
From V$process A
INNER JOIN V$session B on
A.ADDR = b.paddr
INNER JOIN V$sqlarea c on b.sql_hash_value =
C.hash_value;

--size of the table
Select round (bytes/1024/1024,2) | | M ' from
User_segments where
Segment_name= ' T_hs_inivbalanceexp_h ';

--Lock table query SQL
SELECT object_name,
Machine, S.sid, s.serial#
From Gv$locked_object L
INNER JOIN Dba_objects
O on l.object_id=o.object_id
Inner JOIN gv$session s on l.session_id = S.sid;


--Release session SQL:
--alter system kill session ' Sid, Serial# ';
ALTER system kill session ' 441, 61701 ';

Header Some of Oracle's frequently used statement records

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.