把数据库从oracle迁移到PPAS
PPAS有两个迁移工具,一个图形界面的,一个命令行的,下面以图形界面为例。 1 首先需要在目标数据库系统PPAS上建立和源库对应的用户和对等的权限,再建立目标数据库。 create user USERNAMEXXX withsuperuser password 'xxxxxx'; create database DatabaseNa
PPAS有两个迁移工具,一个图形界面的,一个命令行的,下面以图形界面为例。
1
首先需要在目标数据库系统PPAS上建立和源库对应的用户和对等的权限,再建立目标数据库。
create user " USERNAMEXXX " withsuperuser password 'xxxxxx';
create database DatabaseNameowner="TYTUTOR" encoding='utf8';
2
根据jre版本(当前环境是1.4版)把oracle数据库的驱动程序拷贝到如下目录
/opt/PostgresPlus/9.2AS/jre/lib/ext/ojdbc14.jar
3
运行PPAS迁移工具
4
5
在servers上右键点击增加迁移的源和目标数据库
6
7
在左侧oracle源数据库上右键点击要迁移的schema,现在在线迁移
8
选择目标数据库,schema,点击run
Ok了,开始迁移了,可以看过程中的信息提示或迁移日志文件,oracle迁移到pg可能有很多pl/sql的数据库对象都会失败,要迁到ppas就好多了,因为ppas有oracle兼容引擎。
都搞定后就可以迁移应用程序了,这又是一堆事。
PPAS还有个命令行的迁移工具,比图形界面可以有对迁移过程有更多控制,具体见下面其可带的参数:
ot@host1 9.2AS]#jre/bin/java -jar bin/edb-migrationtoolkit.jar -help
EnterpriseDBMigration Toolkit (Build 46)
Usage: runMTK[-options] SCHEMA
If no option isspecified, the complete schema will be imported.
where optionsinclude:
-help Display the application command-lineusage.
-version Display the application version information.
-verbose [on|off]Display application log messages on standard output (default: on).
-schemaOnly Import the schema object definitions only.
-dataOnly Import the table data only. When -tablesis in place, it imports data only for the selected tables. Note: If there areany FK constraints defined on target tables, use -truncLoad option along withthis option.
-sourcedbtypedb_type The -sourcedbtype option specifies the source database type. db_typemay be one of the following values: mysql, oracle, sqlserver, sybase,postgresql, enterprisedb. db_type is case-insensitive. By default, db_type is oracle.
-targetdbtypedb_type The -targetdbtype option specifies the target database type. db_typemay be one of the following values: oracle, sqlserver, postgresql,enterprisedb. db_type is case-insensitive. By default, db_type is enterprisedb.
-allTables Import all tables.
-tables LIST Import comma-separated list of tables.
-constraints Import the table constraints.
-indexes Import the table indexes.
-triggers Import the table triggers.
-allViews Import all Views.
-views LIST Import comma-separated list of Views.
-allProcs Import all stored procedures.
-procs LIST Import comma-separated list of storedprocedures.
-allFuncs Import all functions.
-funcs LIST Import comma-separated list of functions.
-allPackages Import all packages.
-packages LISTImport comma-separated list of packages.
-allSequences Import all sequences.
-sequences LISTImport comma-separated list of sequences.
-targetSchemaNAME Name of the target schema (default: target schema is named after sourceschema).
-allDBLinks Import all Database Links.
-allSynonyms It enables the migration of all public andprivate synonyms from an Oracle database to an Advanced Server database. If a synonym with the same name alreadyexists in the target database, the existing synonym will be replaced with themigrated version.
-allPublicSynonyms It enables the migration of all publicsynonyms from an Oracle database to an Advanced Server database. If a synonym with the same name alreadyexists in the target database, the existing synonym will be replaced with themigrated version.
-allPrivateSynonyms It enables the migration of all privatesynonyms from an Oracle database to an Advanced Server database. If a synonym with the same name alreadyexists in the target database, the existing synonym will be replaced with themigrated version.
-dropSchema[true|false] Drop the schema if it already exists in the target database(default: false).
-truncLoad It disables any constraints on target tableand truncates the data from the table before importing new data. This optioncan only be used with -dataOnly.
-safeMode Transfer data in safe mode using plain SQLstatements.
-copyDelimiter Specify a single character to be used asdelimiter in copy command when loading table data. Default is \t
-batchSize Specify the Batch Size to be used by thebulk inserts. Valid values are 1-1000,default batch size is 1000, reduce if you run into Out of Memory exception
-cpBatchSize Specify the Batch Size in MB, to be used inthe Copy Command. Valid value is > 0, default batch size is 8 MB
-fetchSize Specify fetch size in terms of number ofrows should be fetched in result set at a time. This option can be used whentables contain millions of rows and you want to avoid out of memory errors.
-filterProp The properties file that contains tablewhere clause.
-skipFKConst Skip migration of FK constraints.
-skipCKConst Skip migration of Check constraints.
-ignoreCheckConstFilter By default MTK does not migrate Checkconstraints and Default clauses from Sybase, use this option to turn off thisfilter.
-fastCopy Bypass WAL logging to perform the COPYoperation in an optimized way, default disabled.
-customColTypeMappingLIST Use custom type mapping representedby a semi-colon separated list, where each entry is specified usingCOL_NAME_REG_EXPR=TYPE pair. e.g. .*ID=INTEGER
-customColTypeMappingFilePROP_FILE The custom type mappingrepresented by a properties file, where each entry is specified usingCOL_NAME_REG_EXPR=TYPE pair. e.g. .*ID=INTEGER
-offlineMigration[PATH] This performs offline migration and saves the DDL/DML scripts in filesfor a later execution. By default the script files will be saved under userhome folder, if required follow -offlineMigration option with a custom path.
-logDir LOG_PATHSpecify a custom path to save the log file. By default, on Linux the logs willbe saved under folder $HOME/.enterprisedb/migration-toolkit/logs. In case ofWindows logs will be saved under folder%HOMEDRIVE%%HOMEPATH%\.enterprisedb\migration-toolkit\logs.
-copyViaDBLinkOraThis option can be used to copy data using dblink_ora COPY commad. This optioncan only be used in Oracle to EnterpriseDB migration mode.
-singleDataFile Use single SQL file for offline datastorage for all tables. This option cannot be used in COPY format.
-allUsers Import allusers and roles from the source database.
-users LISTImport the selected users/roles from the source database. LIST is acomma-separated list of user/role names e.g. -users MTK,SAMPLE
-allRules Importall rules from the source database.
-rules LIST Importthe selected rules from the source database. LIST is a comma-separated list ofrule names e.g. -rules high_sal_emp,low_sal_emp
-allGroups Importall groups from the source database.
-groups LISTImport the selected groups from the source database. LIST is a comma-separatedlist of group names e.g. -groups acct_emp,mkt_emp
-allDomainsImport all domain, enumeration and composite types from the source database.
-domains LISTImport the selected domain, enumeration and composite types from the sourcedatabase. LIST is a comma-separated list of domain names e.g. -domainsd_email,d_dob, mood
-objecttypes Import the user-defined object types.
-replaceNullChar
-importPartitionAsTable[LIST] Use this option to import Oracle Partitioned table as a normal table inEnterpriseDB. To apply the rule on a selected set of tables, follow the optionby a comma-separated list of table names.
-enableConstBeforeDataLoadUse this option to re-enable constraints (and triggers) before data load. Thisis useful in the scenario when the migrated table is mapped to a partitiontable in EnterpriseDB.
-checkFunctionBodies[true|false] When set to false, it disables validation of the function bodyduring function creation, this is to avoid errors if function contains forwardreferences. Applicable when target database is Postgres/EnterpriseDB, defaultis true.
-retryCount VALUE Specify the number of re-attempts performedby MTK to migrate objects that failed due to cross-schema dependencies. TheVALUE parameter should be greater than 0, default is 2.
-analyze It invokes ANALYZE operation against a targetPostgres or Postgres Plus Advanced Server database. The ANALYZE collectsstatistics for the migrated tables that are utilized for efficient query plans.
-vacuumAnalyze It invokes VACUUM and ANALYZE operationsagainst a target Postgres or Postgres Plus Advanced Server database. The VACUUMreclaims dead tuple storage whereas ANALYZE collects statistics for themigrated tables that are utilized for efficient query plans.
-loaderCountVALUE Specify the number of jobs (threads)to perform data load in parallel. The VALUE parameter should be greater than 0,default is 1.
DatabaseConnection Information:
The applicationwill read the connectivity information for the source and target databaseservers from toolkit.properties file.
Refer to MTKreadme document for more information.

热AI工具

Undresser.AI Undress
人工智能驱动的应用程序,用于创建逼真的裸体照片

AI Clothes Remover
用于从照片中去除衣服的在线人工智能工具。

Undress AI Tool
免费脱衣服图片

Clothoff.io
AI脱衣机

Video Face Swap
使用我们完全免费的人工智能换脸工具轻松在任何视频中换脸!

热门文章

热工具

记事本++7.3.1
好用且免费的代码编辑器

SublimeText3汉化版
中文版,非常好用

禅工作室 13.0.1
功能强大的PHP集成开发环境

Dreamweaver CS6
视觉化网页开发工具

SublimeText3 Mac版
神级代码编辑软件(SublimeText3)

热门话题

MySQL是一种开源的关系型数据库管理系统,主要用于快速、可靠地存储和检索数据。其工作原理包括客户端请求、查询解析、执行查询和返回结果。使用示例包括创建表、插入和查询数据,以及高级功能如JOIN操作。常见错误涉及SQL语法、数据类型和权限问题,优化建议包括使用索引、优化查询和分表分区。

Oracle 打不开的解决办法包括:1. 启动数据库服务;2. 启动监听器;3. 检查端口冲突;4. 正确设置环境变量;5. 确保防火墙或防病毒软件未阻止连接;6. 检查服务器是否已关闭;7. 使用 RMAN 恢复损坏的文件;8. 检查 TNS 服务名称是否正确;9. 检查网络连接;10. 重新安装 Oracle 软件。

选择MySQL的原因是其性能、可靠性、易用性和社区支持。1.MySQL提供高效的数据存储和检索功能,支持多种数据类型和高级查询操作。2.采用客户端-服务器架构和多种存储引擎,支持事务和查询优化。3.易于使用,支持多种操作系统和编程语言。4.拥有强大的社区支持,提供丰富的资源和解决方案。

解决 Oracle 游标关闭问题的方法包括:使用 CLOSE 语句显式关闭游标。在 FOR UPDATE 子句中声明游标,使其在作用域结束后自动关闭。在 USING 子句中声明游标,使其在关联的 PL/SQL 变量关闭时自动关闭。使用异常处理确保在任何异常情况下关闭游标。使用连接池自动关闭游标。禁用自动提交,延迟游标关闭。

Oracle 中,FOR LOOP 循环可动态创建游标, 步骤为:1. 定义游标类型;2. 创建循环;3. 动态创建游标;4. 执行游标;5. 关闭游标。示例:可循环创建游标,显示前 10 名员工姓名和工资。

要停止 Oracle 数据库,请执行以下步骤:1. 连接到数据库;2. 优雅关机数据库(shutdown immediate);3. 完全关机数据库(shutdown abort)。

可以通过使用 Oracle 的动态 SQL 来根据运行时输入创建和执行 SQL 语句。步骤包括:准备一个空字符串变量来存储动态生成的 SQL 语句。使用 EXECUTE IMMEDIATE 或 PREPARE 语句编译和执行动态 SQL 语句。使用 bind 变量传递用户输入或其他动态值给动态 SQL。使用 EXECUTE IMMEDIATE 或 EXECUTE 执行动态 SQL 语句。

在CentOS系统上搭建Hadoop分布式文件系统(HDFS)需要多个步骤,本文提供一个简要的配置指南。一、前期准备安装JDK:在所有节点上安装JavaDevelopmentKit(JDK),版本需与Hadoop兼容。可从Oracle官网下载安装包。环境变量配置:编辑/etc/profile文件,设置Java和Hadoop的环境变量,使系统能够找到JDK和Hadoop的安装路径。二、安全配置:SSH免密登录生成SSH密钥:在每个节点上使用ssh-keygen命令
