meta données pour cette page
Différences
Ci-dessous, les différences entre deux révisions de la page.
| Prochaine révision | Révision précédente | ||
| oracle:database:rman [04/12/2024 08:37] – créée mdl | oracle:database:rman [04/12/2024 10:10] (Version actuelle) – mdl | ||
|---|---|---|---|
| Ligne 4: | Ligne 4: | ||
| <code PLSQL> | <code PLSQL> | ||
| set lines 200 pages 2000 | set lines 200 pages 2000 | ||
| - | col STATUS format | + | col STATUS format |
| col dev format a10 | col dev format a10 | ||
| col START_TIME format a16 | col START_TIME format a16 | ||
| Ligne 11: | Ligne 11: | ||
| col INBYTES format a10 | col INBYTES format a10 | ||
| col OUTBYTES format a10 | col OUTBYTES format a10 | ||
| - | select SESSION_KEY, | + | select SESSION_KEY, |
| - | to_char(START_TIME,' | + | to_char(START_TIME,' |
| - | to_char(END_TIME,' | + | to_char(END_TIME,' |
| elapsed_seconds/ | elapsed_seconds/ | ||
| input_bytes_display inbytes, output_bytes_display outbytes | input_bytes_display inbytes, output_bytes_display outbytes | ||
| Ligne 19: | Ligne 19: | ||
| where status=' | where status=' | ||
| order by session_key; | order by session_key; | ||
| + | |||
| + | SESSION_KEY SESSION_RECID SESSION_STAMP INPUT_TYPE | ||
| + | ----------- ------------- ------------- ------------- -------------------- ---------- ---------------- ---------------- ------ ---------- ---------- | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | |||
| + | </ | ||
| + | \\ | ||
| + | |||
| + | == Kill runing jobs == | ||
| + | <code PLSQL> | ||
| + | ### Check what Session will be killed | ||
| + | select s.sid, s.serial#, s.username, | ||
| + | | ||
| + | p.pid oraclepid, p.spid " | ||
| + | | ||
| + | | ||
| + | from v$session s, v$process p | ||
| + | where s.paddr=p.addr | ||
| + | and s.program like ' | ||
| + | order by s.sid | ||
| + | |||
| + | ### Generate simple command | ||
| + | select '! kill -9 ' | ||
| + | from v$session s, v$process p | ||
| + | where s.paddr=p.addr | ||
| + | and s.program like ' | ||
| + | order by s.sid | ||
| + | |||
| + | |||
| + | KILL_RMAN_PROCESS | ||
| + | ---------------------------------- | ||
| + | ! kill -9 2516 | ||
| + | ! kill -9 2517 | ||
| + | ! kill -9 2497 | ||
| + | </ | ||
| + | \\ | ||
| + | == Job Summary with SESSION_RECID and SESSION_STAMP== | ||
| + | <code PLSQL> | ||
| + | set lines 220 | ||
| + | set pages 1000 | ||
| + | col backup_type for a4 heading " | ||
| + | col controlfile_included heading " | ||
| + | col incremental_level heading "INCR LVL" | ||
| + | col pieces for 999 heading " | ||
| + | col elapsed_seconds heading " | ||
| + | col device_type for a10 trunc heading " | ||
| + | col compressed for a4 heading " | ||
| + | col output_mbytes for 9,999,999 heading " | ||
| + | col input_file_scan_only for a4 heading " | ||
| + | select | ||
| + | d.bs_key, d.backup_type, | ||
| + | to_char(d.start_time, | ||
| + | to_char(d.completion_time, | ||
| + | d.elapsed_seconds, | ||
| + | from V$BACKUP_SET_DETAILS d | ||
| + | join V$BACKUP_SET s on s.set_stamp = d.set_stamp and s.set_count = d.set_count | ||
| + | where session_recid = & | ||
| + | and session_stamp = & | ||
| + | order by d.start_time; | ||
| + | |||
| + | ELAPSED DEVICE | ||
| + | BS_KEY TYPE CF? INCR LVL PCS START_TIME | ||
| + | ---------- ---- --- ---------- ---- ---------------- ------------------- ---------- ---------- ---- ---------- ---- | ||
| + | 3336 L NO 1 2024-12-02 20:14 2024-12-02 20: | ||
| + | |||
| + | </ | ||
| + | \\ | ||
| + | |||
| + | == Job Detail with SESSION_RECID and SESSION_STAMP == | ||
| + | <code PLSQL> | ||
| + | set lines 200 | ||
| + | set pages 1000 | ||
| + | select output | ||
| + | from GV$RMAN_OUTPUT | ||
| + | where session_recid = & | ||
| + | and session_stamp = & | ||
| + | order by recid; | ||
| + | |||
| + | OUTPUT | ||
| + | ---------------------------------------------------------------------------------------------------------------------------------- | ||
| + | connected to target database: C1DIGDEV (DBID=1272122079) | ||
| + | connected to recovery catalog database | ||
| + | PL/SQL package RMAN_C1DIGDEV.DBMS_RCVCAT version 19.21.00.00. in RCVCAT database is not current | ||
| + | PL/SQL package RMAN_C1DIGDEV.DBMS_RCVMAN version 19.21.00.00 in RCVCAT database is not current | ||
| + | |||
| + | |||
| + | resync only records later than timestamp 1186107934 | ||
| + | RMAN configuration parameters for database with db_unique_name C1DIGDEV are: | ||
| + | CONFIGURE RETENTION POLICY TO REDUNDANCY 1; # default | ||
| + | CONFIGURE BACKUP OPTIMIZATION ON; | ||
| + | CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default | ||
| + | CONFIGURE CONTROLFILE AUTOBACKUP ON; | ||
| + | CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE ' | ||
| + | CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO ' | ||
| + | CONFIGURE DEVICE TYPE ' | ||
| + | CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET; # default | ||
| + | CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE SBT_TAPE TO 1; # default | ||
| + | CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default | ||
| + | CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE SBT_TAPE TO 1; # default | ||
| + | CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default | ||
| + | CONFIGURE CHANNEL DEVICE TYPE DISK MAXPIECESIZE 2 G; | ||
| + | CONFIGURE CHANNEL DEVICE TYPE ' | ||
| + | CONFIGURE MAXSETSIZE TO UNLIMITED; # default | ||
| + | CONFIGURE ENCRYPTION FOR DATABASE OFF; # default | ||
| + | CONFIGURE ENCRYPTION ALGORITHM ' | ||
| + | CONFIGURE COMPRESSION ALGORITHM ' | ||
| + | CONFIGURE RMAN OUTPUT TO KEEP FOR 90 DAYS; | ||
| + | CONFIGURE ARCHIVELOG DELETION POLICY TO BACKED UP 1 TIMES TO ' | ||
| + | CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/ | ||
| + | [...] | ||
| + | Finished backup at 02-DEC-24 | ||
| + | |||
| + | Starting Control File and SPFILE Autobackup at 02-DEC-24 | ||
| + | released channel: ch00 | ||
| + | RMAN-00571: =========================================================== | ||
| + | RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS =============== | ||
| + | RMAN-00571: =========================================================== | ||
| + | RMAN-03009: failure of Control File and SPFILE Autobackup command on ch00 channel at 12/04/2024 10:57:29 | ||
| + | ORA-19506: failed to create sequential file, name=" | ||
| + | ORA-27027: sbtremove2 returned error | ||
| + | ORA-19511: non RMAN, but media manager or vendor specific failure, error text: | ||
| + | | ||
| + | </ | ||
| + | \\ | ||
| + | == Past 24 hours jobs == | ||
| + | <code PLSQL> | ||
| + | set lines 220 | ||
| + | set pages 1000 | ||
| + | col cf for 9,999 | ||
| + | col df for 9,999 | ||
| + | col elapsed_seconds heading " | ||
| + | col i0 for 9,999 | ||
| + | col i1 for 9,999 | ||
| + | col l for 9,999 | ||
| + | col output_mbytes for 99,999,999 heading " | ||
| + | col session_recid for 999999 heading " | ||
| + | col session_stamp for 99999999999 heading " | ||
| + | col status for a20 | ||
| + | col time_taken_display for a10 heading " | ||
| + | col output_instance for 9999 heading " | ||
| + | col DOW format a10 | ||
| + | col START_TIME format a20 | ||
| + | col END_TIME format a20 | ||
| + | select | ||
| + | j.session_recid, | ||
| + | to_char(j.start_time, | ||
| + | to_char(j.end_time, | ||
| + | (j.output_bytes/ | ||
| + | decode(to_char(j.start_time, | ||
| + | 3, ' | ||
| + | 5, ' | ||
| + | 7, ' | ||
| + | j.elapsed_seconds, | ||
| + | x.cf, x.df, x.i0, x.i1, x.l, | ||
| + | ro.inst_id output_instance | ||
| + | from V$RMAN_BACKUP_JOB_DETAILS j | ||
| + | left outer join (select | ||
| + | d.session_recid, | ||
| + | sum(case when d.controlfile_included = ' | ||
| + | sum(case when d.controlfile_included = ' | ||
| + | and d.backup_type||d.incremental_level = ' | ||
| + | sum(case when d.backup_type||d.incremental_level = ' | ||
| + | sum(case when d.backup_type||d.incremental_level = ' | ||
| + | sum(case when d.backup_type = ' | ||
| + | from | ||
| + | V$BACKUP_SET_DETAILS d | ||
| + | join V$BACKUP_SET s on s.set_stamp = d.set_stamp and s.set_count = d.set_count | ||
| + | where s.input_file_scan_only = ' | ||
| + | group by d.session_recid, | ||
| + | on x.session_recid = j.session_recid and x.session_stamp = j.session_stamp | ||
| + | left outer join (select o.session_recid, | ||
| + | from GV$RMAN_OUTPUT o | ||
| + | group by o.session_recid, | ||
| + | ro on ro.session_recid = j.session_recid and ro.session_stamp = j.session_stamp | ||
| + | where j.start_time > trunc(sysdate)-1 | ||
| + | order by j.start_time; | ||
| </ | </ | ||