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

How to restore DM7 RAC database to stand-alone database

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article shows you how to restore the DM7 RAC database into a stand-alone database, the content is concise and easy to understand, it will definitely brighten your eyes. I hope you can get something through the detailed introduction of this article.

Restore DM7 RAC database to stand-alone database

1) start RMAN to back up the database to ensure that the server is offline.

RMAN > backup database'/ dm7/data/rac0_config/dm.ini' full backupset'/ dm7/backup/db_rac_full_bak_recover_dbmagic';backup database'/ dm7/data/rac0_config/dm.ini' full backupset'/ dm7/backup/db_rac_full_bak_recover_dbmagic' File dm.key not found, use default licenseurs if the RAC database under system path [+ DMDATA/data/rac] is running....EP [0] is checking....EP [1] is checking....EP [0] max_lsn: 76986EP [0] adjust cur_lsn from [76986] to [77001] BACKUP DATABASE [rac], execute.CMD CHECK LSN.BACKUP DATABASE [rac] Collect dbf.CMD CHECK .DBF BACKUP SUBS.total 1 packages processed...total 2 packages processed...total 3 packages processed...total 4 packages processed...total 5 packages processed...DBF BACKUP MAIN.BACKUPSET [/ dm7/backup/db_rac_full_bak_recover_dbmagic] END CODE [0] .meta GENERATING.total 9 packages processed...total 9 packages processedCMD END.CODE: [0] backup fulfilling fulfilling time used: 3887.714 (ms) RMAN > show backupset'/ dm7/backup/db_rac_full_bak_recover_dbmagic' Show backupset'/ dm7/backup/db_rac_full_bak_recover_dbmagic' System path: + DMDATA/data/racdb magic:-1632052820permanent magic: 450923536rac node: 2page check: 0rlog encrypt: 0external cipher [id/name]: 0/external hash [id/name]: 0/length in char: 0use new hash: 1page size: 8 KBextent size: 16case sensitive: 1log page size: 512 Bunicode_flag/charset: 0data version: 0x7000Asys version: V7.1.6.46-Build (2018.02.08-89107) ENTenable policy: 0archive flag: 1blank_pad_mode: 0crc_check: TRUEbackupset sig: BAbackupset version: 4009database name: racbackup name: DB_FULL_rac_20200616_ 154323_000689backupset description:backupset ID: 1145407476parent backupset ID:-1META file size: 74240compressed level: 0encrypt type: 0parallel num: 1backup range: databasempp_timestamp: 1592293401ddl_clone: FALSEmpp_flag: FALSEbackup level: offlinebackup type: fullwithout log: FALSESTART_LSN: 76987START_SEQ: 309END_LSN: 77001END_SEQ: 308base START_LSN:-1base END_LSN:-1base name:base backupset:backup time: 2020-06-16 15:43:25min trx start lsn: 76987min exec ver: 0x0701060Cpkg size: 0x02000000RAC EP: 0RAC status: OKRAC Begin lsn: 76987RAC begin seq: 309RAC end lsn: 77001RAC end seq: 308RAC base begin lsn:-1RAC base begin seq:-1RAC base end lsn:-1RAC base end seq:-1RAC EP: 1RAC status: OKRAC begin lsn: 77002RAC begin seq: 308RAC end lsn: 77001RAC end seq: 307RAC base begin lsn:-1RAC base begin seq:- 1RAC base end lsn:-1RAC base end seq:-1backupset directory: / dm7/backup/db_rac_full_bak_recover_dbmagicbackupset name: db_rac_full_bak_recover_dbmagicbackup data file num: 5backup piece num: 1 $file_seq | $size (KB) | $pos_desc | $content_type0 | 26103 | db_rac_full_bak_recover_dbmagic. Bak | DATA$file_seq | $group_id | $group_name | $file_id | $file_path | $mirror_path | $file_len1 | 0 | SYSTEM | 0 | + DMDATA/data/rac/system.dbf | | 1342177282 | | 1 | ROLL | 0 | + DMDATA/data/rac/roll.dbf | | 1342177283 | 4 | MAIN | 0 | + DMDATA/data/rac/main.dbf | | 1342177284 | | | 5 | TS_FOR_DBF | 0 | + DMDATA/data/rac/ts_for_dbf_01.dbf | | 1342177285 | 5 | TS_FOR_DBF | 1 | + DMDATA/data/rac/ts_for_dbf_02.dbf | | | 134217728 $file_seq | $file_path | $file_len | $begin_lsn | $begin_seqno | $begin_rpag_off | $end_lsn | $end_seqno | $create_time | $close_timeshow backupsets successfully.time used: 10.655 (ms) |

2) to prepare the target library, you can use the backup library or regenerate the library. Here, create a new library on another server, and regenerate the library as follows:

[dmdba@dmks ~] $dminit path=/dm_home/dmdbms/data db_name=dameng_for_recover auto_overwrite=1 port_num=5336initdb V7.1.6.46-Build (2018.02.08-89107) ENTdb version: 0x7000afile dm.key not found Use default license will expire in 14 day (s) on 2020-06-30 log file path: / dm_home/dmdbms/data/dameng_for_recover/dameng_for_recover01.log log file path: / dm_home/dmdbms/data/dameng_for_recover/dameng_for_recover02.logwrite to dir [/ dm_home/dmdbms/data/dameng_for_recover]. Create dm database success. 2020-06-16 16:03:18 [root@dmks root] # / dm_service_installer.sh-I / dm_home/dmdbms/data/dameng_for_recover/dm.ini-p dmrc-t dmserverMove the service script file (/ dm_home/dmdbms/bin/DmServicedmrc to / etc/rc.d/init.d/DmServicedmrc) Finished to create the service (DmServicedmrc) [root@dmks root] # service DmServicedmrc startStarting DmServicedmrc: [OK] [dmdba@dmks ~] $disql SYSDBA/SYSDBA@localhost:5336Server [localhost:5336]: mode is normal State is openlogin used time: 10.727 (ms) disql V7.1.6.46-Build (2018.02.08-89107) ENTConnected to: DM 7.1.6.46SQL > select permanent_magic LINEID PERMANENT_MAGIC--1-1238913195used time: 0.793 (ms) Execute id is 809.SQL > select db_magic from vault logicLineID DB_MAGIC--1 1319824724used time: 0.984 (ms). Execute id is 810.

3) copy the backup set and archive log files to the host where the target library is located

[dmdba@dmrac1 backup] $scp-r db_rac_full_bak_recover_dbmagic dmdba@10.10.10.187:/dm_home/dmdbms/backup/

The authenticity of host '10.10.10.187 (10.10.10.187)' can't be established.

RSA key fingerprint is 34:9a:d7:67:6d:be:20:45:21:ce:96:82:23:e5:e9:11.

Are you sure you want to continue connecting (yes/no)? Yes

Warning: Permanently added '10.10.10.187' (RSA) to the list of known hosts.

Dmdba@10.10.10.187's password:

Db_rac_full_bak_recover_dbmagic.meta 100% 73KB 72.5KB/s 00:00

Db_rac_full_bak_recover_dbmagic.bak 100% 25MB 25.5MB/s 00:00

[dmdba@dmrac1 data] $scp-r local_arch dmdba@10.10.10.187:/dm_home/dmdbms/backup/

Dmdba@10.10.10.187's password:

ARCHIVE_LOCAL1_20200528171255857_0.log 100% 157KB 156.5KB/s 00:00

[dmdba@dmrac1 data] $scp-r rac0_arch dmdba@10.10.10.187:/dm_home/dmdbms/backup/

Dmdba@10.10.10.187's password:

ARCHIVE_LOCAL1_20200615164953273_0.log 100% 160KB 160.0KB/s 00:00

ARCHIVE_LOCAL1_20200615165648166_0.log 100% 157KB 157.0KB/s 00:00

ARCHIVE_LOCAL1_20200528202150715_0.log 100% 277KB 277.0KB/s 00:00

ARCHIVE_LOCAL1_20200608151836879_0.log 100% 158KB 157.5KB/s 00:00

ARCHIVE_LOCAL1_20200609150852829_0.log 100% 157KB 157.0KB/s 00:00

ARCHIVE_LOCAL1_20200608152638617_0.log 100% 159KB 158.5KB/s 00:00

ARCHIVE_LOCAL1_20200609170732487_0.log 100% 161KB 160.5KB/s 00:00

ARCHIVE_LOCAL1_20200615172117341_0.log 100% 159KB 158.5KB/s 00:00

ARCHIVE_LOCAL1_20200615171042444_0.log 100% 159KB 159.0KB/s 00:00

ARCHIVE_LOCAL1_20200605154214367_0.log 100% 157KB 157.0KB/s 00:00

[dmdba@dmrac1 data] $scp-r rac1_arch dmdba@10.10.10.187:/dm_home/dmdbms/backup/

Dmdba@10.10.10.187's password:

ARCH_REMOTE1_20200608152641970_1.log 100% 158KB 158.0KB/s 00:00

ARCH_REMOTE1_20200609170737070_1.log 100% 159KB 159.0KB/s 00:00

ARCH_REMOTE1_20200609150857056_1.log 100% 158KB 158.0KB/s 00:00

ARCH_REMOTE1_20200615172121038_1.log 100% 158KB 158.0KB/s 00:00

ARCH_REMOTE1_20200608151838201_1.log 100% 5632 5.5KB/s 00:00

ARCH_REMOTE1_20200528202146001_1.log 100% 158KB 158.0KB/s 00:00

ARCH_REMOTE1_20200615164957743_1.log 100% 158KB 158.0KB/s 00:00

ARCH_REMOTE1_20200605154211189_1.log 100% 159KB 159.0KB/s 00:00

ARCH_REMOTE1_20200615165652504_1.log 100% 158KB 158.0KB/s 00:00

ARCH_REMOTE1_20200615171046600_1.log 100% 158KB 158.0KB/s 00:00

[dmdba@dmrac1 data] $

4) verify backup

RMAN > check backupset'/ dm_home/dmdbms/backup/db_rac_full_bak_recover_dbmagic';check backupset'/ dm_home/dmdbms/backup/db_rac_full_bak_recover_dbmagic';CMD END.CODE: [0] check backupset successfully.time used: 5.877 (ms)

5) restore the database

RMAN > restore database'/ dm_home/dmdbms/data/dameng_for_recover/dm.ini' from backupset'/ dm_home/dmdbms/backup/db_rac_full_bak_recover_dbmagic';restore database'/ dm_home/dmdbms/data/dameng_for_recover/dm.ini' from backupset'/ dm_home/dmdbms/backup/db_rac_full_bak_recover_dbmagic' File dm.key not found Use default license!checking if the database under system path [/ dm_home/dmdbms/data/dameng_for_recover] is running... [4] .checking if the database under system path [/ dm_home/dmdbms/data/dameng_for_recover] is running... [3] .checking if the database under system path [/ dm_home/dmdbms/data/dameng_for_recover] is running... [2] .checking if the database under system path [/ dm_home/dmdbms/data/dameng_for _ recover] is running... [1] .checking if the database under system path [/ dm_home/dmdbms/data/dameng_for_recover] is running... [0] .checking if the database under system path [/ dm_home/dmdbms/data/dameng_for_recover] is running Write dmrman info.RESTORE DATABASE CHECK.RESTORE DATABASE, dbf collect.RESTORE DATABASE, dbf refresh .RESTORE BACKUPSET [/ dm_home/dmdbms/backup/db_rac_full_bak_recover_dbmagic] START.total 5 packages processed...RESTORE DATABASE, UPDATE ctl file.RESTORE DATABASE, REBUILD key file.RESTORE DATABASE, CHECK db info.RESTORE DATABASE UPDATE db info.total 7 packages processedCMD END.CODE: [0] restore successfully.time used: 16226.253 (ms)

6) restore the database

RMAN > recover database'/ dm_home/dmdbms/data/dameng_for_recover/dm.ini' update db_magic; recover database'/ dm_home/dmdbms/data/dameng_for_recover/dm.ini' update db_magic Checking if the database under system path [/ dm_home/dmdbms/data/dameng_for_recover] is running... [4] .checking if the database under system path [/ dm_home/dmdbms/data/dameng_for_recover] is running... [3] .checking if the database under system path [/ dm_home/dmdbms/data/dameng_for_recover] is running... [2] .checking if the database under system path [/ dm_home/dmdbms/data/dameng_for_recover] is Running... [1] .checking if the database under system path [/ dm_home/dmdbms/data/dameng_for_recover] is running... [0] .checking if the database under system path [/ dm_home/dmdbms/data/dameng_for_recover] is running Write dmrman info.EP [0] max_lsn: 76986 [- 8308]: forbid updating database magic, need redo log

There is an error using the update db_magic option here, indicating that the log file needs to be redone. Let's remove the update db_magic option, because the db_ Magic value is always updated each time the restore is restored.

RMAN > recover database'/ dm_home/dmdbms/data/dameng_for_recover/dm.ini' with archivedir'/ dm_home/dmdbms/backup/rac0_arch','/dm_home/dmdbms/backup/rac1_arch';recover database'/ dm_home/dmdbms/data/dameng_for_recover/dm.ini' with archivedir'/ dm_home/dmdbms/backup/rac0_arch','/dm_home/dmdbms/backup/rac1_arch' Checking if the database under system path [/ dm_home/dmdbms/data/dameng_for_recover] is running... [4] .checking if the database under system path [/ dm_home/dmdbms/data/dameng_for_recover] is running... [3] .checking if the database under system path [/ dm_home/dmdbms/data/dameng_for_recover] is running... [2] .checking if the database under system path [/ dm_home/dmdbms/data/dameng_for_recover] is Running... [1] .checking if the database under system path [/ dm_home/dmdbms/data/dameng_for_recover] is running... [0] .checking if the database under system path [/ dm_home/dmdbms/data/dameng_for_recover] is running Write dmrman info.EP [0] max_lsn: 76986min_ckpt_lsn = The RAC recover total redo 0 ptxEP (0) slot ctl page (1,0,16) trxid = 9986EP (1) slot ctl page (1,0,17) trxid = 8457EP [0] Recover LSN from 76987 to 77001.EP [1] Recover LSN from 77002 to 77001.Recover from archive log finished, time used:0.006s.recover fulfilling time used: 7027.075 (ms)

7) check the data. Querying the data in table T1 can verify the success of data recovery.

[dmdba@dmks] $disql SYSDBA/SYSDBA@localhost:5336Server [localhost:5336]: mode is normal, state is openlogin used time: 10.727 (ms) disql V7.1.6.46-Build (2018.02.08-89107) ENTConnected to: DM 7.1.6.46SQL > desc T1 LINEID NAME TYPE$ NULLABLE--1 ID INTEGER Y2 NAME VARCHAR (20) Yused time: 20.311 (ms). Execute id is 3.SQL > select * from T1 political line ID NAME- 1 1 jy2 2 hyused time: 1.138 (ms). Execute id is 4.

8) check db_magic. After restore, db_magic has changed from-1632052820 to 1009602608.

SQL > select permanent_magic;LINEID PERMANENT_MAGIC--1 450923536used time: 1.042 (ms). Execute id is 5.SQL > select db_magic from vault logicLineID DB_MAGIC--1 1009602608used time: 1.332 (ms). Execute id is 6. The above is how to restore the DM7 RAC database to a stand-alone database. Have you learned any knowledge or skills? If you want to learn more skills or enrich your knowledge reserve, you are welcome to follow the industry information channel.

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: 0

*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