June 05, 2013

Longops - RMAN

oracle instance process running on the server
---------------------------------------------
ps -ef | grep pmon

Set the environment for the database
------------------------------------
uname

cat /etc/oratab (Linux/AIX)
(OR)
cat /var/opt/oracle/oratab

export ORACLE_SID=<INSTANCE_NAME>
export ORACLE_HOME=/usr/app/oracle/product/10.2.0/
export PATH=$PATH:$ORACLE_HOME/bin

Database Details
----------------
sqlplus "/as sysdba"

set pages 9999 lines 300
col OPEN_MODE for a10
col HOST_NAME for a20
select name DB_NAME, INSTANCE_NAME, HOST_NAME, DATABASE_ROLE,
OPEN_MODE, version DB_VERSION, LOGINS,
to_char(STARTUP_TIME,'DD-MON-YYYY HH24:MI:SS') "DB UP TIME"
from v$database,gv$instance;

Longops - RMAN
------------------------
set pages 50000 lines 32767

col USERNAME for a10
col OPNAME for a10
col TARGET_DESC for a10
col CONTEXT for a10
col MESSAGE for a30

SELECT SID, SERIAL#, CONTEXT, SOFAR, TOTALWORK, ROUND(SOFAR/TOTALWORK*100,2) "%_COMPLETE",
TIME_REMAINING/60 REMAINING_MINS 
FROM GV$SESSION_LONGOPS
WHERE OPNAME LIKE 'RMAN%'
AND OPNAME NOT LIKE '%aggregate%'
AND TOTALWORK != 0 AND SOFAR <> TOTALWORK
/
Longops - RMAN
------------------------
set pages 9999 lines 300
col status for a10
col object_type for a10

alter session set nls_date_format = 'DD-MM-YYYY HH24:MI:SS';

select SID,STATUS,START_TIME,END_TIME,OBJECT_TYPE,OUTPUT_DEVICE_TYPE
from v$rman_status order by START_TIME desc;

select max(START_TIME) "START_TIME", END_TIME,
ELAPSED_SECONDS/60 "ELAPSED_MINS",
OUTPUT_BYTES/1024/1024/1024 "OUTPUT_BYTES_GB",STATUS
from v$rman_backup_job_details
group by START_TIME,END_TIME,ELAPSED_SECONDS,OUTPUT_BYTES, STATUS
having max(START_TIME) > sysdate-1
/

No comments:

Post a Comment