Oracle12c RAC data export to Oracle11g

 A, Oracle12c export data

1. Connect database

sqlplus / as sysdba

2. Check pdbs

show pdbs;

3. Switch pdb

alter session set container=spdb1pdb;

4. Specify the storage path dump

create directory dump as '/tmp/dumpdata';

5. Query table space and size

select tablespace_name,sum(bytes)/1048576 from cdb_data_files group by tablespace_name;

 

 6. Export Data

expdp user/passwd@localhost:1521/spdb1pdb directory=dump dumpfile=dump190809.dump logfile=dump190809.log version=11.2.0.4.0 cluster=n;

Note: The parameters given schemas = {}

The following error solution:

dump path / tmp / dumpdata, in New dumpdata tmp directory folder

Waiting for the export is complete

 

Two, Oracle11g import

 1. Check the log and export files

2. Copy the files to the server 11g

  scp dump190809.dump [email protected]:/tmp

 

Two reasons due to network server is down, can be copied to a corresponding server through other means

3. Connect Server 11g

sqlplus / as sysdba

4. Create a watch with space and temporary table space

create tablespace CLOUDDATA datafile '/u01/app/oracle/oradata/orcl/CLOUDDATA.dbf' size 500m REUSE autoextend on next 50M;

create temporary tablespace temp1 tempfile '/u01/app/oracle/oradata/orcl/temp1.dbf' size 100m REUSE autoextend on next 50M;

5.创建用户并赋权

CREATE USER USER IDENTIFIED BY PASSWD DEFAULT TABLESPACE CLOUDDATA TEMPORARY TABLESPACE temp1;

GRANT CONNECT, RESOURCE, DBA TO USER;

注:删除用户及清除SESSION

select sid,serial# from v$session where username='USER';

ALTER SYSTEM KILL SESSION '185,37315'; 

 

DROP USER USER CASCADE;

 

6.指定dump存放路径

create directory dump as '/tmp/dumpdata';

impdp user/passwd directory=dump dumpfile=dump190809.dump logfile=dump190809.log

等待导入完成,对此处报错忽略。

 

Guess you like

Origin www.cnblogs.com/sonnyBag/p/11330451.html