已经设置表空间自增还是报错ORA-01653

--查看表空间的使用情况
SELECT UPPER(F.TABLESPACE_NAME) "表空间名",
       D.TOT_GROOTTE_MB "表空间大小(M) ",
       D.TOT_GROOTTE_MB - F.TOTAL_BYTES "已使用空间(M)",
       TO_CHAR(ROUND((D.TOT_GROOTTE_MB - F.TOTAL_BYTES) / D.TOT_GROOTTE_MB * 100,
                     2),
               '990.99') "使用比",
       F.TOTAL_BYTES "空闲空间(M) ",
       F.MAX_BYTES "最大块(M) "
  FROM (SELECT TABLESPACE_NAME,
               ROUND(SUM(BYTES) / (1024 * 1024), 2) TOTAL_BYTES,
               ROUND(MAX(BYTES) / (1024 * 1024), 2) MAX_BYTES
          FROM SYS.DBA_FREE_SPACE
         GROUP BY TABLESPACE_NAME) F,
       (SELECT DD.TABLESPACE_NAME,
               ROUND(SUM(DD.BYTES) / (1024 * 1024), 2) TOT_GROOTTE_MB
          FROM SYS.DBA_DATA_FILES DD
         GROUP BY DD.TABLESPACE_NAME) D
 WHERE D.TABLESPACE_NAME = F.TABLESPACE_NAME
 ORDER BY 4 DESC

已经设置表空间自增还是报错ORA-01653_第1张图片

SELECT T.TABLESPACE_NAME,
       D.FILE_NAME,
       D.AUTOEXTENSIBLE,
       D.BYTES,
       D.MAXBYTES,
       D.STATUS
  FROM DBA_TABLESPACES T, DBA_DATA_FILES D
 WHERE T.TABLESPACE_NAME = D.TABLESPACE_NAME
 ORDER BY TABLESPACE_NAME, FILE_NAME;

已经设置表空间自增还是报错ORA-01653_第2张图片

--增加数据文件并允许自动增长 
ALTER TABLESPACE ***_TRD ADD DATAFILE 
‘D:\ORACLE\PRODUCT\10.2.0\ORADATA\DBFILE\TRD_2.DBF’ SIZE 1024M AUTOEXTEND ON NEXT 8M MAXSIZE 10240M;

方法2:

--删除用户停掉Tomcat
drop user sxjm_base cascade;
--删除表空间
DROP TABLESPACE sxjm_base INCLUDING CONTENTS AND DATAFILES;
--创建用户并指定表空间
create tablespace sxjm_base
    logging  
    datafile 'F:\ORACLE\ORADATA\ORCL\sxjm_base.dbf' 
    size 50m  
    autoextend on  
    next 50m maxsize 30720m  
    extent management local;
create user sxjm_base
  identified by sxjm_base
  default tablespace sxjm_base
  temporary tablespace TEMP
  profile DEFAULT
  password expire;
--给用户授予权限
grant connect to sxjm_base;
grant dba to sxjm_base;
grant resource to sxjm_base;
grant unlimited tablespace to sxjm_base;
--imp去cmd中执行 
--imp sxjm_base/sxjm_base@orcl file=E:\work\数据库\wpsale0712\wpsale.dmp

你可能感兴趣的:(工作总结)