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 Solaris[tm] OE (32-bit) Big 0

2 Solaris[tm] 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>

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

相关推荐
码农研究僧12 分钟前
详细分析ip addr show 查看网络配置的命令
linux·tcp/ip·ip addr show
码狂☆14 分钟前
ubuntu连接orangepi-zero-2w桌面的几种方法
linux·ubuntu
学习向前冲31 分钟前
安装一键式重置密码插件(Linux)-CloudResetPwdAgent
linux·运维·服务器
石兴稳1 小时前
Ceph client 写入osd 数据的两种方式librbd 和kernel rbd
linux·ceph
FIN技术铺1 小时前
问:数据库的六种锁机制实践总结?
数据库·sql·oracle
程序员劝退师_2 小时前
优惠券秒杀的背后原理
java·数据库
Gauss松鼠会2 小时前
GaussDB全密态数据库等值查询
数据库·oracle·gaussdb
JSUITDLWXL2 小时前
在Oracle数据中更新整个对象和更新对象的某几个字段时,他们的锁是相同的吗
数据库·oracle
杏花春雨江南2 小时前
ddl/dml/dcl
数据库·oracle
大G哥2 小时前
python 数据类型----可变数据类型
linux·服务器·开发语言·前端·python