歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux綜合 >> Linux資訊 >> 更多Linux >> 某個數據文件損壞,如何打開數據庫?(for Linux)

某個數據文件損壞,如何打開數據庫?(for Linux)

日期:2017/2/27 14:17:31   编辑:更多Linux
  >

某個數據文件損壞,如何打開數據庫? (for Linux) PuJiang Science Park Of ShangHai 、 jccz_zys_zhouys 最近做開發時不小心刪除了創建的數據庫表空間文件,導致服務器重新啟動時普通用戶 不能夠正常登陸。網上有一篇此類文章是針對winnt和Oracle8i的。我通過簡單的嘗試即解決了此問題,過程如下: 系統環境: 1、操作系統:RedHat Advanced Server,機器內存512M 2、數據庫: Oracle 9i Release 9.2.0.1.0 for linux 3、安裝路徑:/home/oracle/ora 錯誤現象: 因誤操作,數據庫中某一數據文件被誤刪, Oracle相關服務顯示已啟動,用SQL*Plus可以連接sys DBA用戶,但普通用戶無法連接, 顯示以下錯誤 ORA-01033: ORACLE initialization or shutdown in progress 模擬現象: create tablespace tablespace_ecms datafile '/home/oracle/ora/prodUCts/9.2.0/oradata/ora9i/tablespace_ecms.dbf' size 512M extent management local autoallocate --default storage (initial 128k next 2M pctincrease 0) online; shutdown 在操作系統中刪除tablespace_ecms.dbf文件 [oracle@js-oracle oracle]$ sudo - oracle -c "dbstart" >> /var/log/oracle [oracle@js-oracle oracle]$ sudo - oracle -c "lsnrctl start" >> /var/log/oracle 在客戶端PL/SQL工具中正常連接sys DBA用戶,但數據庫沒有打開,同時普通用戶無法連接, 顯示以下錯誤 ORA-01033: ORACLE initialization or shutdown in progress 解決方法: 先讓該數據文件脫機,就可以打開數據庫 --NOARCHIVELOG模式命令 [oracle@js-oracle oracle]$ sqlplus /NOLOG SQL> connect sys/wellhope as sysdba SQL> alter database datafile '/home/oracle/ora/products/9.2.0/oradata/ora9i/tablespace_ecms.dbf' offline drop; SQL> alter database open; --則數據庫正常打開 SQL> select file#,name,status from v$datafile; SQL> drop tablespace tablespace_ecms INCLUDing contents; 表空間已丟棄。 如有不足,請指正。 [email protected]




Copyright © Linux教程網 All Rights Reserved