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 Choose Size of Datafile on Raw Devicedev
- how to remove "Elapsed" in sqlplusREMSQL
- How to copy a datafile from ASM to a file system not using RMANASM
- How to release space from database( in other words: resize datafile ) (zt)Database
- How to release space from database( in other words: resize datafile ) 【zt】Database
- WINNT: How to Remove Oracle Fail Safe From a Windows NT Cluster ServerREMOracleAIWindowsServer
- 轉載 個人用 How To Remove Docker Images, Containers, and VolumesREMDockerAI
- How to Create or Remove Restore Point on Standby database (文件 ID 1672977.1)REMRESTDatabase
- rman copy asm datafile(rename asm datafile)ASM
- 【Datafile】Oracle單個datafile大小的限制Oracle
- remove()REM
- RemoveREM
- Oracle datafileOracle
- v$datafile_header 查詢datafile 狀態Header
- JavaScript remove()JavaScriptREM
- jQuery remove()jQueryREM
- Remove ElementREM
- Remove Element 解答REM
- DataTransferItemList.remove()REM
- Remove Unused ModulesREM
- alter database create datafileDatabase
- alter database create datafile '' as ''Database
- Flutter Path(二) : Path 進階Flutter
- alter database datafile offline drop 與 alter tablespace drop datafile 區別Database
- Renaming a Datafile in the Primary DatabaseDatabase
- 收縮datafile for oracle -- 轉Oracle
- Flutter Path(一) : Path 與 CustomPainterFlutterAI
- JavaScript select remove()JavaScriptREM
- jQuery empty() vs remove()jQueryREM
- Conventional Path Export和Direct Path ExportExport
- Conventional Path Export Versus Direct Path ExportExport
- Move datafile:From File System to ASMASM
- Move datafile:From ASM to File SystemASM
- alter system dump datafile headerHeader
- ALTER DATABASE DATAFILE OFFLINEDatabase
- 重新認識CREATE DATAFILE命令
- 冷備_並行copy datafile並行
- openmesh - impl - Remove Duplicated VerticesREM