1、登录到数据库服务器
2、登录到SQLPlus
sqlplus / as sysdba
3、【可选】连接要具体操作的用户
conn 用户名/密码
1、查看并发连接数
select machine,count(*) from gv$session group by machine;
2、查看日志表空间:
SELECT Upper(F.TABLESPACE_NAME), D.TOT_GROOTTE_MB, D.TOT_GROOTTE_MB - F.TOTAL_BYTES, To_char(Round(( D.TOT_GROOTTE_MB - F.TOTAL_BYTES ) / D.TOT_GROOTTE_MB * 100, 2), '990.99') || '%' , F.TOTAL_BYTES, F.MAX_BYTES FROM (SELECT TABLESPACE_NAME, Round(Sum(BYTES) / ( 1024 * 1024 ), 2) TOTAL_BYTES, Round(Max(BYTES) / ( 1024 * 1024 ), 2) MAX_BYTES FROM SYS.DBA_FREE_SPACE GROUP BY TABLESPACE_NAME) F, (SELECT DD.TABLESPACE_NAME, Round(Sum(DD.BYTES) / ( 1024 * 1024 ), 2) TOT_GROOTTE_MB FROM SYS.DBA_DATA_FILES DD GROUP BY DD.TABLESPACE_NAME) D WHERE D.TABLESPACE_NAME = F.TABLESPACE_NAME ORDER BY 1;
3、查看日志表空间目录:
select tablespace_name, file_id, file_name, round(bytes / (1024 * 1024), 0) total_space from sys.dba_data_files order by tablespace_name