Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

RMAN backup filesperset usage

2025-04-11 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

RMAN backup filesperset usage

Using filesperset to control the size of backup set

When the filesperset parameter is specified, rman compares the filesperset with the automatically calculated value (number of files per assigned channel)

And take the smaller value to ensure that all channels are used.

If the number of files specified or implied by combining backupSpec statements is larger than filesperset

Then rman creates multiple backup sets to maintain the correct rate (ratio)

If you do not specify the value calculated by the filesperset,rman comparison (number of files divided by assigned channels) and the default value of 64

And take the smaller value to ensure that all channels are available.

Rman usually attempts to create enough backup sets to give all assigned channels something to do.

One exception is that there are more channels than files to back up.

Allocate channel provides backup concurrency, if the average number of files is create catalog

C:/rman target sys/a123456@192.168.100.2 catalog rman / rman

Rman > register database

If you want to re-register, query the dictionary DB to get DB_KEY and DB_ID to execute the DBMS_RCVAT.UNREGISTERDATABASE command to cancel the registration. Re-register.

Sql > conn rman/rman

Sql > select * from db

Sql > exec dbms_rcvcat.unregisterdatabase (DB_KEY,DB_ID)

Rman > resync catalog

Make a full backup of the database every six months (including read-only tablespaces)

Make a level zero backup once a month (excluding read-only tablespaces)

Make a first-level backup once a week

Make a secondary backup every day

Database full backup script:

Run {

Allocate channel c1 type disk

Allocate channel c2 type disk

Allocate channel c3 type disk

Backup full tag 'dbfull' format' / backup/ncfc/full%d%p%t' database

Sql 'alter system archive log current'

Backup format / backup/ncfc/dbL0/dbL0%d%p%t.arc' filesperset 5 archivelog all delete input

Release channel c1

Release channel c2

Release channel c3

}

Zero-level backup scripts (except read-only tablespaces)

Run {

Allocate channel C1 type disk maxpiecesize = 20g

Allocate channel c2 type disk maxpiecesize = 20g

Allocate channel c3 type disk maxpiecesize = 20g

Backup incremental level 0 filesperset 10 tag 'dbL0' format' / backup/ncfc/dbL0/dbL0%u%p%c 'database skip readonly

Sql 'alter system archive log current'

Backup format'/ backup/ncfc/dbL0/arch%u%p%c.arc' filesperset 5 archivelog from time "sysdate-1" all

Release channel c1

Release channel c2

Release channel c3

}

First-level backup script

Run {

Allocate channel C1 type disk maxpiecesize = 20g

Allocate channel c2 type disk maxpiecesize = 20g

Allocate channel c3 type disk maxpiecesize = 20g

Backup incremental level 1 filesperset 5 tag 'dbL1' format' / backup/ncfc/dbL1/dbL1%d%p%t 'ddatabase skip readonly

Sql 'alter system archive log current'

Backup format'/ backup/ncfc/dbL1/dbL1%d%p%t.arc' filesperset 5 archivelog from time "sysdate-1" all

Release channel c1

Release channel c2

Release channel c3

}

Second-level backup script

Run {

Allocate channel C1 type disk maxpiecesize = 20g

Allocate channel c2 type disk maxpiecesize = 20g

Allocate channel c3 type disk maxpiecesize = 20g

Backup incremental level 2 filesperset 5 tag 'dbL2' format' / backup/ncfc/dbL2/dbL2%u%p%c' ddatabase skip readonly

Sql 'alter system archive log current'

Backup format'/ backup/ncfc/dbL2/dbL2%d%p%t.arc' filesperset 5 archivelog from time "sysdate-1" all

Release channel c1

Release channel c2

Release channel c3

}

Archive file backup script

Run {

Allocate channel dev1 type disk maxpiecesize = 20g

Allocate channel dev2 type disk maxpiecesize = 20g

Allocate channel dev3 type disk maxpiecesize = 20g

Sql 'alter system archive log current'

Backup format'/ backup/ncfc/arc/arch%u%p%c 'archivelog from time "sysdate-1" all

Release channel dev1

Release channel dev2

Release channel dev3

}

Tablespace backup script (take users tablespace as an example)

Run {

Allocate channel c1 type disk

Allocate channel c2 type disk

Allocate channel c3 type disk

Backup tag 'tabsp' format' / backup/ncfc/tabsp/tabsp%u%p%c' tablespace users

Sql 'alter system archive log current'

Backup format'e:\ oradata\% d% p% t.arc' filesperset 5 archivelog all delete input

Release channel c1

Release channel c2

Release channel c3

}

Then the amount of data that needs to be backed up every day is only an one-day change. When doing recovery, you only need to restore one zero-level backup + three first-level backups + 6 second-level backups + archived files of the same day. If you cannot accept such a recovery time, you can only reduce the interval between level zero backups (for example, you can do a level zero backup every week, so that you only need to restore a maximum of one week of data).

Backup CATALOG database (database logical output)

Exp pafile=exp.dat

The exp.dat is as follows

Userid=rman/rman

File=rmanexp.dmp

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 256

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report