您好,登錄后才能下訂單哦!
這篇文章主要講解了“數(shù)據(jù)庫中怎么添加控制文件”,文中的講解內(nèi)容簡單清晰,易于學習與理解,下面請大家跟著小編的思路慢慢深入,一起來研究和學習“數(shù)據(jù)庫中怎么添加控制文件”吧!
1. 一致性關閉數(shù)據(jù)庫
shutdown immediate
2. 通過spfile創(chuàng)建pfile
create pfile from spfile;
3. 修改pfile,增加一個控制文件
vi pfile
4. 在操作系統(tǒng)上通過已有控制文件復制出新控制文件
cp new control file from control file that already exist
控制文件路徑是/u01/app/oracle/product/fast_recovery_area
Pfile中的<ORACLE_BASE>必須改成絕對路徑,否則報錯
<ORACLE_BASE> from pfile must be absolute path
ORA48140 the specified ADR Base directory does not exist [u01/app/oracle]
ORA48187 specified directory does not exist
cd /u01/app/oracle/product/fast_recovery_area/sales
cp control02.ctl control03.ctl
5. 將pfile內(nèi)容刷到spfile上
create spfile from pfile;
6. 啟動數(shù)據(jù)庫到nomount
SQL> startup nomount
ORA-09925:Unable to create audit trail file
Linux-x86_64 Error:2: No such file or directory
Additional information: 9925
發(fā)現(xiàn)audit文件路徑不存在,admin下沒有orcl/adump, 創(chuàng)建此文件,就可解決
audit file does extist, create orcl/adump under admin to solve
touch /u01/app/oracle/product/admin/orcl/adump
7. 啟動數(shù)據(jù)庫到mount
startup nomount
alter database mount;
startup
重建control file(慎用,會重置redo)
recreate control file(be careful, it will reset redo log)
.SQL> alter database backup controlfile to trace as '/u01/controlfile';
database altered
SQL> CREATE CONTROLFILE REUSE DATABASE "SALES" RESETLOGS NOARCHIVELOG
2 MAXLOGFILES 16
3 MAXLOGMEMBERS 3
4 MAXDATAFILES 100
5 MAXINSTANCES 8
6 MAXLOGHISTORY 292
7 LOGFILE
8 GROUP 1 '/u01/base/sales/redo01.log' SIZE 50M BLOCKSIZE 512,
9 GROUP 2 '/u01/base/sales/redo02.log' SIZE 50M BLOCKSIZE 512,
10 GROUP 3 '/u01/base/sales/redo03.log' SIZE 50M BLOCKSIZE 512
11 -- STANDBY LOGFILE
12 DATAFILE
13 '/u01/base/sales/system01.dbf',
14 '/u01/base/sales/sysaux01.dbf',
15 '/u01/base/sales/undotbs01.dbf',
16 '/u01/base/sales/users01.dbf',
17 '/u01/base/sales/example01.dbf'
18 CHARACTER SET WE8MSWIN1252
19 ;
Control file created.
感謝各位的閱讀,以上就是“數(shù)據(jù)庫中怎么添加控制文件”的內(nèi)容了,經(jīng)過本文的學習后,相信大家對數(shù)據(jù)庫中怎么添加控制文件這一問題有了更深刻的體會,具體使用情況還需要大家實踐驗證。這里是億速云,小編將為大家推送更多相關知識點的文章,歡迎關注!
免責聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進行舉報,并提供相關證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權(quán)內(nèi)容。