当前位置:网站首页>Viewing and verifying backup sets using dmrman

Viewing and verifying backup sets using dmrman

2022-07-06 03:54:00 Song Xiaorong

stay DM Restoring and restoring the database , Sometimes, restore fails , At this time, first check and verify the correctness of the database backup set information , Check whether the initialization parameters of the source library and the target library are compatible . We can use DMRMAN View and verify the database backup set .

View the full backup set of the database ( Offline backup )

Use show backupset Statements can be viewed DM Database backup set information , The command reference is as follows (DB_DAMENG_FULL_20200825_111703_293463 For offline full backup sets ):

RMAN>show backupset '/dm8/data/DAMENG/bak/DB_DAMENG_FULL_20200825_111703_293463';

The results are as follows .DBINFO Display database related information , Contains the magic number of the database , Database creation Directory , Database page size 、 Cluster size , Case sensitive 、 Whether the length is in characters 、 Character set 、 Database version 、 Whether to open archiving and other related information .

Be careful : stay DM8 Physical backup restore in progress , If the source database and the target database “ Case sensitive ” and “ Whether the length is in characters ” And other initialization parameter settings are different , Then the source library backup set file cannot be restored in the target library .

META INFO Show the name of the database 、 Backup name 、 Backup range 、 Backup type ( Total quantity / Incremental backup ) And backup methods ( offline / Online backup ) Etc , It can be seen here that the backup scope of this backup set is database backup , The backup type is full backup , The backup method is offline backup , As shown in the figure below :

FILE INFO Show the backup set of the database 、 Backup film and other information . It consists of four parts : Backup slice information <backup_piece_list>、 Data file information <data_file_list>、 Archived log information <arch_file_list>、HUGE Tablespace data file information <huge_file_list>. It can be seen here that the offline backup disk does not contain redo log information , Only data file information ,<data_file_list> Lists the included data file information .

View the full backup set of the database ( Online backup )

Use the following statement to view the database backup set (DB_DAMENG_FULL_2020_08_27_17_59_14 For online full backup sets ):

RMAN>show backupset '/dm8/data/DAMENG/bak/DB_DAMENG_FULL_2020_08_27_17_59_14';

The query results are as follows , It can be seen that , The same database , Online backup and offline backup DBINFO The information is basically the same ( Online backup requires opening the archive , so archive flag by 1).

META INFO in , The backup scope is database backup , The backup method is online backup , As shown in the figure below :

FILE INFO It can be seen that the online backup backup includes data backup and log backup , It includes data file information and part of archive log information .

View the database incremental backup set ( Online backup )

Use the following statement to view the backup set information (DB_DAMENG_INCRE_2020_08_27_16_19_58 Incremental backup sets for online ):

RMAN>show backupset '/dm8/data/DAMENG/bak/DB_DAMENG_INCRE_2020_08_27_16_19_58';

DB INFO Same as online full backup ,META INFO in , The backup scope is displayed as database backup , The backup mode is displayed as online backup , The backup type is incremental , As shown in the figure below :

FILE INFO It can be seen that online incremental backup is the same as online full backup , The backup piece contains data file information and archive log information .

View tablespace backup sets ( Online backup )

Use the following statement to view the backup set (TS_TBS_FULL_2020_08_27_16_20_56 It is online full TBS Tablespace backup sets ):

DMRMAN>show backupset '/dm8/data/DAMENG/bak/TS_TBS_FULL_2020_08_27_16_20_56';

META INFO in , The backup scope is displayed as table space backup , The backup mode is displayed as online full backup , As shown in the figure below .

FILE INFO It can be seen from table space online backup that the backup piece only contains the data file information corresponding to the table space , Do not include redo log information (DM8 When restoring a tablespace, it will automatically restore the tablespace to the latest time according to the archive log ).

View archived backup sets ( Online backup )

Use the following statement to view the backup set information (ARCH_2020_08_27_22_36_47 Archive backup sets online ):

RMAN>show backupset '/dm8/data/DAMENG/bak/ARCH_2020_08_27_22_36_47';

The results are as follows . among ,META INFO The backup range in is displayed as archive backup , The backup mode is displayed as online backup .

FILE INFO It can be seen that the archive backup backup only contains archive log information .<arch_file_list> Archive log file information is listed in .

Verify backup set

Use check backupset Statements can verify DM Database backup set information , The command reference is as follows :

RMAN>check backupset '/dm8/data/DAMENG/bak/DB_DAMENG_FULL_2020_08_27_17_59_14';

The verification backup is successful , Then the backup set is correct .

If the backup piece file in the backup set (.bak file ) Was renamed , Then the backup set verification fails , The following error is the duplicate name of the backup piece file, which leads to the failure of backup set verification :

summary :

①DM The physical backup set of the database contains metadata files and backup slice files .

② The suffix of metadata file is .meta, Through metadata files , You can learn about the entire backup set . The metadata file records the backup piece file name , Therefore, you cannot modify the backup piece file at will (.bak file ) name , If you modify the backup piece file name, the backup set will not find the backup piece file and cannot restore the database .

③ The suffix of backup slice file is .bak, Used to store backup data . The backup slice file contains data backup slice and log backup slice ; The data backup piece is used to store the information of the data page in the data file , The log backup is used to store REDO Log information . Online backup because the database is running , To ensure the consistency of the database , Online backup includes data file information , Also include REDO Log information , Therefore, the online database backup piece includes two parts: data backup piece and log backup piece ( Intuitively speaking, there are two online backup sets .bak file ); While offline backup, because the database is closed , There is no consistency problem , So offline backup only needs to back up data files .

④DM8 Tablespace backup only supports online backup , But only the data files corresponding to the tablespace are backed up , actual DM8 When restoring a tablespace, it will automatically restore the tablespace to the latest state according to the archive log .

原网站

版权声明
本文为[Song Xiaorong]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202132259039150.html