oracle把表移到另一个表空间,将表迁移至其他表空间

实验环境:REDHAT 5.5 X64系统+ORACLE10.2.0.4

实验要求:将表迁移至其他表空间

实验过程

建立源表空间及用户

create tablespace test1 datafile '/home/oracle/oradata/orcl/test101.dat'

size 100m;

create tablespace test2 datafile '/home/oracle/oradata/orcl/test102.dat'

size 100m;

create user test identified

by test default tablespace test1 temporary tablespace temp;

grant

resource,connect,dba to test;

create table test.testtp

as (select * from dba_object_tables);

create table

test.testtp1 as (select * from dba_object_tables);

create table

test.testtp2 as (select * from dba_object_tables);

create table

test.testtp3 as (select * from dba_object_tables);

conn test/test

create index

testtpi on ttesttp(table_name) tablespace test1;

create index

testtp1i on testtp1(table_name) tablespace test1;

create index

testtp2i on testtp2(table_name) tablespace test1;

create index

testtp3i on testtp3(table_name) tablespace test1;

1.查询当前表空间所包含表

select

table_name ,tablespace_name from dba_tables where tablespace_name = 'TEST1';

2.查询当前用户默认表空间

select

username,default_tablespace from dba_users where username = 'TE

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值