Database - Display database information in HTML |
--
-- Name: db_info_html.sql
--
-- Parms: none
--
-- Description: Database - Display database information in HTML
--
-- Compatability: 8.1.x and above
--
-- Usage: @db_info_html.sql
--
-- Note: HTML file is created as c:\temp\dbinfo.html
clear columns
set feed off head off echo off verify OFF wrap OFF trimspool ON pages 0
set linesize 300
define spoolfile=c:\temp\dbinfo.html
define table=' '
prompt spooling to file &&spoolfile
set termout off
spool &&spoolfile
prompt
rem -- Define the styles of the report
prompt
rem -- Database Information
prompt
prompt Database Information
prompt &&table
prompt |
'||
''||name||
' | '||log_mode
from v$database
/
prompt |
rem -- Database Version
prompt
prompt Database Version
prompt &&table
prompt |
|
'||
''||banner
from v$version
/
prompt |
rem -- Tablespaces
prompt
prompt Tablespaces
prompt &&table
prompt |
'||
''||tablespace_name||
' | '||status||
' | '||contents
from dba_tablespaces
/
prompt |
rem -- Datafiles
column bytes format 999,999,999
prompt
prompt Datafiles
prompt &&table
prompt |
'||
''||file_name||
' | '||tablespace_name||
' | '||to_char(blocks,'999,999,999,999')||
' | '||to_char(bytes,'999,999,999,999')
from dba_data_files
order by file_name
/
prompt |
rem -- Redo Logfiles
prompt
prompt Redo Logfiles
prompt &&table
prompt |
'||
''||GROUP#||
' | '||MEMBER
from v$logfile
order by GROUP#
/
prompt |
rem -- Control Files
prompt
prompt Control Files
prompt &&table
prompt |
'||
''||name
from v$controlfile
order by name
/
prompt |
rem -- Rollback Segments
prompt
prompt Rollback Segments
prompt &&table
prompt |
'||owner||'.'||segment_name||
' | '||tablespace_name||
' | '||initial_extent||
' | '||next_extent||
' | '||min_extents||
' | '||max_extents||
' | '||pct_increase||
' | '||status
from dba_rollback_segs
order by 1
/
prompt |
rem -- Non-default Database Parameters
prompt
prompt Non-default Database Parameters
prompt &&table
prompt |
'||
''||name||
' | '||value
from v$parameter
where isdefault = 'FALSE'
order by type,name
/
prompt |
prompt
spool off;
set termout ON define ON head ON feed ON verify ON
set lines 80 pages 100