利用Impdp+Network将Oracle 11g数据迁移到Oracle 19c
补充:
1 Impdp+Network_link, 直接导入到目标库中(从dblink对应的远端库)
2 Expdp+Network_link,直接将远端库上的数据,导出到本地机器上
一、目标端
dblink
CREATE PUBLIC DATABASE LINK conn_old_11g
CONNECT TO system IDENTIFIED BY "oracle" USING '(DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.6.101)(PORT = 11521))) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = testdb)))';
directory :
create directory QN as '/home/db/oracle/from11g/QN';
创建用户并赋权限:
SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 TESTPDB READ WRITE NO
4 TESTPDB2 MOUNTED
5 MY_APP MOUNTED
6 SALESPDB2 MOUNTED
8 TESTPDB22 MOUNTED
9 SALESACT MOUNTED
10 SALESPDB MOUNTED
11 MY_APP2 MOUNTED
12 SALESACT$SEED MOUNTED
13 MY_APP3 MOUNTED
SQL> alter session set container=testpdb ;
SQL> create user qn identified by qn default tablespace qn ;
alter user qn quota unlimited on qn;
grant IMP_FULL_DATABASE to qn;
grant read,write on directory SYS.QN to qn ;
Impd+Network恢复:
恢复的parfile=11g.parfile:
oracle@node1:/home/db/oracle$ cat 11g.parfile
network_link=CONN_OLD_11G
cluster=n
content=metadata_only
schemas=QN,LMIS_HIS,GJIC,IM,GJJS,DC,YSJL,STAT
#job_name=job_qn
directory=QN
logfile=QN.log
logtime=all
parallel=2
#sqlfile=job_qn.sql
table_exists_action=replace
#exclude=statistics
#version=12.1.0.2
remap_tablespace=QN:QN,LMIS:QN,GJIC:QN,IM:QN,GJJS:QN,DC:QN,YSJL:QN,STAT:QN
remap_schema=QN:QN,LMIS:QN,GJIC:QN,IM:QN,GJJS:QN,DC:QN,YSJL:QN,STAT:QN
transform=OID:N
恢复过程:
oracle@node1:/home/db/oracle$ impdp qn/qn@192.168.66.144:1521/testpdb parfile=11g.parfile
Import: Release 19.0.0.0.0 - Production on Wed Apr 14 15:22:58 2021
Version 19.3.0.0.0
Copyright (c) 1982, 2019, Oracle and/or its affiliates. All rights reserved.
Connected to: Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
14-APR-21 15:23:06.468: Starting "QN"."SYS_IMPORT_SCHEMA_01": qn/********@192.168.66.144:1521/testpdb parfile=11g.parfile
14-APR-21 15:23:09.521: Processing object type SCHEMA_EXPORT/USER
14-APR-21 15:23:10.065: ORA-31684: Object type USER:"QN" already exists
————————————————
原文链接:https://blog.csdn.net/u010719917/article/details/115699788