heading.sql
@heading.sql
Oracle database useful info
Oracle report heading
set heading off
set linesize 175
select 'Server Detail:- '||SYS_CONTEXT('USERENV','SERVER_HOST')||'.'||SYS_CONTEXT( 'USERENV', 'DB_DOMAIN' )||':'||UTL_INADDR.get_host_address||' Inst Name and Id->'||SYS_CONTEXT( 'USERENV', 'INSTANCE_NAME' )||'='||SYS_CONTEXT( 'USERENV', 'INSTANCE' )||', Db Name= '||SYS_CONTEXT( 'USERENV', 'DB_NAME' )||' OS:- '||dbms_utility.port_string ||' Uptime:-' || floor(sysdate - startup_time) || 'days' ||
trunc( 24*((sysdate-startup_time) -
trunc(sysdate-startup_time))) || 'hours' ||
mod(trunc(1440*((sysdate-startup_time) -
trunc(sysdate-startup_time))), 60) ||'minutes' ||
mod(trunc(86400*((sysdate-startup_time) -
trunc(sysdate-startup_time))), 60) ||'seconds' Db_Detail from
sys.v_$instance where rownum=1;
col NAME format a30
col VALUE format a50
select NAME,VALUE from v$parameter
where NAME like 'log_archive_dest_%'
and VALUE is not null
and VALUE!='enable'
union
select NAME,VALUE from v$parameter
where NAME in ('cluster_database','cluster_database_instances','db_recovery_file_dest');
select 'FlashBack '||FLASHBACK_ON FROM v$database;
set heading on
Search This Blog
Total Pageviews
Saturday, 22 October 2011
Subscribe to:
Post Comments (Atom)
Oracle DBA
anuj blog Archive
- ▼ 2011 (362)
No comments:
Post a Comment