Transaction Manager Failover A Case Study Using JBOSS Application Server

合集下载

FedStore SCV3000系列存储产品介绍

FedStore SCV3000系列存储产品介绍

关键性业务 运行性业务 ERP, 交易 内部业务 E-mail, CRM, 处理 个人空间, 研发 Web, 市场
SATA HDD
SAS HDD
Cost
Page 16
OKTT快速性能优化设计,维护更简单
名称 工作组 文件服务器 视频系统 数据库系统
描述
读缓存
写缓存
条带大小
顺序/ 随机读/写值
混合读/写值
中端和高端分别占到12.2%和8.4%。从左边的图表, 我们可以清晰得出一个结论,从短期来看制造业的衰 退给中低端市场带来一定负面的影响。 从长期来看,IDC预期低端市场依旧是推动市场复兴 和增长的重点。 中低端市场也一直是中亚联邦重点投入和耕耘的市场 之一。
Page 8
统一存储SCV3000系列产品概述
Xserver (Metadata Primary)
Ethernet Switch (Public LAN)
MAC Pro (Client2)
Xserver (Metadata Secondary)
MAC Pro (Client3)
SCV3200/SCV360 0 (Metadata Volume)
LUN2
Active path to LUN 1 Standby path to LUN 1
Page 20
通过快照功能,增强系统的数据保护功能
Primary Volume
Volume pair
Snapshot Volume 1
Snapshot Volume 2
Secondary Volume
Snapshot Volume 3
SAS base
Page 11
业界先进的架构设计——领先的SBB2.0架构

《大数据技术原理与操作应用》第8章习题答案

《大数据技术原理与操作应用》第8章习题答案

第八章一、单选题1.当服务器突然宕机,下列Channels选项中,哪一个可以保证数据不会丢失。

A、Memory ChannelB、File ChannelC、JDBC ChannelD、Kafka Channel参考答案:B2.、以下关于flume的说法正确的是A Event是Flume数据传输的基本单元B Sink是Flume数据传输的基本单元C Channel是Flume数据传输的基本单元D Source是Flume数据传输的基本单元参考答案:A二、多选题1、下列选项中,说法错误的是()。

•A、在一个Agent中,同一个source可以有多个channel•B、在一个Agent中,同一个sink可以有多个channel•C、在一个Agent中,同一个source只能多1个channel•D、在一个Agent中,同一个sink只能有1个channel参考答案:A,D2、下列说法中,关于配置参数说法错误的是()。

•A、a1.sources.r1.channels = c1•B、a1.sinks.k1.channel = c1•C、a1.source.r1.channels = c1•D、a1.sinks.k1.channels = c1参考答案:C,D三、判断题1、在一个POST请求发送的所有的events数据,可以在多个事务中插入channel。

•对•错参考答案:错答案解析:在一个POST请求发送的所有的events都被认为是一个批次,会在一个事务中插入channel。

2、Flume负载均衡接收器处理器能够在多个Sink上进行均衡流量的功能。

•对•错参考答案:对3、查询和替换拦截器基于Java正则表达式提供了简单的用于字符串的搜索和替换功能,同时还具有进行回溯/群组捕捉功能。

•对•错参考答案:对4、采集方案中的sources、channels、sinks是在具体编写时根据业务需求进行配置的,可以随意设置。

利用MySQL工具进行故障切换第二部分:mysqlfailover

利用MySQL工具进行故障切换第二部分:mysqlfailover

利用MySQL工具进行故障切换——第二部分:mysqlfailover 在本系列的前面的文章我们看到在MySQL 5.6中,当GTID启用时如何使用mysqlrpladmin 执行手动故障转移/切换。

现在我们将回顾MySQL实用程序中的另一个工具mysqlfailover(1.4.3版本),它可以用于故障的自动转移。

Summary●如果MySQL 5.6的GTID复制启用的话,mysqlfailover可以执行故障自动转移。

●所有的从机都必须使用——主信息资料库列表。

(All slaves must use --master-info-repository=TABLE.)●监控节点是一个单故障点:别忘了监视它。

(The monitoring node is a single point of failure: don’t forget to monitor it! )●错误事项检测效果很好,但是你必须使用保守的选项来确保故障转移将永远不会发生错误。

(Detection of errant transactions works well, but you have to use the -- pedanticoption to make sure failover will never happen if there is an errant transaction. )●有一些局限性,比如不能只失败一次或过度的CPU利用率,但这对大多数设置影响不是很大。

(There are a few limitations such as the inability to only fail over once, or excessive CPU utilization, but they are probably not showstoppers for most setups. )Setup我们将使用与上次相同的设置:一个主机和两个从机,并且都使用了GTID复制。

Transactionrolledbackbecauseithasbeenmarkedas。。。

Transactionrolledbackbecauseithasbeenmarkedas。。。

Transactionrolledbackbecauseithasbeenmarkedas。

1.Transaction rolled back because it has been marked as rollback-only事务已回滚,因为它被标记成了只回滚<prop key="query*">PROPAGATION_REQUIRED,readOnly</prop>query开头的⽅法readOnly,所以只能select,抛出异常,insert/update/delete操作必然回滚2.发现selectA调⽤selectB,如果selectB抛出Exception,selectA中捕获Exception但是并不继续向外抛出,最后会出现错误。

纠其原理其实很简单,在selectB返回的时候,transaction被设置为rollback-only了,但是selectA正常消化掉,没有继续向外抛。

那么selectA结束的时候,transaction会执commit操作,但是 transaction已经被设置为 rollback-only了。

所以会出现这个错误。

有的同学说了,那不是没得搞了,service不能抛出异常,或者不能拦截异常了?其实不然,其实错误不在这⾥,⽽是select这种操作为什么要启动事务呢?3.demo⽰例代码1.applicationContext.xml配置事务<tx:advice id="txAdvice" transaction-manager="transactionManager"><tx:attributes><!-- <tx:method name="sendIllegalMessage" read-only="false" rollback-for="Exception" propagation="REQUIRES_NEW" /> --><tx:method name="get*" read-only="true"/><tx:method name="find*" read-only="true"/><tx:method name="load*" read-only="true"/><tx:method name="query*" read-only="true"/><tx:method name="add*" read-only="false" rollback-for="Exception" propagation="REQUIRED"/><tx:method name="batchAdd*" read-only="false" rollback-for="Exception" propagation="REQUIRED"/><tx:method name="save*" read-only="false" rollback-for="Exception" propagation="REQUIRED"/><tx:method name="insert*" read-only="false" rollback-for="Exception" propagation="REQUIRED"/><tx:method name="update*" read-only="false" rollback-for="Exception" propagation="REQUIRED"/><tx:method name="modify*" read-only="false" rollback-for="Exception" propagation="REQUIRED"/><tx:method name="delete*" read-only="false" rollback-for="Exception" propagation="REQUIRED"/><tx:method name="del*" read-only="false" rollback-for="Exception" propagation="REQUIRED"/><tx:method name="registe*" read-only="false" rollback-for="Exception" propagation="REQUIRED"/><tx:method name="approve*" read-only="false" rollback-for="Exception" propagation="REQUIRED"/><tx:method name="clear*" read-only="false" rollback-for="Exception" propagation="REQUIRED"/><tx:method name="set*" read-only="false" rollback-for="Exception" propagation="REQUIRED"/><tx:method name="reset*" read-only="false" rollback-for="Exception" propagation="REQUIRED"/><tx:method name="getUpdate*" read-only="false" rollback-for="Exception" propagation="REQUIRED"/><tx:method name="updatedQuery*" read-only="false" rollback-for="Exception" propagation="REQUIRES_NEW"/><!-- <tx:method name="*" read-only="true"/> --></tx:attributes></tx:advice><aop:config><aop:advisor pointcut="execution(* com.xxx.service..*Service.*(..))" advice-ref="txAdvice"/><aop:advisor pointcut="execution(* com.xxx.v30.service..*Service.*(..))" advice-ref="txAdvice"/><aop:advisor pointcut="execution(* com.xxx.v31.service..*Service.*(..))" advice-ref="txAdvice"/><aop:advisor pointcut="execution(* com.xxx.v33.service..*Service.*(..))" advice-ref="txAdvice"/><aop:advisor pointcut="execution(* com.xxx.v34.service..*Service.*(..))" advice-ref="txAdvice"/><aop:advisor pointcut="execution(* com.xxx.limitCoupon.service..*Service.*(..))" advice-ref="txAdvice"/><aop:advisor pointcut="execution(* com.xxx.v35.service..*Service.*(..))" advice-ref="txAdvice"/><aop:advisor pointcut="execution(* com.xxx.v36.service..*Service.*(..))" advice-ref="txAdvice"/><aop:advisor pointcut="execution(* com.xxx.auth.*Service.*(..))" advice-ref="txAdvice"/><aop:advisor pointcut="execution(* com.xxx.notify.*Service.*(..))" advice-ref="txAdvice"/></aop:config>2.junit测试代码@Testpublic void testCancelTask2(){try {transService.updateTransCancel2();} catch (Exception e) {e.printStackTrace();}}public void updateTransCancel2() {int upCount = transMapper.updateTransCancelStat(520657512071l, 1, 0, 0,-1,-1,-1,-1,-1,-1);try {cancelTransSendSms.cancelTransSendSms2();} catch (Exception e) {e.printStackTrace();}("upCount="+upCount);}public void cancelTransSendSms2() throws Exception{aotoCancel2();}private void aotoCancel2() {txtMap=smsConverUtil.getMessage(smsParamsMap, "RenterNoAuthDeposite", "RenterNoAuthDeposite0000");}public Map<String,String> getMessage(Map<String,Object> smsParamsMap,String smsContentKey,String pushKey){Map<String,String> map=new LinkedHashMap<String, String>();String smsContent="";String jpushContent="";String smsMessage="";String flag="";("in rentNo->smsContentKey is {}",smsContentKey);if(StringUtils.isNotBlank(smsContentKey)){smsContent=getContent(smsParamsMap,smsContentKey);smsMessage=smsMsgDescMap.get(smsContentKey);}if(StringUtils.isNotBlank(pushKey)){jpushContent=getPushContentTemplate(pushKey,smsParamsMap);flag=pushMsgFlagMap.get(pushKey);}map.put("smsContent",smsContent);map.put("jpushContent",jpushContent);map.put("smsMessage",smsMessage);map.put("flag",flag);return map;}private String getPushContentTemplate(String contentKey,Map<String,Object> contentParamMap){try {String templateContent = operationService.getTemplateMsgByAppTypeAndCode(AppTypeConstant.JPUSH, contentKey);if(StringUtils.isEmpty(templateContent)){return null;}return replaceTemplateContent(templateContent,contentParamMap);} catch (Exception e) {logger.error("推送消息获取消息内容报错!",e);}return null;}public String getTemplateMsgByAppTypeAndCode(String appType, String textCode) {try {return operationTextCache.getUpdateOperateTextMsgByAppTypeAndTextCode(appType, textCode);} catch (Exception e) {e.printStackTrace();}return null;}public String tgetTemplateMsgByAppTypeAndCode(String appType, String textCode) {return operationTextCache.tfindOperateTextMsgByAppTypeAndTextCode(appType, textCode);}public String findOperateTextMsgByAppTypeAndTextCode(String appType,String textCode) {OperationText operationText = this.findOperationTextByAppTypeAndTextCode(appType, textCode);if (operationText==null) {throw new IllegalArgumentException("appType:"+appType+","+"textCode:"+textCode+",不存在⽂本模板消息");}else {return operationText.getTextMsg();}}public String getUpdateOperateTextMsgByAppTypeAndTextCode(String appType,String textCode) {OperationText operationText = this.findOperationTextByAppTypeAndTextCode(appType, textCode);if (operationText==null) {throw new IllegalArgumentException("appType:"+appType+","+"textCode:"+textCode+",不存在⽂本模板消息");}else {return operationText.getTextMsg();}}public String tfindOperateTextMsgByAppTypeAndTextCode(String appType,String textCode) {OperationText operationText = this.findOperationTextByAppTypeAndTextCode(appType, textCode);if (operationText==null) {throw new IllegalArgumentException("appType:"+appType+","+"textCode:"+textCode+",不存在⽂本模板消息");}else {return operationText.getTextMsg();}}4.汇总(A调⽤B)4.1 A⽆事务,B⽆事务(将find,get改成tfind,tget⽅法名) A不回滚,不报以上错误。

解决@Transactional注解事务不回滚不起作用的问题

解决@Transactional注解事务不回滚不起作用的问题

解决@Transactional注解事务不回滚不起作⽤的问题这⼏天在项⽬⾥⾯发现我使⽤@Transactional注解事务之后,抛了异常居然不回滚。

后来终于找到了原因。

如果你也出现了这种情况,可以从下⾯开始排查。

⼀、特性先来了解⼀下@Transactional注解事务的特性吧,可以更好排查问题1、service类标签(⼀般不建议在接⼝上)上添加@Transactional,可以将整个类纳⼊spring事务管理,在每个业务⽅法执⾏时都会开启⼀个事务,不过这些事务采⽤相同的管理⽅式。

2、@Transactional 注解只能应⽤到 public 可见度的⽅法上。

如果应⽤在protected、private或者 package可见度的⽅法上,也不会报错,不过事务设置不会起作⽤。

3、默认情况下,Spring会对unchecked异常进⾏事务回滚;如果是checked异常则不回滚。

辣么什么是checked异常,什么是unchecked异常java⾥⾯将派⽣于Error或者RuntimeException(⽐如空指针,1/0)的异常称为unchecked异常,其他继承⾃ng.Exception得异常统称为Checked Exception,如IOException、TimeoutException等辣么再通俗⼀点:你写代码出现的空指针等异常,会被回滚,⽂件读写,⽹络出问题,spring就没法回滚了。

然后我教⼤家怎么记这个,因为很多同学容易弄混,你写代码的时候有些IOException我们的编译器是能够检测到的,说以叫checked异常,你写代码的时候空指针等死检测不到的,所以叫unchecked异常。

这样是不是好记⼀些啦4、只读事务:@Transactional(propagation=Propagation.NOT_SUPPORTED,readOnly=true)只读标志只在事务启动时应⽤,否则即使配置也会被忽略。

SUNDB数据库开发者指南说明书

SUNDB数据库开发者指南说明书

Developer Manual Developer Manual目录1.Database Connection (1)1.1特征 (1)1.2选择执行成员 (2)1.3Global Session (4)1.4约束事项 (6)1.5设置 (8)2.ODBC (9)2.1SUNDB ODBC Driver概述 (9)2.2数据源构成 (13)2.3GLOBAL CONNECTION (36)2.4目录函数 (48)2.5非标准数据类型 (54)2.6ODBC API References (69)2.7XA API References (580)3.JDBC (607)3.1概要 (607)3.1功能详情 (614)3.2JDBC API References (669)4.Embedded SQL (942)4.1Precompiler (942)4.2Embedded SQL (958)4.3Advanced Topic (1149)4.4Embedded SQL Reference (1214)Developer Manual 5.PDO (1252)5.1PDO概要 (1252)5.2安装/构成 (1252)5.3使用 (1256)5.4示例 (1256)6.PyDBC (1275)6.1SUNDB PyDBC (1275)6.2API Reference (1280)6.3Exception (1302)6.4Data Type (1304)7.Ruby (1309)7.1概要 (1309)7.2安装 (1309)7.3示例 (1311)7.4ActiveRecord的使用示例 (1316)8.Hibernate (1322)8.1概要 (1322)8.2联动 (1322)8.3示例 (1325)1.Database Connection1.1特征Figure30-1GLOBAL CONNECTIONGlobal connection功能是考虑到数据locality的事务性能优化方案通常connection连接一个成员而global connection连接所有成员使用global connection的应用程序执行查询访问的数据最多的成员的查询从而提高性能Global connection可用于hashrangelist sharding等所有方式此时不需要变更应用程序执行online scale-out时用户不需要追加考虑新的节点应用程序可自动访问新节点运行此节点Figure30-2GLOBAL CONNECTION HA(high availability)执行SQL时所选节点发生故障时通过其他组的其他节点执行SQL所选的组的所有节点发生故障时通过其他组执行SQL恢复发生故障的节点时在online状态下自动重新访问该节点不仅如此用户也可以使用以下语句使应用程序重新执行访问ALTER SYSTEM RECONNECT GLOBAL CONNECTION1.2选择执行成员执行成员按照事务为单位进行选择没有事务时首次执行DML查询时按照sharding key选择组组内的执行成员取决于LOCALITY_MEMBER_POLICY参数之后在COMMIT或ROLLBACK之前执行的所有查询在所选成员中执行如果首次查询未选择根据sharding key的合适的组时根据LOCALITY_GROUP_POLICY参数决定组Figure30-3选择成员上图中transaction1的UPDATE查询根据sharding key在group1执行因此后续COMMIT之间的所有查询均在group1执行Transaction2的UPDATE查询在group3执行即使后续查询不适合在group 3执行但在COMMIT之前所有查询均在group3执行在没有事务的情况下只读专用查询(SELECT)与其他查询相同根据sharding key选择执行成员但后续执行的查询未必在上一次选择的成员中执行即包含在事务的所有查询仅在一个成员中执行与事务无关的查询按照查询为单位选择成员1.3Global SessionFigure30-4从global connection衍生的cluster session与应用程序直接连接的会话叫做driver session从driver session到其他成员的会话叫做cluster sessionGlobal connection在所有成员中创建driver session根据所需向其他成员创建cluster session由于global connection的特征可在一个成员中创建多个cluster sessionFigure30-5Global sessionGlobal session是在global connection创建的cluster session共享一个会话并由此提高资源效率的功能Global connection不使用global session时根据组和成员的增加而增加cluster session相反使用global session时即使增加组和成员也不会增加cluster sessionGlobal session功能仅可在global connection使用普通connection无法使用1.4约束事项使用global connection时SQL语句无法使用拥有session dependenccy的对象(session dependent object)或语句(session dependent clause)或函数(session dependent function)另外访问多个集群节点的SQL存在于一个事务中时事务中的SQL共同使用第一个SQL的sharding key选择的集群节点Global connection中查询仅在以prepare execute执行时考虑数据locality以direct execute执行时在任意节点执行Session Dependent Object在SQL语句使用session dependent object时不支持global connection●Global temporary tableSession Dependent Clause在SQL语句使用session dependent clause时不支持global connection●所有@domain相关语句Session Dependent Function和Pseudo Column 在SQL语句使用session dependent信息时不支持global connection●CURRVAL(sequence),sequence.CURRVAL●UUID()●VERSION()●SESSION_ID()●SESSION_SERIAL()●USER_ID()●LAST_IDENTITY_VALUE()●STATEMENT_VIEW_SCN()●STATEMENT_VIEW_SCN_GCN()●STATEMENT_VIEW_SCN_DCN()●STATEMENT_VIEW_SCN_LCN()●LOCAL_GROUP_ID()●LOCAL_MEMBER_ID()●LOCAL_GROUP_NAME()●LOCAL_MEMBER_NAME()●CLUSTER_GROUP_ID●CLUSTER_GROUP_NAME●CLUSTER_MEMBER_ID●CLUSTER_MEMBER_NAME●CLUSTER_SHARD_ID使用Global Session功能的情况SQL语句不支持Data Definition Language(DDL) 1.5设置详细内容参考如下●ODBC Global Connection●JDBC Global Connection2.ODBC2.1SUNDB ODBC Driver概述SUNDB ODBC Driver的概念ODBC(开放数据库互连Open Database Connectivity)是数据库API(Application Programming Interface)的配置Microsoft ODBC3.0版本基于International Standards Organization/ International Electromechanical Commission(ISO/IEC)和X/open的分级调用接口(CLI)的推荐配置ODBC使用C libarary函数支持SQL语句应用程序通过调用该函数实现ODBC功能架构由执行以下功能的个要素组成组成要素功能应用程序调用与ODBC数据源通信的ODBC函数传递SQL语句后处理结果集驱动管理器管理应用程序以及应用程序中使用的所有ODBC驱动程序之间的通信驱动处理应用程序中的所有ODBC调用连接数据源并从应用程序将SQL语句传递至数据源后向应用程序返回结果必要时驱动将应用程序传递的ODBC SQL转换为数据源使用的基本SQL数据源包含驱动访问数据库数据时所需的所有信息使用ODBC应用程序可以执行以下操作●连接数据源●向数据源传输SQL语句●在数据源处理SQL语句的结果●错误及信息处理●断开与数据源的连接ODBC构成要素概要包含驱动管理器的SUNDB ODBC Driver以下为系统包含驱动管理器的软件架构此时应用程序需要链接到驱动管理器库Figure31-1包含驱动管理器的SUNDB ODBC driver不包含驱动管理器的SUNDB ODBC Driver下图为系统不包含驱动管理器并使用SUNDB ODBC driver的架构此时应用程序需要直接链接到SUNDB ODBC driver库Figure31-2不包含驱动管理器的SUNDB ODBC driverSUNDB ODBC Driver的使用头文件(header file)执行SUNDB ODBC driver需要有$SUNDB_HOME/include中设置的sundb.h文件此文件定义SUNDB ODBC driver的常数和类型提供SUNDB ODBC driver函数的原型库(Libraray)不使用驱动管理器的应用程序需要链接SUNDB ODBC driver库的静态或共享文件UNIX文件名说明libsundb.a包含DA与CS的库的静态版本libsundba.a DA专用库的静态版本libsundbas.so DA专用库的共享版本文件名说明libsundbc.a CS专用库的静态版本libsundbcs-ul32.so将SQLLEN识别为4字节的64Bit CS专用库的共享版本libsundbcs-ul64.so将SQLLEN识别为8字节的64Bit CS专用库的共享版本libsundbcs.so32Bit CS专用库的共享版本libsundbs.so包含DA与CS的库的共享版本Table31-1SUNDB UNIX ODBC driver库文件WindowsSUNDB Windows ODBC driver库只提供CS库文件文件名说明sundbcs-ul64.dll将SQLLEN识别为8字节的64Bit CS专用库的共享版本sundbcs.dll32Bit CS专用库的共享版本sundbsetup32.dll设置32Bit ODBC driver manager的库sundbsetup64.dll设置64Bit ODBC driver manager的库Table31-2SUNDB Windows ODBC driver库文件SUNDB数据库SQL手册2.2数据源构成UNIX中的DSN设置odbcinst.ini文件odbcinst.ini是已安装的ODBC驱动程序的配置文件●unixODBC%odbcinst-junixODBC2.3.4DRIVERS............:/etc/odbcinst.iniSYSTEM DATA SOURCES:/etc/odbc.iniFILE DATA SOURCES..:/etc/ODBCDataSourcesUSER DATA SOURCES..:/home/sundb/.odbc.iniSQLULEN Size.......:8SQLLEN Size........:8SQLSETPOSIROW Size.:8●iODBC%iodbc-config--odbcinstini/etc/odbcinst.iniODBC Driver配置odbcinst.ini文件的ODBC驱动程序配置部分描述驱动程序属性值和目录每个安装的驱动程序的驱动程序名称下有注册信息部分[driver_name]Description=driver_descriptionDriver=driver_library_pathSetup=setup_library_pathFileUsage=file_usage下表描述了驱动程序配置部分中的关键字关键字说明Description说明驱动程序的字符串Driver驱动library路径Setup安装library路径FileUsage显示基于文件的驱动在DSN中直接处理文件的方法的文字以下为查看SUNDB ODBC驱动配置相关信息的示例[SUNDB ODBC Driver]Description=SUNDB ODBC DriverDriver=/home/sundb/home/lib/libsundbcs-ul64.soSetup=/home/sundb/home/lib/libsundbcs-ul64.soFileUsage=0odbc.ini文件odbc.ini文件是应用程序连接的DSN的配置文件分为用户DSN与系统DSN通常用户DSN文件为~/.odbc.ini文件系统DSN文件为/etc/odbc.ini文件●unixODBC%odbcinst-junixODBC2.3.4DRIVERS............:/etc/odbcinst.iniSYSTEM DATA SOURCES:/etc/odbc.iniFILE DATA SOURCES..:/etc/ODBCDataSourcesUSER DATA SOURCES..:/home/sundb/.odbc.iniSQLULEN Size.......:8SQLLEN Size........:8SQLSETPOSIROW Size.:8●iODBC%iodbc-config--odbcini/etc/odbc.ini数据源配置odbc.ini文件的数据源配置部分中说明DSN[data_source_name]Driver=driver_namePROTOCOL={DA|TCP|IPC}CS_MODE={default|dedicated|shared}HOST=host_addressPORT=port_noPREFER_IPV6={0|1}CHARSET={SQL_ASCII|UTF8|UHC|GB18030}TCP_NODELAY={0|1}ALTERNATE_SERVERS=(HOST=ADDRESS1:PORT=PORT1,HOST=ADDRESS2:PORT=PORT2) CONNECTION_RETRY_COUNT=retry_countCONNECTION_RETRY_DELAY=retry_delayFAILOVER_TYPE={CONNECTION|SESSION}FAILOVER_GRANULARITY={0|1|2}FAILOVER_ROUTING_POLICY={0|1}DATE_FORMAT=date_format_stringTIME_FORMAT=time_format_stringTIME_WITH_TIME_ZONE_FORMAT=timetz_format_stringTIMESTAMP_FORMAT=timestamp_format_stringTIMESTAMP_WITH_TIME_ZONE_FORMAT=timestamptz_format_stringCHAR_LENGTH_UNITS={BYTE|OCTETS|CHAR|CHARACTERS}ENABLE_SQLDESCRIBEPARAM={0|1}ENABLE_SQLBINDPARAMETER_CONSISTENCY_CHECK={0|1}USE_TARGETTYPE={0|1|2}LOCATOR_DSN=locator_dsn_nameLOCATOR_SERVICE=locator_service_nameLOCALITY_AWARE_TRANSACTION={0|1}LOCALITY_GROUP_POLICY={0|1|2}LOCALITY_GROUP_PATH=group_name1,group_name2,group_name3LOCALITY_MEMBER_POLICY={0|1|2|3|4}LOCALITY_MEMBER_PATH=member_name1,member_name2,member_name3DB_HOME=database_home_pathPACKET_COMPRESSION_THRESHOLD=packet_compression_thresholdUSE_GLOBAL_SESSION={0|1}LOGIN_TIMEOUT=login_timeoutTRACE={0|1}TRACEFILE=file_path_nameTRACE_POLICY={DEFAULT|ERROR}INCLUDE_SYNONYMS={0|1}DOT_NET_FOR_ODBC={0|1}[locator_dsn_name]FILE=location_file_nameHOST=IP address(v4)PORT=locator_portCONNECTION_TIMEOUT=secondALTERNATE_LOCATORS=(HOST=ADDRESS1:PORT=PORT1,HOST=ADDRESS2:PORT=PORT2)下表为数据源配置部分的关键字属性说明data_source_name数据源section中指定的数据源Driver odbcinst.ini中安装的驱动名PROTOCOL与服务器连接的方式●DA:无额外的通讯直接连接●TCP:使用TCP socket进行通讯●IPC:使用共享内存进行通讯并且需要与server在相同设备上第一次连接时为了传输IPC信息会使用TCP连接所以需要设置HOST和PORT仅可使用Dedicated模式进行连接CS_MODE 设置以dedicated模式访问还是以shared模式连接如果不使用此设置模式取决于listener的configuration(DEFAULT_CS_MODE)HOST HOST IP地址或名称PORT连接端口号PREFER_IPV6HOST参数为HOST名时IP地址中优先IPv6 TCP_NODELAY socket TCP_NODELAY选项UID用户ID属性说明PWD用户密码CHARSET客户端字符集ALTERNATE_SERVERS 发生failover时尝试连接的服务器目录每个服务器以逗号","区分不使用failover功能时不设置ALTERNATE_SERVERSCONNECTION_RETRY_COUNT连接失败时尝试连接服务器的次数CONNECTION_RETRY_DELAY连接失败时尝试连接的服务器的时间间隔(单位:秒)FAILOVER_TYPE ●CONNECTION:连接失败时连接至ALTERNATE_SERVERS●SESSION:连接失败或处理statement过程中连接断开时连接至ALTERNATE_SERVERS后恢复statement如果断开连接时没有进行中的事务则failover后执行进行中的statementFAILOVER_GRANULARITY●0:进行failover的过程中发生错误也继续进行failover属性说明●1:进行failover的过程中发生除SQLExeceute()SQLExecDirect()外的错误时failover将失败●2:进行failover的过程中发生错误时failover将失败DATE_FORMAT DATE类型字符串TIME_FORMAT TIME类型字符串TIME_WITH_TIME_ZONE_FORMAT TIME WITH TIME ZONE类型字符串TIMESTAMP_FORMAT TIMESTAMP类型字符串TIMESTAMP_WITH_TIME_ZONE_FORMAT TIMESTAMP WITH TIME ZONE类型字符串CHAR_LENGTH_UNITS SQLBindParameter()中ParameterType为SQL_CHARSQL_VARCHAR时的ColumnSize的单位●BYTE,OCTETS:以byte为单位●CHAR,CHARACTERS:以字符为单位ENABLE_SQLDESCRIBEPARAM决定是否执行SQLDescribeParam()●0:不支持SQLDescribeParam()●1:对所有parameter返回属性说明SQL_VARCHARENABLE_SQLBINDPARAMETER_CONSISTENCY_CHECK决定是否检查SQLBindParameter()的ColumnSize和DecimalDigits●0:不检查ColumnSize和DecimalDigits ●1:检查ColumnSize和DecimalDigitsUSE_TARGETTYPE设置以通信接收column类型时同时接收的类型信息●0:仅接收column类型●1:接收column类型与column名称●2:接收column类型与column的所有信息LOCATOR_DSN指定Location信息的Data Source Name(DSN)LOCATOR_SERVICE从Service hintglocator获取访问信息LOCALITY_AWARE_TRANSACTION是否使用GLOBAL CONNECTION●0:不使用GLOBAL CONNECTION ●1:使用GLOBAL CONNECTION属性说明LOCALITY_GROUP_POLICY使用GLOBAL CONNECTION时没有可选择的群组或可以选择两个以上的群组时设置群组选择方法●0:任意选择●1:按照顺序选择LOCALITY_GROUP_PATH设置中的群组无法使用LOCALITY_GROUP_PATH的所有群组时选择任意群组●2:按照顺序选择每次按照驱动中连接的群组顺序选择LOCALITY_GROUP_PATH 使用GLOBAL CONNECTION时可选择的群组不是1个时指定选择的群组的目录各群组以逗号()区分例:G1G2G3LOCALITY_MEMBER_POLICY决定使用GLOBAL CONNECTION时所选的群组中的成员的选择方法●0:DML:MASTER/SELECT:MASTER ●1:DML:ANY/SELECT:ANY●2:DML:MASTER/SELECT:ANY●3:DML:MASTER/SELECT:SLAVE属性说明●4:按照LOCALITY_MEMBER_PATH设置中的成员的顺序进行选择无法使用LOCALITY_MEMBER_PATH中的所有成员时选择所选群组的MASTERLOCALITY_MEMBER_PATH 指定在使用GLOBAL CONNECTION时所选的群组中要使用的成员的目录各成员以逗号()区分例:G1N1,G2N1,G3N1,G1N2,G2N2,G3N2DB_HOME设置数据库的home目录默认值使用$SUNDB_HOME的环境变量PACKET_COMPRESSION_THRESHOLD 发送至服务器的通信数据的大小大于PACKET_COMPRESSION_THRESHOLD时压缩通信数据设定值的范围为32~2113929216USE_GLOBAL_SESSION是否使用GLOBAL SESSION●0:不使用GLOBAL SESSION ●1:使用GLOBAL SESSIONLOGIN_TIMEOUT等待完成login请求的时间(秒)TRACE是否在ODBC API使用trace属性说明●0:不使用trace●1:使用traceTRACEFILE Trace文件名输入在相对路径时执行程序的当前目录成为标准默认值为'odbc_trace.log'TRACE_POLICY Trace策略默认值为DEFAULT●DEFAULT:同时记录函数参数和结果●ERROR:函数失败时记录日志INCLUDE_SYNONYMS决定是否在SQLGetColumns()中包含synonym 个体.●0:不包含synonym个体●1:包含synonym个体DOT_NET_FOR_ODBC决定是否将ODBC用于.NET Framework用途●0:不改变用途●1:SQLGetDescField()和SQLColAttribute()中将SQL_DESC_BASE_COLUMN_NAME,属性说明SQL_DESC_NAME属性替换为SQL_DESC_LABEL Table31-3数据源配置部分的关键字关键字说明FILE Location file nameHOST glocator ip addressPORT glocator port number CONNECTION_TIMEOUT Connection timeout with glocator(second) ALTERNATE_LOCATORS未收到glocator的响应时使用ALTERNATE_LOCATORS获取访问信息Table31-4LocationNote:*LOCATOR_DSN中已设置FILE与HOSTPORT属性时优先适用FILE属性FILE相关详细内容参考Location File*通过LOCATOR_SERVICE属性可访问LOCATOR_SERVICE所属的服务器所访问的服务器以外的服务器为ALTERNATE_SERVERS+未设置FAILOVER_TYPE则FAILOVER_TYPE为session+未设置FAILOVER_GRANULARITY则FAILOVER_GRANULARITY为1+详细内容参考glocator与gloctlSUNDB的DSN配置如下[SUNDB]Driver=SUNDB ODBC DriverPROTOCOL=TCPCS_MODE=SHAREDHOST=192.168.0.10PORT=22581CHARSET=UTF8TCP_NODELAY=1ALTERNATE_SERVERS=(HOST=192.168.0.11:PORT=22581,HOST=192.168.0.12:PORT=22581) CONNECTION_RETRY_COUNT=3CONNECTION_RETRY_DELAY=1FAILOVER_TYPE=SESSIONFAILOVER_GRANULARITY=0FAILOVER_ROUTING_POLICY=0DATE_FORMAT=YYYY-MM-DDTIME_FORMAT=HH24:MI:SS.FF6TIME_WITH_TIME_ZONE_FORMAT=HH24:MI:SS.FF6TZH:TZMTIMESTAMP_FORMAT=YYYY-MM-DD HH24:MI:SS.FF6TIMESTAMP_WITH_TIME_ZONE_FORMAT=YYYY-MM-DD HH24:MI:SS.FF6TZH:TZM CHAR_LENGTH_UNITS=CHARACTERSENABLE_SQLDESCRIBEPARAM=1ENABLE_SQLBINDPARAMETER_CONSISTENCY_CHECK=1USE_TARGETTYPE=0INCLUDE_SYNONYMS=0PACKET_COMPRESSION_THRESHOLD=2113929216LOCALITY_AWARE_TRANSACTION=0LOCALITY_GROUP_POLICY=0LOCALITY_GROUP_PATH=G1,G2,G3LOCALITY_MEMBER_POLICY=0LOCALITY_MEMBER_PATH=G1N1,G2N1,G3N1,G1N2,G2N2,G3N2 USE_GLOBAL_SESSION=0LOGIN_TIMEOUT=0LOCATOR_DSN=LOCATORLOCATOR_SERVICE=S1TRACE=1TRACEFILE=/home/test/log/mytrace.logDOT_NET_FOR_ODBC=0[LOCATOR]FILE=/home/test/.location.iniHOST=127.0.0.1PORT=42581ALTERNATE_LOCATORS=(HOST=127.0.0.1:PORT=42582,HOST=127.0.0.1:PORT=42583) Windows中的DSN设置Windows中可通过ODBC数据源管理器添加或设置DSNFigure31-3Creating new data sourceFigure31-4ODBC driver configuration各项详细说明如下关键字说明DSN数据源名称HOST HOST IP地址或名称PORT连接端口号UID用户IDCS_MODE 设置以dedicated模式连接或以shared模式连接未设置时default模式取决于listener的configuration(DEFAULT_CS_MODE)ALTERNATE_SERVERS发生failover时尝试连接的服务器列表以逗号()区分不使用failover功能时ALTERNATE_SERVERS设置为空白CONNECTION_RETRY_COUNT连接失败时尝试重连服务器的次数CONNECTION_RETRY_DELAY连接失败时尝试重连的服务器时间间隔(单位:秒)FAILOVER_TYPE ●CONNECTION:连接失败时连接至ALTERNATE_SERVERS●SESSION:连接失败或语句执行中连接中断时连接至ALTERNATE_SERVERS后恢复语句断开连接时如没有进行中的事务failover后执行进行中的statement关键字说明FAILOVER_GRANULARITY ●Non-atomic:failover过程中即使报错也继续执行failover●Atomic:failover过程中报错则failover失败DATE_FORMAT DATE类型字符串TIME_FORMAT TIME类型字符串TIME_WITH_TIME_ZONE_FORMAT TIME WITH TIME ZONE类型字符串TIMESTAMP_FORMAT TIMESTAMP类型字符串TIMESTAMP_WITH_TIME_ZONE_FORMAT TIMESTAMP WITH TIME ZONE类型字符串CHAR_LENGTH_UNITS SQLBindParameter()中ParameterType为SQL_CHAR时的ColumnSize单位●BYTE,OCTETS:以byte为单位●CHAR,CHARACTERS:以字符为单位LOCALITY_AWARE_TRANSACTION GLOBAL CONNECTION使用与否●0:不使用GLOBAL CONNECTION ●1:使用GLOBAL CONNECTIONUSE_GLOBAL_SESSION GLOBAL SESSION使用与否关键字说明●0:不使用GLOBAL SESSION●1:使用GLOBAL SESSIONLOCALITY_GROUP_POLICY设置可使用GLOBAL CONNECTION时没有可选择的group或有两个以上可选择的group时选择哪个group●0:任意选择●1:依次选择LOCALITY_GROUP_PATH设置中的group无法使用所有LOCALITY_GROUP_PATH中的group时选择任意group●2:依次选择按照每次连接驱动的group顺序选择LOCALITY_GROUP_PATH 使用GLOBAL CONNECTION时可选择的group不是一个时指定选择的group的目录各个group以逗号()区分例:G1G2G3LOCALITY_MEMBER_POLICY使用GLOBAL CONNECTION时决定选择被选择地group中的成员的方法●0:DML:MASTER/SELECT:MASTER●1:DML:ANY/SELECT:ANY●2:DML:MASTER/SELECT:ANY●3:DML:MASTER/SELECT:SLAVE关键字说明●4:依次选择LOCALITY_MEMBER_PATH设置中的成员无法使用所有LOCALITY_MEMBER_PATH中的成员时选择被选择的group的MASTERLOCALITY_MEMBER_PATH 使用GLOBAL CONNECTION时在所选的group中指定要使用的成员的目录各个成员以逗号()区分例:G1N1,G2N1,G3N1,G1N2,G2N2,G3N2LOCATOR_HOST glocator ip address LOCATOR_PORT glocator port number LOCATOR_CONNECTION_TIMEOUT Connection timeout with glocator(second) ALTERNATE_LOCATORS无法从glocator获得响应时使用ALTERNATE_LOCATORS获取访问信息TRACE是否在ODBC API使用trace●0:不使用trace●1:使用traceTRACEFILE Trace文件名输入到相对路径时执行程序的当前目录成为标准默认值为'odbc_trace.log'TRACE_POLICY Trace策略默认值为DEFAULT关键字说明●DEFAULT:同时记录函数参数和结果●ERROR:函数失败时记录日志DOT_NET_FOR_ODBC决定是否将ODBC用于.NET Framework用途●0:不改变用途●1:SQLGetDescField()和SQLColAttribute()中将SQL_DESC_BASE_COLUMN_NAME,SQL_DESC_NAME属性替换为SQL_DESC_LABELTable31-5DSN配置关键字2.3GLOBAL CONNECTION集群环境支持应用程序可以选择符合处理查询的节点后执行的GLOBAL CONNECTION功能设置仅在PROTOCOL为TCP时才可使用GLOBAL CONNECTION此时需要在设置LOCALITY_AWARE_TRANSACTION属性值的同时设置LOCATOR文件或LOCATOR服务器使用global session时需要将USE_GLOBAL_SESSION属性值设置为1使用DSN时的.odbc.ini[SUNDB]PROTOCOL=TCPHOST=192.168.0.1PORT=22581UID=TESTPWD=testLOCALITY_AWARE_TRANSACTION=1LOCATOR_DSN=LOCATOR[LOCATOR]FILE=/home/sundb/.location.ini使用连接字符串时SQLDriverConnect(dbc,NULL,(SQLCHAR*)"PROTOCOL=TCP;HOST=192.168.0.1;PORT=22581;UID=TEST;PWD=test;LOCA LITY_AWARE_TRANSACTION=1;LOCATOR_HOST=192.168.0.2;LOCATOR_PORT=42581",SQL_NTS,NULL,0,NULL,SQL_DRIVER_NOPROMPT);GLOBAL CONNECTION的处理过程Figure31-5Basic steps of applying GLOBAL CONNECTION 1.SQLAllocHandle(DBC)分配connection handle连接用户输入服务器信息的服务器并获取集群系统的信息后通过LOCATOR文件或LOCATOR 服务器建立集群系统信息并连接集群系统的所有节点3.SQLAllocHandle(STMT)向连接的所有节点分配各个statement4.SQLPrepare在连接的所有节点准备执行SQL5.SQLExecute如未建立集群系统信息应用程序可通过LOCATOR文件或LOCATOR服务器建立集群系统信息并连接集群系统的所有节点在集群添加节点后访问新的节点时在该节点同样生成其他节点的所有statement并准备执行SQL如已建立sharding key信息应用程序使用sharding key信息选择合适的节点后执行查询如未建立sharding key信息应用程序从任意服务器建立该SQL的sharding key信息后选择合适的节点并执行查询所选节点发生故障时除该节点外再重新选择合适的节点后执行查询SQLExecute后sharding信息发生变更则删除已建立的sharding key信息SQLExecute后添加/删除集群节点等集群系统信息发生变更则删除已建立的集群系统信息6.SQLFetch从执行SQL的节点获取数据7.SQLCloseCursor在执行SQL的节点关闭游标8.SQLFreeHandle(STMT)在所有已连接的节点上解除statement解除与所有节点的连接10.SQLFreeHandle(DBC)解除connection handleGLOBAL CONNECTION异常处理使用GLOBAL CONNECTION时运行中所选节点发生故障时根据事务发生及SELECT进行与否如下进行操作●没有事务的情况没有事务的情况下所选节点发生故障时在ODBC内部选择其他节点并执行对应查询虽然所选节点发生了故障但由其他节点正常执行因此不向用户报错●有事务或SELECT进行时发生事务或SQLFetch()进行时所选节点发生故障时ODBC无法再进行当前操作因此返回19068(Retry the transactional operations)错误发生19068错误时用户需要重新执行对应事务或SELECTif(!SQL_SUCCEEDED(SQLPrepare(sStmt,(SQLCHAR*)"INSERT INTO T1VALUES(?)",SQL_NTS))){goto stmt_error;}trans_retry:if(!SQL_SUCCEEDED(SQLExecute(sStmt))) {SQLGetDiagRec(SQL_HANDLE_STMT,sStmt,1,sSQLState,&sNativeError,sMessageText,sizeof(sMessageText),&sTextLength);if(sNativeError==19068){goto trans_retry;}goto stmt_error;}if(!SQL_SUCCEEDED(SQLPrepare(sStmt,(SQLCHAR*)"SELECT*FROM T1WHERE C1=?",SQL_NTS))){goto stmt_error;}trans_begin:sReturn=SQLExecute(sStmt);if(sRetrun==SQL_ERROR){SQLGetDiagRec(SQL_HANDLE_STMT,sStmt,1,sSQLState,&sNativeError,sMessageText,sizeof(sMessageText),&sTextLength);if(sNativeError==19068){goto trans_retry;}goto stmt_error;}while(1){sReturn=SQLFetch(sStmt);if(sReturn==SQL_NO_DATA){SQLCloseCursor(sStmt);break;}else if(sReturn==SQL_ERROR){SQLGetDiagRec(SQL_HANDLE_STMT,sStmt,1,sSQLState,&sNativeError,sMessageText,sizeof(sMessageText),&sTextLength);if(sNativeError==19068){goto trans_retry;}goto stmt_error;}...}COMMIT或ROLLBACK事务时COMMIT事务时所选节点发生故障时ODBC通过其他节点查看事务是否在所选节点发生故障之前COMMIT如果所选节点发生了故障但事务正常COMMIT时不返回错误而且在事务未COMMIT的情况下所选节点发生故障时返回19068(Retry the transactional operations)错误发生19068错误时用户要重新执行该事务ROLLBACK事务时如果所选节点发生故障ODBC不报错因为由于节点故障该事务已经被ROLLBACKif(!SQL_SUCCEEDED(SQLSetConnectAttr(sDbc,SQL_AUTOCOMMIT,(SQLPOINTER)SQL_AUTOCOMMIT_OFF,0))){goto dbc_error;}if(!SQL_SUCCEEDED(SQLPrepare(sStmt,(SQLCHAR*)"INSERT INTO T1VALUES(?)",SQL_NTS))){goto stmt_error;}trans_retry:if(!SQL_SUCCEEDED(SQLExecute(sStmt))){SQLGetDiagRec(SQL_HANDLE_STMT,sStmt,1,sSQLState,&sNativeError,sMessageText,sizeof(sMessageText),&sTextLength);if(sNativeError==19068){goto trans_retry;}goto stmt_error;}if(!SQL_SUCCEEDED(SQLEndTran(SQL_HANDLE_DBC,sDbc,SQL_COMMIT))){SQLGetDiagRec(SQL_HANDLE_DBC,sDbc,1,sSQLState,&sNativeError,sMessageText,sizeof(sMessageText),&sTextLength);if(sNativeError==19068){goto trans_retry;}goto stmt_error;}GLOBAL CONNECTION约束事项●为了选择符合查询的节点需要使用SQLPrepare()和SQLExecute()使用GLOBAL CONNECTION查找符合查询的节点时需要使用SQLPrepare()和SQLExecute()SQLExecDirect()中没有查找符合查询的节点的信息因此选择节点取决于LOCALITY_GROUP_POLICY和LOCALITY_MEMBER_POLICY属性●COMMIT或ROLLBACK事务时要使用SQLEndTran()使用GLOBAL CONNECTION时通过SQL语句执行COMMIT或ROLLBACK则无法检测到事务状态变化COMMIT或ROLLBACK事务时必须使用SQLEndTran()●Global session不支持SQL语句中的Data Definition Language(DDL)。

Aster平台基础培训

Aster平台基础培训

Relational/SQL MapReduce MapReduce Apps SAS, R interfaces BI, Tableau
Business Users Analysts Data Scientists
9 > 8/5/2016
Aster部署架构
Queries/Answers
应用
其他系统
CRM 图片
音频/视频
数据挖掘
前端操作人员
日志
业务分析师
快速数据加载和获取
文本
分析探索平台 数据发现 快速假设检验和试错
数理统计 数据科学家 编程语言 开发人员
数据过滤和预处理 细粒度历史:在线归档
Web and 社交媒体
路径、图、时间系列分析
模式检测
数据源
6 > 8/5/2016
分析工具 和应用


表述格式化 – For example, “get me top K counts only”
17 > 8/5/2016
支持多平台之间的在线互联
Aster
TERADATA ASTER DATABASE
HADOOP
TERADATA ASTER DATABASE
TERADATA DATABASE
partition。 • 对于包含Partition Key的任何表,物理分布都是自动完成的。
15 > 8/5/2016
Aster是新一代高性能计算平台
MPP架构 高扩展能力 行列混合存储
密集并行技术,意味着 高性能,能支持海量数 据复杂计算
支持MapReduce,最大能扩展 到5PB。 支持在线扩展,用图 形化工具秒级完成节点扩展

HP认证题库

HP认证题库

HP HP0-794Implementing Windows Server 2003 on HP ProLiant Cluster SolutionsC. 2D. 3Answer: C4. What enables restoring Exchange databases to an online production server?A. Shadow Backup CopyB. Recovery Storage GroupC. Mailbox Recovery CenterD. Mobile Exchange Solution PackageAnswer: B5. What is the leading cause of downtime?A. hardware failuresB. operational activitiesC. software failuresD. infrastructure problemsAnswer: D6. What is the maximum number of drive letters per cluster for shared drives with Microsoft Windows Server 2003?A. 18B. 19C. 20D. 23Answer: D7. When creating a clustered volume mount point on a cluster node, which requirement must be met? The partition to be mounted must be ______.A. created on the Quorum diskB. mounted to a shared disk in a different groupC. created on a non-clustered diskD. formatted using NTFSAnswer: D8. Which description accurately depicts an HP Multi-Server Card?A. It supports up to 64 network devices within a single UPS group and provides unattended, sequential shutdown of every device in that group, regardless of the operating system.B. It enables each load segment to function as a separate UPS with individual shutdown schedules and load segment configurations.C. It detects and warns users of power failures and manages a safe system shutdown before the backup power supply is exhausted.D. It allows for the safe installation of new batteries through the front panel, without powering down the connected equipment.Answer: B9. Which component of Insight Manager 7 enables you to browse cluster and component status in a tree hierarchy?A. Systems ManagerB. Cluster MonitorC. Cluster ManagerD. Management ServicesAnswer: B10. What is least likely to fail in a Windows Server 2003 network environment?A. hardwareB. applications。

sqlserver 数据库实例

sqlserver 数据库实例

sqlserver 数据库实例SQL Server 数据库实例SQL Server 是由微软公司开发的关系型数据库管理系统(DBMS),它是一种可靠、安全、高效的数据库解决方案。

在SQL Server中,一个数据库实例(Database Instance)是指在一个计算机上运行的SQL Server程序,它包含了一个或多个数据库。

一个SQL Server数据库实例由以下几个主要组件组成:1. SQL Server引擎(SQL Server Engine):SQL Server引擎是核心组件,负责处理数据库的管理和查询。

它包括查询优化器、查询执行引擎和事务管理器等功能,提供了高效的数据存储和检索机制。

2. 数据库文件(Database Files):数据库文件是SQL Server中存储数据的基本单元。

一个数据库实例可以包含多个数据库文件,包括主要数据文件(Data Files)、事务日志文件(Transaction Log Files)和辅助文件组(Filegroup)。

主要数据文件用于存储表、索引和存储过程等数据,事务日志文件用于记录数据库的变更操作,辅助文件组用于存储其他辅助数据。

3. 实例配置(Instance Configuration):实例配置包括数据库实例的名称、端口号、身份验证方式、内存限制和CPU限制等参数设置。

通过实例配置,可以对数据库实例进行灵活的管理和优化。

4. 安全性和权限(Security and Permissions):SQL Server提供了丰富的安全性和权限控制机制,可以对数据库实例、数据库和对象进行细粒度的访问控制。

管理员可以通过角色、用户和权限设置来管理用户的访问权限,保证数据的安全性和完整性。

5. 备份和恢复(Backup and Recovery):SQL Server提供了强大的备份和恢复功能,可以对数据库进行定期备份,以防止数据丢失。

管理员可以通过备份和恢复操作来保护数据库的可用性和持久性。

记一次springboot配置事务@transactional失效的事故

记一次springboot配置事务@transactional失效的事故

记⼀次springboot配置事务@transactional失效的事故问题:有两张表,分别是user(⽤户信息表),user_role(⽤户⾓⾊信息表),添加⼀个⽤户的同时会在user_info表中插⼊该⽤户的⽤户⾓⾊信息记录。

在添加⼀个⽤户信息时,由于⽤户信息重复,导致主键冲突,user表插⼊⽤户信息失败,此时按照正常逻辑,user_info表也会插⼊不成功,事务会回滚。

但是结果是user_info中的记录插⼊成功了。

项⽬启动后的⽇志如下:2018-08-08 17:17:41.496 DEBUG 7692 --- [WriteCheckTimer] o.a.a.t.AbstractInactivityMonitor : WriteChecker: 10008ms elapsed since last write check.2018-08-08 17:17:41.496 DEBUG 7692 --- [yMonitor Worker] o.a.a.t.AbstractInactivityMonitor : Running WriteCheck[tcp://127.0.0.1:61616]2018-08-08 17:17:41.655 DEBUG 7692 --- [WriteCheckTimer] o.a.a.t.AbstractInactivityMonitor : WriteChecker: 10010ms elapsed since last write check.2018-08-08 17:17:41.655 DEBUG 7692 --- [yMonitor Worker] o.a.a.t.AbstractInactivityMonitor : Running WriteCheck[tcp://127.0.0.1:61616]2018-08-08 17:17:41.710 DEBUG 7692 --- [WriteCheckTimer] o.a.a.t.AbstractInactivityMonitor : WriteChecker: 10003ms elapsed since last write check.2018-08-08 17:17:41.710 DEBUG 7692 --- [yMonitor Worker] o.a.a.t.AbstractInactivityMonitor : Running WriteCheck[tcp://127.0.0.1:61616]2018-08-08 17:17:41.710 DEBUG 7692 --- [WriteCheckTimer] o.a.a.t.AbstractInactivityMonitor : WriteChecker: 10003ms elapsed since last write check.2018-08-08 17:17:41.710 DEBUG 7692 --- [yMonitor Worker] o.a.a.t.AbstractInactivityMonitor : Running WriteCheck[tcp://127.0.0.1:61616]2018-08-08 17:17:41.710 DEBUG 7692 --- [WriteCheckTimer] o.a.a.t.AbstractInactivityMonitor : WriteChecker: 10003ms elapsed since last write check.2018-08-08 17:17:41.710 DEBUG 7692 --- [yMonitor Worker] o.a.a.t.AbstractInactivityMonitor : Running WriteCheck[tcp://127.0.0.1:61616]2018-08-08 17:17:41.710 DEBUG 7692 --- [WriteCheckTimer] o.a.a.t.AbstractInactivityMonitor : WriteChecker: 10003ms elapsed since last write check.2018-08-08 17:17:41.710 DEBUG 7692 --- [yMonitor Worker] o.a.a.t.AbstractInactivityMonitor : Running WriteCheck[tcp://127.0.0.1:61616]2018-08-08 17:17:51.497 DEBUG 7692 --- [WriteCheckTimer] o.a.a.t.AbstractInactivityMonitor : WriteChecker: 10001ms elapsed since last write check.2018-08-08 17:17:51.498 DEBUG 7692 --- [yMonitor Worker] o.a.a.t.AbstractInactivityMonitor : Running WriteCheck[tcp://127.0.0.1:61616]2018-08-08 17:17:51.664 DEBUG 7692 --- [WriteCheckTimer] o.a.a.t.AbstractInactivityMonitor : WriteChecker: 10009ms elapsed since last write check.2018-08-08 17:17:51.664 DEBUG 7692 --- [yMonitor Worker] o.a.a.t.AbstractInactivityMonitor : Running WriteCheck[tcp://127.0.0.1:61616]2018-08-08 17:17:51.726 DEBUG 7692 --- [WriteCheckTimer] o.a.a.t.AbstractInactivityMonitor : WriteChecker: 10016ms elapsed since last write check.2018-08-08 17:17:51.726 DEBUG 7692 --- [yMonitor Worker] o.a.a.t.AbstractInactivityMonitor : Running WriteCheck[tcp://127.0.0.1:61616]2018-08-08 17:17:51.726 DEBUG 7692 --- [WriteCheckTimer] o.a.a.t.AbstractInactivityMonitor : WriteChecker: 10016ms elapsed since last write check.2018-08-08 17:17:51.726 DEBUG 7692 --- [WriteCheckTimer] o.a.a.t.AbstractInactivityMonitor : WriteChecker: 10016ms elapsed since last write check.2018-08-08 17:17:51.726 DEBUG 7692 --- [yMonitor Worker] o.a.a.t.AbstractInactivityMonitor : Running WriteCheck[tcp://127.0.0.1:61616]2018-08-08 17:17:51.726 DEBUG 7692 --- [yMonitor Worker] o.a.a.t.AbstractInactivityMonitor : Running WriteCheck[tcp://127.0.0.1:61616]2018-08-08 17:17:51.726 DEBUG 7692 --- [WriteCheckTimer] o.a.a.t.AbstractInactivityMonitor : WriteChecker: 10016ms elapsed since last write check.2018-08-08 17:17:51.726 DEBUG 7692 --- [yMonitor Worker] o.a.a.t.AbstractInactivityMonitor : Running WriteCheck[tcp://127.0.0.1:61616]2018-08-08 17:17:52.591 DEBUG 7692 --- [8080-Acceptor-0] o.apache.tomcat.util.threads.LimitLatch : Counting up[http-nio-8080-Acceptor-0] latch=12018-08-08 17:17:52.592 DEBUG 7692 --- [8080-Acceptor-0] o.apache.tomcat.util.threads.LimitLatch : Counting up[http-nio-8080-Acceptor-0] latch=22018-08-08 17:17:52.595 DEBUG 7692 --- [nio-8080-exec-3] o.a.coyote.http11.Http11InputBuffer : Received [GET /user/insertUser HTTP/1.1Host: localhost:8080Connection: keep-aliveCache-Control: max-age=0Upgrade-Insecure-Requests: 1User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.87 Safari/537.36Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8Accept-Encoding: gzip, deflate, brAccept-Language: zh-CN,zh;q=0.9]2018-08-08 17:17:52.597 DEBUG 7692 --- [nio-8080-exec-3] o.a.c.authenticator.AuthenticatorBase : Security checking request GET /user/insertUser2018-08-08 17:17:52.597 DEBUG 7692 --- [nio-8080-exec-3] org.apache.catalina.realm.RealmBase : No applicable constraints defined2018-08-08 17:17:52.597 DEBUG 7692 --- [nio-8080-exec-3] o.a.c.authenticator.AuthenticatorBase : Not subject to any constraint2018-08-08 17:17:52.598 DEBUG 7692 --- [nio-8080-exec-3] org.apache.tomcat.util.http.Parameters : Set encoding to UTF-82018-08-08 17:17:52.598 DEBUG 7692 --- [nio-8080-exec-3] o.s.b.w.f.OrderedRequestContextFilter : Bound request context to thread: org.apache.catalina.connector.RequestFacade@6fcff0282018-08-08 17:17:52.598 DEBUG 7692 --- [nio-8080-exec-3] o.s.web.servlet.DispatcherServlet : DispatcherServlet with name 'dispatcherServlet' processing GET request for [/user/insertUser]2018-08-08 17:17:52.598 DEBUG 7692 --- [nio-8080-exec-3] s.w.s.m.m.a.RequestMappingHandlerMapping : Looking up handler method for path /user/insertUser2018-08-08 17:17:52.598 DEBUG 7692 --- [nio-8080-exec-3] s.w.s.m.m.a.RequestMappingHandlerMapping : Returning handler method [public ng.String erController.insertUser()]2018-08-08 17:17:52.599 DEBUG 7692 --- [nio-8080-exec-3] o.s.b.f.s.DefaultListableBeanFactory : Returning cached instance of singleton bean 'userController'2018-08-08 17:17:52.599 DEBUG 7692 --- [nio-8080-exec-3] o.s.web.servlet.DispatcherServlet : Last-Modified value for [/user/insertUser] is: -12018-08-08 17:17:52.599 DEBUG 7692 --- [nio-8080-exec-3] o.s.j.d.DataSourceTransactionManager : Creating new transaction with name [erController.insertUser]: PROPAGATION_REQUIRED,ISOLATION_DEFAU 2018-08-08 17:17:52.601 DEBUG 7692 --- [nio-8080-exec-3] o.s.j.d.DataSourceTransactionManager : Acquired Connection [ProxyConnection[PooledConnection[com.mysql.jdbc.JDBC4Connection@17ff0053]]] for JDBC transaction2018-08-08 17:17:52.601 DEBUG 7692 --- [nio-8080-exec-3] o.s.j.d.DataSourceTransactionManager : Switching JDBC Connection [ProxyConnection[PooledConnection[com.mysql.jdbc.JDBC4Connection@17ff0053]]] to manual commit2018-08-08 17:17:52.601 DEBUG 7692 --- [nio-8080-exec-3] org.mybatis.spring.SqlSessionUtils : Creating a new SqlSession2018-08-08 17:17:52.601 DEBUG 7692 --- [nio-8080-exec-3] org.mybatis.spring.SqlSessionUtils : Registering transaction synchronization for SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@2b29164f]2018-08-08 17:17:52.602 DEBUG 7692 --- [nio-8080-exec-3] o.m.s.t.SpringManagedTransaction : JDBC Connection [ProxyConnection[PooledConnection[com.mysql.jdbc.JDBC4Connection@17ff0053]]] will be managed by Spring2018-08-08 17:17:52.602 DEBUG 7692 --- [nio-8080-exec-3] erRoleMapper.insertUserRole : ==> Preparing: insert into user_role ( user_id, role_id, descInfo ) values ( ?, ?, ? )2018-08-08 17:17:52.602 DEBUG 7692 --- [nio-8080-exec-3] erRoleMapper.insertUserRole : ==> Parameters: 111(String), 999(String), uuuu(String)2018-08-08 17:17:52.603 DEBUG 7692 --- [nio-8080-exec-3] erRoleMapper.insertUserRole : <== Updates: 12018-08-08 17:17:52.603 DEBUG 7692 --- [nio-8080-exec-3] org.mybatis.spring.SqlSessionUtils : Releasing transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@2b29164f]2018-08-08 17:17:52.603 DEBUG 7692 --- [nio-8080-exec-3] org.mybatis.spring.SqlSessionUtils : Fetched SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@2b29164f] from current transaction2018-08-08 17:17:52.604 DEBUG 7692 --- [nio-8080-exec-3] erMapper.insertUser : ==> Preparing: insert into user ( id, age, user_name, password ) values ( ?, ?, ?, ? )2018-08-08 17:17:52.604 DEBUG 7692 --- [nio-8080-exec-3] erMapper.insertUser : ==> Parameters: 11(Integer), 11(Integer), nihao(String), password(String)2018-08-08 17:17:52.662 DEBUG 7692 --- [nio-8080-exec-3] erMapper.insertUser : <== Updates: 12018-08-08 17:17:52.662 DEBUG 7692 --- [nio-8080-exec-3] org.mybatis.spring.SqlSessionUtils : Releasing transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@2b29164f]2018-08-08 17:17:52.662 DEBUG 7692 --- [nio-8080-exec-3] org.mybatis.spring.SqlSessionUtils : Transaction synchronization deregistering SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@2b29164f]2018-08-08 17:17:52.662 DEBUG 7692 --- [nio-8080-exec-3] org.mybatis.spring.SqlSessionUtils : Transaction synchronization closing SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@2b29164f]2018-08-08 17:17:52.662 DEBUG 7692 --- [nio-8080-exec-3] o.s.j.d.DataSourceTransactionManager : Initiating transaction rollback2018-08-08 17:17:52.663 DEBUG 7692 --- [nio-8080-exec-3] o.s.j.d.DataSourceTransactionManager : Rolling back JDBC transaction on Connection [ProxyConnection[PooledConnection[com.mysql.jdbc.JDBC4Connection@17ff0053]]]2018-08-08 17:17:52.702 DEBUG 7692 --- [nio-8080-exec-3] o.s.j.d.DataSourceTransactionManager : Releasing JDBC Connection [ProxyConnection[PooledConnection[com.mysql.jdbc.JDBC4Connection@17ff0053]]] after transaction2018-08-08 17:17:52.702 DEBUG 7692 --- [nio-8080-exec-3] o.s.jdbc.datasource.DataSourceUtils : Returning JDBC Connection to DataSource2018-08-08 17:17:52.702 DEBUG 7692 --- [nio-8080-exec-3] .m.m.a.ExceptionHandlerExceptionResolver : Resolving exception from handler [public ng.String erController.insertUser()]: ng.RuntimeExceptio 2018-08-08 17:17:52.702 DEBUG 7692 --- [nio-8080-exec-3] .w.s.m.a.ResponseStatusExceptionResolver : Resolving exception from handler [public ng.String erController.insertUser()]: ng.RuntimeExceptio 2018-08-08 17:17:52.702 DEBUG 7692 --- [nio-8080-exec-3] .w.s.m.s.DefaultHandlerExceptionResolver : Resolving exception from handler [public ng.String erController.insertUser()]: ng.RuntimeException 2018-08-08 17:17:52.703 DEBUG 7692 --- [nio-8080-exec-3] o.s.web.servlet.DispatcherServlet : Could not complete requestng.RuntimeException: 抛异常at erController.insertUser(UserController.java:81) ~[classes/:na]at erController$$FastClassBySpringCGLIB$$8630d08.invoke(<generated>) ~[classes/:na]at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204) ~[spring-core-4.3.3.RELEASE.jar:4.3.3.RELEASE]at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:720) ~[spring-aop-4.3.3.RELEASE.jar:4.3.3.RELEASE]at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157) ~[spring-aop-4.3.3.RELEASE.jar:4.3.3.RELEASE]at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99) ~[spring-tx-4.3.3.RELEASE.jar:4.3.3.RELEASE]at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:281) ~[spring-tx-4.3.3.RELEASE.jar:4.3.3.RELEASE]at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96) ~[spring-tx-4.3.3.RELEASE.jar:4.3.3.RELEASE]at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) ~[spring-aop-4.3.3.RELEASE.jar:4.3.3.RELEASE]at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:655) ~[spring-aop-4.3.3.RELEASE.jar:4.3.3.RELEASE]at erController$$EnhancerBySpringCGLIB$$c0911a9d.insertUser(<generated>) ~[classes/:na]at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_121]at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_121]at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_121]at ng.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_121]at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:221) ~[spring-web-4.3.3.RELEASE.jar:4.3.3.RELEASE]at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:136) ~[spring-web-4.3.3.RELEASE.jar:4.3.3.RELEASE]at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:114) ~[spring-webmvc-4.3.3.RELEASE.jar:4.3.3.RELEASE]at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:827) ~[spring-webmvc-4.3.3.RELEASE.jar:4.3.3.RELEASE]at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:738) ~[spring-webmvc-4.3.3.RELEASE.jar:4.3.3.RELEASE]at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85) ~[spring-webmvc-4.3.3.RELEASE.jar:4.3.3.RELEASE]at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:963) ~[spring-webmvc-4.3.3.RELEASE.jar:4.3.3.RELEASE]at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:897) ~[spring-webmvc-4.3.3.RELEASE.jar:4.3.3.RELEASE]at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970) [spring-webmvc-4.3.3.RELEASE.jar:4.3.3.RELEASE]at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:861) [spring-webmvc-4.3.3.RELEASE.jar:4.3.3.RELEASE]at javax.servlet.http.HttpServlet.service(HttpServlet.java:622) [tomcat-embed-core-8.5.5.jar:8.5.5]at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846) [spring-webmvc-4.3.3.RELEASE.jar:4.3.3.RELEASE]at javax.servlet.http.HttpServlet.service(HttpServlet.java:729) [tomcat-embed-core-8.5.5.jar:8.5.5]at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230) [tomcat-embed-core-8.5.5.jar:8.5.5]at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) [tomcat-embed-core-8.5.5.jar:8.5.5]at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) [tomcat-embed-websocket-8.5.5.jar:8.5.5]at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192) [tomcat-embed-core-8.5.5.jar:8.5.5]at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) [tomcat-embed-core-8.5.5.jar:8.5.5]at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:99) [spring-web-4.3.3.RELEASE.jar:4.3.3.RELEASE]at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-4.3.3.RELEASE.jar:4.3.3.RELEASE]at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192) [tomcat-embed-core-8.5.5.jar:8.5.5]at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) [tomcat-embed-core-8.5.5.jar:8.5.5]at org.springframework.web.filter.HttpPutFormContentFilter.doFilterInternal(HttpPutFormContentFilter.java:89) [spring-web-4.3.3.RELEASE.jar:4.3.3.RELEASE]at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-4.3.3.RELEASE.jar:4.3.3.RELEASE]at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192) [tomcat-embed-core-8.5.5.jar:8.5.5]at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) [tomcat-embed-core-8.5.5.jar:8.5.5]at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:77) [spring-web-4.3.3.RELEASE.jar:4.3.3.RELEASE]at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-4.3.3.RELEASE.jar:4.3.3.RELEASE]at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192) [tomcat-embed-core-8.5.5.jar:8.5.5]at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) [tomcat-embed-core-8.5.5.jar:8.5.5]at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:197) [spring-web-4.3.3.RELEASE.jar:4.3.3.RELEASE]at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-4.3.3.RELEASE.jar:4.3.3.RELEASE]at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192) [tomcat-embed-core-8.5.5.jar:8.5.5]at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) [tomcat-embed-core-8.5.5.jar:8.5.5]at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198) [tomcat-embed-core-8.5.5.jar:8.5.5]at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:108) [tomcat-embed-core-8.5.5.jar:8.5.5]at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472) [tomcat-embed-core-8.5.5.jar:8.5.5]at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140) [tomcat-embed-core-8.5.5.jar:8.5.5]at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79) [tomcat-embed-core-8.5.5.jar:8.5.5]at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87) [tomcat-embed-core-8.5.5.jar:8.5.5]at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:349) [tomcat-embed-core-8.5.5.jar:8.5.5]at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:784) [tomcat-embed-core-8.5.5.jar:8.5.5]at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) [tomcat-embed-core-8.5.5.jar:8.5.5]at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:802) [tomcat-embed-core-8.5.5.jar:8.5.5]at .NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1410) [tomcat-embed-core-8.5.5.jar:8.5.5]at .SocketProcessorBase.run(SocketProcessorBase.java:49) [tomcat-embed-core-8.5.5.jar:8.5.5]at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_121]at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_121]at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-embed-core-8.5.5.jar:8.5.5]at ng.Thread.run(Thread.java:745) [na:1.8.0_121]2018-08-08 17:17:52.704 DEBUG 7692 --- [nio-8080-exec-3] o.s.b.w.f.OrderedRequestContextFilter : Cleared thread-bound request context: org.apache.catalina.connector.RequestFacade@6fcff0282018-08-08 17:17:52.705 ERROR 7692 --- [nio-8080-exec-3] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is ng.Ru ng.RuntimeException: 抛异常at erController.insertUser(UserController.java:81) ~[classes/:na]at erController$$FastClassBySpringCGLIB$$8630d08.invoke(<generated>) ~[classes/:na]at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204) ~[spring-core-4.3.3.RELEASE.jar:4.3.3.RELEASE]at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:720) ~[spring-aop-4.3.3.RELEASE.jar:4.3.3.RELEASE]at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157) ~[spring-aop-4.3.3.RELEASE.jar:4.3.3.RELEASE]at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99) ~[spring-tx-4.3.3.RELEASE.jar:4.3.3.RELEASE]at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:281) ~[spring-tx-4.3.3.RELEASE.jar:4.3.3.RELEASE]at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96) ~[spring-tx-4.3.3.RELEASE.jar:4.3.3.RELEASE]at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) ~[spring-aop-4.3.3.RELEASE.jar:4.3.3.RELEASE]at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:655) ~[spring-aop-4.3.3.RELEASE.jar:4.3.3.RELEASE]at erController$$EnhancerBySpringCGLIB$$c0911a9d.insertUser(<generated>) ~[classes/:na]at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_121]at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_121]at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_121]at ng.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_121]at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:221) ~[spring-web-4.3.3.RELEASE.jar:4.3.3.RELEASE]at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:136) ~[spring-web-4.3.3.RELEASE.jar:4.3.3.RELEASE]at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:114) ~[spring-webmvc-4.3.3.RELEASE.jar:4.3.3.RELEASE]at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:827) ~[spring-webmvc-4.3.3.RELEASE.jar:4.3.3.RELEASE]at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:738) ~[spring-webmvc-4.3.3.RELEASE.jar:4.3.3.RELEASE]at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85) ~[spring-webmvc-4.3.3.RELEASE.jar:4.3.3.RELEASE]at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:963) ~[spring-webmvc-4.3.3.RELEASE.jar:4.3.3.RELEASE]at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:897) ~[spring-webmvc-4.3.3.RELEASE.jar:4.3.3.RELEASE]at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970) ~[spring-webmvc-4.3.3.RELEASE.jar:4.3.3.RELEASE]at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:861) ~[spring-webmvc-4.3.3.RELEASE.jar:4.3.3.RELEASE]at javax.servlet.http.HttpServlet.service(HttpServlet.java:622) ~[tomcat-embed-core-8.5.5.jar:8.5.5]at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846) ~[spring-webmvc-4.3.3.RELEASE.jar:4.3.3.RELEASE]at javax.servlet.http.HttpServlet.service(HttpServlet.java:729) ~[tomcat-embed-core-8.5.5.jar:8.5.5]at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230) ~[tomcat-embed-core-8.5.5.jar:8.5.5]at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) ~[tomcat-embed-core-8.5.5.jar:8.5.5]at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) ~[tomcat-embed-websocket-8.5.5.jar:8.5.5]at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192) ~[tomcat-embed-core-8.5.5.jar:8.5.5]at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) ~[tomcat-embed-core-8.5.5.jar:8.5.5]at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:99) ~[spring-web-4.3.3.RELEASE.jar:4.3.3.RELEASE]at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-4.3.3.RELEASE.jar:4.3.3.RELEASE]at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192) ~[tomcat-embed-core-8.5.5.jar:8.5.5]at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) ~[tomcat-embed-core-8.5.5.jar:8.5.5]at org.springframework.web.filter.HttpPutFormContentFilter.doFilterInternal(HttpPutFormContentFilter.java:89) ~[spring-web-4.3.3.RELEASE.jar:4.3.3.RELEASE]at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-4.3.3.RELEASE.jar:4.3.3.RELEASE]at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192) ~[tomcat-embed-core-8.5.5.jar:8.5.5]at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) ~[tomcat-embed-core-8.5.5.jar:8.5.5]at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:77) ~[spring-web-4.3.3.RELEASE.jar:4.3.3.RELEASE]at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-4.3.3.RELEASE.jar:4.3.3.RELEASE]at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192) ~[tomcat-embed-core-8.5.5.jar:8.5.5]at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) ~[tomcat-embed-core-8.5.5.jar:8.5.5]at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:197) ~[spring-web-4.3.3.RELEASE.jar:4.3.3.RELEASE]at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-4.3.3.RELEASE.jar:4.3.3.RELEASE]at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192) ~[tomcat-embed-core-8.5.5.jar:8.5.5]at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) ~[tomcat-embed-core-8.5.5.jar:8.5.5]at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198) ~[tomcat-embed-core-8.5.5.jar:8.5.5]at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:108) [tomcat-embed-core-8.5.5.jar:8.5.5]at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472) [tomcat-embed-core-8.5.5.jar:8.5.5]at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140) [tomcat-embed-core-8.5.5.jar:8.5.5]at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79) [tomcat-embed-core-8.5.5.jar:8.5.5]at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87) [tomcat-embed-core-8.5.5.jar:8.5.5]at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:349) [tomcat-embed-core-8.5.5.jar:8.5.5]at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:784) [tomcat-embed-core-8.5.5.jar:8.5.5]at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) [tomcat-embed-core-8.5.5.jar:8.5.5]at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:802) [tomcat-embed-core-8.5.5.jar:8.5.5]at .NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1410) [tomcat-embed-core-8.5.5.jar:8.5.5]at .SocketProcessorBase.run(SocketProcessorBase.java:49) [tomcat-embed-core-8.5.5.jar:8.5.5]at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_121]at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_121]at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-embed-core-8.5.5.jar:8.5.5]at ng.Thread.run(Thread.java:745) [na:1.8.0_121]2018-08-08 17:17:52.706 DEBUG 7692 --- [nio-8080-exec-3] o.a.c.c.C.[Tomcat].[localhost] : Processing ErrorPage[errorCode=0, location=/error]2018-08-08 17:17:52.707 DEBUG 7692 --- [nio-8080-exec-3] o.s.web.servlet.DispatcherServlet : DispatcherServlet with name 'dispatcherServlet' processing GET request for [/error]2018-08-08 17:17:52.707 DEBUG 7692 --- [nio-8080-exec-3] s.w.s.m.m.a.RequestMappingHandlerMapping : Looking up handler method for path /error2018-08-08 17:17:52.707 DEBUG 7692 --- [nio-8080-exec-3] s.w.s.m.m.a.RequestMappingHandlerMapping : Returning handler method [public org.springframework.web.servlet.ModelAndView org.springframework.boot.autoconfigure.web.BasicErro 2018-08-08 17:17:52.708 DEBUG 7692 --- [nio-8080-exec-3] o.s.b.f.s.DefaultListableBeanFactory : Returning cached instance of singleton bean 'basicErrorController'2018-08-08 17:17:52.708 DEBUG 7692 --- [nio-8080-exec-3] o.s.web.servlet.DispatcherServlet : Last-Modified value for [/error] is: -12018-08-08 17:17:52.708 DEBUG 7692 --- [nio-8080-exec-3] o.s.c.e.PropertySourcesPropertyResolver : Found key 'spring.template.provider.cache' in [refresh] with type [String]2018-08-08 17:17:52.712 DEBUG 7692 --- [nio-8080-exec-3] o.s.c.e.PropertySourcesPropertyResolver : Found key 'spring.template.provider.cache' in [refresh] with type [String]2018-08-08 17:17:52.715 DEBUG 7692 --- [nio-8080-exec-3] o.s.w.s.v.ContentNegotiatingViewResolver : Requested media types are [text/html, text/html;q=0.8] based on Accept header types and producible media types [text/html])2018-08-08 17:17:52.715 DEBUG 7692 --- [nio-8080-exec-3] o.s.b.f.s.DefaultListableBeanFactory : Returning cached instance of singleton bean 'error'2018-08-08 17:17:52.715 DEBUG 7692 --- [nio-8080-exec-3] o.s.w.s.v.ContentNegotiatingViewResolver : Returning [org.springframework.boot.autoconfigure.web.ErrorMvcAutoConfiguration$SpelView@2f2af303] based on requested media type 'te 2018-08-08 17:17:52.715 DEBUG 7692 --- [nio-8080-exec-3] o.s.web.servlet.DispatcherServlet : Rendering view [org.springframework.boot.autoconfigure.web.ErrorMvcAutoConfiguration$SpelView@2f2af303] in DispatcherServlet with name 'd 2018-08-08 17:17:52.715 DEBUG 7692 --- [nio-8080-exec-3] o.s.web.servlet.DispatcherServlet : Successfully completed request2018-08-08 17:17:52.716 DEBUG 7692 --- [nio-8080-exec-3] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Disabling the response for futher output2018-08-08 17:17:52.719 DEBUG 7692 --- [nio-8080-exec-3] o.apache.coyote.http11.Http11Processor : Socket: [.NioEndpoint$NioSocketWrapper@2e76b354:.NioChannel@5d4092f:java.nio.ch 2018-08-08 17:17:52.719 DEBUG 7692 --- [nio-8080-exec-3] o.apache.tomcat.util.threads.LimitLatch : Counting down[http-nio-8080-exec-3] latch=22018-08-08 17:18:01.307 DEBUG 7692 --- [ ReadCheckTimer] o.a.a.t.AbstractInactivityMonitor : 30003ms elapsed since last read check.2018-08-08 17:18:01.310 DEBUG 7692 --- [ ReadCheckTimer] o.a.a.t.AbstractInactivityMonitor : 30002ms elapsed since last read check.2018-08-08 17:18:01.310 DEBUG 7692 --- [ ReadCheckTimer] o.a.a.t.AbstractInactivityMonitor : 30002ms elapsed since last read check.2018-08-08 17:18:01.328 DEBUG 7692 --- [ ReadCheckTimer] o.a.a.t.AbstractInactivityMonitor : 30001ms elapsed since last read check.2018-08-08 17:18:01.328 DEBUG 7692 --- [ ReadCheckTimer] o.a.a.t.AbstractInactivityMonitor : 30001ms elapsed since last read check.2018-08-08 17:18:01.328 DEBUG 7692 --- [ ReadCheckTimer] o.a.a.t.AbstractInactivityMonitor : 30001ms elapsed since last read check.2018-08-08 17:18:01.503 DEBUG 7692 --- [WriteCheckTimer] o.a.a.t.AbstractInactivityMonitor : WriteChecker: 10006ms elapsed since last write check.2018-08-08 17:18:01.503 DEBUG 7692 --- [yMonitor Worker] o.a.a.t.AbstractInactivityMonitor : Running WriteCheck[tcp://127.0.0.1:61616]。

Diameter协议学习笔记一

Diameter协议学习笔记一

Diameter协议学习笔记一(协议介绍)一、摘要:Diameter协议主要为应用程序提供认证、鉴权、计费框架,即AAA,并支持本地AAA和漫游场景下的AAA。

二、介绍:AAA协议、例如TACACS、RADIUS起初是为了提供PPP及终端接入,随着Internet及新的接入技术的发展,包括无线、DSL、移动IP, 以太网路由、网络访问服务器(NAS)在复杂和密集性方面有所增强,这对AAA协议提出了新的要求。

例如,网络访问对AAA 协议提出的要求总结有以下这些:∙Failover(故障转移)RADIUS协议没有定义failover机制,因此,failover的行为随着程序的实现不同而各异,为了提供一个明确定义的failover行为,Diameter支持应用层的应答,并定义failover的西装算法和偶联状态机。

∙传输层安全RADIUS在定义了应用层的认证,但仅使用了响应包,RADEXT定义了另外的认证,但仅要求在EAP session中使用,且支持属性隐藏。

RFC3162为RADIUS定义了IPsec,但对其支持并没有做要求,Diameter强制要求支持IPSec,TLS的支持可选择。

∙可靠传输RADIUS运行在UDP上,且没有定义重传行为,所有,可靠性因实现不同而各异。

Diameter运行在可靠的传输层(TCP, SCTP)上。

∙代理支持RADIUS没有明确地规定支持agent,包括Proxies, Redirects, Relays。

Diameter明确地定义了代理的行为。

∙服务器发起消息RADIUS中对于服务器发起消息的支持是可选的,这就使用一些如主动断链、或者重新认证或重新鉴权等特性实现困难。

服务器发起消息在Diameter中强制要求支持。

∙可审核性RADIUS没有定义数据对象安全机制,结果,不受信任的代理可能修改属性或都包头,并且不会被检测出来,结合对能力协商机制的缺失,无法预期结果会发生什么。

netezza命令语法简要

netezza命令语法简要

nzsqlThis is nzsql, the Netezza SQL interactive terminal.Usage:nzsql [options] [dbname [username] [password]]Options:-a Echo all input from script-A Unaligned table output mode (-P format=unaligned)-c <query> Run only single query (or slash command) and exit-d <dbname> Specify database name to connect to (default: system)-D <dbname> Specify database name to connect to (default: system)-e Echo queries sent to backend-E Display queries that internal commands generate-f <filename> Execute queries from file, then exit-F <string> Set field separator (default: "|") (-P fieldsep=)-host <host> Specify database server host (default: domain socket)-H HTML table output mode (-P format=html)-l List available databases, then exit-n Disable readline-o <filename> Send query output to filename (or |pipe)-port <port> Specify database server port (default: hardwired)-P var[=arg] Set printing option 'var' to 'arg' (see \pset command)-q Run quietly (no messages, only query output)-R <string> Set record separator (default: newline) (-P recordsep=)-Rev Show version information and exit-rev Show version information and exit-s Single step mode (confirm each query)-S Single line mode (newline terminates query)-t Print rows only (-P tuples_only)-T text Set HTML table tag options (width, border) (-P tableattr=)-u <username> Specify database username (default: admin)-U <username> Specify database username (default: admin)-v name=val Set nzsql variable 'name' to 'value'-V Show version information and exit-W <password> Specify the database user password-pw <password> Specify the database user password-x Turn on expanded table output (-P expanded)-X Do not read startup file (~/.nzsqlrc)-h or -? Display this helpWelcome to nzsql, the Netezza SQL interactive terminal.Type: \h for help with SQL commands\? for help on internal slash commands\g or terminate with semicolon to execute query\q to quitsystem(admin)=> \hAvailable help:ALTER GROUP CREATE VIEW ROLLBACK ALTER TABLE DELETE SELECT ALTER USER DROP DATABASE SET BEGIN DROP GROUP SET SESSION COMMENT DROP TABLE SET SYSTEM DEFAULT COMMIT DROP USER SET TRANSACTION COPY DROP VIEW SHOW CREATE DATABASE EXPLAIN SHOW SYSTEM DEFAULTCREATE EXTERNAL TABLE GENERATE STATISTICS TRUNCATE CREATE GROUP GRANT UPDATE CREATE TABLE INSERT VACUUM CREATE TABLE AS RESETCREATE USER REVOKEsystem(admin)=> \?\a toggle between unaligned and aligned mode\act show current active sessions\c[onnect] [dbname [user] [password]]connect to new database (currently 'system')\C <title> table title\copy ... perform SQL COPY with data stream to the client machine\d <table> describe table (or view, index, sequence)\d{t|v|i|s|e|x} list tables/views/indices/sequences/temp tables/external tables \dS{t|v|i|s} list system tables/views/indexes/sequences\dp <name> list user permissions\dpu <name> list permissions granted to a user\dpg <name> list permissions granted to a group\dgp <name> list grant permissions for a user\dgpu <name> list grant permissions granted to a user\dgpg <name> list grant permissions granted to a group\d{u|U} list users/User Groups\d{g|G} list groups/Group Users\da list aggregates\dd [object] list comment for table, type, function, or operator\df list functions\do list operators\dT list data types\e [file] edit the current query buffer or [file] with external editor\echo <text> write text to stdout\encoding <encoding> set client encoding\f <sep> change field separator\g [file] send query to backend (and results in [file] or |pipe)\h [cmd] help on syntax of sql commands, * for all commands\H toggle HTML mode (currently off)\i <file> read and execute queries from <file>\l list all databases\o [file] send all query results to [file], or |pipe\p show the content of the current query buffer\pset <opt> set table output <opt> = {format|border|expanded|fieldsep|null|recordsep|tuples_only|title|tableattr|pager}\q quit nzsql\qecho <text> write text to query output stream (see \o)\r reset (clear) the query buffer\s [file] print history or save it in [file]\set <var> <value> set internal variable\t show only rows (currently off)\T <tags> HTML table tags\unset <var> unset (delete) internal variable\w <file> write current query buffer to a <file>\x toggle expanded output (currently off)\! [cmd] shell escape or commandnzloadUsage: nzload [-h|-rev] [<options>]Options:-h or -? display this help-[rR]ev or -V print the software revision of this program-host <name/IP> host name or IP address [NZ_HOST]-u <user> user name [NZ_USER]-pw <string> password [NZ_PASSWORD]-db <database> database name [NZ_DATABASE]-t <table> target table within database-dryRun validate input rows, do not modify table-updateStats <bool> (Yes) update statistics after load completes [default = No] Files:-cf <filename> control-df <filename> data (input rows to be loaded)-lf <filename> log (append if file already exists)-bf <filename> bad/rejected rows (overwrite if file already exists)-outputDir <dir> location for output files (log and bad rows)Reporting:-sts display a status line every 10000 input rows-distStats include distribution statistics in log file (imputed if -dryRun) Counters:-skipRows <n> skip (do not load) the first n input rows [default = 0 (none)] -maxRows <n> end loading after processing n input rows [default = 0 (all)] -maxErrors <n> abort after encountering n bad input rows [default = 1]Row syntax:-delim <char> separator between successive input fields [default = \t]-ignoreZero <bool> binary zero bytes in input generate errors (NO) / are ignored (YES):NO, FALSE / YES, TRUE [default = error]-quotedValue <type> fields are unquoted (NO) / enclosed in optional [SINGLE|DOUBLE] quotes:NO / YES, SINGLE, DOUBLE [default = NO; YES => SINGLE]-requireQuotes quotes are mandatory (except nullValue) [default = optional] Nulls:-nullValue <token> case-insensitive alphabetic pattern or '' [default = NULL; max 4 chars]-fillRecord treat missing trailing input fields as null (columns must be "nullable")Strings:-escapeChar <char> process escapes in char/varchar fields (currently <char> must be '\')-ctrlChars accept control chars in char/varchar fields (must escape NUL, CR and LF)-crInString accept unescaped CR in char/varchar fields (LF becomes only end of row)-truncString truncate any string value that exceeds its declared char/varchar storageDates:-dateStyle <style> Y[2]MD, DMY[2], MDY[2], MONDY[2] [default = YMD]-dateDelim <char> date component separator [MONDY[2] = ' ' else '-']-y2Base <year> first year expressible using two digit year (Y2) dateStyle Times:-timeStyle <style> 24HOUR, 12HOUR [default = 24HOUR]-timeDelim <char> time component separator [default = ':']-timeExtraZeros allow extra zeros following 6 fractional seconds digits Booleans:-boolStyle <style> 1_0, T_F, Y_N, TRUE_FALSE, YES_NO [default = 1_0]nzinventoryUsage: nzinventory [-h|-rev] [-hc] <subcmd> [<subcmd options>]Options:-h or -? display this help-[rR]ev or -V print the software revision of this program-hc display help for <subcmd>Subcommands:show show hardware or mirroring information (default)listTypes list the information types supported by showUsage: nzinventory show [<subcmd options>]Subcmd Options:-host <name/IP> host name or IP address [NZ_HOST]-timeout <secs> time to wait before exiting with a timeout error (default = 300) -u <user name> login using <user name> [NZ_USER]-pw <password> authentication password [NZ_PASSWORD]-type <info type> show this type of informationInformation Type Description---------------- ---------------------------------------------------hwSummary summary attributes per hardware component (default)hwDetail detail attributes per hardware componentdataSlices attributes per data slicediskPartitions attributes per disk partitionregenTasks list of current disk regeneration tasksfailover summary of failover situationsExamplenzinventory -type hwSummaryType HW ID Role State SPA # Slot # IP Addr Disk Size---- ------ ------- ------ ----- ------ --------- ---------SPU 1001 Active Online 2 1 10.0.2.1 115.04 GBSPU 1002 Active Online 2 2 10.0.2.2 115.04 GB...SFI 1113 Primary up 2 R 10.0.2.15SFI 1120 Primary up 8 R 10.0.8.15...FAN 100011 up 1 LFAN 100083 up 8 R...PWR 100014 up 1 LPWR 100025 up 2 Rnzinventory -type dataSlicesData Slice ID Primary HW ID Primary Partition ID Mirror HW ID Mirror Partition ID ------------- ------------- -------------------- ------------ -------------------1 1004 0 1001 12 1005 0 1002 13 1006 0 1010 14 1008 0 1012 1 nzinventory -type diskPartitionsSPU ID Type ID Partition Size (GB) Used (%) SPA # Slot # IP Addr------ --------- -- ------------------- -------- ----- ------ ---------1001 Primary 0 43.77 4.68 2 1 10.0.2.11001 Secondary 1 43.77 4.69 2 1 10.0.2.11002 Primary 0 43.77 4.68 2 2 10.0.2.21002 Secondary 1 43.77 4.69 2 2 10.0.2.2nzspuUsage: nzspu [-h|-rev] [-hc] <subcmd> [<subcmd options>]Options:-h or -? display this help-[rR]ev or -V print the software revision of this program-hc display help for <subcmd>Subcommands:activate make specified spu(s) available to system as sparesdeactivate make specified spu(s) unavailable to systemfailover mark specified spu as 'failed' and start using its mirrorlocate turn on locate LED for specified spu(s)regen start regeneration of a failed spu partition to specified spureset reset specified spu(s)delete delete specified spu(s) from system databasesnzstartUsage: nzstart [-h] <options>Options:-h show this usage-D <dataDir> use data directory-daemon run the system as a daemon process, disconnected from any terminal -log <file> send daemon output to a file rather than /dev/null-timeout seconds before exiting (while waiting for the system to start) -noWait do not wait for the system to go onlineDeveloper Options:-cf <cfg file> use named startup config file-sim start the system with 1 SPU simulator rather than real hardware -sim <num> start the system with <num> SPU simulators-w wait for startupsvr to exit-noRestart do not auto-restart after a process failure [NZ_NO_SPS_RESTART]nzstopUsage: nzstop [-h] <options>Options:-h show this usage-timeout seconds before exiting (while waiting for the system to stop)Developer Options:-noClean do not cleanup shared system resourcesnzstateUsage: nzstate [-h|-rev] [-hc] <subcmd> [<subcmd options>]Options:-h or -? display this help-[rR]ev or -V print the software revision of this program-hc display help for <subcmd>Subcommands:show show the overall state state (default)waitFor wait for the system to reach a specified statelistStates list the state values supported by waitFornzsystemUsage: nzsystem [-h|-rev] [-hc] <subcmd> [<subcmd options>]Options:-h or -? display this help-[rR]ev or -V print the software revision of this program-hc display help for <subcmd>Subcommands:showState show the overall system state (default)showRev show the system's software revisionshowRegistry show the system's configuration registryoffline take the system offlinepause pause the systemrestart stop and then automatically start the systemresume bring the system back onlinestop stop the systeminitTopology create the initial topology configurationset configure system setting(s)nzrevUsage: nzrev [-h|-rev] [<options>]Options:-h or -? display this help-[rR]ev or -V print the software revision of this program-dirSuffix display directory suffix form-shortLabel display a shorter version of the full formnzcontentsUsage: nzcontents -hOptions:-h show this usageExamplenzcontentsProgram Revision Stamp Build Stamp ------------------ ------------------------ ------------------------------------adm nzbackup 2.1.0-1.F-1.P-0.Bld-3782 v2_1.cm.3782 nzcontents nzevent 2.1.0-1.F-1.P-0.Bld-3782 v2_1.cm.3782 nzhostbackup nzhostrestore nzinventory 2.1.0-1.F-1.P-0.Bld-3782 v2_1.cm.3782 nzload 2.1.0-1.F-1.P-0.Bld-3782 v2_1.cm.3782 nzeventUsage: nzevent [-h|-rev] [-hc] <subcmd> [<subcmd options>]Options:-h or -? display this help-[rR]ev or -V print the software revision of this program-hc display help for <subcmd>Subcommands:show show the list of existing event rules (default)add add a new event ruledelete delete an event rulemodify modify an existing event rulegenerate generate an eventlistEventTypes list the valid event typeslistNotifyTypes list the valid notification types。

常用数据库词汇英汉对照

常用数据库词汇英汉对照

常用数据库词汇英汉对照abort 中断,中止access 访问account 账户action 操作active process 活动进程active statement 活动语句active voice 主动语态ActiveX Data Objects(ADO) ActiveX 数据对象ad hoc connector name 特殊连接器名称add-in 加载项adjective phrasing 形容词句式adverb 副词aggregate function 聚合函数aggregate query 聚合查询aggregation 聚合aggregation prefix 聚合前缀aggregation wrapper 聚合包装alert 警报alert log file 告警日志文件alias 别名aliasing 命名别名American National Standards Institute (ANSI) 美国国家标准学会 (ANSI) analysis server 分析服务器ancestor 祖先annotational property 批注属性anonymous subscription 匿名订阅ANSI:American National Standards Institute美国国家标准学会ANSIAPI:Application Program Interface【电脑】应用程序界面, 应用程序接口API server cursor API 服务器游标application role 应用程序角色archive 把……存档archive file 存档文件argument 参数article 项目atomic 原子的attribute 特性authentication 身份验证authorization 授权automatic recovery 自动恢复autonomy 独立axis 轴background process 后台处理,后台进程background trace file 后台跟踪文件backup 备份backup device 备份设备backup file 备份文件backup media 备份媒体backup set 备份集balanced hierarchy 均衡层次结构base data type 基本数据类型base table 基表batch 批处理batch process 批次处理BCP files BCP文件BCP utility BCP实用工具bigint data type bigint数据类型binary data type binary 数据类型binary large object 二进制大对象binding 绑定bit data type bit 数据类型bitwise operation 按位运算BLOB: binary large object二进制大对象,是一个可以存储二进制文件的容器block 块、区块、语句块Boolean 布尔型browse mode 浏览模式buffer cache 缓冲区built-in functions 内置函数business rules 业务规则cache aging 高速缓存老化数据清除calculated column 计算列calculated field 计算字段calculated member 计算所得成员calculation condition 计算条件calculation formula 计算公式calculation pass 计算传递calculation subcube 计算子多维数据集call-level interface (CLI)调用级接口(CLI)candidate key 候选键capacity plan容量图cascading delete 级联删除cascading update 级联更新case 事例case key 事例键case set 事例集cell 单元cellset 单元集certificate 证书change script 更改脚本changing dimension 可更改维度char data type char 数据类型character format 字符格式character set 字符集CHECK constraints CHECK约束checkpoint 检查点child 子代classification 分类clause 子句CLI: call-level interface 调用级接口client客户端client application 客户端应用程序client cursor 客户端游标clustered index 聚集索引clustering 聚集code page 代码页collation 排序规则column 列column filter 列筛选column-level collation 列级排序规则column-level constraint 列级约束command relationship 命令关系commit 提交comparative form 比较级component-based基于构件的component object model (COM)组件对象模型 (COM)composite index 组合索引composite key 组合键computed column 计算列COM-structured storage file COM结构化存储文件concatenation 串联concurrency 并发configuration options 配置选项conjunction 连词connection 连接connection pooling 连接池constant 常量constraint 约束continuation media 延续媒体control-break report 控制中断报表control-of-flow language 控制流语言correlated subquery 相关子查询CPU: Central Processing Unit中央处理器crosstab query 交叉表查询cube 多维数据集cube file 多维数据集文件cube role 多维数据集角色cursor 游标cursor data type cursor 数据类型cursor library 游标库custom rollup 自定义汇总custom rule 自定义规则data block 数据块data connection 数据连接data control language (DCL)数据控制语言 (DCL)data courier 数据快递data definition 数据定义data definition language (DDL)数据定义语言 (DDL)data dictionary 数据字典data dictionary view 数据字典视图data explosion 数据爆炸data file 数据文件data integrity 数据完整性data lineage 数据沿袭data manipulation language (DML)数据操作语言 (DML)data mart 数据集市data member 数据成员data modification 数据修改data pump 数据抽取data scrubbing 数据清理data source 数据源data source name (DSN) 数据源名称 (DSN) data type 数据类型data warehouse 数据仓库database 数据库database catalog 数据库目录database console 数据库控制台database credential 数据库证书database diagram 数据关系图database file 数据库文件database language 数据库语言database object 数据库对象database owner 数据库所有者database performance数据库性能database project 数据库工程database role 数据库角色database schema 数据库架构database script 数据库脚本data-definition query 数据定义查询dataset 数据集DateTime data type DateTime 数据类型DBA:database administrator 数据库管理员DBCS:double-byte character set(DBCS)双字节字符集(DBCS)deadlock 死锁decimal data type decimal 数据类型decision support 决策支持decision tree 决策树declarative referential integrity (DRI) 声明引用完整性 (DRI)dedicated server 专属服务器default 系统默认值,系统缺省值,默认值default constraint 默认约束default database 默认数据库default instance 默认实例default language 默认语言default member 默认成员default result set 默认结果集delete query 删除查询delimiter 分隔符demonstration示范denormalize 使非规范化density 密度deny 拒绝dependencies 相关性descendant 后代destination object 目的对象device 设备diagnostic file 诊断文件dictionary entry 字典条目differential database backup差异数据库备份dimension 维度dimension hierarchy 维度层次结构dimension table 维度表direct connect 直接连接direct object 直接对象direct response mode 直接响应模式dirty pages 脏页dirty read 脏读disable 使无效dispatcher progress 调度程序distribute 分发distributed query 分布式查询distribution CD 发行CDdistribution database 分发数据库distribution retention period分发保持期distributor 分发服务器domain 域domain integrity 域完整性drill down/drill up 深化/浅化drill through 钻取DSN-less connection 无DSN连接DTS package DTS包DTS package template DTS包模板dump 转储dump file 转储文件dynamic 动态的dynamic cursor 动态游标dynamic filter 动态筛选dynamic locking 动态锁定dynamic recovery 动态恢复dynamic snapshot 动态快照dynamic SQL statements 动态SQL语句enable 使有效encrypted trigger 加密触发器encryption 加密entity 实体entity integrity 实体完整性enroll 登记enumeration 枚举environment variable 环境变量equijoin 同等联接error log 错误日志error state number 错误状态号escape character 转义符exclusive lock 排它锁execute 执行explicit transaction 显式事务expression 表达式extended stored procedure 扩展存储过程extent 扩展failover 失效备援fact 事实fact table 事实数据表Federal Information Processing Standard (FIPS) 联邦信息处理标准 (FIPS)fetch 提取field 字段field length 字段长度field terminator 字段终止符file 文件file storage type 文件存储类型filegroup 文件组fill factor 填充因子filter 筛选filtering 筛选firehose cursor 流水游标fixed database role 固定数据库角色fixed server role 固定服务器角色flash recovery area 快速恢复区flattened interface 平展界面flattened rowset 平展行集float data type float 数据类型foreign key (FK) 外键 (FK)foreign table 外表forward-only cursor 只进游标fragmentation 碎片full outer join 完整外部联接full-text catalog 全文目录full-text enabling 全文启用full-text index 全文索引full-text query 全文查询full-text service 全文服务function 函数global default 全局默认值global properties 全局属性global rule 全局规则global subscriptions 全局订阅global variable 全局变量grant 授权granularity 粒度heterogeneous data 异类数据hierarchy 层次结构homogeneous data 同类数据hop 跃点horizontal partitioning 水平分区huge dimension 巨型维度hybrid OLAP (HOLAP) 混合OLAP (HOLAP) Hypertext Markup Language (HTML)超文本标记语言 (HTML)identifier 标识符identity column 标识列identity property 标识属性idle time 空闲时间image data type image 数据类型immediate updating 即时更新immediate updating subscribers即时更新订阅服务器immediate updating subscriptions即时更新订阅implement 实现implicit transaction 隐性事务implied permission 暗示性权限income 接收incremental update 增量更新index 索引index ORing 索引或运算index page 索引页indirect object 间接宾语information model 信息模型initial media 初始化媒体initialization parameters 初始化参数initial snapshot 初始化快照inner join 内联接input member 输入成员input set 输入集input source 输入源insensitive cursor 不感知游标insert query 插入查询insert values query 插入值查询instance 实例int (integer) data typeint (integer) 数据类型integer 整型integrated environment 集成环境integrated security 集成安全性integrity constraint 完整性约束intent lock 意向锁interactive 交互的interactive structured query language (ISQL) 交互式结构化查询语言 (ISQL) interface 接口interface implication 接口含义internal identifier 内部标识符International Electrotechnical Commission (IEC) 国际电子技术委员会International Organization for Standardization (ISO) 国际标准化组织interprocess communication (IPC)进程间通讯 (IPC)invoke 调用irregular form 不规则形式irregular form type 不规则形式类型irregular noun 不规则名词irregular verb 不规则动词isolation level 隔离级别JDBC:Java database connectivity Java数据库连接job 作业join 联接join column 联接列join condition 联接条件join field 联接字段join filter 联接筛选join operator 联接运算符join path 联接路径join table 联接表junction table 连接表kernel 核心key 键key column 键列key range lock 键范围锁keyset-driven cursor 键集驱动游标keyword 关键字large level 大级别latency 滞后时间leaf 叶leaf level 叶级leaf member 叶成员left outer join 左向外联接level 级别level hierarchy 级别层次结构library 库linked cube 链接多维数据集linked server 链接服务器linked table 链接表linking table 链接表listener:监听程序livelock 活锁local cube 本地多维数据集local distributor 本地分发服务器local group 本地组local login identification本地登录标识local server 本地服务器local subscription 本地订阅local variable 局部变量locale 区域设置locale identifier (LCID)区域设置标识符 (LCID)lock 锁lock escalation 锁升级log file 日志文件logical name 逻辑名称logical operators 逻辑运算符logical_join 逻辑联接login (account) 登录(帐户)login security mode 登录安全模式lookup table 查找表LRU algorithm:least recently used algorithm 最近最少使用算法Maintain 维护make table query 生成表查询mandatory强制的,必选的many-to-many relationship 多对多关系many-to-one relationship 多对一关系master database master 数据库master definition site 主定义位置master file 主文件master site 主位置measure 度量值measurement 度量media description 媒体描述media family 媒体家族media header 媒体首部media name 媒体名称media set 媒体集member 成员member delegation 成员委派member group 成员组member key column 成员键列member name column 成员名列member property 成员属性member variable 成员变量memo 备注merge 合并merge replication 合并复制message number 消息编号messaging application programming interface (MAPI) 消息应用程序接口meta data 元数据method 方法middle tier:中介层,中间层migrate移植mining model 挖掘模型mining model training 挖掘模型培训mirroring 镜像mixed mode 混合模式model 模型model database model 数据库model dependency 模型相关性module 模块modulo 以...为模money data type money 数据类型multidimensional expressions (MDX) 多维表达式 (MDX)multidimensional OLAP (MOLAP)多维 OLAP (MOLAP)multidimensional structure 多维结构multiple inheritance 多重继承multiple instances 多实例multithreaded server application多线程服务器应用程序multiuser 多用户name phrasing 名称句式named instance 命名实例named pipe 命名管道named set 命名集naming relationship 命名关系native format 本机格式navigate导航NLS:natural language support自然语言支持系统nchar data type nchar数据类型nested query 嵌套查询nested table 嵌套表nickname 别名noise word 干扰词nonclustered index 非聚集索引nonleaf 非叶nonleaf member 非叶成员nonrepeatable read 不可重复读取normalization rules 规范化规则ntext data type ntext 数据类型NULL 不知道nullability 为空性numeric expression 数值表达式nvarchar data type nvarchar 数据类型object 对象object dependencies 对象相关性object identifier 对象标识符object owner 对象所有者object permission 对象权限object variable 对象变量ODBC:open database connectivity开放数据库互连ODBC data source ODBC数据源ODBC driver ODBC驱动程序OEM:Oracle enterprise manager Oracle企业管理器OFA:optimal flexible architecture优化自由结构OLAP:online transaction processing 联机事务处理OLE Automation controller OLE 自动化控制器OLE Automation objects OLE 自动化对象OLE Automation server OLE 自动化服务器OLE DB consumer OLE DB使用者OMF:Oracle managed files Oracle管理文件one-to-many relationship 一对多关系one-to-one relationship 一对一关系online analytical processing (OLAP) 联机分析处理 (OLAP)online redo log 联机重做日志online transaction processing (OLTP) 联机事务处理 (OLTP)open data services (ODS) 开放式数据服务 (ODS)open database connectivity (ODBC)开放式数据库连接 (ODBC)open information model (OIM)开放信息模型 (OIM)optimize synchronization 优化同步optimizer 优化程序optional:可选的Oracle世界领先的信息管理软件开发商,因其复杂的关系数据库产品而闻名Oracle homes:Oracle主目录ORACLE_SID Oracle System Identifier 的缩写ordered set 有序集origin object 起始对象OUI:Oracle universal installer Oracle 通用安装程序outer join 外联接overfitting 过适page 页page split 页拆分parent 父代partition 分区partitioning 分区parts of speech 词性pass order 传递顺序passive voice 被动语态pass-through query 直接传递查询pass-through statement 直接传递语句persistence 持续性PGA:program global area 程序全局区phantom 幻像phrase 短语phrasing 句式physical name 物理名称physical reads 物理读取pivot 数据透视platform平台port 端口position 位置positioned update 定位更新possessive case 所有格precision 精度preconfigured 预配置的predicate 谓词prediction 预测prefix characters 前缀字符prefix length 前缀长度prefix search 前缀搜索preposition 介词preposition phrasing 介词句式prerequisite先决条件primary dimension table 主维度表primary key (PK) 主键 (PK) primary table 主表prioritized approach优先方法private dimension 专用维度privilege特权procedure cache 过程缓存process 处理producer 发生器project 工程pronoun 代词proper noun 专有名词property 属性property pages 属性页provider 提供程序proximity search 近似搜索publication 发布publication database 发布数据库publication retention period 发布保持期published data 已发布数据publisher 发布服务器publishing table 发布表pubs database pubs 数据库pull subscription 请求订阅push subscription 强制订阅query optimizer 查询优化器question Builder 问题生成器question file 问题文件question template 问题模板queue 队列ragged hierarchy 不齐整层次结构range query 范围查询rank 级raw device 裸设备real data type real 数据类型record 记录record set 记录集recovery 恢复recovery interval 恢复间歇recursive partitioning 递归分区redo log file 恢复日志文件referenced key 引用键referencing key 参照键referential integrity (RI) 引用完整性reflexive relationship 反身关系refresh data 刷新数据regular cube 常规多维数据集regular dimension 常规维度relational database 关系数据库relational database management system (RDBMS) 关系数据库管理系统 (RDBMS) relational OLAP (ROLAP) 关系OLAP relationship 关系relationship object 关系对象relationship type 关系类型remote data 远程数据remote Distributor 远程分发服务器remote login identification 远程登录标识remote partition 远程分区remote server 远程服务器remote stored procedure 远程存储过程remote table 远程表replicated data 已复制数据replication 复制replication conflict Viewer 复制冲突查看器replication monitor 复制监视器replication scripting 编写复制脚本replication topology 复制拓扑repository 知识库,数据贮存器repository engine 知识库引擎repository object 知识库对象repository SQL schema 知识库SQL架构repository type information model (RTIM) 知识库类型信息模型 (RTIM)resolution strategy 冲突解决策略response file响应文件restatement 复述result 结果result set 结果集return parameters 返回参数reusable bookmark 可再次使用的书签revoke 废除right outer join 右向外联接role 角色roll back 回滚roll forward 前滚root form 原形root user:根用户,超级用户row 行row aggregate function 行聚合函数row filter 行筛选row lock 行锁rowset 行集rule 规则sample data 示例数据save point 保存点scalar aggregate 标量聚合scheduled backup 已调度备份schedule:安排schema 架构schema rowset 架构行集Scott 演示用户,普通用户script 脚本scroll 滚动search condition 搜索条件security identifier 安全标识号security strategy安全策略seed database种子数据库segment段segmentation 分段select list 选择列表select query 选择查询self-join 自联接semantic object 语义对象semiadditive measure 半加法度量sensitive cursor 感知游标sequence 序列sequenced collection 顺序集合sequenced relationship 顺序关系serializable 可串行server cursor 服务器游标server name 服务器名称session 会话setup initialization file 安装程序初始化文件severity level 严重级别SGA:system global area 系统全局区shared dimension 共享维度shared lock 共享锁showplan 显示计划sibling 兄弟SID:System Identifier的缩写系统标识符single-user mode 单用户模式slice 切片smalldatetime data type smalldatetime 数据类型smallint data type smallint 数据类型smallmoney data type smallmoney 数据类型snapshot agent 快照代理程序snapshot agent utility 快照代理程序实用工具snapshot cursor 快照游标snapshot replication 快照复制solve order 求解次序sort order 排序次序source and target 源和目标source cube 源多维数据集source database 源数据库source object 源对象source partition 源分区sparsity 稀疏度specify inventory directory:指定存盘目录SQL:structured query language 结构化查询语言SQL collation SQL 排序规则SQL database SQL 数据库SQL expression SQL 表达式SQL Mail SQL 邮件SQL query SQL 查询SQL Server AuthenticationSQL Server 身份验证SQL Server Event Forwarding Server SQL Server 事件转发服务器SQL Server login SQL Server 登录SQL Server role SQL Server 角色SQL Server user SQL Server 用户SQL statement SQL 语句sql_variant data type sql_variant 数据类型stand-alone 独立,单机standard security 标准安全机制standby database备用数据库star join 星型联接star schema 星型架构statement permission 语句权限static cursor 静态游标static SQL statements 静态 SQL 语句step object 步骤对象storage structure存储结构store-and-forward database 保存与转发数据库stored procedure 存储过程string 字符串string functions 字符串函数structured query language (SQL)结构化查询语言 (SQL)structured storage file 结构化存储文件subject 主语subquery 子查询subscribe 订阅subscriber 订阅服务器subscribing server 订阅服务器subscription 订阅subscription database 订阅数据库subset 子集subset phrasing 子集句式subtask:子任务suite:一套superlative form 最高级synchronization 同步synonym 同义词syntax语法SYS 超级管理员SYSDBA 超级权限SYSTEM 普通管理员system administrator 系统管理员system catalog 系统目录system databases 系统数据库system functions 系统函数system stored procedures 系统存储过程system tables 系统表table 表table data type table 数据类型table lock 表锁table scan 表扫描tablespace 表空间table-level constraint 表级约束tabular data stream (TDS) 表格格式数据流 (TDS)tape backup 磁带备份target object 目标对象target partition 目标分区task 任务task object 任务对象tempdb database tempdb 数据库template模板temporary stored procedure 临时存储过程temporary table 临时表temporary tablespace 临时表空间text data type text 数据类型theta join theta 联接third-party service 第三方服务thread 线程time dimension 时间维度timestamp data type timestamp数据类型tinyint data type tinyint数据类型tool 工具trace file 跟踪文件training data set 培训数据集trait 特征trait phrasing 特征句式transaction 事务transaction log 事务日志transaction processing 事务处理transaction rollback 事务回滚transactional replication 事务复制Transact-SQL cursor Transact-SQL游标transformable subscription 可转换订阅transformation 转换trigger 触发器trusted connection 信任连接tuple 元组two-phase commit 两相提交unbalanced hierarchy 不均衡层次结构underlying table 基础表unenforced relationship 未强制关系Unicode collation Unicode 排序规则Unicode format Unicode 格式Union query 联合查询UNIQUE constraints UNIQUE 约束unique index 唯一索引uniqueidentifier data type uniqueidentifier 数据类型update 更新update lock 更新锁update query 更新查询update statistics 更新统计UPI:user program interface 用户程序接口user (account) 用户(帐户)user database 用户数据库user-defined data type 用户定义数据类型user-defined event 用户定义事件user-defined function 用户定义函数utility 实用工具value expression 值表达式varbinary data type varbinary 数据类型varchar data type varchar 数据类型variables 变量verb phrasing 动词句式verify 检查,校验vertical filtering 垂直筛选vertical partitioning 垂直分区very large dimension 超大型维度view 视图view generation 视图生成virtual cube 虚拟多维数据集virtual dimension 虚拟维度WHERE clause WHERE 子句wildcard characters 通配符字符wildcard search 通配符搜索word generation 字生成write back 写回write enable 写启用write-ahead log 预写日志XTerm:命令行终端。

DataGuard11g_Best_Practices-Wangjian

DataGuard11g_Best_Practices-Wangjian
• 其他应用网络传输的竞争
• RTT 网络延迟 – 主库和备份库之间数据往返时间 • Note - 11g 的异步加强方式消除了RTT的影响
• 调优关键参数,可以有较好的性能
• 参阅 MAA Best Practices for Redo Transport and Network
15
数据库性能
影响主库性能的因素?
MRP LSP
LGWR
Primary Database
Online Redo Logs
Standby Redo Logs
Transform Redo to SQL for Logical Standby
arch ping ARCH Logs to resolve outage RFS
ARCH
Queries Reports Testing Backups
• 实现细节 – 参阅 MetaLink Note 729551.1 • 要求: Oracle 11g 高级压缩选项
19
位置
主库和备份库之间的规划距离 ?
• The greater the distance, the greater the protection • 采用多个备份数据库,或结合逻辑备份和物理备份 • 参阅: MAA Best Practices for Multi-Standby Configurations
• 合理的 Oracle 解决方案
• 数据库级可控的角色转换Database-controlled role transitions • 高 ROI – 充分利用备份服务器、存储和软件
5
Data Guard 传输服务
Primary Database
Oracle Instance in-memory

利用MySQL工具进行故障切换第二部分:mysqlfailover

利用MySQL工具进行故障切换第二部分:mysqlfailover

利用MySQL工具进行故障切换第二部分:mysqlfailover————————————————————————————————作者:————————————————————————————————日期:利用MySQL工具进行故障切换——第二部分:mysqlfailover 在本系列的前面的文章我们看到在MySQL 5.6中,当GTID启用时如何使用mysqlrpladmin 执行手动故障转移/切换。

现在我们将回顾MySQL实用程序中的另一个工具mysqlfailover(1.4.3版本),它可以用于故障的自动转移。

Summary●如果MySQL 5.6的GTID复制启用的话,mysqlfailover可以执行故障自动转移。

●所有的从机都必须使用——主信息资料库列表。

(All slaves must use --master-info-repository=TABLE.)●监控节点是一个单故障点:别忘了监视它。

(The monitoring node is a single point of failure: don’t forget to monitor it! )●错误事项检测效果很好,但是你必须使用保守的选项来确保故障转移将永远不会发生错误。

(Detection of errant transactions works well, but you have to use the -- pedanticoption to make sure failover will never happen if there is an errant transaction. )●有一些局限性,比如不能只失败一次或过度的CPU利用率,但这对大多数设置影响不是很大。

(There are a few limitations such as the inability to only fail over once, or excessive CPU utilization, but they are probably not showstoppers for most setups. )Setup我们将使用与上次相同的设置:一个主机和两个从机,并且都使用了GTID复制。

timeout exceeded try restarting transaction

timeout exceeded try restarting transaction

timeout exceeded try restarting transaction "Timeout exceeded, try restarting transaction" is a common error message encountered in database management systems. This error occurs when a transaction takes longer to complete than the specified timeout period. In this article, we will explore the possible causes of this error and discuss how to troubleshoot and resolve it.One of the main causes of this error is a long-running transaction. When a transaction executes multiple queries or updates a significant amount of data, it may take longer to complete, exceeding the predefined timeout period. In such cases, restarting the transaction can be an effective solution.To restart a transaction, you need to follow these steps:1. Identify the transaction: When you encounter the "timeout exceeded, try restarting transaction" error, you need to identify the specific transaction causing the issue. This can be done by examining the logs or error messages associated with the application or database.2. Analyze the transaction: Once you have identified the problematic transaction, analyze it to determine why it is taking longer to complete. Look for any inefficient queries, missing or outdated indexes, or contention for resources, such as locks or disk I/O.3. Optimize the transaction: After identifying the problem areas, optimize the transaction to make it more efficient. This can involverewriting queries to use proper indexes, reducing the number of queries, or optimizing resource allocation.4. Retry the transaction: Once you have optimized the transaction, retry it to see if the timeout error persists. If the error still occurs, you may need to further analyze and optimize the transaction or consider other solutions.In addition to these steps, there are other strategies you can employ to avoid or resolve the "timeout exceeded, try restarting transaction" error:1. Increase the timeout period: If you frequently encounter this error with certain transactions, consider increasing the timeout period. This gives more time for the transaction to complete before triggering the error. However, increasing the timeout period may not always be feasible or effective, especially if the transaction is genuinely problematic.2. Tune the database configuration: Review and tune the database configuration parameters related to transaction management. This includes settings like transaction timeout, maximum concurrent transactions, and resource allocation. Adjusting these parameters can help alleviate the timeout issue.3. Monitor database performance: Implement a database monitoring system to track transaction performance and identify any abnormalities or bottlenecks. By monitoring the performance, you can proactively detect and address issues before they cause timeouts.4. Consider distributed transactions: If the transaction involves multiple databases or resources, consider using distributed transactions. Distributed transactions allow multiple data manipulations across different databases or systems to be grouped into a single transaction. This can help reduce the chances of timeout errors.In conclusion, encountering the "timeout exceeded, try restarting transaction" error can be frustrating, but it is a common issue in database management. By following the steps outlined above and considering the suggested strategies, you can troubleshoot and resolve this error, ensuring smoother execution of transactions in your database system. Remember to analyze the problematic transaction, optimize it, and retry it, while also considering other approaches like increasing the timeout period or tuning the database configuration.。

Waiting

Waiting

Waiting for HAManagerTechnote (troubleshooting)Problem(Abstract)In IBM® WebSphere® Application Server version 6.0 and higher, WebSphere processes fail to complete initialization. One or both of the following messages are continuously logged in SystemOut.log:SymptomCWRLS0030W: Waiting for HAManager to activate recovery processing...DCSV8030I: DCS Stack DefaultCoregroup at Member myCell\myNode1\myAppServer1: Failed a join attempt with member [myCell\myNode2\myAppServer2]. The reason is Not all candidates are connectedCauseBackgroundEvery WebSphere process is a member of a HA Manager core group. In the case where a clustered Application Server is started, WebSphere services, including the HA Manager and Transaction Manager are initialized and started. Before the Transaction Manager can complete its startup it must have exclusive ownership of its transaction recovery log file. In WebSphere Application Server V6.0 and higher, the Transaction Manager relies on the HA Manager to assign it ownership of its transaction log file. This is true even if the “highly available transaction log” feature is not used. The Transaction Manager logs a CWRLS0030W message when it is waiting for the HA Manager to assign it ownership of its transaction log. In order for the HA Manager to assign ownership of the transaction log to the Transaction Manager, the Application Server must establish itself as a member of a “View”. This requires the HA Manager to establish network connectivity between all running core group members.Therefore, there are situations where things are working properly but the CWRLS0030W message might be logged simply due to timing conditions. The time required to establish a DCS View depends on a number of factors, including: The number of members in the core groupThe number of core group members that are started concurrentlyThe existing load on the machines hosting the core group membersWhen core group topologies are large and many core group members are started concurrently, it might take several minutes to establish a view.Continually logged DCSV8030I messages indicate problems establishing a DCS view.In the case where the core group member is not a clustered application server, the Transaction Manager is not initialized and CWRLS0030W will not be observed; however, continuously logged DCSV8030I messages indicate network connectivity issues exist.CWRLS0030W or DCSV8030I message can occur as a natural consequence of variable network timing conditions; however, if either message is observed to occur over extended periods of time, then it is likely that a network connectivity problem exists. .Resolving the problemDebugging the problemCheck known problems by searching the WebSphere Application Server Support page.Perform the debug checklistIf the problem has not been resolved through this check list, use MustGather: Read first for WebSphere Application Server.Debug checklistThere are a number of messages in the SystemOut.log file that can be used to help determine when a problem is occurring. The messages of interest have a component code of HMGR (CWRHA) or DCSV (CWRCS).To proceed, obtain the SystemOut.log file, open it and scroll to the messages that were logged around the time of interest. Follow the check list below.1. If you are seeing repeating DCSV8030I messages logged in any SystemOut.log, go to the Connection Issues section of this document2. Has the process established a DCS View?An HMGR0218I message is logged in the SystemOut.log file when this occurs.Yes, go to the The process is in a view section of this document.No, continue with step 3.3. Are connections being established? DCSV1032I messages are logged as connections are established to other core group members.Yes, continue with step 4.No - If there are no DCSV1032I messages in the log, then either there is a problem with the network or no other core group members have been started. If only one core group member has been started, then starting a second member should correct the condition.4. Check the other DCSV and HMGR messages in the SystemOut.log file. These might give indications of other configuration or network communications problems. Some of the more common messages include:DCSV1111W, DCSV1112W, DCSV1113W or DCSV115W messages are logged when the network connection to another core group member is closed. Under normal circumstances, this should only occur when the other core group member is stopped. If network connections to core group members that are still running are being closed, there might be a network issue or a problem in the operating system.DCSV8020W or DCSV8021W messages indicate that the core group configuration is inconsistent across the various nodes in the cell. This condition may be transient. The HA Manager will attempt a limited number of retries to correct this condition. If an HMGR0090W message is logged, this indicates that the condition is not transient and thatautomatic recovery has failed. When the problem is not recovered automatically, manual recovery must be performed.A cell-wide configuration synchronization must be performed and the failed application server must be restarted.There might be a DCS_UNICAST_ADDRESS port conflict across multiple processes on the same node. In Version 6.1 and higher, a HMGR0028E message will be logged if this condition occurs. If a port conflict exists, then the port conflict must be resolved, the updated configuration synchronized across all nodes in the cell and all core group members restarted.There might be a duplicate IP Address assignment across host names in the cell. In version 6.1 and higher, aHMGR0027W message will be logged if this condition occurs. If this condition occurs, then the IP assignment must be repaired and, in most cases, all core group processes must be restarted.The process is in a viewIf the HMGR0218I message was logged, but server startup continues to log the CWRLS0030, check the following: If new HA Policies have been created for the Transaction Manager or if the default HA Policy has been modified, then the most likely cause of the problem is an incorrectly configured HA Policy. For more information on selection ofHAManager policy, see the Information center.If the highly available transaction log feature has been enabled, then further investigation as to why the Transaction Manager cannot complete initialization should commence with the Transaction Manager.If the highly available transaction log feature has not been enabled, then further investigation should commence with the HA Manager. To further debug the problem, support will need traces (Trace string of HAManager=finest) of both the application server that will not start and the process that is currently serving as the HA Manager Active Coordinator as indicated by the presence of an HMGR0206I message.Connection issuesChecklist for identifying, gathering diagnostic data from, and recovering core group members with connectivity problems.Before proceeding with the following steps - make sure other network connectivity problems, as documented in the debug checklist above, have been ruled out. Under normal circumstances, debugging connectivity issues of this nature require extensive trace collection from all running core group members. Given the intrusive nature of the debug process in production environments, the following steps are provided to assist in minimizing potential business impact.Locate the SystemOut.log(s) where DCSV8030I messages have been logged in the following specific syntax (note the key pieces of information to focus on are the “RoleViewLeade” and “DCSV8030I” strings and are highlighted in the message sample for this step below):RoleViewLeade I DCSV8030I: DCS Stack DefaultCoregroup at Member myCell\myNode1\myAppServer1: Failed a join attempt with member [myCell\myNode2\myAppServer2]. The reason is Not all candidates are connected ConnectedSetMissing= [ ] ConnectedSetAdditional [myCell\myNode1\myAppServer3 myCell\myNode1\myAppServer4 ].[/]This message is indicates potential network connectivity problems. To collect diagnostic data and initiate a recovery process, continue to the steps below:1. Construct a list of core group members with potential connectivity problems. There are three possible variations to consider. Determine which variation is applicable.Variation 1:If the message has entries in only the connectedSetAdditional list then:Add all core group members specified in the connectedSetAdditional list identified in the DCSV8030I message to the list of members with potential connectivity problems.Add the core group member logging this message (in this example myAppServer1) to the list.Focus strings for this variation are highlighted in the message below:RoleViewLeade I DCSV8030I: DCS Stack DefaultCoregroup at Member myCell\myNode1\myAppServer1: Failed a join attempt with member [myCell\myNode2\myAppServer2]. The reason is Not all candidates are connected ConnectedSetMissing= [ ] ConnectedSetAdditional[myCell\myNode1\myAppServer3 myCell\myNode1\myAppServer4]. [/]For this example, the result list is:myCell\myNode1\myAppServer1,myCell\myNode1\myAppServer3,myCell\myNode1\myAppServer4Variation 2:If the message instead had entries only in the connectedSetMissing list:Add all core group members specified in the connectedSetMissing list to the list.Add the core group member identified after the "failed a join attempt with member" (in this example myAppServer2) to the listFocus strings for this variation are highlighted in the message below:RoleViewLeade I DCSV8030I: DCS Stack DefaultCoregroup at Member myCell\myNode1\myAppServer1: Failed a join attempt with member myCell\myNode2\myAppServer2. The reason is Not all candidates are connectedConnectedSetMissing= [myCell\myNode1\myAppServer5 myCell\myNode1\myAppServer6]ConnectedSetAdditional []. [/]For this example, the result list is:myCell\myNode2\myAppServer2,myCell\myNode1\myAppServer5,myCell\myNode1\myAppServer6Variation 3:If the message has entries in both the connectedSetAdditional and connectedSetMissing lists:Add all core group members specified in the connectedSetMissing list to the list.Add all core group members specified in the connectedSetAdditional list to the list.Add the core group member identified after the "failed a join attempt with member" (in this example myAppServer2) to the listAdd the core group member logging this message (in this example myAppServer1) to the list.Focus strings for this variation are highlighted in the message below:RoleViewLeade I DCSV8030I: DCS Stack DefaultCoregroup at Member myCell\myNode1\myAppServer1: Failed a join attempt withmember[myCell\myNode2\myAppServer2]. The reason is Not all candidates are connected ConnectedSetMissing=[myCell\myNode1\myAppServer5 myCell\myNode1\myAppServer6] ConnectedSetAdditional [myCell\myNode1\myAppServer3myCell\myNode1\myAppServer4 ]. [/]For this example, the result list is:myCell\myNode1\myAppServer1,myCell\myNode1\myAppServer3,myCell\myNode1\myAppServer4myCell\myNode2\myAppServer2,myCell\myNode1\myAppServer5,myCell\myNode1\myAppServer62. Collect diagnostic information.Utilizing the admin console runtime tab on each of the running core group members in the resulting list of members with potential connectivity problems built in step 1, enable dynamic trace specifying the trace string“HAManager=all:DCS=all:RMM=all:TCPChannel=fine”. In addition, confirm the trace Maximum File Size has been set to 20MB and Maximum Number of Historical Files to 4. This will assure sufficient data is captured before file trace file rollover. For a core group member attempting and failing to complete “open for e-business”, enable trace statically via the configuration tab (same trace string specification as documented previously).Collect approximately 5-10 minutes of overlapped (i.e. the period during which trace is enabled on all core groupmembers in the process candidate list) trace data. This should be sufficient to diagnose the connectivity problem being encountered.Disable trace, run the collector tool on all pertinent nodes (i.e. those with trace data) and upload the results to an IBM service site (as directed by the IBM service representatives assigned to the pmr associated with this problem).3. RecoveryStop all core group members in the list of members with potential connectivity problems built in step 1 under connection issues.Sequentially restart each member (stopped in this step), inspect its SystemOut.log to validate its DCS view has merged with the main view of the other core group members.If network connectivity problems persist, restart all core group members in the cell.。

  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

Transaction Manager Failover: A Case Study UsingJBOSS Application ServerA. I. Kistijantoro, G. Morgan, S. K. ShrivastavaSchool of Computing Science, Newcastle University, Newcastle upon Tyne, UK {A.I.Kistijantoro, Graham.Morgan, S.K.Shrivastava}@ Abstract.This paper describes, for the case of Enterprise Java Beancomponents and JBoss application server, how replication for availability canbe supported to tolerate application server/transaction manager failures.Replicating the state associated with the progression of a transaction (i.e., whichphase of two-phase commit is enacted and the transactional resources involved)provides an opportunity to continue a transaction using a backup transactionmanager if the transaction manager of the primary fails. Existing applicationservers do not support this functionality. The paper discusses the techical issuesinvolved and shows how a solution can be engineered.Keywords: Availability, application servers, components, Enterprise JavaBeans, fault tolerance, middleware, replication, transactions1. IntroductionThree-tier middleware architecture is commonly used for hosting large-scale distributed applications. Typically the application is decomposed into three layers: front end, middle layer and back-end. Front-end (‘Web server’) is responsible for handling user interactions and acts as a client of the middle layer, while back-end provides storage facilities for applications. Middle layer (‘Application Server’) is usually the place where all computations are performed, so this layer provides middleware services for transactions, security and so forth. The benefit of this architecture is that it allows flexible configuration such as partitioning and clustering for improved performance and scalability. Furthermore, availability measures, such as replication, can be introduced in each tier in an application specific manner. In this paper we concentrate on application server (middle tier) replication. Data as well as object replication techniques have been studied extensively in the literature, so our task is not to invent new replication techniques, but to investigate how existing techniques can be migrated to middle tier.One important concept related to availability measures is that of exactly once transaction or exactly once execution[1,2]. The concept is particularly relevant in web-based e-services where the system must guarantee exactly once execution of userrequests despite system failures. Problems arise as the clients in such systems are usually not transactional, thus they are not part of the recovery guarantee provided by the underlying transaction processing systems that support the web-based e-services. When failures occur, clients often do not know whether their requests have been processed or not. Resubmitting the requests may result in duplication, and on the other hand it is also possible the requests have not been processed at all. This problem can be handled by replicating the application server to achieve availability. As we discuss in the next section, while existing application servers for Enterprise Java Bean (EJB) components do use replication, they do not adequately support exactly once transaction capability. For this reason, there has been much recent research works on replication for supporting exactly once transactions over commonly used application servers. However, implementation work reported so far has dealt with transactions that update a single database only, so do not require two-phase commit.In this paper we go a step further and present design, implementation and performance evaluation of a middle tier replication scheme for multi-database transactions using a widely deployed application server (JBoss). We describe how a backup transaction manager can complete two-phase commit for transactions that would otherwise be blocked. The paper discusses the technical issues involved and shows how a solution can be engineered. Our case study can be used by other designers intending to enhance application servers in a similar manner.2. Related WorkThe classic text [3] discusses replicated data management techniques that go hand in hand with transactions. Object replication using group communication, originally developed in the ISIS system [4], has been studied extensively [e.g., 5]. The interplay between replication and exactly once execution within the context of multi-tier architectures is examined in [6], whilst [7] describes how replication and transactions can be incorporated in three-tier CORBA architecture. The approach of using a backup transaction monitor was implemented as early as 1980 in the SDD-1 distributed database system [8]; another implementation is reported in [9]. A replicated transaction coordinator to provide non-blocking commit service has also been described in [10]. Our paper deals with the case of replicating transaction managers in the context of standards compliant Java application servers (J2EE servers).There are several studies that deal with replication of application servers as a mechanism to improve availability [1,2,11,12]. In [2], the authors precisely describe the concept of exactly once transaction (e-transaction) and develop server replication mechanisms; their model assumes stateless application servers(no session state is maintained by servers) that can access multiple databases. Their algorithm handles the transaction commitment blocking problem by making the backup server take on the role of transaction coordinator. As their model limits the application servers to be stateless, the solution cannot be directly implemented on stateful server architectures such as J2EE servers.The approach by Wu, Kemme et al in [12] specifically addressed the replication of J2EE application servers, where components may possess session state in addition to persistent state stored on a single database. The approach assumes that an active transaction is always aborted by the database whenever an application server crashes. Therefore, it uses a mechanism similar to testable transaction abstraction developed in [1], and on failover, the backup server uses this mechanism to find out the outcomes of transactions performed on the crashed primary. Our approach assumes the more general case of access to multiple databases; hence two phase commitment (2PC) is necessary. Application server failures that occur during the 2PC process do not always cause abortion of active transactions, since the backup transaction manager can complete the commit process.JBoss clustering [13] uses session replication to enable failover of a component processing on one node to another. The approach targets load balancing among replicas and it allows each replica handles different client sessions. The state of a session is propagated to backup after the computation finish. When a server crashes, all sessions that it hosts can be migrated and continued on another server, regardless the outcome of formerly active transactions on the crashed server, which may lead to inconsistencies.Exactly once transaction execution can also be implemented by making the client transactional, and on web-based e-services, this can be done by making the browser as a resource which can be controlled by the resource manager from the server side, as shown in [14,15]. One can also employ transactional queue [16]. In this way, user requests are kept in a queue that are protected by transactions, and clients submit requests and retrieve results from the queue as separate transactions. As the result, three transactions are required for processing each client requests and developers must construct their application so that no state is kept in the application servers between successive requests from clients. The approach presented in [17] guarantees exactly once execution on internet-based e-services by employing message logging. The authors describe which messages require logging, and how to do the recovery on the application servers. The approach addresses stateful application servers with single database processing without replicating the application servers. The table below summarizes the differences between the various approaches described above.Aspects Transactionalqueue Trans. client Messagelogging [17]e-transaction Wu andKemmeOur approachApp. serverreplicationNo No No Yes Yes YesTransactionalclientNot required Required Not required Not required Not required Not required Stateful server Supported Supported Supported Not supported Supported Supported Platform TP monitors Web Web Custom J2EE J2EE Multi database Supported Supported Not supported Supported Not supported SupportedTable: exactly once transaction solutionsFor the sake of completeness, we point out here that replication approaches for the third tier (backend, database tier) that work with application servers have also been investigated by many researchers (see [18,19]).3. BackgroundWe assume the reader is familiar with EJB component model and how transactions are used through containers in J2EE servers (background details are available in the more detailed version of this paper [20]). We only provide a brief description of how services are integrated into JBoss via interceptors, management beans (MBeans) and Java Management Extensions JMX and then describe how this approach is used to implement transactions in JBoss middleware.Figure 1 – Augmenting application server with transactions.In JBoss invocations pass through a series of interceptors within a container. These interceptors enable the integration of additional services into a container to support EJB execution (e.g., security, transactions), with the final interceptor in the incoming chain of interceptors handling method invocation on the actual EJB itself. Services may be added to JBoss via MBeans. An MBean exposes a management interface, attributes and operations while adhering to the JMX specification and may be made available for use via the standard object location services in JBoss (JNDI). JMX provides an API for management and monitoring of resources, including remote access, so a remote application can manage and monitor applications.JBoss implements transactions with the aid of tx interceptors and the transaction manager (figure 1). The tx interceptor inspects an incoming invocation with the aid of the transaction manager and determines the appropriate settings for the transaction context before the receiving bean processes the invocation. A transaction context is used to identify a transaction and determines the transaction an invocation belongs to (in particular, the thread of execution associated to an invocation), allowing transactional mechanisms to be enacted in line with invocation processing on transactional objects (e.g., mark for rollback, throw exception, commit).4. ModelOur approach to component replication is based on a passive replication scheme, in that a primary services all client requests with a backup assuming the responsibility of servicing client requests when a primary fails. Crash failures of servers are assumed. There are two different times within a client session when a primary may fail: (1) during non-transactional invocation phase, (2) during transactional phase.As entity beans access and change persistent state, the time taken to execute application logic via entity beans is longer than enacting the same logic using session beans. The reason for this is two fold: (1) the high cost of retrieving state on entity bean activation and writing state on entity bean deactivation; (2) the transactional management associated to persistent state updates. The structuring of an application to minimize the use of entity beans (and transactions) to speed up execution times is commonplace. This approach to development leads to scenarios in which a client enacts a “session” (a series of related invocations) on an application server, with the majority of invocations handled by session beans. Transactional manipulation of persistent state via entity beans is usually left to the last steps of processing in a client’s session. The sequence diagram in figure 2 describes the style of interaction our model assumes. We are only showing application level logic invocations (as encoded in EJBs) in our diagram, therefore, we do not show the transaction manager and associated databases. The invocations that occur within a transaction are shown in the shaded area. As mentioned earlier, we assume a client is not part of the transaction.Figure 2 – Interactions between beans and client.We assume a single stateful session bean is used to present a single interface for a client during a session. The creation and destruction of a stateful session bean by a client delimits the start and end of a session (i.e., lifetime of stateful session bean). We assume the existence of a single transaction during the handling of the last client invocation and such a transaction is initiated by the stateful session bean and involves one or more entity beans. The transaction is container managed and is scoped by this last method invocation.Failure of the primary during a session will result in a backup assuming responsibility for continuing the session. This may require the replaying of the last invocation sent by a client if state changes and return parameters associated to the last invocation were not recorded at backups. If state changes and parameters were recorded then the backup will reply with the appropriate parameters. During the transactional phase the transaction may be completed at the backup if the commit stage had been reached by the primary and computation has finished between the entity beans. The backup will be required to replay the transaction if failure occurs during transactional computation.5. JBoss ImplementationWe use interceptors, MBeans and JMX technologies to integrate our replication service into JBoss. This approach ensures that we do not disturb the functionality of existing services. Figure 3 shows the interceptors and associated services that implement our replication scheme in the JBoss application server. The interceptors perform the following tasks: retry interceptor– identifies if a client request is a duplicate and handles duplicates appropriately; txinspector interceptor– determines how to handle invocations that are associated to transactions; txinterceptor – interacts with transaction manager to enable transactional invocations (unaltered existing interceptor shown for completeness); replica interceptor– ensures state changes associated with a completed invocation are propagated to backups.Figure 3 – Augmenting application server with replication service.The txinterceptor together with the transaction manager accommodates transactions within the application server. The replication service supports inter-replica consistency and consensus services via the use of JGroups [21]. JGroups provides a group communication subsystem that supports the abstraction of a process group (and totally ordered atomic multicast). The replication service, retry interceptor, txinspector interceptor and the replica interceptor, implements our replication scheme.Replication logic at the server side makes use of four persistent logs that are maintained by the replication service: (i) current primary and backup configuration (group log), (ii) most recent state of session bean together with the last parameters sent back as a reply to a client invocation (bean log), (iii) invocation timestamp associated to most recent session bean state (timestamp log), (iv) state related to the progress of a transaction (transaction log). The replication service uses a single group via the JGroups service to ensure these logs are consistent across replicas.We skip over the details of how a client side proxy has been enhanced with retry ability to backups as well as how session state checkpointing to backups is performed using group communication, as these techniques are well known (details can be found in [20]); instead we concentrate below on transaction failover management.5.1. Transaction failover managementWe assume container managed transaction demarcation. Via this approach to managing transactions the application developer specifies the transaction demarcation for each method via the transaction attribute in a bean deployment descriptor. Using this attribute a container decides how a transaction is to be handled. For example, if anew transaction has to be created for an invocation, or to process the invocation as part of an existing transaction (i.e., the transaction was started earlier in the execution chain). Based on this mechanism, a single invocation of a method can be: a single transaction unit (a transaction starts at the beginning of the invocation and ends at the end of the invocation), a part of a transaction unit originated from other invocation, or non transactional (e.g. the container can suspend a transaction prior to executing a method, and resume the transaction afterwards). We assume that the processing of an invocation may involve one or more beans (both session beans and entity beans) and may accesses one or more databases, requiring two phase commitment.Figure 4 - A typical interaction for a transaction processing in EJB Figure 4 illustrates the execution of a typical transaction (for brevity, we have not shown resource adaptors). We shall use this example as a comparison to highlight the enhancements we have provided to handle transaction failover (this example is represents the shaded area shown in figure 4). SFSB stands for a stateful session bean and EB stands for an entity bean. All methods on the beans have a Required tag as their transaction attribute, indicating to the container that they must be executed within a transaction. The invocation from the client initially does not contain a transaction context. At (1), a client invokes a method on a stateful session bean SFSB1. The container (e.g. the tx interceptor on JBoss app server) determines that the invocation requires a transaction and calls the transaction manager to create a transaction T1 for this invocation (2). The container proceeds to attach a transaction context for T1 to the invocation. The container does not have to create a new transaction for nested invocations (3) and (5). The invocation on EB1 requires access to a database DB1 (4) and at this point, the container registers DB1 to the transaction manager as a resource associated with T1. The same process happens at (6) where the container registers DB2 to be associated with T1.After the computation on SFSB1, EB1 and EB2 finishes, before returning the result to the client, the container completes the transaction by instructing the transaction manager to commit T1. The transaction manager then performs two phase commit with all resources associated with T1 (8) (not shown in detail here).Our transaction failover mechanisms are performed at point (7) and (8). A multicast of the state update of all involved session beans together with the result parameter, the transaction id and information on all resources involved is made (7a) and (7b) to all backup replicas. If the primary fails after this point, a backup will try to finish the commit process. At point (8), a multicast of the decision taken by the transaction manager is made to all backup replica transaction managers via the replication service (8a) and (8b). If the primary fails after this point, a backup will try to finish the commit process according to the decision that has been taken by the failed primary.A number of technical challenges needed to be overcome to provide an engineered solution. However, for brevity we do not go into such details here; the interested reader is referred to [20].6. Experimental EvaluationWe carried out our experiments on the following configurations: (1) Single application server with no replication; (2) Two application server replicas with transaction failover. Both configurations use two databases, as we want to conduct experiments for distributed transaction setting.The application server used was JBoss 3.2.5 with each application server deployed on a Pentium IV 2.8 GHz PC with 2048MB of RAM running Fedora Core 4. The database used was Oracle 9i release 2 (9.2.0.1.0) [20] with each database deployed on a Pentium IV 2.8 GHz PC with 2048MB of RAM running Fedora Core 4. The client was deployed on a Pentium IV 2.8 GHz PC with 2048MB of RAM running Fedora Core 4. The LAN used for the experiments was a 100 Mbit Ethernet. ECperf [22] was used as the demonstration application in our experiments. ECperf is a benchmark application provided by Sun to enable vendors to measure the performance of their J2EE products. For our experiments, we configured the ECperf application to use two databases instead of just a single database (as is the default configuration).Two experiments are performed. First, we measure the overhead of our replication scheme introduces into application performance. The ECperf driver was configured to run each experiment with 10 different injection rates (1 though 10 inclusive). At each of these increments a record of the overall throughput (transactions per minute) for both order entry and manufacturing applications is taken. The injection rate relates to the order entry and manufacturer requests generated per second. Due to the complexity of the system the relationship between injection rate and resulted transactions is not straightforward. The second experiment measures how our replicated algorithm performs in the presence of failures. In this experiment we ran the ECperf benchmark for 20 minutes, and the throughput of the system every 30 seconds is recorded. After the first 12 minutes, we kill the primary server to force the system to failover to the backup server.(i) throughput for entry order app. (ii) response time for entry order app.Figure 5 – Performance figures.Figure 5 presents two graphs that describe the throughput and response time of the ECperf applications; figure 5(i) identifies the throughput for the entry order system, figure 5(ii) identifies the response time for the entry order system. On first inspection we see that our replication scheme lowers the overall throughput of the system. This is to be expected as additional processing resources are required to maintain state consistency across components on a backup server.Figure 6 presents a graph that describes the throughput of our system and the standard implementation over the time of the benchmark. After 720 seconds running (12 minutes), we crash the primary server. When no replication is present the failure of the application server results in throughput decreasing to zero, as there is no backup to continue the computation. When replication is present performance drops when failure of the primary is initiated. However, the backup assumes the role of the primary allowing for throughput to rise again. An interesting observation is that throughput on the new primary is higher than it was on the old primary. This may be explained by the fact that only one server exists and no replication is taking place. The initial peak in throughput may also be explained by the completion of transactions that started on the old primary but finish on the new primary. This addsFigure 6 – Performance figures under a failure.The experiments show that our replication scheme does not incur high overhead compared to a non replicated system, and is able to perform quick failover when the primary crashes.7. Concluding RemarksWe have presented a practical solution to the problem of incorporating availability through replication in application servers, specifically for the general case of multi-database transactions. Although our design and implementation have been for a specific component model (EJBs) and application server (JBoss), the ideas can be applied to other application servers. Thus our case study can be used by other designers intending to enhance application servers in a similar manner. References1. S. Frolund and R. Guerraoui, “A pragmatic implementation of e-transactions”, Proceedings the 19th IEEE Symposium on.Reliable Distributed Systems, SRDS-2000.2. S. Frolund and R. Guerraoui, “e-transactions: End-to-end reliability for three-tier architectures”, IEEE Transactions on Software Engineering 28(4): 378-395, 2002.3. P.A. Bernstein et al, "Concurrency Control and Recovery in Database Systems", Addison-Wesley, 1987.4. K. Birman , "The process group approach to reliable computing", CACM , 36, 12, pp. 37-53, December 1993.5. P. Felber, R. Guerraoui, and A. Schiper, “The implementation of a CORBA object group service”, Theory and Practice of Object Systems, 4(2), 1998, pp. 93-105.6. B. Kemme, R. Jimenez-Peris et al, “Exactly once Interaction in a Multi-tier Architecture”, VLDB Conf. Trondheim, Norway. Aug. 2005. Workshop on design, implementation, and deployment of database replication.7. W. Zhao, L. M. Moser and P. M. melliar-Smith,”Unification of Transactions and Replication in Three-tier Architectures Based on CORBA”, IEEE transactions on Dependable and Secure Computing, Vol. 2, No. 1, 20- 33, 2005.8. M. Hammer and D. Shipman, "Reliability mechanisms for SDD-1: A system for distributed databases" ACM Transactions on Database Systems 5(4): 431--466, 1980.9. P.K. Reddy and M. Kitsuregawa, “Reducing the blocking in two-phase commit protocol employing backup sites”, Proceedings of Third IFCIS Conference on Cooperative Information Systems (CoopIS'98), August 1998, New York.10. Jiménez-Peris, R., M. Patiño-Martínez, et al, “A Low-Latency Non-blocking Commit Service”, 15th International Conference on Distributed Computing (DISC), October 2001. 11. Ozalp Babaoglu et al, “A Framework for Prototyping J2EE Replication Algorithms”, Int. Symposium on Distributed Objects and Applications (DOA), Agia Napa, October 2004.12. H. Wu, B. Kemme, V. Maverick, “Eager Replication for Stateful J2EE Servers”, Int. Symposium on Distributed Objects and Applications (DOA), Agia Napa, Cyprus, October 2004.13. bourey and B.Burke, “ JBoss Clustering 2nd Edition”, 2002, 14. M.C. Little and S K Shrivastava, “Integrating the Object Transaction Service with the Web”, Proc. Of IEEE/OMG Second Enterprise Distributed Object Computing Workshop (EDOC’98), La Jolla, CA, November 1998, pp. 194 – 205.15. M.C. Little and S K Shrivastava, “Java Transactions for the Internet”, Distributed Systems Engineering, 5 (4), December 1998, pp. 156-167.16. P.A. Bernstein, M. Hsu, et al. , “Implementing recoverable requests using queues”, Proceedings of ACM SIGMOD international conference on Management of data, 1990, Atlantic City, New Jersey.17. R. Barga, D. Lomet, et al. ,"Recovery guarantees for Internet applications", ACM Trans. on Internet Tech. 4(3): 289-328, 2004.18. A. I. Kistijantoro, G. Morgan, S. K. Shrivastava and M.C. Little, “Component Replication in Distributed Systems: a Case study using Enterprise Java Beans”, 22nd IEEE/IFIP Symposium on Reliable Distrinbuted Systems (SRDS2003), Florence, October 2003, pp. 89-98.19. M. Patiño-Martínez, R. Jiménez-Peris, B. Kemme, G. Alonso, “Consistent Database Replication at the Middleware Level”, ACM Transactions on Computer Systems (TOCS). Volume 23, No. 4, 2005, pp 1-49.20. I. Kistijantoro, G. Morgan, S. K. Shrivastava, “Transaction Manager Failover: A Case Study Using JBOSS Application Server”, technical Report, School of Computing Science, Newcastle University, 2006.21. Ban B., “JavaGroups User’s Guide” 22. /en/jsr/detail?id=4。

相关文档
最新文档