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 migrate Dameng database instance from Windows to Linux system

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

Share

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

Phenomenon description

Sometimes we have a real need to migrate Dameng database instances from Windows to Linux system, especially when there is a large amount of data. If we create a new database on linux and then migrate it through the migration tool or logical backup recovery (dexp, dimp), there are two weaknesses:

1. The process is complicated. There are many things to consider for all tables, data, triggers, non-table objects, statistics, etc.

two。 And this process, which involves the process of B-tree reconstruction in the destination database, is not efficient.

Here we introduce a way to directly copy data files on the Windows operating system and migrate Dameng database instances to Linux. This is the most efficient way for instances with high utilization of tablespaces, and the process is simple, regardless of the integrity of object migration in the instance.

Treatment method

Windows software installation directory: e:\ OneDrive-business\ DM_DBMS\ DBMS_20190604\ bin

Windows instance data directory: e:\ test1\ DAMENG\ dm.ini

Linux software installation directory: / opt/dmdbms/bin

1. On Windows, stop the database service normally.

2. Cmd goes to the database software installation directory

E:

Cd e:\ dmdbms\ bin

3. Backup database

PS E:\ OneDrive-business\ DM_DBMS\ DBMS_20190604\ bin >.\ dmbackup.exe ini_path=E:\ test1\ DAMENG\ dm.ini bakfile_path=e:\ back\ back.bak name=test01

Backup fun end time used: 1144.562 (ms)

Backup successfully!

Backup time used: 7555.626 (ms)

PS E:\ OneDrive-business\ DM_DBMS\ DBMS_20190604\ bin >

Note: ini_path should be careful not to use single quotation marks and double quotation marks if you want to use them.

4. Then, log in to linux and copy the backup file to the linux server: (for example, under / opt/dmdbms/bak)

Note: make sure that the relevant directories, including the uploaded bak files, are dmdba users and have permissions.

5. Initialize a new instance on linux (database software has been installed on linux, under / opt/dmdbms/)

[dmdba@localhost ~] $cd / opt/dmdbms/bin

[dmdba@localhost bin] $. / dminit path=/opt/dmdbms/data

6. Restore the backup to the location of that instance

[dmdba@localhost bin] $. / dmrestore ini_path=/opt/dmdbms/data/DAMENG/dm.ini file=/opt/dmdbms/bak/back.bak

Continue? [Y/N]: y

Warning: Backup file may has been modified!

Continue? [Y/N]: y

Restore bak_file: / opt/dmdbms/bak/back.bak...

Apply archive log LSN from 40113 to 40112, time used:0.000s.

Restore finished, code = 0!

Restore successfully!

Restore time used: 2965.309 (ms)

[dmdba@localhost bin] $

7. Then you can start the database normally and complete the instance migration.

Note 1: if the instance is relatively large, there will be more than one file format generated under the backup file directory. The name rules are: back.bak, back_1.bak, back_2.bak, etc.

At this time, in the command, you only need to write the file name back.bak.

But:

1. When you need to make sure that it is copied, the relevant documents will be copied away.

two。 When restoring, you need to make sure that the subsequent files with a small tail (_ 1, _ 2) are kept in the same directory.

You can recover normally.

Note 2: please use a similar version of dmserver under linux and Windows, otherwise you may encounter similar errors:

Server version mismatch, version of data is 0x70106a5, server version is 0x7010660.

Please use the correct version of server or set the CHECK_SVR_VERSION=0 in dm.ini

There is no solution here (the solution is also in the error prompt. ), the same or similar version is recommended.

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