Backup-related dynamic performance views and monitoring

Source: Internet
Author: User

1. Related views

V$backup_files

V$backup_set

V$backup_piece

V$backup_redolog

V$backup_spfile

V$backup_device

V$rman_configuration

V$archived_log

V$backup_corruption

V$copy_corruption

V$database_block_corruption

V$backup_datafile

2. View the server sessions for the channel

Using the SET command ID command

Query v$process and v$session to determine which session corresponds to the Rman channel

Sql> Select Sid,username,client_info from V$session

2 where client_info is not null;

SID USERNAME Client_info

---------- ------------------------------ ------------------------------

146 SYS Rman Channel=ora_disk_1

148 SYS Rman Channel=ora_disk_2

SYS Rman Channel=ora_disk_3

--The SET command ID commands are used below

Rman> run{

2> Allocate channel CH1 type disk;

3> set command ID to ' Rman ';

4> Backup as Copy datafile 4

5> format '/u01/app/oracle/rmanbak/dd_%u ';

6>}

Sql> Select Sid,username,client_info from V$session

2 where client_info is not null;

SID USERNAME Client_info

---------- ------------------------------ ------------------------------

Id=rman SYS

Sql> Select Sid,spid,client_info

2 from V$process p, v$session s

3 Where p.addr = S.paddr

4 and Client_info like '%id=% ';

SID SPID Client_info

---------- ------------ ------------------------------

5002 Id=rman

--View the full progress of Rman

Sql> Select Sid,serial#,context,sofar,totalwork,

2 round (sofar/totalwork*100,2) "% complete"

3 from V$session_longops

4 where opname like ' rman:% '

5 and Opname not like ' rman:aggregate% '

6 and Totalwork!=0;

--The SID and SPID information for the service process that Rman used to complete the backup operation is obtained by using the following SQL:

Select Sid, SPID, client_info

From V$process p, v$session s

where p.addr = S.paddr

and client_info like '%id=rman% '

Automatic backup of Rman under 3.Linux

Backup Script +crontab

Bak_inc0:0-level incremental backups, backed up by use-level increments per Sunday

Bak_inc1:1-level incremental backups, incremental backups per Wednesday, backup data changes from Sunday to Wednesday

Bak_inc2:2-level incremental backup, which backs up the difference increment that occurs daily. Differences from Monday to Tuesday, as from Sunday to Monday

--The following is the level increment of the script, the remaining level and the level Efaro, the difference is the backup level and tag tag

[email protected] scripts]$ cat BAK_INC0

Run {

Allocate channel CH1 type disk;

Backup as compressed Backupset incremental level 0

Format '/u01/oracle/bk/rmbk/incr0_%d_%u '

Tag ' day_incr0 '

Database plus archivelog Delete input;

Release channel CH1;

}

Test scripts individually

[Email protected] bk]$ Rman target/log=/u01/oracle/bk/log/bak_inc0.log/

> CMDFILE=/U01/ORACLE/BK/SCRIPTS/BAK_INC0.RCV

rman> 2> 3> 4> 5> 6> 7> 8> 9>

[Email protected] bk]$

Edit Crontab

[Email protected] ~]# WhoAmI

Root

[Email protected] ~]# CRONTAB-E-U Oracle

* * 0 Rman target/log=/u01/oracle/bk/log/bak_inc0.log Append cmdfile =/U01/ORACLE/BK/SCRIPTS/BAK_INC0.RCV

* * 1 Rman target/log=/u01/oracle/bk/log/bak_inc2.log Append cmdfile =/U01/ORACLE/BK/SCRIPTS/BAK_INC2.RCV

* * 2 Rman target/log=/u01/oracle/bk/log/bak_inc2.log Append cmdfile =/U01/ORACLE/BK/SCRIPTS/BAK_INC2.RCV

* * 3 Rman target/log=/u01/oracle/bk/log/bak_inc1.log Append cmdfile =/U01/ORACLE/BK/SCRIPTS/BAK_INC1.RCV

* * 4 Rman target/log=/u01/oracle/bk/log/bak_inc2.log Append cmdfile =/U01/ORACLE/BK/SCRIPTS/BAK_INC2.RCV

* * 5 Rman target/log=/u01/oracle/bk/log/bak_inc2.log Append cmdfile =/U01/ORACLE/BK/SCRIPTS/BAK_INC2.RCV

* * 6 Rman target/log=/u01/oracle/bk/log/bak_inc2.log Append cmdfile =/U01/ORACLE/BK/SCRIPTS/BAK_INC2.RCV

"/tmp/crontab. Xxxxinbzgr "7L, 791C written

Crontab:installing New Crontab

Restart crontab after saving

[Email protected] ~]# service Crond restart

stopping Crond: [OK]

Starting Crond: [OK]

Check that automatic backups are executed successfully

Backup-related dynamic performance views and monitoring

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.