数据库中的表分别分布在几个不同的表空间,如何他表都放到一个表空间?
解决方案 »
- 如果只有表空间能恢复库吗?
- 各位大哥哥,帮帮小妹忙了,不慎感激,我想问个统计sql写法,急哦,在线等!!
- DX请帮忙,由于买书不便,谁有“<<Oracle 9i 中文版数据库系统管理>>赵松涛著 人民邮电出版社” 电子版或网址
- 怎么查询某个表空间下所用用户使用空间的情况
- ORACLE的CLOB的数据类型调用出来是不是需要再转换才能显示呢 ?(在线等待.....)
- 求解:一些机器使用OraOLEDB的问题,请高手帮忙
- Oracle研发中心招人,高手快来看看
- 文本数据导入时出错:ORA--01632
- 创建触发器权限不足?!
- oracle12c,想在相关表里面找含有某个值的记录,为啥没有返回值
- 安装Oracle10g时出现“createfile error 32 when trying set file time”
- PL/SQL
alter table move tablespace
ALTER TABLE A MOVE TABLESPACE TEST;10G的文档是这么说的:
Moving a table changes the rowids of the rows in the table. This causes indexes on the table to be ed UNUSABLE, and DML accessing the table using these indexes will receive an ORA-01502 error. The indexes on the table must be dropped or rebuilt. Likewise, any statistics for the table become invalid and new statistics should be collected after moving the table.
CURSOR get_t IS
SSelect t.table_name
From User_Tables t;
begin
-- Test statements here
FOR rec_ IN get_t LOOP
Begin
Alter Table rec_.table_name Move Tablespace New_Tablespace;
EXCEPTION
WHEN OTHERS THEN
dbms_output.put_line('error:'||Sqlerrm);
END;
END LOOP;
end;
如果在执行EXP/EXPDP命令时,导出了索引的话,在IMP/IMPDP时,也会导入索引,而无需重建索引。
并且该命令支持并行操作。
现在是这样的,用imp导入的话,如果导入的新库中的表空间与dmp文件中含有的表空间信息一致的话,就是你指定自己的表空间也是没有用的。
比如,导出的dmp文件中有从users表空间导出的数据,那么你再倒入新库的时候,数据仍然会写到新库的users表空间,是没有办法更改的,入过新库没有users表空间,那么会报错吧。
alter user 用户名 quota 0 on user;
ALTER USER 用户名 QUOTA UNLIMITED ON 目的表空间;
imp/impdp在导入数据时,肯定可以将表导入指定的表空间中,方法是:
1、将目标用户的默认表空间改为要导入的表空间名称,并保证该用户在表空间上有足够的配额。
2、用户目标用户执行Imp/impdp操作。