当前位置:网站首页>可移动表空间
可移动表空间
2022-07-26 12:19:00 【青木与风】
目录
1.创建实验用表空间
$ . oranev
$ sqlplus / as sysdba
SQL>conn / as sysdba
SQL>create tablespace trans_tbs datafile '/home/oracle/trans01.dbf'
2 size 20M;

2 创建测试用户 trans
SQL>create user trans identified by trans
2 default tablespace trans_tbs;

3 修改用户权限
SQL>alter user trans quota unlimited on trans_tbs;
SQL>grant connect to trans;
SQL>grant create table to trans;
SQL>grant select on hr.employees to trans;

4 创建实验表
SQL>conn trans/trans;
SQL>create table trans_tb tablespace trans_tbs
2 as select * from hr.employees;

5 将移动表空间修改为只读模式
SQL>conn / as sysdba

6 使用数据泵导出 TRANS_TBS 表空间元数据
$ expdp system/oracle_4U directory=udbs_dir dumpfile=trans.dump TRANSPORT_TABLESPACES=trans_tbs_

7 删除 TRANS_TBS 表空间
SQL>drop tablespace trans_tbs including contents;
SQL>conn trans/trans
SQL>select count(*) from trans_tb;

注意:不要同时删除数据文件。
8 使用数据泵导入可移动表空间元数据
$ impdp system/oracle_4U directory=udbs_dir dumpfile=trans.dump transport_datafiles='/homeoracle/trans01.dbf'_

9 验证数据
SQL>conn / as sysdba
SQL>select name from v$database;
SQL>select count(*) from trans.trans_tb;

边栏推荐
猜你喜欢
随机推荐
What is oom, why it happens and some solutions
Overseas app push (Part 2): Channel Integration Guide for overseas manufacturers
常用的 list.isEmpty() 为何突然报null?
三维点云课程(八)——特征点匹配
STM32 drives hc05 Bluetooth serial port communication module
腾讯云与智慧产业事业群(CSIG)调整组织架构,成立数字孪生产品部
详解勒让德变换与共轭函数
Introduction to FPGA (II) - one out of two selector
Backtracking - question 51 Queen n -- a classic backtracking problem that must be overcome
.eslintrc.js配置说明
HTAP是有代价的
Uniapp H5, APP references external online JS
什么是OOM,为什么会OOM及一些解决方法
DS-24C/DC220V时间继电器
Pytest interface automation test framework | execute use cases through markup expressions
基于STM32的SIM900A发送中文和英文短信
3D point cloud course (VIII) -- feature point matching
[MySQL constraint]
RFID的工作原理
You Yuxi recommends vite to beginners [why use vite]










