增
alter database backup controlfile to trace as 'e:\oracle11g\oradata\orcl\control.txt';
如果你在增加控制檔案之後出現問題,可能是你的控制檔案版本不一樣。複製貼上讓他們一摸一樣。
刪
sql> alter database datafile 'e:\oracle11g\mytablespaces\usertbs1\user02.dbf' offline drop;
offline drop 並不會drop datafile,僅僅是將datafile 標記為offline,我們online 之後還可以recover回來。 具體參考:
alter database datafile offline drop 與 alter tablespace drop datafile 區別
非歸檔模式使用:alter database datafile '...' offline drop;
歸檔模式使用: alter database datafile '...' offline;
oracle徹底刪除資料檔案
或者用recover datafile name;命令來恢復,並聯機。
sql> drop tablespace usertbs1 including contents and datafiles;
表空間已刪除。
查
但是用以txt格式開啟控制檔案,都是亂碼,無法理解。
所以必須重建控制檔案:
alter database backup controlfile to trace as 'e:\oracle11g\oradata\orcl\control.txt';
然後這個txt檔案就是控制檔案的內容。
e:\oracle11g\diag\rdbms\orcl\orcl\trace\alert_orcl.txt
離線
oracle資料檔案離線問題
oracle非歸檔模式下離線、聯機資料檔案:
oracle 表空間聯機(online)與離線(offline)
更名:
sql> alter tablespace users offline normal;
表空間已更改。
然後在e:\oracle11g\mytablespaces\users\目錄手動建立乙個user003.dbf
sql> alter database rename file 'e:\oracle11g\mytablespaces\users\user03.dbf' to 'e:\oracle11g\mytablespaces\users\user003.dbf';
資料庫已更改。
error1:
輸入使用者名稱後: sys as sysdba
輸入口令:(空)
error:ora-12560: tns: 協議介面卡錯誤
solution:
◆1.監聽服務沒有起起來。windows平台個一如下操作:開始---程式---管理工具---服務,開啟服務面板,
啟動oraclehome92tnslistener服務。
error2:ora-01109:資料庫未開啟
sql> shutdown immediate;
sql> startup mount;
sql> alter database open;
移動表空間資料檔案
2011年5月31日 移動表空間資料檔案方法 一 首先啟用介質恢復即開啟歸檔模式,用sys使用者 如果已經開啟則省略該步驟 sql shutdown immediate 資料庫已經關閉。已經解除安裝資料庫。oracle 例程已經關閉。sql startup mount oracle 例程已經啟動。t...
Oracle 表空間 資料檔案自動增加
執行此指令碼之前需要建立名稱為 datafile no 的序列 最小值為1 增長量為1 最大值為 10000000 預設為在表空間his data下建立資料檔案。過程建立之後需要進行編譯,編譯成功後,建立job進行呼叫。間隔時間為 trunc sysdate 1,dd 1 24 每天呼叫。並且呼叫時...
Oracle的表空間 資料檔案 使用者
每乙個oracle資料庫都是由三種型別的檔案組成 資料檔案 data file 日誌檔案 log file 和控制檔案 control file 資料庫的檔案為資料庫資訊提供真正的物理儲存。每個資料庫有乙個或多個物理的資料檔案。邏輯資料庫結構 如表 索引等 的資料物理地儲存在資料庫的資料檔案中,資料...