Hi,
Is there any way to do a cat * where it shows the name of each file in the process? Similar to what more does below?
Is there any way to do a cat * where it shows the name of each file in the process? Similar to what more does below?
Code:
$ more ?.sql
::::::::::::::
1.sql
::::::::::::::
set linesize 200
select db_unique_name,
cast(
from_tz(
cast( oldest_flashback_time as timestamp )
,dbtimezone )
at time zone 'Pacific/Melbourne' as date ) oldest_db_fb
, round((sysdate - oldest_flashback_time) * 24, 1) oldest_db_fb_hours
, d.inst_id
from gv$flashback_database_log l, gv$database d
where l.inst_id = d.inst_id
order by d.inst_id
;
::::::::::::::
2.sql
::::::::::::::
set linesize 200
alter session set nls_date_format = 'DD-MON-YYYY HH24:MI:SS'
;
col name format a60
col db_unique_name format a15
select a.db_unique_name, b.name, a.first_time_min, a.inst_id, a.database_role, sysdate
from ( select db_unique_name, min(first_time) first_time_min, max(first_time) first_time_max, d.name, f.inst_id, d.database_role, sysdate
from gv$flashback_database_logfile f, gv$database d
where f.inst_id = d.inst_id
group by db_unique_name, d.name, f.inst_id, d.database_role
order by f.inst_id ) a,
gv$flashback_database_logfile b
where b.first_time = a.first_time_min and
b.inst_id = a.inst_id
;
select a.db_unique_name, c.name, a.first_time_max, a.inst_id, a.database_role, sysdate
from ( select db_unique_name, min(first_time) first_time_min, max(first_time) first_time_max, d.name, f.inst_id, d.database_role, sysdate
from gv$flashback_database_logfile f, gv$database d
where f.inst_id = d.inst_id
group by db_unique_name, d.name, f.inst_id, d.database_role
order by f.inst_id ) a,
gv$flashback_database_logfile c
where c.first_time = a.first_time_max and
c.inst_id = a.inst_id
;
::::::::::::::
3.sql
::::::::::::::
set linesize 200
alter session set nls_date_format = 'DD-MON-YYYY HH24:MI:SS'
;
col name format a20
select db_unique_name, min(first_time), max(first_time), d.name, f.inst_id, d.database_role, sysdate
from gv$flashback_database_logfile f, gv$database d
where f.inst_id = d.inst_id
group by db_unique_name, d.name, f.inst_id, d.database_role
order by f.inst_id
;