Linux下Oracle数据迁移常用工具及方法如下:
适用场景:逻辑迁移(表结构+数据)。
步骤:
sqlplus / as sysdba → create or replace directory tmpDir as '/path';。expdp username/password@ip:port/service schemas=库名 directory=tmpDir dumpfile=export.dmp logfile=export.log;。scp -P 端口 /path/export.dmp 目标服务器:/path;。impdp username/password@ip:port/service schemas=库名 directory=tmpDir dumpfile=export.dmp job_name=job1;。适用场景:物理迁移(全量备份恢复)。
步骤:
rman target / → backup database plus archivelog;。rman target / → restore controlfile from '/path'; → restore database;。ALTER SYSTEM SET DB_FILE_NAME_CONVERT='/old/path,/new/path' SCOPE=SPFILE;。适用场景:实时数据同步/异构数据库迁移。
步骤:
extract和replicat进程。CREATE DIRECTORY、EXP_FULL_DATABASE等权限。PARALLEL=4)。工具选择建议:
参考来源: