Oracle 19C 传输表空间之-Windows 至 Linux

1、源端步骤(Windows )

SQL> col platform_name for a40

SQL> SELECT * FROM V$TRANSPORTABLE_PLATFORM ORDER BY PLATFORM_ID;

PLATFORM_ID PLATFORM_NAME ENDIAN_FORMAT CON_ID


1 Solaristm OE (32-bit) Big 0

2 Solaristm OE (64-bit) Big 0

3 HP-UX (64-bit) Big 0

4 HP-UX IA (64-bit) Big 0

5 HP Tru64 UNIX Little 0

6 AIX-Based Systems (64-bit) Big 0

7 Microsoft Windows IA (32-bit) Little 0

8 Microsoft Windows IA (64-bit) Little 0

9 IBM zSeries Based Linux Big 0

10 Linux IA (32-bit) Little 0

11 Linux IA (64-bit) Little 0

PLATFORM_ID PLATFORM_NAME ENDIAN_FORMAT CON_ID


12 Microsoft Windows x86 64-bit Little 0

13 Linux x86 64-bit Little 0

15 HP Open VMS Little 0

16 Apple Mac OS Big 0

17 Solaris Operating System (x86) Little 0

18 IBM Power Based Linux Big 0

19 HP IA Open VMS Little 0

20 Solaris Operating System (x86-64) Little 0

21 Apple Mac OS (x86-64) Little 0

22 Linux OS (S64) Big 0

21 rows selected.

SQL> SELECT d.PLATFORM_NAME,ENDIAN_FORMAT FROM VTRANSPORTABLE_PLATFORM tp, VDATABASE d WHERE tp.PLATFORM_NAME =d.PLATFORM_NAME;

PLATFORM_NAME ENDIAN_FORMAT


Microsoft Windows x86 64-bit Little

SQL> select file_name from dba_data_files where TABLESPACE_NAME='USERS';

FILE_NAME


C:\APP\DB_DATA\UTBS\USERS01.DBF

SQL> create tablespace test datafile 'C:\APP\DB_DATA\UTBS\test01.dbf' size 1M autoextend on;

Tablespace created.

SQL> create user ahern identified by ahern default tablespace test quota unlimited on test;

User created.

SQL> grant connect,resource to ahern;

Grant succeeded.

SQL> conn ahern/ahern;

Connected.

SQL> create table t1(id number, name varchar2(30));

Table created.

SQL> insert into t1 values(1, 'ASDFG');

1 row created.

SQL> insert into t1 values(2, 'QWERT');

1 row created.

SQL> commit;

Commit complete.

SQL> select * from t1;

ID NAME


1 ASDFG

2 QWERT

SQL> conn / as sysdba

Connected.

SQL> create directory dir as 'C:\app\db_dump\';

Directory created.

SQL> grant read,write on directory dir to ahern;

Grant succeeded.

SQL> execute dbms_tts.transport_set_check(ts_list => 'TEST',incl_constraints => TRUE,full_check => TRUE);

PL/SQL procedure successfully completed.

SQL> select * from transport_set_violations;

no rows selected

SQL> alter tablespace TEST read only;

Tablespace altered.

SQL> select tablespace_name,status from dba_tablespaces where tablespace_name='TEST';

TABLESPACE_NAME STATUS


TEST READ ONLY

expdp sys/oracle dumpfile=test.dmp directory=dir transport_tablespaces=TEST transport_full_check=y logfile=test.log

源端转化

rman target /

convert tablespace 'TEST'

to platform 'Linux x86 64-bit'

from platform 'Microsoft Windows x86 64-bit' format 'C:\app\db_dump\%N_%f'

PARALLELISM 8;

拷贝文件至目标端

cp C:\app\db_dump\test.dmp target_IP:/u01/dump/test.dmp

cp C:\app\db_dump\TEST_5 target_IP:/u01/app/oracle/oradata/ZZH/TEST_5

2、目标端步骤 (Oel 7.5):

SQL> create user ahern identified by ahern;

SQL> grant connect,resource to ahern;

impdp \'/as sysdba\' directory=dir dumpfile=test.dmp transport_datafiles='/u01/app/oracle/oradata/ZZH/test_5' logfile=test.log

这里也可以使用 remap_schema remap_tablespace 做映射

传输完成后验证数据,以及修改用户权限、默认表空间等:

oracle@oel ZZH$ sqlplus ahern/ahern

SQL*Plus: Release 19.0.0.0.0 - Production on Tue May 7 11:28:23 2024

Version 19.3.0.0.0

Copyright (c) 1982, 2019, Oracle. All rights reserved.

Connected to:

Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production

Version 19.3.0.0.0

SQL> select * from t1;

ID NAME


1 ASDFG

2 QWERT

SQL>

到此表空间简单传输完成。

相关推荐
●VON3 小时前
鸿蒙Flutter实战:分类管理页BottomSheet CRUD
数据库·flutter·华为·harmonyos·鸿蒙
Cosolar3 小时前
Chroma向量库面试学习指南
数据库·人工智能·面试·职场和发展·数据库架构
2301_809051143 小时前
Linux 网络编程 学习笔记
linux·网络·学习
坤昱3 小时前
cfs调度类深入解刨——最新内核细节分析2
linux·服务器·cfs·cfs调度·eevdf调度·eevdf·kernel 7.1
艾莉丝努力练剑4 小时前
【Linux:文件】Ext系列文件系统进阶
linux·运维·服务器·c++·文件系统·文件io·ext
海市公约4 小时前
Linux核心基础命令与权限管理实战指南
linux·运维·服务器·vim·权限管理·系统监控·命令行
eggcode4 小时前
【Qt学习】Linux(ARM架构)在线安装Qt6.x
linux·qt·学习·arm
wkd_0074 小时前
Ubuntu 22.04 Samba 连接故障排查记:从“用户名或密码错误”到 NTLM 版本不兼容
linux·运维·ubuntu
企服AI产品测评局4 小时前
Agent适配信创环境实测:企业级自动化如何实现国产操作系统与数据库全兼容?
运维·数据库·人工智能·ai·chatgpt·自动化
cfm_29144 小时前
Redis数据安全性解析
数据库·redis·缓存