您的位置:首页 > 理论基础 > 数据结构算法

ORA-01658:无法为表空间users中的段创建initial区

2017-11-09 10:10 525 查看
建表语句:

-- Create table
create table MODIFY_CARDPERSON
(
id   NUMBER(10) not null,
test CHAR(10)
)
tablespace USERS
pctfree 10
initrans 1
maxtrans 255
storage
(
initial 648M
next 1M
minextents 1
maxextents unlimited
);
-- Create/Recreate primary, unique and foreign key constraints
alter table MODIFY_CARDPERSON
add primary key (ID)
using index
tablespace USERS
pctfree 10
initrans 2
maxtrans 255;


执行插入语句报错,如下图:



--查看表空间
select b.file_name as "物理文件名",
b.tablespace_name as "表空间",
b.bytes / 1024 / 1024 as "大小M",
(b.bytes - sum(nvl(a.bytes, 0))) / 1024 / 1024 as "已使用M",
substr((b.bytes - sum(nvl(a.bytes, 0))) / (b.bytes) * 100, 1, 5) as "利用率"
from dba_free_space a, dba_data_files b
where a.file_id = b.file_id
group by b.tablespace_name, b.file_name, b.bytes
order by b.tablespace_name;




问题解决:可以像网上搜索出来的答案一样更改整个表空间的大小;也可以降低我们新创建的这个表的大小。

因为某些原因,我采用第二种方法。因为原来的大小是648MB, 那么我们改小一点改成6MB,再试一次就发现问题已经解决了。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息