select file#,name,checkpoint_change# from v$dat..."/>
溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點(diǎn)擊 登錄注冊 即表示同意《億速云用戶服務(wù)條款》
  • 首頁 > 
  • 教程 > 
  • 數(shù)據(jù)庫 > 
  • 數(shù)據(jù)庫open狀態(tài)下,如何修改數(shù)據(jù)文件路徑(可用于改名改路徑)

數(shù)據(jù)庫open狀態(tài)下,如何修改數(shù)據(jù)文件路徑(可用于改名改路徑)

發(fā)布時(shí)間:2020-08-14 15:21:14 來源:網(wǎng)絡(luò) 閱讀:707 作者:duxiutemp 欄目:數(shù)據(jù)庫


數(shù)據(jù)庫open下,將users表空間下的數(shù)據(jù)遷移到/home/oracle/dsk1下(可用作為改名)
 col name for a50
SQL> select file#,name,checkpoint_change# from v$datafile;

     FILE# NAME                                               CHECKPOINT_CHANGE#
---------- -------------------------------------------------- ------------------
         1 /u01/app/oracle/oradata/ORA11GR2/system01.dbf                 1043045
         2 /u01/app/oracle/oradata/ORA11GR2/sysaux01.dbf                 1043045
         3 /u01/app/oracle/oradata/ORA11GR2/undotbs01.dbf                1043045
         4 /u01/app/oracle/oradata/ORA11GR2/users01.dbf                  1043045
         5 /u01/app/oracle/oradata/ORA11GR2/example01.dbf                1043045
         6 /u01/app/oracle/oradata/ORA11GR2/users02.dbf                  1044441
SQL> alter system checkpoint;
select file#,name,checkpoint_change# from v$datafile;
 alter tablespace users offline;
select file#,name,checkpoint_change# from v$datafile;
 alter tablespace users rename datafile '/u01/app/oracle/oradata/ORA11GR2/users01.dbf' to '/home/oracle/dsk1/users01.dbf';
 alter tablespace users rename datafile '/u01/app/oracle/oradata/ORA11GR2/users02.dbf' to '/home/oracle/dsk1/users02.dbf';修改控制文件內(nèi)容
  select name from v$datafile;
SQL> alter tablespace users online;
總結(jié)為四步
1 tablespace offline
2 cp datafile to dest
3 alter tablespace xxx rename
4 tbs online


向AI問一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI