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

Backup and restore of Dameng Database

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

Share

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

Backup and restore of Dameng Database

Backup and restore methods of Dameng database: physical backup restore and logical backup restore

Physical backup:

Cold backup: (database is closed when dmap service is open)

Hot backup: (the dmap service must be open, the database must be open, and the database should be archived)

Physical backup restore is the backup and restore of the operating system physical files of the database, such as data files, control files, log files, etc.

Logical backup:

Xporting: dexp

Import: dimp

Logical export and logical import of database objects are divided into four levels: database level, user level, schema level, and table level. The four levels are mutually exclusive and cannot exist at the same time. Functions available at four levels:

 database level (FULL): exports or imports all objects in the entire database.

 user level (OWNER): exports or imports all objects owned by one or more users.

 schema level (SCHEMAS): exports or imports all objects in one or more schemas.

 table level (TABLE): exports or imports one or more specified tables or table partitions.

1. Open and archive the database

Mount statu

Alter database mount

Set the archive path

Alter database add archivelog 'type=local,dest=D:\ dmdbms\ bakup,file_size=64,space_limit=0'

Open archiving

Alter database archivelog

Open statu

Alter database open

Check the status of the database

Select name,status$,ARCH_MODE from v$database

2. Start the backup operation

Backup command backup

This operation is a full backup. Dmap needs to be enabled and the database instance is closed.

Reopen a command window, use commands from the operating system to access the bin directory of the DM installation path, execute dmap under the / dm7/bin directory, and open an account dmap.

Re-enter the SQL window and execute backup database backupset'd:\ dmdbms\ bakdb\ db'

Dexp command backup

Dexp dimp can prepare tables, users, schemas, databases

Use the DM tool to export:

Command export:

Dexp TEST1/TEST123456 file=D:\ dmdbms\ bakdb\ 20191128\ db_bak.dmp

D:\ dmdbms\ bin > dexp TEST1/TEST123456 file=D:\ dmdbms\ bakdb\ 20191128\ db_bak.dmp

Dexp V7.6.0.77-Build (2018.07.17-94714) ENT

Exporting the first SCHEMA: TEST1

Start exporting the schema [TEST1].

-A total of 0 SEQUENCE are exported

-A total of 0 VIEW are exported

-A total of 0 TRIGGER are exported

-A total of 0 COMMENT TAB are exported

-A total of 0 COMMENT COL are exported

-A total of 0 PROCEDURE are exported

-A total of 0 SYNONYM are exported

-A total of 0 DBLINK are exported

-A total of 0 TRIGGER are exported

-A total of 0 PACKAGE are exported

-A total of 0 PKG_BODY are exported

-A total of 0 OBJECT of NO REFER OTHER CLASS are exported

-A total of 0 OBJECT of REFER OTHER CLASS are exported

-A total of 0 JCLASS are exported

-A total of 0 CLASS_BODY are exported

-A total of 0 DOMAIN are exported

Object permissions in export mode.

-[2019-11-28 15:42:35] Export Table: STUDY-

Import / export STUDY comments

Import / export STUDY comments

Import / export STUDY comments

Import / export STUDY comments

Import / export STUDY comments

Import / export STUDY comments

Import / export STUDY comments

Object permissions in export mode.

Table STUDY export ends, with a total of 3 rows of data exported

-[2019-11-28 15:42:36] Export Table: COURSE-

Import / export COURSE comments

Import / export COURSE comments

Import / export COURSE comments

Import / export COURSE comments

Export constraints: CONS134218824

Object permissions in export mode.

Table COURSE export ends, with a total of 3 rows of data exported

-[2019-11-28 15:42:36] Export Table: TAB1-

Object permissions in export mode.

Table TAB1 export ends, with a total of 2 rows of data exported

Mode [TEST1] export ends.

Successfully exported the first SCHEMA: TEST1

Export a total of 1 SCHEMA

The whole export process takes a total of 0.266 seconds

Export terminated successfully with no warning

D:\ dmdbms\ bin >

3. Start the restore operation

Create a new user TEST2 and give the user administrator privileges

Create user TEST2 identified by TEST123456 default tablespace tbs1

Grant dba to TEST2

After the new user is created, we start the import operation, and import TEST1 to TEST2

Use the DM tool to import:

Command Import:

Dimp TEST1/TEST123456 file=D:\ dmdbms\ bakdb\ 20191128\ db_bak.dmp ignore=y remap_schema=TEST1:TEST2

D:\ dmdbms\ bin > dimp TEST1/TEST123456 file=D:\ dmdbms\ bakdb\ 20191128\ db_bak.dmp ignore=y remap_schema=TEST1:TEST2

Dimp V7.6.0.77-Build (2018.07.17-94714) ENT

Start importing the schema [TEST1].

Import NECESSARY GLOBAL objects in the schema...

The import of NECESSARY GLOBAL objects in the schema is complete.

-[2019-11-28 16:43:01] Import form: STUDY-

Create table STUDY...

Import data from table STUDY: 3 rows are processed

Import / export STUDY comments

STUDY

The import was successful.

Import / export STUDY comments

STUDY

The import was successful.

Import / export STUDY comments

STUDY

The import was successful.

Import / export STUDY comments

STUDY

The import was successful.

Import / export STUDY comments

STUDY

The import was successful.

Import / export STUDY comments

STUDY

The import was successful.

Import / export STUDY comments

STUDY

The import was successful.

-[2019-11-28 16:43:01] Import form: COURSE-

Create table COURSE...

Import data from table COURSE: 3 rows are processed

Import / export COURSE comments

COURSE

The import was successful.

Import / export COURSE comments

COURSE

The import was successful.

Import / export COURSE comments

COURSE

The import was successful.

Import / export COURSE comments

COURSE

The import was successful.

-[2019-11-28 16:43:01] Import form: TAB1-

Create table TAB1...

Import data from table TAB1: 2 rows are processed

Import GLOBAL objects in the schema...

The import of GLOBAL objects in the schema is complete.

Schema [TEST2] Import completed.

Import constraints for the table:

CONS134218824

The import was successful.

The import was successful.

The whole import process takes a total of 0.153 seconds

The import was terminated successfully with no warning

D:\ dmdbms\ bin >

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