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

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/qq_22073849/article/details/78467977

建表语句:


-- 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,再试一次就发现问题已经解决了。

猜你喜欢

转载自blog.csdn.net/qq_22073849/article/details/78467977
今日推荐