数据库基础环境查看

select * from v$version;
select * from dba_registry_database;
select instance_name,host_name,version,status,database_status from v$instance;
select dbms_utility.port_string from dual;

-----------查看数据版本

select * from dba_registry;

-----------查看数据库安装的组件

select protection_mode, protection_level, remote_archive, database_role, dataguard_broker,guard_status
  from v$database;

-----------是否配置了dataguard

select log_mode from v$database;

-----------查看数据库是否启用了归档模式;

select flashback_on from v$database;

-----------是否起用了flashback database特性

select force_logging,supplemental_log_data_min, supplemental_log_data_pk, supplemental_log_data_ui,
  supplemental_log_data_fk, supplemental_log_data_all
  from v$database;

-----------是否启用了force logging和补充日志

select * from v$controlfile; --------控制文件的组成;
select l.group#, lf.type, lf.member, l.bytes, l.status LOG_STATUS, lf.status LOGFILE_STATUS
  from v$log l, v$logfile lf
  where l.group# = lf.group#
  order by 1,3; -------------REDO LOG日志文件

select owner, object_type, COUNT(*)
  from dba_objects
  where status = 'INVALID'
  group by owner, object_type; ---------数据库中无效对象


select name,phyrds,phywrts,readtim,writetim
from v$filestat a,v$dbfile b
where a.file# = b.file#
order by readtim desc ----------查看频繁读写的表空间

你可能感兴趣的:(数据库)