In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
DM7 database and its table backup and restore is how, many novices are not very clear about this, in order to help you solve this problem, the following editor will explain in detail for you, people with this need can come to learn, I hope you can gain something.
DM7 online backup recovery
Main tests:
1. Online full backup without archiving
2. Online full backup with archives
3. Online full recovery without archiving
4. Online full recovery including archiving
I. preparatory work
Online backup must be in archive mode
-- check whether the archive is open
Select arch_mode from v$database
-- View archive log information
Select arch_name,arch_type,arch_dest from v$dm_arch_ini
If archiving execution is not enabled
Alter database mount
-- configure archiving parameters, which are essentially equivalent to changing dmarch.ini files
Alter database add archivelog 'DEST=C:\ dmdbms\ data\ DAMENG\ arc,TYPE=local,FILE_SIZE=128,space_limit=1024'
-- set the database to archive mode
Alter database archivelog
Alter database open
Second, test data
-- create a tablespace test_data (the data file TEST_DATA01.DBF size is 50m)
Create tablespace test_data datafile'C:\ dmdbms\ data\ DAMENG\ TEST_DATA01.DBF' size 50
-increase the number of users
Create user "TESTUSER" identified by "111111" default tablespace "TEST_DATA"
-Authorization
Grant "DBA" to "TESTUSER"
-- create a pattern
Create schema test_sch authorization testuser
-- create a table
Create table test_sch.t1 (id int primary key, name varchar (20)) storage (on test_data)
-- insert data
Insert into test_sch.t1 values (1 recorder aaaa')
Insert into test_sch.t1 values (2)
-- retrieve data
Select * from test_sch.t1
Back up the database
-does not include archive backup online backup
-- only the database is backed up, not the log
Backup database full to dmbkname03_noarc bakfile'C:\ xcl\ online_noarc\ dmbkname03_noarc.bak' backupinfo 'Test full library online backup does not contain archive' maxsize 50 without log
-- insert a piece of data that contains archived online backups
-- insert data
Insert into test_sch.t1 values (3memery dmbkname03')
-- retrieve data
Select * from test_sch.t1
-- online backup containing archiv
-- back up the database and include logs
Backup database full to dmbkname04 bakfile'C:\ xcl\ online\ dmbkname04.bak' backupinfo 'Test full library online backup' maxsize 50
Delete or modify the corresponding instance base from stopping the service after the backup is completed
Four recovery test
Restore the database under the dos command
Cd C:\ dmdbms\ bin
Restore under the bin directory of the installation database
First, reinitialize a library with the same name as the backup database through dminit
Second。 Execute the restore command to restore.
-online full recovery without archiving
Initialize the database
C:\ dmdbms\ bin > dminit.exe PATH=C:\ dmdbms\ data DB_NAME=DAMENG INSTANCE_NAM
-- restore the database
-does not include archiving
C:\ dmdbms\ bin > dmrestore ini_path=C:\ xcl\ dm.ini file=C:\ xcl\ online_noarc\ dmbkname03_noarc.bak
-- start the service and enter the database to view the reply result
-online full recovery with archiving
-initialize the database
Dminit.exe PATH=C:\ dmdbms\ data DB_NAME=DAMENG INSTANCE_NAME=DMSERVER
-- restore the database
-full database backup, including logs
Dmrestore ini_path=C:\ xcl\ dm.ini file=C:\ xcl\ online\ dmbkname04.bak
-- start the service and enter the database to view the reply result
Note that if case sensitivity occurs during execution, please add the
CASE_SENSITIVE=N
Backup and restore of tablespace
I. preparatory work
Online backup must be in archive mode
-- check whether the archive is open
Select arch_mode from v$database
-- View archive log information
Select arch_name,arch_type,arch_dest from v$dm_arch_ini
If archiving execution is not enabled
Alter database mount
-- configure archiving parameters, which are essentially equivalent to changing dmarch.ini files
Alter database add archivelog 'DEST=C:\ dmdbms\ data\ DAMENG\ arc,TYPE=local,FILE_SIZE=128,space_limit=1024'
-- set the database to archive mode
Alter database archivelog
Alter database open
Second, test data
-- create a tablespace with an initial tablespace of 50m and increase by 5m at a time
Create tablespace XWJ datafile'G:\ ABC\ XWJ.dbf' size 50 autoextend on next 5
-- create a user name of zqq password 123456789 default tablespace xwj
Create user zqq identified by 123456789 default tablespace XWJ
-- create a table
Create table zqq.app as select * from all_objects
-- add data to the table
Insert into zqq.app select * from zqq.app
-- submit
Commit
Three backups
Backupset backup (as many backups as the table space is used) (recommended)
Backup tablespace xwj full to zqq backupset'g:\ zqq\ a'
After the backup, the service is stopped to modify or delete the original tablespace files.
Bakfile backup
Backup tablespace xwj full to zqq bakfile'g:\ zqq\ a.bak'
Four reduction
Restart the service login to the dm administrative tool
Backupset reduction
Restore tablespace XWJ from backupset'G:\ zqq\ a'
View data after execution is complete
Bakfile reduction
Restore tablespace XWJ from'g:\ zqq\ a.bak'
View data after execution is completed
The backup of the tablespace cannot release the redundant tablespace.
Is it helpful for you to read the above content? If you want to know more about the relevant knowledge or read more related articles, please follow the industry information channel, thank you for your support.
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.