常用数据库管理sql语句

2023-03-01 03:09:38   第一文档网     [ 字体: ] [ 阅读: ] [ 文档下载 ]

#第一文档网# 导语】以下是®第一文档网的小编为您整理的《常用数据库管理sql语句》,欢迎阅读!
语句,常用,数据库,管理,sql
常用数据库管理sql语句: Session(非IDLE Wait Event

select event,sid from v$session_wait where event not like 'SQL%' and event not like '%message%'; SGA空余内存

select * from v$SGASTAT where name='free memory'; LOCK信息

select event,sid from v$session_wait where event like '%enqueue%' or event like 'library cache lock%'; TEMP信息

column s.machine format a10 SQL> column s.sid format 9999999 SQL> column s.module format a30 SQL> column u.tablespace format a10 SQL> column u.contents format a20 SQL> column u.segtype format a10 SQL> column MB format 999999

SQL> column u.tablespace format a10 select

s.machine,s.sid,s.module,u.tablespace,u.contents,u.segtype,round(u.blocks*8192/1024/1024,2)MB sys.v_$session

s,sys.v_$sort_usage

u

from where


s.saddr=u.session_addr and u.contents='TEMPORARY' and round(u.blocks*8192/1024/1024,2)>50; 表碎片信息(行迁移)

select owner ||'.'||table_name,CHAIN_CNT from dba_tables where CHAIN_CNT>0; 检查表记录数变化情况 select

table_name,owner,num_rows,sysdate

from

dba_tables ,dual where owner='LBC1' and num_rows>1000000;




本文来源:https://www.dy1993.cn/88a4.html

相关推荐