It took me a lot of time to back up DM database online. The key is that the attached documents are unclear. However, after testing, I think the design of DM is concise. In order not to spend so much time studying later, I sorted out the test process below: main test: 1. online full backup without archiving 2. online full with archive
It took me a lot of time to back up DM database online. The key is that the attached documents are unclear. However, after testing, I think the design of DM is concise. In order not to spend so much time studying later, I sorted out the test process below: main test: 1. online full backup without archiving 2. online full with archive
It took me a lot of time to back up DM database online. The key is that the attached documents are unclear. However, after testing, I think the design of DM is concise.
In order not to spend so much time studying later, I sorted out the test process below:
Mainly tested:
1. Online full backup without Archiving
2. Online full backup that includes Archiving
3. Online full backup recovery that does not include archiving
4. Restore of online full-backup files that do not contain archive logs
5. Online full backup recovery that includes Archiving
Test version: V7.1.2.215-Build (2013.11.08-36626 trunc)
I. Check and set the database to archive Mode
Online backup must be in archive mode. You can use the following two SQL statements to view the current database status.
-- Check whether the select arch_mode from v $ database is enabled for archiving; -- view the archived log information select arch_name, arch_type, arch_dest from v $ dm_arch_ini;
II. Create Test Data
-- Create a tablespace test_data (the data file TEST_DATA01.DBF is 50 MB) create tablespace test_data datafile 'C: \ dmdbms \ data \ DAMENG \ test_data01.dbf' size 50; -- create user "TESTUSER" identified by "111111" default tablespace "TEST_DATA"; -- grant "DBA" to "TESTUSER"; -- create schema test_sch authorization testuser; -- create table test_sch.t1 (id int primary key, name varchar (20) storage (on test_data) -- insert data into test_sch.t1 values (1, 'aaa '); insert into test_sch.t1 values (2, 'bbb '); -- retrieve data select * from test_sch.t1;
3. Back up database
1. Online full backup without Archiving
-- Only back up the database, do not back up the log backup database full to dmbkname03_noarc bakfile 'C: \ xcl \ online_noarc \ dmbkname03_noarc.bak 'backupinfo' test the full database online backup does not include the archive;
2. Insert data again
insert into test_sch.t1 values(3,'dmbkname03_noarc');
3. Online full backup that includes Archiving
-- Back up the database and include the log backup database full to dmbkname04 bakfile 'C: \ xcl \ online \ dmbkname04.bak 'backupinfo' to test the full-database online backup 'maxsize 50;
Follow-up after backup:
1. Insert a data record
-- Insert data into test_sch.t1 values (4, 'dmbkname04 '); -- retrieve data select * from test_sch.t1; SQL> select * from test_sch.t1; row id name ---------- ----------- ---------------- 1 aaa2 2 bbb3 3 dmbkname03_noarc4 4 dmbkname04 used time: 1.245 (MS ). execution number: 99.
2. Back up an archive file to another directory.
3. Stop the corresponding instance service "DmServiceDMSERVER" in "DM Service viewer"
4. Back up dm. ini to another directory.
5. Delete the database directory
Delete the "DAMENG" directory of the database under the "C: \ dmdbms \ data" directory. The database is deleted.
At this time, you go to the "DM Service viewer" to refresh, and you will not be able to see the "DmServiceDMSERVER" service.
4. RECOVERY TEST
The restoration of DM database is usually divided into two steps.
First, reinitialize a database with the same name as the backup database through dminit.
Second, execute the recovery command to restore.
A. Online full backup recovery that does not include archiving
1. initialize the database
c:\dmdbms\bin>dminit.exe PATH=C:\dmdbms\data DB_NAME=DAMENG INSTANCE_NAME=DMSERVER
2. Restore the database
-- Archive c: \ dmdbms \ bin> dmrestore ini_path = C: \ xcl \ dm. ini file = C: \ xcl \ online_noarc \ dmbkname03_noarc.bak is not included
3. Start the service and go to the database to view the recovery result.
SQL> select * from test_sch.t1; row ID NAME ---------- --------- ---- 1 1 aaa2 2 bbb used time: 60.990 (MS). Execution number: 3.
B. Restore of online full-backup files that do not contain archive logs
1. initialize the database
--For the next round of memory testing without specifying a document, specify the document recording dminit.exe PATH = C: \ dmdbms \ data DB_NAME = DAMENG INSTANCE_NAME = DMSERVER
2. Restore the database
dmrestore ini_path=C:\xcl\dm.ini file=C:\xcl\online_noarc\dmbkname03_noarc.bak archive_dir=C:\xcl\online_noarc\arc2
3. Start the service and go to the database to view the recovery result.
SQL> select * from test_sch.t1; row id name ---------- ----------- ---------------- 1 1 aaa2 2 bbb3 3 dmbkname03_noarc4 4 dmbkname04 used time: 62.247 (MS). Execution No.: 3. SQL>
C. Online full backup recovery that includes Archiving
1. initialize the database
dminit.exe PATH=C:\dmdbms\data DB_NAME=DAMENG INSTANCE_NAME=DMSERVER
2. Restore the database
-- Database full-database backup with the log dmrestore ini_path = C: \ xcl \ dm. ini file = C: \ xcl \ online \ dmbkname04.bak
3. Start the service and go to the database to view the recovery result.
SQL> select * from test_sch.t1; row ID NAME ---------- ----------- ---------------- 1 1 aaa2 2 bbb3 3 dmbkname03_noarc used time: 62.508 (MS). Execution number: 3.
V. Summary
The DM database documentation does not indicate that the dmrestore command can recover both offline and online backups. After executing the backup command,
I mistakenly thought there was a resotre for recovery. However, after the database is damaged, you cannot enter disql to execute restore. Then you can test the dmrestore command to kill offline and online recovery methods.
From the test above, we can see that basically the dream backup process is to issue commands, generate backup files, and back up dm. ini at the same time. In some cases, you need to back up and archive logs.
Then, the database is reinitialized with dminit and then restored with dmrestore. Dm. ini is very important in dm databases. Remember to back up dm. ini together.
MAIL: xcl_168@aliyun.com
BLOG: http://blog.csdn.net/xcl168