[ 登录注册 ]

云计算

Oracle表空间不足的案例总结

2016-08-25 21:32:02 admin 返回上一页

1、问题描述:
Creating procedure PRO_ALTER_TABLES
===================================
CREATE OR REPLACE PROCEDURE PRO_ALTER_TABLES IS
*
ERROR at line 1:
ORA-00604: error occurred at recursive SQL level 1
ORA-01653: unable to extend table SYS.SOURCE$ by 1024 in tablespace SYSTEM


如上所示,创建存储过程或者函数时如果出现上面的错误,应该是表空间空间不够。


2、查看指定表空间大小(bytes指总共大小)
select bytes/1024/1024 ||'M' from dba_data_files where tablespace_name in ('SYS','SYSTEM');


3、查看所有表空间大小
SQL> select tablespace_name,(bytes/1024/1024) M from dba_data_files;


TABLESPACE_NAME M
------------------------------ ----------
USERS 5
UNDOTBS1       65
SYSAUX      570
SYSTEM      710
MYTEST      200


4、查看表空间对应的数据文件路径
SQL> select FILE_NAME,TABLESPACE_NAME from dba_data_files;
FILE_NAME
--------------------------------------------------------------------------------
TABLESPACE_NAME
------------------------------
/opt/oracle/oradata/ora11g/users01.dbf
USERS


/opt/oracle/oradata/ora11g/undotbs01.dbf
UNDOTBS1


/opt/oracle/oradata/ora11g/sysaux01.dbf
SYSAUX


/opt/oracle/oradata/ora11g/system01.dbf
SYSTEM
......


5、扩展表空间大小的几种方法
(1) 增加表空间数据文件大小
alter table move tablespace tablespace_name
SQL> alter database datafile '/opt/oracle/oradata/ora11g/system01.dbf' resize 5000M;
(2)增加一个数据文件到表空间
alter tablespace SYSTEM add datafile '/opt/oracle/oradata/ora11g/system02.dbf' size 200m;
(3)修改表空间自增长并且最大值为固定值
alter database datafile '/opt/oracle/oradata/ora11g/system01.dbf' autoextend on next 1M maxsize 100M;




文章来源:http://www.bozhiyue.com/cloud/2016/0825/432557.html
返回上一页    返回分类 上一篇:   下一篇:
相关