天天看點

Oracle system表空間滿的暫定解決方法

Oracle system表空間滿的暫定解決方法

資料庫用的是Oracle Express 10.2版本的。利用Oracle Text做全文檢索應用,建立使用者yxl時沒有初始化預設表空間,在系統開發過程中我利用yxl在資料庫中建立了7個Context或Ctxcat類型索引。開始利用這些索引進行查詢的時候速度很慢,在控制台檢視了一下,發現system表空間居然占了99.69%。下面是表空間占用情況的截圖:

Oracle system表空間滿的暫定解決方法

在sqlplus中執行SQL語句:

Sql代碼  

Oracle system表空間滿的暫定解決方法
  1. select username,default_tablespace,temporary_tablespace from dba_users where username='YXL';  
select username,default_tablespace,temporary_tablespace from dba_users where username='YXL';      

執行結果:YXL  USERS  TEMP

未指定預設表空間而建立使用者,則系統應該是指定其預設為system表空間的,這裡不太清楚為什麼USERS成了yxl的預設表空間。

最後,我找到system表空間滿的暫定解決方法如下:

一、為system表空間另外新增一個資料檔案。

Oracle system表空間滿的暫定解決方法
  1. alter tablespace system add datafile 'D:\oracleXE\oradata\XE\system_01.dbf' resize 1024M;  
alter tablespace system add datafile 'D:\oracleXE\oradata\XE\system_01.dbf' resize 1024M;      

二、更改system表空間的資料檔案SYSTEM.dbf配置設定空間。

Sql代碼

Oracle system表空間滿的暫定解決方法
  1. alter database datafile 'D:\oracleXE\oradata\XE\system_01.dbf' autoextend on;  
  2. alter database datafile 'D:\oracleXE\oradata\XE\system_01.dbf' resize 1024M;