數據庫建庫的時候指定數據文件多出來一個子目錄htdisdbsql
如今要作的操做是讓oracle 認出移動數據文件,數據庫
1)確認當前的模式,而且把關閉歸檔模式oracle
- SQL> archive log list; 查看歸檔模式是否打開
- Database log mode Archive Mode
- Automatic archival Enabled
- Archive destination /oradata/htdisdbarc2
- Oldest online log sequence 37
- Next log sequence to archive 39
- Current log sequence 39
關閉歸檔模式ide
- SQL> startup nomount;
- ORACLE instance started.
- Total System Global Area 1610612736 bytes
- Fixed Size 2084296 bytes
- Variable Size 385876536 bytes
- Database Buffers 1207959552 bytes
- Redo Buffers 14692352 bytes
- SQL> alter database mount;
- Database altered.
- SQL> alter database noarchivelog
- 2 ;
- Database altered.
- SQL> alter database open;
- Database altered.
2)查看數據文件位置spa
- SQL> select name from v$datafile;
- NAME
- ---------------------------------------------------
- /oradata/htdisdb/htdisdb/system01.dbf
- /oradata/htdisdb/htdisdb/undotbs01.dbf
- /oradata/htdisdb/htdisdb/sysaux01.dbf
- /oradata/htdisdb/htdisdb/users01.dbf
3)移動數據文件到目標文件夾日誌
- [oracle@htdtest htdisdb]$ mv *.dbf ../
4)重啓數據庫到mount狀態string
- SQL> startup nomount;
- SQL> alter database mount;
5)重命名數據文件it
- SQL> alter database rename file '/oradata/htdisdb/htdisdb/sysaux01.dbf' to '/oradata/htdisdb/sysaux01.dbf';
- Database altered.
- SQL> alter database rename file '/oradata/htdisdb/htdisdb/undotbs01.dbf' to '/oradata/htdisdb/undotbs01.dbf';
- Database altered.
- SQL> alter database rename file '/oradata/htdisdb/htdisdb/users01.dbf' to '/oradata/htdisdb/users01.dbf';
- Database altered.
- SQL> alter database rename file '/oradata/htdisdb/htdisdb/temp01.dbf' to '/oradata/htdisdb/temp01.dbf';
- Database altered.
- SQL>
6)重命名重作日誌文件io
- alter database rename file '/oradata/htdisdb/htdisdb/redo01.log' to '/oradata/htdisdb/redo01.log';
- alter database rename file '/oradata/htdisdb/htdisdb/redo02.log' to '/oradata/htdisdb/redo02.log';
- alter database rename file '/oradata/htdisdb/htdisdb/redo03.log' to '/oradata/htdisdb/redo03.log';
7)更改數據庫到open狀態,從新查詢數據文件位置class
- SQL> alter database open;
- Database altered.
- SQL> select name from v$datafile;
- NAME
- --------------------------------------------------------------------------------
- /oradata/htdisdb/system01.dbf
- /oradata/htdisdb/undotbs01.dbf
- /oradata/htdisdb/sysaux01.dbf
- /oradata/htdisdb/users01.dbf
- /oradata/htdisdb/isaccdb.dbf
- /oradata/htdisdb/isposdb.dbf
- /oradata/htdisdb/ismngdb.dbf
- /oradata/htdisdb/isstldb.dbf
- /oradata/htdisdb/istxndb.dbf
- /oradata/htdisdb/isacqdb.dbf
- 10 rows selected.