col name for a15
col open_mode for a10
select name,open_mode,to_char(open_time,'yyyy/mm/dd') open_time,to_char(CREATION_TIME,'yyyy/mm/dd') CREATE_TIME,round(TOTAL_SIZE/1024/1024/1024,2) as "disk_size(GB)",
(select pdb_size from
(select con_id,round(sum(bytes/1024/1024/1024),2) pdb_size from cdb_segments group by con_id) t where p.con_id=t.con_id) as "pdb_size(GB)"
from v$pdbs p order by open_time;
prompt
prompt
prompt
prompt
prompt
2.2 Tablespace all
select c.name name,f.tablespace_name tablespace_name,
round((d.sumbytes/1024/1024/1024),2) total_without_extend_GB,
round(((d.sumbytes+d.extend_bytes)/1024/1024/1024),2) total_with_extend_GB,
round((f.sumbytes+d.Extend_bytes)/1024/1024/1024,2) free_with_extend_GB,
round((d.sumbytes-f.sumbytes)/1024/1024/1024,2) used_GB,
round((d.sumbytes-f.sumbytes)*100/(d.sumbytes+d.extend_bytes),2) used_percent
from (select con_id,tablespace_name,sum(bytes) sumbytes from cdb_free_space group by con_id,tablespace_name) f,
(select con_id,tablespace_name,sum(aa.bytes) sumbytes,sum(aa.extend_bytes) extend_bytes from
(select con_id,nvl(case when autoextensible ='YES' then (case when (maxbytes-bytes)>=0 then (maxbytes-bytes) end) end,0) Extend_bytes
,tablespace_name,bytes from cdb_data_files) aa group by con_id,tablespace_name) d,v$containers c
where (f.con_id=d.con_id and f.tablespace_name=d.tablespace_name) and f.con_id=c.con_id
order by name,used_percent desc;
prompt
prompt
3.1 Redo log info
select thread#, GROUP#,SEQUENCE#,BYTES/1024/1024,STATUS,FIRST_TIME from v$log;
select * from v$logfile;
prompt
prompt
3.2 arch info
prompt
prompt
prompt
prompt
4.1 Session info
prompt
prompt
prompt
prompt
4.2 Transactions info
prompt
prompt
prompt
prompt
4.3 Dbtime info
prompt
prompt
prompt
prompt
4.4 Wait event
prompt
prompt
prompt
prompt
5.1 Alert_log(last 300) info
set markup html off
exec dbms_output.put_line('');
exec dbms_output.put_line('');
spool off
!sed -i '/
/d' &&FileName._&&_host_name._&&_SID._&&_spool_time..html
column alertfile new_value alertfiledr
select value as alertfile from V$DIAG_INFO where name='Diag Trace';
!tail -500 &&alertfiledr/alert_&&_SID..log | sed 's/^/
/g' >> &&FileName._&&_host_name._&&_SID._&&_spool_time..html
quit
```