博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
oracle中创建脚本文件怎么打开,创建脚本文件 (OracleToSQL)
阅读量:5106 次
发布时间:2019-06-13

本文共 10536 字,大约阅读时间需要 35 分钟。

创建脚本文件 (OracleToSQL)Creating Script Files (OracleToSQL)

01/19/2017

本文内容

启动 SSMA 控制台应用程序之前的第一个步骤是创建脚本文件,并在需要时创建变量值文件和服务器连接文件。The first step before launching the SSMA console application is to create the script file and if required creating the variable value file and the server connection file.

脚本文件可以分为三个部分,即即:The script file can be divided into three sections, viz..,:

config: 允许用户为控制台应用程序设置配置参数。config: Enables the user to set the configuration parameters for the console application.

服务器: 允许用户设置源/目标服务器定义。servers: Enables the user to set the source/target server definitions. 也可以在单独的服务器连接文件中使用。This can also be in a separate server connection file.

脚本-命令: 允许用户执行 SSMA 工作流命令。script-commands: Enables the user to execute SSMA workflow commands.

下面将详细介绍每个部分:Each section is described in detail below:

配置 Oracle 控制台设置Configuring Oracle Console Settings

脚本的配置显示在控制台脚本文件中。The configurations of a script are displayed in the console script file.

如果在配置节点中指定了任一元素,则这些元素将设置为全局设置,即它们适用于所有脚本命令。If any of the elements are specified in the configuration node, they are set as the global setting i.e. they are applicable for all script commands. 如果用户想要替代全局设置,还可以在脚本命令部分的每个命令中设置这些配置元素。These configuration elements can also be set within each command in the script-command section if the user wants to override the global setting.

用户可配置的选项包括:The user-configurable options include:

输出窗口提供程序: 如果将 "取消消息" 特性设置为 "true",则命令特定消息不会显示在控制台上。Output Window Provider: If suppress-messages attribute is set to 'true', the command-specific messages do not get displayed on the console. 属性说明如下所示:The Attributes description is given below:

destination:指定是否需要将输出打印到文件或 stdout。destination: Specifies whether the output needs to get printed to a file or stdout. 默认情况下,此值为 false。This is false by default.

文件名:文件路径 (可选) 。file-name: The path of the file (Optional).

抑制消息:抑制控制台上的消息。suppress-messages: Suppresses messages on the console. 默认情况下,此值为 "false"。This is 'false' by default.

示例:Example:

suppress-messages="" (optional)

destination="" (optional)

file-name="" (optional)

/>

oror

suppress-messages="" (optional)

destination="" (optional)

file-name="" (optional)

/>

数据迁移连接提供程序: 此项指定要将哪个源/目标服务器视为数据迁移。Data Migration Connection Provider: This specifies which source/target server is to be considered for data-migration. 源-使用情况-上次使用指示上次使用的源服务器用于数据迁移。Source-use-last-used indicates that the last used source server is used for data migration. 类似目标-使用-上次使用指示上次使用的目标服务器用于数据迁移。Similarly target-use-last-used indicates that the last used target server is used for data migration. 用户还可以通过使用属性 "源-服务器" 或 "目标服务器" 指定服务器 (源或目标) 。The user can also specify the server (source or target) by using the attributes source-server or target-server.

只能使用一个或另一个指定的属性,例如:Only one or the other specified attribute can be used i.e.:

源-使用-上次使用 = "true" (默认) 或源-server = "source_servername"source-use-last-used="true" (default) or source-server="source_servername"

目标-使用-上次使用 = "true" (默认) 或目标-server = "target_servername"target-use-last-used="true" (default) or target-server="target_servername"

示例:Example:

target-server=""/>

oror

target-use-last-used="true"/>

用户输入弹出窗口: 这允许在从数据库加载对象时处理错误。User Input Popup: This allows handling of errors, when the objects are loaded from the database. 用户提供输入模式,并在发生错误时,控制台将在用户指定的情况下继续。The user provides the input modes, and in case of an error, the console proceeds as user specifies.

模式包括:The modes include:

ask-用户- 提示用户继续 ( "是" ) 或 ( "否" ) 时出现错误。ask-user - Prompts the user to continue('yes') or error out ('no').

错误- 控制台将显示错误并停止执行。error- The console displays an error and halts the execution.

继续- 控制台将继续执行。continue- The console proceeds with the execution.

默认模式为 " 错误"。The default mode is error.

示例:Example:

oror

重新连接提供程序: 这允许用户设置连接失败的重新连接设置大。Reconnect Provider: This allows the user to set the reconnection settings incase of connection failures. 这可为源服务器和目标服务器设置此项。This can be set for both source and target servers.

重新连接模式如下:The reconnection modes are:

重新连接到上次使用的-服务器:如果连接未处于活动状态,则它会尝试重新连接到最近5次使用的最后一个服务器。reconnect-to-last-used-server: If the connection is not active, it tries to reconnect to the last server used at most 5 times.

生成-错误:如果连接未处于活动状态,则会生成错误。generate-an-error: If the connection is not active, an error is generated.

默认模式为 " 生成-错误"。The default mode is generate-an-error.

示例:Example:

on-target-reconnect=""/>

oror

oror

on-source-reconnect="reconnect-to-last-used-server"

on-target-reconnect="generate-an-error"/>

转换器覆盖提供程序: 这使用户能够处理目标元数据库上已存在的对象。Converter Overwrite Provider: This enables the user to handle objects that are already present on the target metabase. 可能的操作包括:The possible actions include:

错误:控制台显示错误并停止执行。error: The console displays an error and halts the execution.

overwrite:覆盖现有对象值。overwrite: Overwrites existing object values. 默认情况下,此操作已完成。This action is done by default.

skip:控制台将跳过数据库中已存在的对象skip: The console skips the objects that already exist on the database

ask-user:提示用户输入 ( "是"/"否" )ask-user: Prompts the user for input ('yes'/ 'no')

示例:Example:

oror

必备组件提供程序: 这使用户能够处理处理命令所需的任何先决条件。Failed Prerequisites Provider: This enables the user to handle any prerequisites that are required for processing a command. 默认情况下,严格模式为 "false"。By default, strict-mode is 'false'. 如果设置为 "true",则会生成异常以满足先决条件。If it is set to 'true', an exception gets generated for failure to meet the prerequisites.

示例:Example:

停止操作: 在中间操作期间,如果用户想要停止操作,则可以使用 "Ctrl + C" 热键。Stop Operation: During the mid-operation, if the user wants to stop the operation, then 'Ctrl+C' hotkey can be used. SSMA for Oracle Console 将等待操作完成,并终止控制台执行。SSMA for Oracle Console will wait for the operation to complete and terminates the console execution.

如果用户想立即停止执行,则可以再次按 "Ctrl + C" 热键来 SSMA 控制台应用程序的突然终止。If the user wants to stop the execution immediately, then, 'Ctrl+C' hotkey can be pressed again for abrupt termination of the SSMA Console application.

进度提供程序: 通知每个控制台命令的进度。Progress Provider: Informs the progress of each console command. 此项已默认禁用。This is disabled by default. 进度报告属性包括:The progress-reporting attributes comprise:

关闭off

每隔1%every-1%

每隔2%every-2%

每5%every-5%

每隔10%every-10%

每隔20%every-20%

示例:Example:

report-messages="" (optional)

report-progress="every-1%/every-2%/every-5%/every-10%/every-20%/off" (optional)/>

oror

enable="" (optional)

report-messages="" (optional)

report-progress="every-1%/every-2%/every-5%/every-10%/every-20%/off" (optional)/>

记录器详细级别: 设置日志详细级别。Logger Verbosity: Sets log verbosity level. 这对应于 UI 中的 "所有类别" 选项。This corresponds with the All Categories option in the UI. 默认情况下,日志详细级别为 "错误"。By default, the log verbosity level is "error".

记录器级别选项包括:The logger-level options include:

严重错误:只记录致命错误消息。fatal-error: Only fatal-error messages are logged.

错误:只记录错误和严重错误消息。error: Only error and fatal-error messages are logged.

警告:记录除 "调试" 和 "信息" 消息以外的所有级别。warning: All levels except debug and info messages are logged.

信息:记录除调试消息以外的所有级别。info: All levels except debug messages are logged.

调试:记录的所有消息级别。debug: All levels of messages logged.

备注

必需的消息记录在任何级别。Mandatory messages are logged at any level.

示例:Example:

oror

替代加密密码: 如果为 "true",则在服务器连接文件或脚本文件的 "服务器定义" 部分中指定的明文密码将覆盖受保护存储区中存储的加密密码(如果存在)。Override Encrypted Password: If 'true', the clear text password specified in the server definition section of the server connection file or in the script file, overrides the encrypted password stored in protected storage if exists. 如果未指定明文形式的密码,则系统会提示用户输入密码。If no password is specified in clear text, the user is prompted to enter the password.

这里出现两种情况:Here two cases arise:

如果 override 选项为 false,则搜索顺序为 "受保护的存储- > 脚本文件- > 服务器连接文件- > 提示用户"。If override option is false, the order of search will be Protected storage->Script File->Server Connection File-> Prompt User.

如果 override 选项为 true,则搜索顺序为 "脚本文件- > 服务器连接文件- > 提示用户"。If override option is true, the order of search will be Script File->Server Connection File->Prompt User.

示例:Example:

不可配置的选项是:The non-configurable option is:

最大重新连接尝试: 如果已建立的连接超时或由于网络故障而中断,则需要重新连接服务器。Maximum Reconnect Attempts: When an established connection times out or breaks due to network failure, the server is required to be reconnected. 允许重新连接尝试最多执行 5 次重试,此时,控制台将自动执行重新连接。The reconnection attempts are allowed to a maximum of 5 retries after which, the console automatically performs the reconnection. 自动重新连接的功能可以减少重新运行脚本的工作量。The facility of automatic reconnection reduces your effort in rerunning the script.

服务器连接参数Server Connection Parameters

服务器连接参数可以在脚本文件中或服务器连接文件中定义。Server connection parameters can be defined in the script file or in the server connection file.

脚本命令Script Commands

脚本文件包含一系列 XML 格式的迁移工作流命令。The script file contains a sequence of migration workflow commands in the XML format. SSMA 控制台应用程序按脚本文件中显示的命令顺序处理迁移。The SSMA console application processes the migration in the order of the commands appearing in the script file.

例如,Oracle 数据库中特定表的典型数据迁移遵循: Schema 表的层次结构 > 。For example, a typical data migration of a specific table in an Oracle database follows the hierarchy of: Schema -> Table.

成功执行脚本文件中的所有命令后,SSMA 控制台应用程序将退出并将控件返回给用户。When all the commands in the script file are executed successfully, the SSMA console application exits and returns the control to the user. 脚本文件的内容具有更多或更少的静态,其中包含的变量信息包含在 创建变量值文件 (OracleToSQL) 或(在脚本文件的单独节中,用于变量值)。The contents of a script file are more or less static with variable information contained either in a Creating Variable Value Files (OracleToSQL) or, in a separate section within the script file for variable values.

示例:Example:

project-name=""

overwrite-if-exists=""/>

产品目录的 "示例控制台脚本" 文件夹中提供了包含3个脚本文件的模板 (用于执行各种方案) 、变量值文件和服务器连接文件:Templates consisting of 3 script files (for executing various scenarios), variable value file, and a server connection file are provided in the Sample Console Scripts folder of the product directory:

AssessmentReportGenerationSample.xmlAssessmentReportGenerationSample.xml

ConversionAndDataMigrationSample.xmlConversionAndDataMigrationSample.xml

SqlStatementConversionSample.xmlSqlStatementConversionSample.xml

VariableValueFileSample.xmlVariableValueFileSample.xml

ServersConnectionFileSample.xmlServersConnectionFileSample.xml

更改中显示的用于关联性的参数后,可以 (文件) 执行模板。You can execute the templates (files) after changing the parameters displayed therein for relevancy.

Complete list of script-commands can be found in Executing the SSMA Console (OracleToSQL)

脚本文件验证Script File Validation

用户可以根据 "架构" 文件夹中提供的架构定义文件 "O2SSConsoleScriptSchema" 轻松地对其脚本文件进行验证。The user can easily validate his/her script file against the schema definition file 'O2SSConsoleScriptSchema.xsd' available in the 'Schemas' folder.

下一步Next Step

另请参阅See Also

转载地址:http://hhudv.baihongyu.com/

你可能感兴趣的文章
Day19内容回顾
查看>>
第七次作业
查看>>
MySql update inner join!MySql跨表更新 多表update sql语句?如何将select出来的部分数据update到另一个表里面?...
查看>>
我最宏大的个人愿望
查看>>
北漂周记--第5记--拼命编程
查看>>
比赛总结一
查看>>
SpringBoot项目打包
查看>>
JSP的3种方式实现radio ,checkBox,select的默认选择值
查看>>
Linux操作系统 和 Windows操作系统 的区别
查看>>
《QQ欢乐斗地主》山寨版
查看>>
文件流的使用以及序列化和反序列化的方法使用
查看>>
Android-多线程AsyncTask
查看>>
第一个Spring冲刺周期团队进展报告
查看>>
C++函数基础知识
查看>>
红黑树 c++ 实现
查看>>
Android 获取网络链接类型
查看>>
报表服务框架:WEB前端UI
查看>>
5.9UDP客户端服务器-基于OK6410
查看>>
java自学基础、项目实战网站推荐
查看>>
软件包的使用
查看>>