首页 > 技术文章 > ORACLE数据库文件信息查询命令

jsxxd 2021-11-26 16:27 原文

ORACLE数据库文件信息查询命令

 

1、查看datafile信息(文件号、是否在线和路径名字)

select file#,status,name from v$datafile;

select file#,name,checkpoint_change# from v$datafile;
select file#,name,checkpoint_change# from v$datafile_header;

 

2、查看数据文件信息(文件号、对应的表空间、文件路径、是否可用)

select file_id,tablespace_name,file_name,status from dba_data_files;

 

3、查看controlfile的路径名字信息

select name from v$controlfile;

 

4、查看redo log组的状态

select group#,sequence#,members,status from v$log;

 

5、查看redo log组文件状态和成员信息(路径和名字)

select group#,type,member from v$logfile;

 

6、查看归档日志信息

select name,sequence# from v$archived_log;

 

7、查看tablespace的信息

select file_name,file_id,tablespace_name,bytes/1024/1024 M,status from dba_data_files;

 

8、查看临时文件的信息

select file#,status,enabled,bytes/1024/1024 M,name from v$tempfile;

 

9、查看数据库用户下表、视图、序列、索引、过程、包、约束、触发器、函数的个数

conn scott/scott
select 
(select count(*) from user_tables) as TABLES,
(select count(*) from user_views) as VIEWS,
(select count(*) from user_sequences) as SEQUENCES,
(select count(*) from user_indexes) as INDEXES,
(select count(*) from user_objects where object_type='PROCEDURE') as PROCEDURES,
(select count(*) from user_objects where object_type='PACKAGE') as PACKAGES,
(select count(*) from user_constraints) as CONSTRAUBTS,
(select count(*) from user_objects where object_type='TRIGGER') as TRIGGERS,
(select count(*) from user_objects where object_type='FUNCTION') as FUNCTIONS
from dual;

 

推荐阅读