将sqlplus的执行结果spool到html文件中关键的就是两步
set markup html on
spool transaction_recovery_date +%H%m%d_%H%M%S
.html
export ORACLE_SID=cdb21
./sqlplus / as sysdba <<EOF
set markup html on
spool transaction_recovery_date +%H%m%d_%H%M%S
.html
alter session set nls_date_format=‘dd-Mon-yyyy hh24:mi:ss’;
select systimestamp from dual;
show pdbs
show parameter cluster_database
show parameter fast_start_parallel_rollback
select *
from v$database;
select *
from v$instance;
select *
from dba_2pc_neighbors;
select *
from dba_2pc_pending;
select b.inst_id “Instance #”, a.ksppinm “Parameter”, b.ksppstvl “Session Value”, c.ksppstvl “Instance Value”, c.ksppstdf “Default?”
from x$ksppi a, x$ksppcv b, x$ksppsv c
where a.indx = b.indx
and a.indx = c.indx
and a.ksppinm in (‘_smu_debug_mode’, ‘_transaction_recovery_servers’);
select systimestamp, x.*
from x$ktuxe x
where x.ktuxesta = ‘ACTIVE’
and x.ktuxecfl = ‘DEAD’;
select u.name useg, u.inst# instid, u.status$ status, k.ktuxeusn xid_usn, k.ktuxeslt xid_slot, k.ktuxesqn xid_seq, k.ktuxesiz undoblocks, k.ktuxesta txstatus
from x$ktuxe k, undo$ u
where k.ktuxesta = ‘ACTIVE’
and k.ktuxecfl = ‘DEAD’
and k.ktuxeusn = u.us#;
select to_char(sysdate,‘DD-MON-YYYY HH24:MI:SS’), v.*
from gv$fast_start_transactions v
where v.state in (‘RECOVERING’, ‘TO BE RECOVERED’);
select inst_id, con_id, state, usn, undoblocksdone, undoblockstotal, undoblocksdone*100/undoblockstotal as “Completed (%)”
from gv$fast_start_transactions v
where v.state in (‘RECOVERING’, ‘TO BE RECOVERED’);
spool off
exit
EOF
https://www.cnblogs.com/hehe520/archive/2009/12/29/6330625.html