how to remove datafile path
How to remove datafile path
一、No Archive Mode
如果處於非歸檔模式下,可以透過如下步驟更改檔案路徑:
a.關閉資料庫
b.系統級進行檔案複製
c.啟動資料庫到mount狀態
d.透過修改資料檔案位置
e.開啟資料庫
以下是實際操作的步驟示範:
1.資料庫處於非歸檔模式
SQL> archive log list; Database log mode No Archive Mode Automatic archival Enabled Archive destination /opt/oracle/oradata/conner/archive Oldest online log sequence 150 Current log sequence 153 |
2.需要移動test.dbf檔案
SQL> select name from v$datafile; NAME ------------------------------------------------------------ /opt/oracle/oradata/conner/system01.dbf /opt/oracle/oradata/conner/undotbs01.dbf /opt/oracle/oradata/conner/users01.dbf /opt/oracle/test.dbf |
SQL> shutdown immediate; Database closed. Database dismounted. ORACLE instance shut down. |
4.複製檔案到新的位置
SQL> ! cp /opt/oracle/test.dbf /opt/oracle/oradata/conner/test.dbf |
5.啟動資料庫到mount狀態
SQL> startup mount; ORACLE instance started. Total System Global Area 101782828 bytes Fixed Size 451884 bytes Variable Size 37748736 bytes Database Buffers 62914560 bytes Redo Buffers 667648 bytes Database mounted. SQL> select name from v$datafile; NAME ----------------------------------------------------------- /opt/oracle/oradata/conner/system01.dbf /opt/oracle/oradata/conner/undotbs01.dbf /opt/oracle/oradata/conner/users01.dbf /opt/oracle/test.dbf |
6.修改檔案位置
SQL> alter database rename file '/opt/oracle/test.dbf' to '/opt/oracle/oradata/conner/test.dbf'; Database altered. SQL> alter database open; Database altered. SQL> select name from v$datafile; NAME ---------------------------------------------------------------- /opt/oracle/oradata/conner/system01.dbf /opt/oracle/oradata/conner/undotbs01.dbf /opt/oracle/oradata/conner/users01.dbf /opt/oracle/oradata/conner/test.dbf SQL> |
二、採用offline的方式
1. 先將表空間離線
SQL> alter tablespace mars_base_data offline;
表空間已更改。
2. 在作業系統中將檔案轉移至需要的新地址
cp /opt/oracle/test.dbf /opt/oracle/oradata/conner/test.dbf
3. 更新控制檔案
SQL> alter tablespace mars_base_data rename datafile 'D:\ORACLE\ORADATA\MARS_BAS
E_DATA03.DBF' to 'D:\ORACLE\ORADATA\HENRY\MARS_BASE_DATA03.DBF';
表空間已更改。
4.. 將表空間聯機
SQL> alter tablespace mars_base_data online;
表空間已更改。
參考文獻:
1.
2. http://blog.**.com/html/89/750489-164106.html
3. http://hi.baidu.com/zidane_xue/blog/item/2e876d34667aff49241f1475.html
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/9252210/viewspace-667806/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 轉載 個人用 How To Remove Docker Images, Containers, and VolumesREMDockerAI
- RMAN-06214: Datafile Copy
- [20201103]set newname for datafile.txt
- JavaScript remove()JavaScriptREM
- JavaScript select remove()JavaScriptREM
- DataTransferItemList.remove()REM
- Remove Element 解答REM
- ORA-19909: datafile 1 belongs to an orphan incarnation
- How to ssh
- [leetcode]remove-elementLeetCodeREM
- Flutter Path(二) : Path 進階Flutter
- Flutter Path(一) : Path 與 CustomPainterFlutterAI
- How to find dependency
- leetcode-27. Remove ElementLeetCodeREM
- Leetcode 27 Remove-ElementLeetCodeREM
- [LintCode/LeetCode] Remove Duplicate LettersLeetCodeREM
- swagger ui remove springboot pathsSwaggerUIREMSpring Boot
- openmesh - impl - Remove Duplicated VerticesREM
- 利用offline datafile檔案方式遷移資料
- Rename or Move a datafile In Oracle 19c RAC-20220117Oracle
- [BUG反饋]defined('ADDON_PATH') or define('ADDON_PATH', APP_PATH.'Addon');APP
- [LeetCode] 402. Remove K DigitsLeetCodeREMGit
- Remove-duplicates-from-sorted-arrayREM
- Remove-duplicates-from-sorted-listREM
- c++的remove函式C++REM函式
- Java List的remove()方法陷阱JavaREM
- jQuery之empty()與remove()方法jQueryREM
- crontab on raspberry pi, full path, not relative path, is needed.
- [譯] WebAssembly: How and whyWeb
- How OpenStack integrates with Ceph?
- How to Build a Cybersecurity CareerUI
- CISO之What & How
- How to Restart Qt ApplicationRESTQTAPP
- How Python list works?Python
- How to Install psql on MacSQLMac
- How to Install LibreOffice on UbuntuUbuntu
- 【故障處理】ORA-39123,ORA-19722 datafile is an incorrect version
- Path-sum
- Path Sum III