一、数据库数据库名称数据库唯一名称数据库ID数据库创建时间日志归档模式打开模式数据库角色服务器参数文件控制文件列表二、数据文件表空间列表数据文件列表临时文件列表日志组列表在线日志文件列表三、备份文件归档日志文件列表备份文件列表四、用户与模式对象数据库用户列表模式对象数量列表五、实例与会话主机名称实例名称服务名称数据库软件版本实例启动时间实例状态当前会话列表文件的大小与分布数据文件总大小临时文件总大小在线日志文件总大小控制文件总大小归档日志文件总大小备份文件总大小数据文件分布临时文件分布在线日志文件分布控制文件分布归档日志文件分布备份文件分布服务器参数文件位置告警日志位置后台跟踪日志位置用户跟踪日志位置内核跟踪日志位置磁盘空间使用情况各表空间空间占用率主机资源使用情况主机资源使用情况版本数据库版本数据库选项系统参数最大进程数最大会话数数据块大小游标共享模式多块读批量回滚段表空间回滚段保留时间回滚段管理模式系统全局区目标大小系统全局区最大值程序全局区目标和时间统计初始化参数文件数据库名称数据库唯一名称实例名称服务名称当前用户概况段的总数量各类型段的数量大段列表段的基本信息区的列表区的大小分布用户存储空间消耗前20个大段表的基本信息字段的基本信息表的备注字段的备注表的约束字段的约束索引的列表索引的字段对象总数量对象分类数量数据库链接列表大对象列表物化视图列表视图列表了解业务表的例子常用基本脚本LONG的显示设置分页设置视图长度视图定义视图定义表的归属段的大小多个段的大小索引的归属表的索引表的状态表的索引字段索引的字段数据分布数据分布selectnamefromv$database;selectdb_unique_namefromv$database;selectdbidfromv$database;selectto_char(created,'yyyy/mm/ddhh24:mi:ss')fromv$database;selectlog_modefromv$database;selectopen_modefromv$database;selectdatabase_rolefromv$database;selectvaluefromv$parameterwherename='spfile';selectvaluefromv$parameter2wherename='control_files';selectnamefromv$tablespace;selectnamefromv$datafile;selectnamefromv$tempfile;selectgroup#,bytes/1024/1024||'M'fromv$log;selectmax(length(member))fromv$logfile;columnmemberformata36selectgroup#,memberfromv$logfile;selectcount(*)fromv$archived_log;selectcount(*)fromv$archived_logwherenameisnotnull;selectnamefromv$archived_logwherenameisnotnull;selectcount(*)fromv$backup_piece;selectcount(*)fromv$backup_piecewherehandleisnotnull;selecthandlefromv$backup_piecewherestart_time=sysdate-1orderbyhandle;selectusernamefromdba_usersorderbycreated;descdba_objectsselectowner,object_type,count(*)fromdba_objectsgroupbyowner,object_typeorderbyowner,object_type;selecthost_namefromv$instance;selectinstance_namefromv$instance;selectvaluefromv$parameterwherename='service_names';selectversionfromv$instance;selectto_char(startup_time,'yyyy/mm/ddhh24:mi:ss')fromv$instance;selectstatusfromv$instance;selectsid,serial#,usernamefromv$session;selectsum(bytes)/1024/1024||'M'fromv$datafile;selectround(sum(bytes)/1024/1024/1024)||'G'fromv$datafile;selectsum(bytes)/1024/1024||'M'fromv$tempfile;selectround(sum(bytes)/1024/1024/1024)||'G'fromv$tempfile;selectsum(bytes*members)/1024/1024||'M'fromv$log;selectround(sum(bytes*members)/1024/1024/1024)||'G'fromv$log;selectsum(block_size*file_size_blks)/1024/1024||'M'fromv$controlfile;selectcount(*)fromv$archived_log;selectmin(block_size*blocks)fromv$archived_log;selectmax(block_size*blocks)/1024/1024||'M'fromv$archived_log;selectsum(block_size*blocks)/1024/1024/1024||'G'fromv$archived_log;selectround(nvl(sum(block_size*blocks),0)/1024/1024/1024)||'G'fromv$archived_logwherenameisnotnull;selectcount(*)fromv$backup_piece;selectsum(bytes)/1024/1024/1024||'G'fromv$backup_piece;selectround(sum(bytes)/1024/1024/1024)||'G'fromv$backup_piecewherehandleisnotnull;selectdistinctsubstr(name,1,instr(name,'/',-1))fromv$datafile;selectdistinctsubstr(name,1,instr(name,'/',-1))fromv$tempfile;selectdistinctsubstr(member,1,instr(member,'/',-1))fromv$logfile;selectdistinctsubstr(name,1,instr(name,'/',-1))fromv$controlfile;selectdistinctsubstr(name,1,instr(name,'/',-1))fromv$archived_log;selectdistinctsubstr(handle,1,instr(handle,'/',-1))fromv$backup_piece;selectsubstr(value,1,instr(value,'/',-1))fromv$parameterwherename='spfile';selectvaluefromv$parameterwherename='background_dump_dest';hols-l/opt/app/oracle/admin/DAL2AP/bdump/alert*selectvaluefromv$parameterwherename='background_dump_dest';selectvaluefromv$parameterwherename='user_dump_dest';selectvaluefromv$parameterwherename='core_dump_dest';columnTotal_Spacefora10columnFree_Spacefora10columnUsed_Spacefora10columnFree_Percentagefora6columnUsed_Percentagefora6setpagesize0selectdf.tablespace_name,round(df.bytes/1024/1024,2)||'M'asTotal_Space,round(nvl(fs.bytes,0)/1024/1024,2)||'M'asFree_Space,round((df.bytes-nvl(fs.bytes,0))/1024/1024,2)||'M'asUsed_Space,round(nvl(fs.bytes,0)/df.bytes,4)*100||'%'asFree_Percentage,round(1-nvl(fs.bytes,0)/df.bytes,4)*100||'%'asUsed_Percentagefrom(selecttablespace_name,sum(bytes)asbytesfromdba_data_filesgroupbytablespace_name)df,(selecttablespace_name,sum(bytes)asbytesfromdba_free_spacegroupbytablespace_name)fswheredf.tablespace_name=fs.tablespace_name(+)orderbydf.tablespace_name;descv$resource_limitselectmax(length(resource_name))fromv$resource_limit;columnresource_nameformata21selectresource_name,current_utilization,max_utilization,initial_allocation,limit_valuefromv$resource_limit;descv$versionselectbannerfromv$version;descv$optionselectmax(length(parameter)),max(length(value))fromv$option;columnparameterformata35columnvalueformata5selectparameter,valuefromv$option;selectvaluefromv$parameterwherename='processes';selectvaluefromv$parameterwherename='sessions';selectvaluefromv$parameterwherename='db_block_size';selectvaluefromv$parameterwherename='cursor_sharing';selectvaluefromv$parameterwherename='db_file_multiblock_read_count';selectvaluefromv$parameterwherename='undo_tablespace';selectvaluefromv$parameterwherename='undo_retention';selectval