非歸檔模式下的資料檔案路徑修改

shawnloong發表於2017-01-22
由於資料目錄已經滿了需要將資料檔案移動到另外一個分割槽,操作步驟
1.停應用,關閉監聽 
lsnrctl stop
2.關閉資料庫
SQL> select file_name from dba_data_files;

FILE_NAME
--------------------------------------------------------------------------------
/u01/app/oracle/oradata/orcl/users01.dbf
/u01/app/oracle/oradata/orcl/undotbs01.dbf
/u01/app/oracle/oradata/orcl/sysaux01.dbf
/u01/app/oracle/oradata/orcl/system01.dbf
/u01/app/oracle/oradata/orcl/xihu.dbf
/u01/app/oracle/oradata/orcl/example01.dbf
/oradata2/zhiyoubao.dbf
/oradata2/SETTLE01.DBF
/u01/app/oracle/oradata/orcl/ebiz.dbf
/u01/app/oracle/oradata/orcl/zhyh.dbf
/u01/app/oracle/oradata/orcl/lnykt.dbf

我們需要將/u01/app/oracle/oradata/orcl/users01.dbf移動到/oradata下
alter system checkpoint;(至少四次)
shutdown immediate;
[oracle@dbserver oradata2]$ pwd
/oradata2
[oracle@dbserver oradata2]$ mv /u01/app/oracle/oradata/orcl/users01.dbf ./
[oracle@dbserver oradata2]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.1.0 Production on Mon May 23 09:13:38 2016

Copyright (c) 1982, 2009, Oracle.  All rights reserved.

Connected to an idle instance.

SQL> startup mount;
ORACLE instance started.

Total System Global Area 1202556928 bytes
Fixed Size            2212816 bytes
Variable Size          922750000 bytes
Database Buffers      268435456 bytes
Redo Buffers            9158656 bytes
Database mounted.
SQL> alter database rename file '/u01/app/oracle/oradata/orcl/users01.dbf' to '/oradata2/users01.dbf';

Database altered.

SQL> alter database open;

Database altered.

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/24486203/viewspace-2132823/,如需轉載,請註明出處,否則將追究法律責任。

相關文章