数据库系统负载高居不下,用户进程占用系统资源约99%
数据库系统负载高居不下,用户进程占用系统资源约99%解决方法:1、通过TOP查看spid值;2、通过spid值查询sid值;SELECT s.sid,s.serial# from v$session s,v$process p where s.paddr=p.addr and p.spid='16406';3、通过sid值查询正在运行的SQL语句;Select sql_textfrom v$sqltext aWhere a.hash_value =(select sql_hash_value from v$session b where b.sid = '&sid')Order by piece asc;4、分析查询出来的SQL语句,通过执行计划进行跟踪;5、优化SQL语句;[@more@]
ORACLE: 查询(看)表的主键、外键、唯一性约束和索引
ORACLE: 查询(看)表的主键、外键、唯一性约束和索引1、查找表的所有索引(包括索引名,类型,构成列):select t.*,i.index_type from user_ind_columns t,user_indexes i where t.index_name = i.index_name and t.table_name = i.table_name and t.table_name = 表名2、查找表的主键(包括名称,构成列):select cu.* from user_cons_columns cu, user_constraints au where cu.constraint_name = au.constraint_name and au.constraint_type = 'P' and au.table_name = 表名3、查找表的唯一性约束(包括名称,构成列):select column