1,连上服务器,使用top命令,可以查看cpu使用率以及内存的使用情况等等,还有当前各用户的使用情况 2,用pl/sql developper,tool里面选sessions,就可以看到当前session的情况,包括卡住的SQL语句 3,查看各用户的各种资源占用,可以运行下面的SQL select se.SID, ses.username, ses.osuser, n.NAME, se.VALUE from v$statname n, v$sesstat se, v$session ses
1.操作 (oracle使用内存约等于 SGA+PGA,所以可以减少SGA与PGA解决你的问题,生产库慎用)alter system set sga_max_size=100m scope=spfile; --减少SGA大小,静态参数,重启后生效alter system set sga_target=80m scope=both; --动态参数:oracle推荐:启动时修改此参数,不要动态设置此参数alter system set pga_aggregate_target=40m
select TABLE_NAME , num_rows * avg_row_len /1024/1024 AS KJfrom ALL_tables WHERE TABLE_NAME IN (select TABLE_NAME from all_tables where owner='PRODDTA')ORDER BY KJ DESC
SELECT T.OWNER, T.SEGMENT_NAME, SUM(T.BYTES) / 1024 / 1024 M FROM DBA_SEGMENTS T WHERE T.OWNER = 'user_name' AND T.SEGMENT_NAME = 'table_name' GROUP BY T.OWNER, T.SEGMENT_NAME; 或者 select sum(bytes/1024/1024) M from user_segments where segment_name
--分配表的物理存储1 select segment_name, bytes from user_segments where segment_type = 'TABLE'; From User_Extents Group By Segment_Name select num_rows * avg_row_len from user_tables where table_name = 'FCT_QUERY_LOG';