当前位置:数据库 > Oracle >>

几个Oracle的小问题:1、怎么在创建表的同时定义表属于哪个表空间?2、创建完表后用什么语句也同样效果?

急用,谢谢!
答案:在创建表的语句后面写tablespace 表空间名
create table SCOTT.BONUS
(
  ENAME VARCHAR2(10),
  JOB   VARCHAR2(9),
  SAL   NUMBER,
  COMM  NUMBER
)
tablespace USERS
修改表空间
alter table table_name move tablespace tablespace_name;
其他:直接在语句后面加tablespace。可以把表Move到指定表空间 create table test_1 (a int ) tablespace users;
create table test_1 tablespace users as select * from tabs;
alter table test_1 move tablespace users;  如果有索引还需要对索引进行rebuild,以避免索引失效
alter index idx_name rebuild; 

上一个:运行exp备份oracle数据库提示oracle-12154错误
下一个:oracle 数据库中怎么删除表内容?

Oracle
MySQL
Access
SQLServer
DB2
Excel
SQLite
SYBASE
Postgres
如果你遇到数据库难题:
请访问www.zzzyk.com 试试
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,