Oracle Database Information Report
This script displays general information about the Oracle database and instance. It retrieves details from several dynamic performance views including database info, instance details, version, SGA components, control files, datafiles, and log files, providing a complete overview of the database environment.
oraclesqlreporting-analyticsv1.0.0
0 stars0 downloads15 views0 comments
By OracleDba • Created
Code
(46 lines)12345678910111213141516171819202122232425262728293031323334353637383940414243444546
-- -----------------------------------------------------------------------------------
-- File Name : https://oracle-base.com/dba/monitoring/db_info.sql
-- Author : Tim Hall
-- Description : Displays general information about the database.
-- Requirements : Access to the v$ views.
-- Call Syntax : @db_info
-- Last Modified: 15/07/2000
-- -----------------------------------------------------------------------------------
SET PAGESIZE 1000
SET LINESIZE 100
SET FEEDBACK OFF
SELECT *
FROM v$database;
SELECT *
FROM v$instance;
SELECT *
FROM v$version;
SELECT a.name,
a.value
FROM v$sga a;
SELECT Substr(c.name,1,60) "Controlfile",
NVL(c.status,'UNKNOWN') "Status"
FROM v$controlfile c
ORDER BY 1;
SELECT Substr(d.name,1,60) "Datafile",
NVL(d.status,'UNKNOWN') "Status",
d.enabled "Enabled",
LPad(To_Char(Round(d.bytes/1024000,2),'9999990.00'),10,' ') "Size (M)"
FROM v$datafile d
ORDER BY 1;
SELECT l.group# "Group",
Substr(l.member,1,60) "Logfile",
NVL(l.status,'UNKNOWN') "Status"
FROM v$logfile l
ORDER BY 1,2;
PROMPT
SET PAGESIZE 14
SET FEEDBACK ON