ORACLE數據庫文件信息查詢命令


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;

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM