如何查看数据库的各种数据文件?

 
  SQL> set pages 100
  SQL> col file_name form a60
  SQL> col name form a60
  SQL> col member form a50
  SQL> col m0 form 99999 heading "Size (Mb)"
  SQL>
  SQL> spool datafile.lst
  SQL>
  
  1、查看数据文件
  SQL> select file_name,bytes/(1024*1024) m0 from dba_data_files;
  
  FILE_NAME Size (Mb)
  ------------------------------------------------------------ ---------
  C:/ORACLE/ORADATA/ORADB/USERS01.DBF 20
  C:/ORACLE/ORADATA/ORADB/DR01.DBF 20
  C:/ORACLE/ORADATA/ORADB/TOOLS01.DBF 10
  C:/ORACLE/ORADATA/ORADB/INDX01.DBF 20
  C:/ORACLE/ORADATA/ORADB/RBS01.DBF 70
  C:/ORACLE/ORADATA/ORADB/TEMP01.DBF 20
  C:/ORACLE/ORADATA/ORADB/SYSTEM01.DBF 236
  
  已选择7行。
  
  
  2、查看控制文件
  SQL> select NAME,status from v$controlfile;
  
  NAME STATUS
  ------------------------------------------------------------ -------
  C:/ORACLE/ORADATA/ORADB/CONTROL01.CTL
  C:/ORACLE/ORADATA/ORADB/CONTROL02.CTL
  C:/ORACLE/ORADATA/ORADB/CONTROL03.CTL
  
  
  3、查看日志文件
  SQL> select group#,member,status from v$logfile;
  
   GROUP# MEMBER STATUS
  ---------- -------------------------------------------------- -------
   1 C:/ORACLE/ORADATA/ORADB/REDO03.LOG STALE
   2 C:/ORACLE/ORADATA/ORADB/REDO02.LOG
   3 C:/ORACLE/ORADATA/ORADB/REDO01.LOG STALE
 

你可能感兴趣的:(Oracle优化专题,数据库,sql,file,c)