-- 查看实例状态
select status from v$instance;
--查看数据库打开模式
select open_mode from v$database;
-- 查看当前系统时间
select to_char(sysdate,'yyyy-MM-dd HH24:mi:ss') from dual;
--查看用户账号的状态
select username,account_status from dba_users order by account_status desc;
--查看表空间
select tablespace_name,
round(used_space*(select value from v$parameter where name='db_block_size')/power(2,30),2) USED_GB,
round(tablespace_size*(select value from v$parameter where name='db_block_size')/power(2,30)) MAXSIZE_GB,
round(used_percent,2) as "PCT%"
from dba_tablespace_usage_metrics;
--查看当前进程数量。
select count(*) from v$process;