搜尋
首頁資料庫mysql教程把数据库从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迁移工具


把数据库从oracle迁移到PPAS
 

 

4


把数据库从oracle迁移到PPAS
 


 

5

在servers上右键点击增加迁移的源和目标数据库


把数据库从oracle迁移到PPAS
 

 

6

 


把数据库从oracle迁移到PPAS
 

 

7

在左侧oracle源数据库上右键点击要迁移的schema,现在在线迁移


把数据库从oracle迁移到PPAS
 

 

8

选择目标数据库,schema,点击run


把数据库从oracle迁移到PPAS
 

 

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 If null character is part of a column value, the data migrationfails over JDBC protocol. This option can be used to replace null characterwith a user-specified character.

-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.


陳述
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn
MySQL與Sqlite有何不同?MySQL與Sqlite有何不同?Apr 24, 2025 am 12:12 AM

MySQL和SQLite的主要區別在於設計理念和使用場景:1.MySQL適用於大型應用和企業級解決方案,支持高性能和高並發;2.SQLite適合移動應用和桌面軟件,輕量級且易於嵌入。

MySQL中的索引是什麼?它們如何提高性能?MySQL中的索引是什麼?它們如何提高性能?Apr 24, 2025 am 12:09 AM

MySQL中的索引是數據庫表中一列或多列的有序結構,用於加速數據檢索。 1)索引通過減少掃描數據量提升查詢速度。 2)B-Tree索引利用平衡樹結構,適合範圍查詢和排序。 3)創建索引使用CREATEINDEX語句,如CREATEINDEXidx_customer_idONorders(customer_id)。 4)複合索引可優化多列查詢,如CREATEINDEXidx_customer_orderONorders(customer_id,order_date)。 5)使用EXPLAIN分析查詢計劃,避

說明如何使用MySQL中的交易來確保數據一致性。說明如何使用MySQL中的交易來確保數據一致性。Apr 24, 2025 am 12:09 AM

在MySQL中使用事務可以確保數據一致性。 1)通過STARTTRANSACTION開始事務,執行SQL操作後用COMMIT提交或ROLLBACK回滾。 2)使用SAVEPOINT可以設置保存點,允許部分回滾。 3)性能優化建議包括縮短事務時間、避免大規模查詢和合理使用隔離級別。

在哪些情況下,您可以選擇PostgreSQL而不是MySQL?在哪些情況下,您可以選擇PostgreSQL而不是MySQL?Apr 24, 2025 am 12:07 AM

選擇PostgreSQL而非MySQL的場景包括:1)需要復雜查詢和高級SQL功能,2)要求嚴格的數據完整性和ACID遵從性,3)需要高級空間功能,4)處理大數據集時需要高性能。 PostgreSQL在這些方面表現出色,適合需要復雜數據處理和高數據完整性的項目。

如何保護MySQL數據庫?如何保護MySQL數據庫?Apr 24, 2025 am 12:04 AM

MySQL數據庫的安全可以通過以下措施實現:1.用戶權限管理:通過CREATEUSER和GRANT命令嚴格控制訪問權限。 2.加密傳輸:配置SSL/TLS確保數據傳輸安全。 3.數據庫備份和恢復:使用mysqldump或mysqlpump定期備份數據。 4.高級安全策略:使用防火牆限制訪問,並啟用審計日誌記錄操作。 5.性能優化與最佳實踐:通過索引和查詢優化以及定期維護兼顧安全和性能。

您可以使用哪些工具來監視MySQL性能?您可以使用哪些工具來監視MySQL性能?Apr 23, 2025 am 12:21 AM

如何有效監控MySQL性能?使用mysqladmin、SHOWGLOBALSTATUS、PerconaMonitoringandManagement(PMM)和MySQLEnterpriseMonitor等工具。 1.使用mysqladmin查看連接數。 2.用SHOWGLOBALSTATUS查看查詢數。 3.PMM提供詳細性能數據和圖形化界面。 4.MySQLEnterpriseMonitor提供豐富的監控功能和報警機制。

MySQL與SQL Server有何不同?MySQL與SQL Server有何不同?Apr 23, 2025 am 12:20 AM

MySQL和SQLServer的区别在于:1)MySQL是开源的,适用于Web和嵌入式系统,2)SQLServer是微软的商业产品,适用于企业级应用。两者在存储引擎、性能优化和应用场景上有显著差异,选择时需考虑项目规模和未来扩展性。

在哪些情況下,您可以選擇SQL Server而不是MySQL?在哪些情況下,您可以選擇SQL Server而不是MySQL?Apr 23, 2025 am 12:20 AM

在需要高可用性、高級安全性和良好集成性的企業級應用場景下,應選擇SQLServer而不是MySQL。 1)SQLServer提供企業級功能,如高可用性和高級安全性。 2)它與微軟生態系統如VisualStudio和PowerBI緊密集成。 3)SQLServer在性能優化方面表現出色,支持內存優化表和列存儲索引。

See all articles

熱AI工具

Undresser.AI Undress

Undresser.AI Undress

人工智慧驅動的應用程序,用於創建逼真的裸體照片

AI Clothes Remover

AI Clothes Remover

用於從照片中去除衣服的線上人工智慧工具。

Undress AI Tool

Undress AI Tool

免費脫衣圖片

Clothoff.io

Clothoff.io

AI脫衣器

Video Face Swap

Video Face Swap

使用我們完全免費的人工智慧換臉工具,輕鬆在任何影片中換臉!

熱工具

MantisBT

MantisBT

Mantis是一個易於部署的基於Web的缺陷追蹤工具,用於幫助產品缺陷追蹤。它需要PHP、MySQL和一個Web伺服器。請查看我們的演示和託管服務。

EditPlus 中文破解版

EditPlus 中文破解版

體積小,語法高亮,不支援程式碼提示功能

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

強大的PHP整合開發環境

Safe Exam Browser

Safe Exam Browser

Safe Exam Browser是一個安全的瀏覽器環境,安全地進行線上考試。該軟體將任何電腦變成一個安全的工作站。它控制對任何實用工具的訪問,並防止學生使用未經授權的資源。

SublimeText3 Mac版

SublimeText3 Mac版

神級程式碼編輯軟體(SublimeText3)