DM归档配置

一、本地归档意义

在使用数据库的过程中,必须要配置本地归档,不然数据库将无法实现备份功能。

DM 服务器既可以运行在归档模式下也可以运行在非归档模式下。如果是归档模式,联机日志文件中的内容将被保存至硬盘,形成归档日志文件;如果是非归档模式,则不会形成归档日志。

采用归档模式对系统的性能会产生一定影响,但对系统的安全性有更大的积极意义,当出现故障时其丢失数据的可能性更小。这是因为一旦出现介质故障,如磁盘损坏时,利用归档日志,系统可被恢复至故障发生的前一刻,也可以还原到指定的时间点,而如果没有归档日志文件,则只能利用备份进行恢复。

二、本地归档的配置参数

通过 dm.ini 和 dmarch.ini 可以配置本地归档。dmarch.ini 为本地归档的配置文件,但其生效的前提是 dm.ini 中的参数 ARCH_INI 置为 1 。

三、归档配置方法

3.1 编辑 dmarch.ini初始化文件归档配置

数据库服务器未启动的情况下,手动编写 dmarch.ini,dmarch.ini 可以进行本地归档和远程归档的设置,其中远程归档在数据守护和 MPP 中使用,DM 备份与还原过程中使用的日志均为本地归档日志。

手动配置 dmarch.ini,之后保存在 dm.ini 所在的目录。

dmarch.ini 中与备份还原相关的配置参数及其介绍见下表。

 

手动修改 dm.ini 中 ARCH_INI = 1 ,启动达梦数据库,即本地归档配置完成。

 

3.2 Disql命令行窗口配置归档

在 DM 服务器运行时,可以使用 SQL 语句配置归档日志。需要注意的一点是,在使用 SQL 语句进行归档配置之前,应先将数据库由 OPEN 状态设置为 MOUNT 状态。配置完毕后再从 MOUNT 状态改回 OPEN 状态。

1.查询是否开启归档

select arch_mode from v$database;

2.将数据库改为mount状态

alter database mount;

 

3.开启归档

alter database archivelog;

 

 4、增加归档路径

配置本地归档TYPE=LOCAL为本地归档模式,DEST为归档路径,Linux下需要注意归档目录权限是否可用。FILE_SIZE为单个归档日志大小单位为M。

SPACE_LIMIT为归档占用最大空间,单位为M。

alter database add archivelog 'TYPE=LOCAL,DEST=/dm8/test/dmarch,FILE_SIZE=128,SPACE_LIMIT=2048';

5.打开数据库

alter database open;

6.切换归档测试

alter switch switch logfile;

 

3.3 DM console配置

1、打开console,点击实例配置选择对应实例,在参数集合中选择配置文件相关参数,将ARCH_INI改为1,点击保存。

2、点击归档配置,添加配置域,并修改相关参数。

 

3、点击保存,则配置成功。

3.4 DM manager配置

1、登录进manager工具后鼠标右键点击需要配置的实例,点击管理服务器。

2、点击系统管理,切换数据库状态。

 3、点击归档配置,配置相关目标参数。

4、配置完归档后,将数据库打开。

 

 

 

 

 

 

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
以下是jmeter配置DM的步骤: 1. 下载DM8的JDBC驱动包,将其放置在jmeter的lib目录下。 2. 在jmeter中添加一个线程组。 3. 在该线程组下添加JDBC Connection Configuration配置元件,配置DM8数据库的连接信息,包括JDBC驱动类、连接URL、用户名和密码等。 4. 在该线程组下添加JDBC Request配置元件,配置SQL语句和参数等信息。 5. 在该线程组下添加监听器,例如View Results Tree,查看测试结果。 下面是一个示例的jmeter配置DM的脚本: ```xml <?xml version="1.0" encoding="UTF-8"?> <jmeterTestPlan version="1.2" properties="2.9" jmeter="5.4.1"> <hashTree> <TestPlan guiclass="TestPlanGui" testclass="TestPlan" testname="Test Plan" enabled="true"> <stringProp name="TestPlan.comments"></stringProp> <boolProp name="TestPlan.functional_mode">false</boolProp> <boolProp name="TestPlan.serialize_threadgroups">false</boolProp> <elementProp name="TestPlan.user_defined_variables" elementType="Arguments" guiclass="ArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true"> <collectionProp name="Arguments.arguments"/> </elementProp> <stringProp name="TestPlan.user_define_classpath"></stringProp> </TestPlan> <hashTree> <ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="Thread Group" enabled="true"> <stringProp name="ThreadGroup.on_sample_error">continue</stringProp> <elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="Loop Controller" enabled="true"> <boolProp name="LoopController.continue_forever">false</boolProp> <intProp name="LoopController.loops">1</intProp> </elementProp> <stringProp name="ThreadGroup.num_threads">1</stringProp> <stringProp name="ThreadGroup.ramp_time">1</stringProp> <longProp name="ThreadGroup.start_time">1630440000000</longProp> <longProp name="ThreadGroup.end_time">1630440000000</longProp> <boolProp name="ThreadGroup.scheduler">false</boolProp> <stringProp name="ThreadGroup.duration"></stringProp> <stringProp name="ThreadGroup.delay"></stringProp> </ThreadGroup> <hashTree> <JDBCConnectionConfiguration guiclass="JDBCConnectionConfigurationGui" testclass="JDBCConnectionConfiguration" testname="JDBC Connection Configuration" enabled="true"> <stringProp name="dataSource">jdbc</stringProp> <stringProp name="poolMax">5</stringProp> <stringProp name="timeout">10000</stringProp> <stringProp name="trimInterval">60000</stringProp> <stringProp name="autocommit">false</stringProp> <stringProp name="transactionIsolation">DEFAULT</stringProp> <stringProp name="keepAlive">true</stringProp> <stringProp name="preinit">false</stringProp> <stringProp name="connectionAge">5000</stringProp> <stringProp name="checkQuery">Select 1</stringProp> <stringProp name="dbUrl">jdbc:dm://localhost:5236</stringProp> <stringProp name="driver">dm.jdbc.driver.DmDriver</stringProp> <stringProp name="username">username</stringProp> <stringProp name="password">password</stringProp> </JDBCConnectionConfiguration> <hashTree/> <JDBCRequest guiclass="TestBeanGUI" testclass="JDBCRequest" testname="JDBC Request" enabled="true"> <stringProp name="dataSource">jdbc</stringProp> <stringProp name="queryType">Select Statement</stringProp> <stringProp name="query">select * from table_name</stringProp> <stringProp name="queryArguments"></stringProp> <stringProp name="queryArgumentsTypes"></stringProp> <stringProp name="variableNames"></stringProp> <stringProp name="resultVariable"></stringProp> <stringProp name="resultSetHandler">Store as String</stringProp> <boolProp name="queryTimeout">false</boolProp> <stringProp name="queryTimeoutDuration"></stringProp> <stringProp name="ResultType">Auto</stringProp> </JDBCRequest> <hashTree/> <ResultCollector guiclass="ViewResultsFullVisualizer" testclass="ResultCollector" testname="View Results Tree" enabled="true"> <boolProp name="ResultCollector.error_logging">false</boolProp> <objProp> <name>saveConfig</name> <value class="SampleSaveConfiguration"> <time>true</time> <latency>true</latency> <timestamp>true</timestamp> <success>true</success> <label>true</label> <code>true</code> <message>true</message> <threadName>true</threadName> <dataType>true</dataType> <encoding>false</encoding> <assertions>true</assertions> <subresults>true</subresults> <responseData>false</responseData> <samplerData>false</samplerData> <xml>false</xml> <fieldNames>true</fieldNames> <responseHeaders>false</responseHeaders> <requestHeaders>false</requestHeaders> <responseDataOnError>false</responseDataOnError> <saveAssertionResultsFailureMessage>true</saveAssertionResultsFailureMessage> <assertionsResultsToSave>0</assertionsResultsToSave> <bytes>true</bytes> <sentBytes>true</sentBytes> <url>true</url> <threadCounts>true</threadCounts> <idleTime>true</idleTime> <connectTime>true</connectTime> </value> </objProp> <stringProp name="filename"></stringProp> </ResultCollector> <hashTree/> </hashTree> </hashTree> </hashTree> </jmeterTestPlan> ```

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值