如何生成oracle控制文件

2024-12-20 03:45:02
推荐回答(3个)
回答1:

?1.generate control.sql from source system. svrmgrl ? ? ? ?connect internal ? ? ? ?shutdown normal ? ? ? ?startup ? ? ? ?alter database backup controlfile to trace resetlogs; //get trace file in % SAPTRACE%\usertrace\ ? ? ? ?alter system switch logfile; (repeat this command, once per redolog group; for SAP , repeat 4 times). //force write log file ? ? ? ?shutdown normal ? ? ? ?exit ? 2. modify trace file according the dest. sap system setup ( including SID, file location ) ? ? 2.1 Copy the adjusted file "control.sql" to a suitable ? ? ? ? directory, and open it using the Editor.Delete the introductory text ? ? ? ? so that the file starts directly with the following line: ? ? ? ? "CREATE CONTROLFILE..." ? ? ? ? If the SID changes, change the line ? ? ? ? "CREATE CONTROLFILE REUSE DATABASE "C11" NORESETLOGS ARCHIVELOG" in ? ? ? ? "CREATE CONTROLFILE SET DATABASE "C12" RESETLOGS ARCHIVELOG" ? ? ? ? (C11 is the SID of the source system, C12 is the SID of the target ? ? ? ? system. Delete all lines with additional SQL statements (such as ? ? ? ? startup mount, recover database, alter database...), until only the ? ? ? ? SQL Statement CREATE CONTROLFILE remains. The statement Create ? ? ? ? Controlfile ... is ended after all components related to the ? ? ? ? database are listed with a semicolon (;). ? ? 2.2 ?Adjust the paths in the script to the situation on the target ? ? ? ? system. 3.Restart OracleService , ?create control file using modified script. svrmgrl ? ? ? ? ? ? ? connect internal ? ? ? ? ? ? ? startup nomount ? ? ? ? ? ? ? @\control.sql ? ? ? ? ? ? ? alter database open resetlogs; ? ? ? ? ? ? ? exit

回答2:

重建控制文件是在数据库没有备份的情况下,实在没办法而采取的下下之策,因为一旦重建,归档全部失效startup nomount CREATE CONTROLFILE REUSE DATABASE "ORCL" RESETLOGS ARCHIVELOG MAXLOGFILES 16 MAXLOGMEMBERS 3 MAXDATAFILES 100 MAXINSTANCES 8 MAXLOGHISTORY 292 LOGFILE --指定redo路径
GROUP 1 '/u01/oracle/oradata/ORCL/redo01.log' SIZE 50M,
GROUP 2 '......' SIZE 50M,
GROUP 3 '......' SIZE 50M
DATAFILE --指定数据文件路径
'/u01/oracle/oradata/ORCL/system01.dbf', '.........'CHARACTER SET WE8ISO8859P1 --指定字符集 alter database open resetlogs;马上做全备

回答3:

删除了?没有备份? 一般控制文件需要多个的,以后你需要在profile文件中再增加几个,这几个是互为镜像的。 如果没有备份,那么只能重新建立一个,再编辑里面的内容了。