文档首页 > > 工具指南> Schema Convertor Tool SQL语法迁移工具> 日志参考> SQL迁移日志

SQL迁移日志

分享
更新时间: 2019/08/09 GMT+08:00

SQL Schema Convertor Tool(migrate.sh)支持以下类型的日志记录:

  • 活动日志
  • 错误日志
  • 成功读
  • 成功写
说明:
  • 如果用户指定了日志路径,所有日志都会保存在该路径下。
  • 如果未指定日志路径,Schema Convertor Tool会在TOOL_HOME路径下创建log文件夹,用于存储所有日志。
  • 为控制磁盘空间用量,日志文件的大小上限为100MB。用户最多可拥有10个日志文件。
  • 工具日志不记录敏感数据,如查询。

活动日志

Schema Convertor Tool将所有日志和错误信息保存到dws-schema-convertor.log文件中。该文件位于log文件夹中。dws-schema-convertor.log文件包含执行迁移的用户、迁移的文件、时间戳等详细信息。活动日志的记录级别为INFO。

dws-schema-convertor.log的文件结构如下:

2018-12-18 03:46:37,199 INFO  [main] - Add class SqlAlterTableDropPrimaryKeyActionUnParser, for dialect DWS, sqlnode SqlAlterTableDropPrimaryKeyAction.(UnParserFactory.java:49) 
2018-12-18 03:46:37,200 INFO  [main] - Add class SqlAlterTableLockActionUnParser, for dialect DWS, sqlnode SqlAlterTableLockAction.(UnParserFactory.java:49) 
2018-12-18 03:46:37,201 INFO  [main] - Add class SqlAlterTableModifyColumnActionUnParser, for dialect DWS, sqlnode SqlAlterTableModifyColumnAction.(UnParserFactory.java:49) 
2018-12-18 03:46:37,202 INFO  [main] - Add class SqlAlterTableRenameTableActionUnParser, for dialect DWS, sqlnode SqlAlterRenameTableAction.(UnParserFactory.java:49) 
2018-12-18 03:46:37,203 INFO  [main] - Add class SqlAlterTableUnParser, for dialect DWS, sqlnode SqlAlterTable.(UnParserFactory.java:49) 
2018-12-18 03:46:37,204 INFO  [main] - Add class SqlBeginTransactionUnParser, for dialect DWS, sqlnode SqlBeginTransaction.(UnParserFactory.java:49) 
2018-12-18 03:46:37,206 INFO  [main] - Add class SqlCacheIndexUnParser, for dialect DWS, sqlnode SqlCacheIndex.(UnParserFactory.java:49) 
2018-12-18 03:46:37,208 INFO  [main] - Add class SqlCheckTableConstraintUnParser, for dialect DWS, sqlnode SqlCheckTableConstraint.(UnParserFactory.java:49) 
2018-12-18 03:46:37,224 INFO  [main] - Add class SqlColumnDefinitionUnParser, for dialect DWS, sqlnode SqlColumnDefinition.(UnParserFactory.java:49) 
2018-12-18 03:46:37,225 INFO  [main] - Add class SqlCommitRollbackTransactionUnParser, for dialect DWS, sqlnode SqlCommitRollbackTransaction.(UnParserFactory.java:49) 
2018-12-18 03:46:37,226 INFO  [main] - Add class SqlCreateDataBaseUnParser, for dialect DWS, sqlnode SqlCreateDatabase.(UnParserFactory.java:49) 
2018-12-18 03:46:37,228 INFO  [main] - Add class SqlCreateIndexUnParser, for dialect DWS, sqlnode SqlCreateIndex.(UnParserFactory.java:49) 
2018-12-18 03:46:37,230 INFO  [main] - Add class SqlCreateTableLikeUnParser, for dialect DWS, sqlnode SqlCreateTableLike.(UnParserFactory.java:49) 
2018-12-18 03:46:37,232 INFO  [main] - Add class SqlCreateTableUnParser, for dialect DWS, sqlnode SqlCreateTable.(UnParserFactory.java:49) 
2018-12-18 03:46:37,234 INFO  [main] - Add class SqlDataTypeSpecUnParser, for dialect DWS, sqlnode SqlDataTypeSpec.(UnParserFactory.java:49) 
2018-12-18 03:46:37,236 INFO  [main] - Add class SqlDeleteUnParser, for dialect DWS, sqlnode SqlDeleteStatement.(UnParserFactory.java:49) 
2018-12-18 03:46:37,237 INFO  [main] - Add class SqlDoStatementUnParser, for dialect DWS, sqlnode SqlDoStatement.(UnParserFactory.java:49) 
2018-12-18 03:46:37,239 INFO  [main] - Add class SqlDropIndexUnParser, for dialect DWS, sqlnode SqlDropIndex.(UnParserFactory.java:49) 
2018-12-18 03:46:37,241 INFO  [main] - Add class SqlDropTableUnParser, for dialect DWS, sqlnode SqlDropTable.(UnParserFactory.java:49) 
2018-12-18 03:46:37,242 INFO  [main] - Add class SqlFKeyTableConstraintUnParser, for dialect DWS, sqlnode SqlFKeyTableConstraint.(UnParserFactory.java:49) 
2018-12-18 03:46:37,243 INFO  [main] - Add class SqlFlushUnParser, for dialect DWS, sqlnode SqlFlush.(UnParserFactory.java:49) 
2018-12-18 03:46:37,243 INFO  [main] - Add class SqlFullColumnNameUnParser, for dialect DWS, sqlnode SqlFullColumnName.(UnParserFactory.java:49) 
2018-12-18 03:46:37,244 INFO  [main] - Add class SqlIdentifierUnParser, for dialect DWS, sqlnode SqlIdentifier.(UnParserFactory.java:49) 
2018-12-18 03:46:37,245 INFO  [main] - Add class SqlIndexColumnNameUnParser, for dialect DWS, sqlnode SqlIndexColumnName.(UnParserFactory.java:49) 
2018-12-18 03:46:37,246 INFO  [main] - Add class SqlInsertUnParser, for dialect DWS, sqlnode SqlInsertReplaceStatement.(UnParserFactory.java:49) 
2018-12-18 03:46:37,247 INFO  [main] - Add class SqlLimitUnParser, for dialect DWS, sqlnode SqlLimit.(UnParserFactory.java:49) 
2018-12-18 03:46:37,249 INFO  [main] - Add class SqlLiteralUnParser, for dialect DWS, sqlnode SqlLiteral.(UnParserFactory.java:49) 
2018-12-18 03:46:37,251 INFO  [main] - Add class SqlLockTableElementUnParser, for dialect DWS, sqlnode SqlLockTableElement.(UnParserFactory.java:49) 
2018-12-18 03:46:37,252 INFO  [main] - Add class SqlLockTableUnParser, for dialect DWS, sqlnode SqlLockTables.(UnParserFactory.java:49) 
2018-12-18 03:46:37,253 INFO  [main] - Add class SqlNodeListUnParser, for dialect DWS, sqlnode SqlNodeList.(UnParserFactory.java:49) 
2018-12-18 03:46:37,254 INFO  [main] - Add class SqlPartitionDefinerAtomUnParser, for dialect DWS, sqlnode SqlPartitionDefinerAtom.(UnParserFactory.java:49) 
2018-12-18 03:46:37,255 INFO  [main] - Add class SqlPartitionDefinitionsUnParser, for dialect DWS, sqlnode SqlPartitionDefinitions.(UnParserFactory.java:49) 
2018-12-18 03:46:37,258 INFO  [main] - Add class SqlPartitionDefinitionUnParser, for dialect DWS, sqlnode SqlPartitionDefinition.(UnParserFactory.java:49) 
2018-12-18 03:46:37,261 INFO  [main] - Add class SqlPartitionFunctionDefinitionUnParser, for dialect DWS, sqlnode SqlPartitionFunctionDefinition.(UnParserFactory.java:49) 
2018-12-18 03:46:37,263 INFO  [main] - Add class SqlPartitionOptionUnParser, for dialect DWS, sqlnode SqlPartitionOption.(UnParserFactory.java:49) 
2018-12-18 03:46:37,265 INFO  [main] - Add class SqlPKeyTableConstraintUnParser, for dialect DWS, sqlnode SqlPKeyTableConstraint.(UnParserFactory.java:49) 
2018-12-18 03:46:37,266 INFO  [main] - Add class SqlReferenceUnParser, for dialect DWS, sqlnode SqlReference.(UnParserFactory.java:49) 
2018-12-18 03:46:37,268 INFO  [main] - Add class SqlReleaseSavePointUnParser, for dialect DWS, sqlnode SqlReleaseSavePoint.(UnParserFactory.java:49) 
2018-12-18 03:46:37,269 INFO  [main] - Add class SqlRollbackSavePointUnParser, for dialect DWS, sqlnode SqlRollbackSavePoint.(UnParserFactory.java:49) 
2018-12-18 03:46:37,270 INFO  [main] - Add class SqlRootUnParser, for dialect DWS, sqlnode SqlRoot.(UnParserFactory.java:49) 
2018-12-18 03:46:37,271 INFO  [main] - Add class SqlSavePointUnParser, for dialect DWS, sqlnode SqlSavePoint.(UnParserFactory.java:49) 
2018-12-18 03:46:37,272 INFO  [main] - Add class SqlSetCharacterUnParser, for dialect DWS, sqlnode SqlSetCharacter.(UnParserFactory.java:49) 
2018-12-18 03:46:37,274 INFO  [main] - Add class SqlSetTransactionUnParser, for dialect DWS, sqlnode SqlSetTransation.(UnParserFactory.java:49) 
2018-12-18 03:46:37,276 INFO  [main] - Add class SqlStartTransactionUnParser, for Input folder : 1 
2018-09-01 15:34:56,141 INFO MigrationService:200 Number of queries failed : 0 
2018-09-01 15:34:56,141 INFO MigrationService:203 Number of files failed : 0 
2018-09-01 15:34:56,141 INFO MigrationService:208 Number of files migrated successfully : 1

错误日志

Schema Convertor Tool仅将迁移过程中发生的错误记录到dws-schema-convertor.log文件中。该文件位于log文件夹中。dws-schema-convertor.log文件包含这些错误的日期、时间,文件详细信息(如文件名),以及查询位置等信息。错误日志的记录级别为ERROR。

dws-schema-convertor.log的文件结构如下:

2019-01-14 12:28:44,212 ERROR [main] - You have an error in your SQL syntax; check the manual that corresponds to your Database version for the right syntax to use near 'GEOMETRY' at line 198:8(AntlrErrorListener.java:50) 
com.huawei.hwclouds.scs.sql.util.ParserException: You have an error in your SQL syntax; check the manual that corresponds to your Database version for the right syntax to use near 'GEOMETRY' at line 198:8
at com.huawei.hwclouds.scs.sql.AntlrErrorListener.syntaxError(AntlrErrorListener.java:47)
at org.antlr.v4.runtime.ProxyErrorListener.syntaxError(ProxyErrorListener.java:41)
at org.antlr.v4.runtime.Parser.notifyErrorListeners(Parser.java:544)
at com.huawei.hwclouds.scs.sql.AntlrErrorStrategy.reportNoViableAlternative(AntlrErrorStrategy.java:59)
at org.antlr.v4.runtime.DefaultErrorStrategy.reportError(DefaultErrorStrategy.java:136)
at com.huawei.hwclouds.scs.mysql.parser.MySqlParser.sqlStatements(MySqlParser.java:1071)
at com.huawei.hwclouds.scs.mysql.parser.MySqlParser.root(MySqlParser.java:808)
at com.huawei.hwclouds.scs.mysql.parser.MysqlSchemaParser.parse(MysqlSchemaParser.java:57)
at com.huawei.hwclouds.scs.dws.MysqlConvertor.parse(MysqlConvertor.java:79)
at com.huawei.hwclouds.scs.dws.DWSMain.parseSqls(DWSMain.java:86)
at com.huawei.hwclouds.scs.dws.DWSMain.main(DWSMain.java:50)
2019-01-14 12:28:44,214 ERROR [main] - (AntlrErrorListener.java:51) org.antlr.v4.runtime.NoViableAltExceptionat org.antlr.v4.runtime.atn.ParserATNSimulator.noViableAlt(ParserATNSimulator.java:2028)
at org.antlr.v4.runtime.atn.ParserATNSimulator.execATN(ParserATNSimulator.java:467)
at org.antlr.v4.runtime.atn.ParserATNSimulator.adaptivePredict(ParserATNSimulator.java:393)
at com.huawei.hwclouds.scs.mysql.parser.MySqlParser.sqlStatements(MySqlParser.java:976)
at com.huawei.hwclouds.scs.mysql.parser.MySqlParser.root(MySqlParser.java:808)
at com.huawei.hwclouds.scs.mysql.parser.MysqlSchemaParser.parse(MysqlSchemaParser.java:57)
at com.huawei.hwclouds.scs.dws.MysqlConvertor.parse(MysqlConvertor.java:79)
at com.huawei.hwclouds.scs.dws.DWSMain.parseSqls(DWSMain.java:86)
at com.huawei.hwclouds.scs.dws.DWSMain.main(DWSMain.java:50)
2019-01-14 12:28:44,229 ERROR [main] - Failed to parse createTable_table_options_runOob_tbl_test_dataType_7.sql(DWSMain.java:96) processing of input in Bulk Migration. PreQueryValidation failed in not proper termination or exclude keyword. /home/testmigration/Documentation/Input/c005.sql for Query in position : 4 
2017-06-29 14:07:39,962 ERROR TeradataBulkHandler:172 Error occurred during processing of input in Bulk Migration. PreQueryValidation failed in not proper termination or exclude keyword. /home/testmigration/Documentation/Input/c013.sql for Query in position : 11 
2017-06-29 14:07:40,136 ERROR QueryConversionUtility:250 Query is not converted as it contains unsupported keyword: join select 
2017-06-29 14:07:40,136 ERROR TeradataBulkHandler:172 Error occurred during processing of input in Bulk Migration. PreQueryValidation failed in not proper termination or exclude keyword. /home/testmigration/Documentation/Input/sample.sql for Query in position : 1 
2017-06-29 14:07:40,136 ERROR TeradataBulkHandler:172 Error occurred during processing of input in Bulk Migration. PreQueryValidation failed in not proper termination or exclude keyword. /home/testmigration/Documentation/Input/sample.sql for Query in position : 3

解析语法树

在Schema Convertor Tool读取SQL文件之后,该文件将被记录日志以进行跟踪。在某些情况下,用户可通过这些日志获取文件执行状态的信息。该文件位于log文件夹中。日志文件包括日期、时间、文件名等详细信息。此日志文件的日志记录级别为INFO。

dws-schema-convertor.log的文件结构如下:

2018-12-18 03:46:37,115 INFO  [main] - Parse Completed(MysqlSchemaParser.java:64) 
2018-12-18 03:46:37,116 INFO  [main] - Syntax tree visitor.(MysqlSchemaParser.java:68) 
2018-12-18 03:46:37,139 INFO  [main] - visitInsertToTable enter (InsertReplaceStatementVisitor.java:173) 
2018-12-18 03:46:37,153 INFO  [main] - visitInsertToTable enter (InsertReplaceStatementVisitor.java:173) 
2018-12-18 03:46:37,154 INFO  [main] - visitInsertToTable enter (InsertReplaceStatementVisitor.java:173) 
2018-12-18 03:46:37,155 INFO  [main] - visitInsertToTable enter (InsertReplaceStatementVisitor.java:173) 
2018-12-18 03:46:37,156 INFO  [main] - visitInsertToTable enter (InsertReplaceStatementVisitor.java:173) 
2018-12-18 03:46:37,157 INFO  [main] - visitInsertToTable enter (InsertReplaceStatementVisitor.java:173) 
2018-12-18 03:46:37,162 INFO  [main] - visitInsertToTable enter (InsertReplaceStatementVisitor.java:173) 
2018-12-18 03:46:37,163 INFO  [main] - visitInsertToTable enter (InsertReplaceStatementVisitor.java:173) 
2018-12-18 03:46:37,164 INFO  [main] - visitInsertToTable enter (InsertReplaceStatementVisitor.java:173) 
2018-12-18 03:46:37,165 INFO  [main] - visitInsertToTable enter (InsertReplaceStatementVisitor.java:173) 
2018-12-18 03:46:37,166 INFO  [main] - visitInsertToTable enter (InsertReplaceStatementVisitor.java:173) 
2018-12-18 03:46:37,166 INFO  [main] - visitInsertToTable enter (InsertReplaceStatementVisitor.java:173) 
2018-12-18 03:46:37,169 INFO  [main] - visitInsertToTable enter (InsertReplaceStatementVisitor.java:173) 
2018-12-18 03:46:37,169 INFO  [main] - visitInsertToTable enter (InsertReplaceStatementVisitor.java:173)

解析SQL文件

Schema Convertor Tool读取、处理文件并将输出写入磁盘。这个过程被记录到成功写日志文件中。在某些情况下,用户可通过此文件了解哪些文件已处理成功。在重新运行的情况下,用户可以跳过这些文件运行剩余的文件。该文件位于log文件夹中。日志文件包括日期、时间、文件名等详细信息。此日志文件的日志记录级别为INFO。

dws-schema-convertor.log的文件结构如下:

2019-01-14 07:36:05,810 INFO  [main] - Parse Completed(MysqlSchemaParser.java:64) 
2019-01-14 07:36:05,811 INFO  [main] - Syntax tree visitor.(MysqlSchemaParser.java:68) 
2019-01-14 07:36:05,811 INFO  [main] - visitCreateDatabase enter (DdlStatementVisitor.java:56) 
2019-01-14 07:36:05,812 INFO  [main] - Create database charset name : utf8(DdlStatementVisitor.java:77) 
2019-01-14 07:36:05,812 INFO  [main] - SqlCreateDatabase unparse enter(SqlCreateDataBaseUnParser.java:30) 
2019-01-14 07:36:05,813 INFO  [main] - SqlCreateDatabase result: CREATE DATABASE "hzq" TEMPLATE=template0 ENCODING='utf8';(SqlCreateDataBaseUnParser.java:58) 
2019-01-14 07:36:05,839 INFO  [main] - start to parse sql :
分享:

    相关文档

    相关产品

文档是否有解决您的问题?

提交成功!

非常感谢您的反馈,我们会继续努力做到更好!

反馈提交失败,请稍后再试!

*必选

请至少选择或填写一项反馈信息

字符长度不能超过200

提交反馈 取消

如您有其它疑问,您也可以通过华为云社区问答频道来与我们联系探讨

跳转到云社区