Oracle RAC迁移到Oracle单实例 -- 使用导出导入

本实验注意模拟在不同的schema、tablespace,使用remap_schema和remap_tablespace参数

https://www.cndba.cn/hbhe0316/article/4856

1.RAC端导出数据

https://www.cndba.cn/hbhe0316/article/4856
[oracle@rac01 backup]$ expdp c##hbhe0316/wwwwww schemas=c##hbhe0316 directory=backup dumpfile=tbs02_20211003.dmp logfile=20211003dmp.log

Export: Release 19.0.0.0.0 - Production on Sun Oct 3 11:18:59 2021
Version 19.12.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

Warning: Oracle Data Pump operations are not typically needed when connected to the root or seed of a container database.

Starting "C##HBHE0316"."SYS_EXPORT_SCHEMA_01":  c##hbhe0316/******** schemas=c##hbhe0316 directory=backup dumpfile=tbs02_20211003.dmp logfile=20211003dmp.log 
Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA
Processing object type SCHEMA_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS
Processing object type SCHEMA_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
Processing object type SCHEMA_EXPORT/STATISTICS/MARKER
Processing object type SCHEMA_EXPORT/SYSTEM_GRANT
Processing object type SCHEMA_EXPORT/ROLE_GRANT
Processing object type SCHEMA_EXPORT/DEFAULT_ROLE
Processing object type SCHEMA_EXPORT/PRE_SCHEMA/PROCACT_SCHEMA
Processing object type SCHEMA_EXPORT/TABLE/TABLE
 Processing object type SCHEMA_EXPORT/TABLE/COMMENT
Processing object type SCHEMA_EXPORT/TABLE/INDEX/INDEX
. . exported "C##HBHE0316"."T1"                          3.973 MB   72710 rows
Master table "C##HBHE0316"."SYS_EXPORT_SCHEMA_01" successfully loaded/unloaded
******************************************************************************
Dump file set for C##HBHE0316.SYS_EXPORT_SCHEMA_01 is:
  /home/oracle/backup/tbs01_20211003.dmp
Job "C##HBHE0316"."SYS_EXPORT_SCHEMA_01" successfully completed at Sun Oct 3 11:20:28 2021 elapsed 0 00:01:28

2.单实例端创建测试表空间、用户。https://www.cndba.cn/hbhe0316/article/4856

SQL> create tablespace tbs02 datafile '/oradata/ORCL/tbs02.dbf' size 1024m;

Tablespace created.

SQL> create user c##hbhe0317 identified by wwwwww default tablespace tbs02 temporary tablespace temp;

User created.

SQL>   grant dba to c##hbhe0317;

Grant succeeded.

SQL> grant connect to c##hbhe0317;

Grant succeeded.

SQL> grant resource to c##hbhe0317;

Grant succeeded.

SQL> conn c##hbhe0317/wwwwww
Connected.

3.将导出的数据scp至单机环境https://www.cndba.cn/hbhe0316/article/4856https://www.cndba.cn/hbhe0316/article/4856

[oracle@rac01 backup]$ scp tbs02_20211003.dmp 192.168.56.100:/oradata/backup

4.导入数据至单实例环境

[oracle@db01 backup]$ impdp c##hbhe0316/wwwwww directory=backup remap_schema=c##hbhe0316:c##hbhe0317 remap_tablespace=tbs01:tbs02 dumpfile=tbs02_20211003.dmp

Import: Release 19.0.0.0.0 - Production on Sun Oct 3 11:27:49 2021
Version 19.12.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

Warning: Oracle Data Pump operations are not typically needed when connected to the root or seed of a container database.

Master table "C##HBHE0316"."SYS_IMPORT_FULL_01" successfully loaded/unloaded
Starting "C##HBHE0316"."SYS_IMPORT_FULL_01":  c##hbhe0316/******** directory=backup remap_schema=c##hbhe0316:c##hbhe0317 remap_tablespace=tbs01:tbs02 dumpfile=tbs02_20211003.dmp 
Processing object type SCHEMA_EXPORT/SYSTEM_GRANT
Processing object type SCHEMA_EXPORT/ROLE_GRANT
Processing object type SCHEMA_EXPORT/DEFAULT_ROLE
Processing object type SCHEMA_EXPORT/PRE_SCHEMA/PROCACT_SCHEMA
Processing object type SCHEMA_EXPORT/TABLE/TABLE
Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA
. . imported "C##HBHE0317"."T1"                          3.973 MB   72710 rows
Processing object type SCHEMA_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
Processing object type SCHEMA_EXPORT/STATISTICS/MARKER
Job "C##HBHE0316"."SYS_IMPORT_FULL_01" successfully completed at Sun Oct 3 11:28:16 2021 elapsed 0 00:00:26

5.验证https://www.cndba.cn/hbhe0316/article/4856https://www.cndba.cn/hbhe0316/article/4856

https://www.cndba.cn/hbhe0316/article/4856
https://www.cndba.cn/hbhe0316/article/4856
https://www.cndba.cn/hbhe0316/article/4856
SQL> conn c##hbhe0317/wwwwww
Connected.
SQL> select count(*) from t1;

  COUNT(*)
----------
     72710

版权声明:本文为博主原创文章,未经博主允许不得转载。

Linux,oracle

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值