可传输表空间

测试表空间

> hr
create tablespace trans_tbs datafile size 100M;
col tablespace_name format a30
col file_name format a100
select tablespace_name, file_name from dba_data_files order by tablespace_name;

测试用户

> hr
create user trans identified by trans default tablespace trans_tbs;
alter user trans quota unlimited on trans_tbs;
grant connect to trans;
grant create table to trans;
grant select on hr.jobs to trans;

测试表

> hr
conn trans/trans@source
create table trans_tb tablespace trans_tbs as select * from hr.jobs;
select count(*) from trans_tb;

测试表置为可读模式

> hr
alter tablespace trans_tbs read only;
select tablespace_name, status from dba_tablespaces;

测试目录对象

> hr
!mkdir /data/dump
create directory dump_dir as '/data/dump';
grant read, write on directory dump_dir to system;
col directory_name format a20
col directory_path format a40
select directory_name, directory_path from dba_directories where directory_name=upper('dump_dir');

导出表空间元数据

> expdp system/oracle@source directory=dump_dir dumpfile=trans_tbs.dump transport_tablespaces=trans_tbs logfile=trans_tbs.log

在这里插入图片描述

删除表空间

> hr
drop tablespace trans_tbs including contents;
select tablespace_name, status from dba_tablespaces;
select count(*) from trans_tb;
--drop tablespace trans_tbs including contents and datafile;

导入表空间元数据

> impdp system/oracle@source directory=dump_dir dumpfile=trans_tbs.dump transport_datafiles='/data/BPXTEST/CBB631BCB18D2105E0531CB40A0AD267/datafile/o1_mf_trans_tb_jnm3mn7s_.dbf' 

在这里插入图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值