select name from v$controlfile;   NAME ..."/>
溫馨提示×

溫馨提示×

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

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務(wù)條款》

遷移控制文件方法(二)

發(fā)布時間:2020-08-16 06:44:44 來源:ITPUB博客 閱讀:117 作者:wg0411 欄目:關(guān)系型數(shù)據(jù)庫
 Oracle數(shù)據(jù)庫文件遷移步驟 
 
(1)首先確認需要遷移的數(shù)據(jù)庫文件
SQL> select name from v$controlfile;
 
NAME
-----------------------------------------
 
D:\ORACLE\ORADATA\XSFREE\CONTROL01.CTL
D:\ORACLE\ORADATA\XSFREE\CONTROL02.CTL
 
SQL> select name from v$datafile;
 
NAME
-----------------------------------------
 
D:\ORACLE\ORADATA\XSFREE\SYSTEM01.DBF
D:\ORACLE\ORADATA\XSFREE\SYSAUX01.DBF
D:\ORACLE\ORADATA\XSFREE\UNDOTBS01.DBF
D:\ORACLE\ORADATA\XSFREE\USERS01.DBF
 
SQL> select member from v$logfile;
 
MEMBER
---------------------------------------------
 
D:\ORACLE\ORADATA\XSFREE\REDO01.LOG
D:\ORACLE\ORADATA\XSFREE\REDO02.LOG
D:\ORACLE\ORADATA\XSFREE\REDO03.LOG
 
SQL> select name from v$tempfile;
 
NAME
--------------------------------------
 
D:\ORACLE\ORADATA\XSFREE\TEMP01.DBF
 
(2)創(chuàng)建pfile,備份spfile
SQL> create pfile from spfile;
move SPFILEXSFREE.ORA SPFILEXSFREE.ORA_bak
 
(3)關(guān)閉數(shù)據(jù)庫
SQL> shutdown immediate;
 
(4)遷移數(shù)據(jù)庫文件
將D:\oracle\oradata下的文件復(fù)制到D:\oracle\oradata_bak下(本測試是將oradata目錄下的數(shù)據(jù)庫文件遷移至oradata_bak下)
 
(5)修改pfile中控制文件路徑
*.control_files='D:\oracle\oradata_bak\xsfree\control01.ctl','D:\oracle\oradata_bak\xsfree\control02.ctl'
 
(6)rename文件
SQL> startup mount pfile='D:\oracle\product\11.2.0\dbhome_1\database\INITxsfree.ORA';
SQL> alter database rename file 'D:\ORACLE\ORADATA\XSFREE\SYSTEM01.DBF'  to  'D:\ORACLE\ORADATA_BAK\XSFREE\SYSTEM01.DBF';
SQL> alter database rename file 'D:\ORACLE\ORADATA\XSFREE\SYSAUX01.DBF'  to  'D:\ORACLE\ORADATA_BAK\XSFREE\SYSAUX01.DBF';
SQL> alter database rename file 'D:\ORACLE\ORADATA\XSFREE\UNDOTBS01.DBF' to  'D:\ORACLE\ORADATA_BAK\XSFREE\UNDOTBS01.DBF';
SQL> alter database rename file 'D:\ORACLE\ORADATA\XSFREE\USERS01.DBF'   to  'D:\ORACLE\ORADATA_BAK\XSFREE\USERS01.DBF'; 
SQL> alter database rename file 'D:\ORACLE\ORADATA\XSFREE\REDO01.LOG'    to  'D:\ORACLE\ORADATA_BAK\XSFREE\REDO01.LOG'; 
SQL> alter database rename file 'D:\ORACLE\ORADATA\XSFREE\REDO02.LOG'    to  'D:\ORACLE\ORADATA_BAK\XSFREE\REDO02.LOG';  
SQL> alter database rename file 'D:\ORACLE\ORADATA\XSFREE\REDO03.LOG'    to  'D:\ORACLE\ORADATA_BAK\XSFREE\REDO03.LOG'; 
SQL> alter database rename file 'D:\ORACLE\ORADATA\XSFREE\TEMP01.DBF'    to  'D:\ORACLE\ORADATA_BAK\XSFREE\TEMP01.DBF'; 
 
(7)打開數(shù)據(jù)庫,open和后面的創(chuàng)建spfile 無順序性 先執(zhí)行哪個都可
SQL> alter database open;
SQL> create spfile from pfile='D:\oracle\product\11.2.0\dbhome_1\database\INITxsfree.ORA';
create pfile='e:\b.txt' from spfile;  --驗證新spfile內(nèi)容已經(jīng)修改


(8) 使用新spfile重啟庫
shutdown immediate 
startup


向AI問一下細節(jié)

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

AI