修改資料檔案地址

shuangoracle發表於2012-05-10
現場反應前臺研發建表空間時建錯了目錄,讓修改:
SQL> select name from v$datafile;
NAME
--------------------------------------------------------------------------------
/home/oracle/oradata/orcl/system01.dbf
/home/oracle/oradata/orcl/undotbs01.dbf
/home/oracle/oradata/orcl/sysaux01.dbf
/home/oracle/oradata/orcl/users01.dbf
/home/oracle/oradata/orcl/mytmp01.dbf
/home/oracle/oradata/test01.dbf
6 rows selected.
SQL> archive log list;
Database log mode Archive Mode
Automatic archival Enabled
Archive destination /home/oracle/archive
Oldest online log sequence 123
Next log sequence to archive 125
Current log sequence 125
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> host
[oracle@RAC1 ~]$ cp /home/oracle/oradata/test01.dbf /home/oracle/oradata/orcl/test01.dbf
[oracle@RAC1 ~]$ exit
exit
SQL> startup mount
ORACLE instance started.
Total System Global Area 167772160 bytes
Fixed Size 1218316 bytes
Variable Size 62916852 bytes
Database Buffers 100663296 bytes
Redo Buffers 2973696 bytes
Database mounted.
SQL> select name from v$datafile;
NAME
--------------------------------------------------------------------------------
/home/oracle/oradata/orcl/system01.dbf
/home/oracle/oradata/orcl/undotbs01.dbf
/home/oracle/oradata/orcl/sysaux01.dbf
/home/oracle/oradata/orcl/users01.dbf
/home/oracle/oradata/orcl/mytmp01.dbf
/home/oracle/oradata/test01.dbf
6 rows selected.
SQL> alter database rename file '/home/oracle/oradata/test01.dbf' to
2 '/home/oracle/oradata/orcl/test01.dbf';
Database altered.
SQL> alter database open;
Database altered.
SQL> select name from v$datafile;
NAME
--------------------------------------------------------------------------------
/home/oracle/oradata/orcl/system01.dbf
/home/oracle/oradata/orcl/undotbs01.dbf
/home/oracle/oradata/orcl/sysaux01.dbf
/home/oracle/oradata/orcl/users01.dbf
/home/oracle/oradata/orcl/mytmp01.dbf
/home/oracle/oradata/orcl/test01.dbf
6 rows selected.

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

相關文章