`

How to Recreate the Controlfile [ID 1012929.6]

阅读更多

Checked for relevance on 06-DEC-2007


PURPOSE
  This article describes how you can recreate your controlfile.

SCOPE & APPLICATION
  For DBAs who need to recreate the controlfile.

WARNING:
--------

You should only need to recreate your control file under very special
circumstances:

- All current copies of the control file have been lost or are corrupted.

- You need to change a "hard" database parameter that was set when the        
  database was first created, such as MAXDATAFILES, MAXLOGFILES,               
  MAXLOGHISTORY, etc.

- You are restoring a backup in which the control file is corrupted or        
  missing.

- Oracle Customer Support advises you to do so.

- If you are moving your database to another machine which is
  running the same operating system but the location of the datafiles,
  logfiles is not the same.


Instructions: 
============= 

I. CREATING A NEW CONTROL FILE FROM THE EXISTING CONTROL FILE:  
--------------------------------------------------------------  
 
1.  If you are running Oracle7 or higher you can get Oracle to generate
    a script for you that enables you to recreate the controlfile.  Run the
    following command while the database is mounted or open and connected
    as a user with DBA privileges: 

       % svrmgrl 
       SVRMGR> connect internal
       SVRMGR> startup mount
       SVRMGR> alter database backup controlfile to trace;  
 
   If you are running Oracle9i or higher you need to use sqlplus instead of
   svrmgrl.

   Oracle6 does not have this feature and therefore you will need to build
   the CREATE CONTROLFILE statement yourself.  The syntax is discussed in
   detail in the Oracle SQL Reference Guide.

2. The trace file will be stored in the USER_DUMP_DEST destination,
   which is set to "$ORACLE_HOME/rdbms/log" by default on Unix platforms.  
 
   To find out what USER_DUMP_DEST is set to, follow one of the following:

   a) Look in the parameter file (init<SID>.ora on UNIX and Windows NT,
      <node>_<ora_sid>_init.ora on VMS) for the parameter:

       USER_DUMP_DEST = d:/oradata/orcl/trce/udump

   b) Using SQL*PLus you can issue the following command:

      SQL> SELECT   value
        2> FROM     v$parameter
        3> WHERE    name = 'user_dump_dest';

      VALUE
      ------------------------------------------------
      d:/oradata/orcl/trace/udump

   c)  Using Server Manager you can issue the following command:  
 
       SVRMGR> show parameter <string>
       SVRMGR> show parameter user_dump_dest; 
                                      
   The easiest way to locate the correct trace is to look at its date.
   A file will exist with the current date and time.  The naming
   convention for these files is operating system specific.  
 
   Example: 
   --------

   % cd $ORACLE_HOME/rdbms/log 
   % ls -l 
   -rw-r--r--   1 osupport dba 2315 Oct  3 16:39 alert_p716.log 
   -rw-r--r--   1 osupport dba 1827 Oct3 16:39 p716_ora_26220.trc  
 
   In this example, the file "p716_ora_26220.trc" is the trace file
   produced that contains a script to create the control file.

   NOTE:  The trace file is handled a bit differently when issuing this
   command from a connection to the database using shared server.  The
   shared server connection is created by PMON and the connection inherits
   its environment, meaning the trace file will be created in the directory
   referenced by the initialization parameter BACKGROUND_DUMP_DEST
   instead of the USER_DUMP_DEST.

   Use similar commands as given above to locate the directory
   referenced in the BACKGROUND_DUMP_DEST.
 
3. Modify the trace file and use it as a script to create the control
   file.  Copy the trace file to a script file, such as "new_control.sql",
   delete the header information prior to the words STARTUP NOMOUNT,
   and make any other desired changes, such as increasing MAXDATAFILES,
   MAXLOGFILES, etc. 
 
   Sample: 
   -------------------------- <start trace> ----------------------------- 
   Dump file /u01/oracle/7.1.6/rdbms/log/p716_ora_26220.trc 
   Oracle7 Server Release 7.1.6.2.0 - Production Release 
   With the distributed and replication options 
   PL/SQL Release 2.1.6.2.0 - Production 
   ORACLE_HOME = /u01/oracle/7.1.6 
   ORACLE_SID = p716 
   Oracle process number: 9         Unix process id: 26220 
   System name:    SunOS 
   Node name:      tcsun2 
   Release:        5.4 
   Version:        Generic_101945-27 
   Machine:   sun4m 
 
   Tue Oct  3 16:39:13 1995 
   *** SESSION ID:(6.61) 
   # The following commands will create a new control file and use it 
   # to open the database. 
   # No data other than log history will be lost. Additional logs may 
   # be required for media recovery of offline data files. Use this 
   # only if the current version of all online logs are available. 
   STARTUP NOMOUNT 
 
   CREATE CONTROLFILE REUSE DATABASE "P716" NORESETLOGS NOARCHIVELOG 
       MAXLOGFILES 32 
       MAXLOGMEMBERS 2 
       MAXDATAFILES 30 
       MAXINSTANCES 8 
       MAXLOGHISTORY 800 
   LOGFILE 
     GROUP 1 '/u01/oracle/7.1.6/dbs/log1p716.dbf'  SIZE 500K, 
     GROUP 2 '/u01/oracle/7.1.6/dbs/log2p716.dbf'  SIZE 500K, 
     GROUP 3 '/u01/oracle/7.1.6/dbs/log3p716.dbf'  SIZE 500K 
   DATAFILE 
     '/u01/oracle/7.1.6/dbs/systp716.dbf' SIZE 40M, 
     '/u01/oracle/7.1.6/dbs/tempp716.dbf' SIZE 550K, 
     '/u01/oracle/7.1.6/dbs/toolp716.dbf' SIZE 15M 
   ; 
   # Recovery is required if any of the datafiles are restored backups, 
   # or if the last shutdown was not normal or immediate. 
   RECOVER DATABASE 
   # Database can now be opened normally. 
   ALTER DATABASE OPEN; 
 
   ---------------------- <end trace> ---------------------------------- 
 

4. Shutdown the database (NORMAL, IMMEDIATE, TRANSACTIONAL (Oracle8 only)
   but not ABORT).

       SVRMGR> shutdown immediate

   If you are running Oracle9i or higher you need to use sqlplus instead of
   svrmgrl.
 
5. Take a full database backup.
 
6. Rename/move the existing database controlfiles to a backup (The REUSE
   option will overwrite the original files). The size of the controlfile
   will be increased    by increasing the value of    MAXDATAFILES,
   MAXLOGMEMBERS, etc.
 
   Example: 
   --------

   % cd $ORACLE_HOME/dbs 
   % mv ctrlV716.ctl ctrlV716.bak 
  
7. Create the controlfile within Server Manager                   
             
SVRMGR> connect internal                    
SVRMGR> @new_control.sql 
 
   If you get the "Statement processed" message, the database will
   be opened with a brand new control file.

   If you are running Oracle9i or higher you need to use sqlplus instead of
   svrmgrl.

8. At the first opportunity, shut the database down (normal, immediate or
   transactional oracle8 only) and take a full backup.

       
II. CREATING A NEW CONTROL FILE WITHOUT AN EXISTING CONTROL FILE:   
----------------------------------------------------------------- 
 
CREATE CONTROLFILE SYNTAX:           
The following is information on the create control file syntax.  This 
information is fully documented in the Oracle SQL Reference Manual. 
 
CREATE CONTROLFILE [REUSE] 
   DATABASE name  
   [LOGFILE filespec [, filespec] ...]   
    RESETLOGS | NORESETLOGS    
   [MAXLOGFILES integer]     
   [DATAFILE filespec [, filespec] ...]      
   [MAXDATAFILES integer]       
   [MAXINSTANCES integer]        
   [ARCHIVELOG | NOARCHIVELOG]         
   [SHARED | EXCLUSIVE]          

The complete procedure follows:

1. Take a full backup of the database, including all datafiles and redo
   log files.

2. Go into SQL*DBA or Server Manager and do a STARTUP NOMOUNT.

3. Issue the CREATE CONTROLFILE statement.

   Example:
   --------

       CREATE CONTROLFILE REUSE DATABASE "P716" NORESETLOGS NOARCHIVELOG
       MAXLOGFILES 50
       MAXLOGMEMBERS 3
       MAXDATAFILES 300
       MAXINSTANCES 8
       MAXLOGHISTORY 500
       LOGFILE
               GROUP 1 '/u01/oracle/7.1.6/dbs/log1p716.dbf'  SIZE 1M,
               GROUP 2 '/u01/oracle/7.1.6/dbs/log2p716.dbf'  SIZE 1M,
               GROUP 3 '/u01/oracle/7.1.6/dbs/log3p716.dbf'  SIZE 1M
       DATAFILE
               '/u01/oracle/7.1.6/dbs/systp716.dbf' SIZE 40M,
               '/u01/oracle/7.1.6/dbs/tempp716.dbf' SIZE 1M,
               '/u01/oracle/7.1.6/dbs/toolp716.dbf' SIZE 15M ;

4. Perform media recovery on the database.

       SVRMGR> recover database;

   If you are running Oracle9i or higher you need to use sqlplus instead of
   svrmgrl.

5. Open the database.

       SVRMGR> alter database open;

   If you are running Oracle9i or higher you need to use sqlplus instead of
   svrmgrl.

6. At the first opportunity, shut the database down and take a full cold
   backup.


Additional Errors:
------------------
ORA-205 ORA-7360 ORA-376 ORA-1110 ORA-1111

分享到:
评论

相关推荐

    Python库 | docker-recreate-1.4.1.tar.gz

    资源分类:Python库 所属语言:Python 资源全名:docker-recreate-1.4.1.tar.gz 资源来源:官方 安装方法:https://lanzao.blog.csdn.net/article/details/101784059

    How To Drop, Create And Recreate DB Control In A 10g Database [ID 278100.1]

    How To Drop, Create And Recreate DB Control In A 10g Database [ID 278100.1] Metalink上下载

    Debbie Millman - How to Think Like a Great Graphic Designer.pdf

    look forward to the next day when I could recreate the world.” 41 pau l a sch er “ I wanted to make wonderful things, things that other people liked, things that were important and mattered.”...

    Python库 | docker-recreate-1.4.0.tar.gz

    资源分类:Python库 所属语言:Python 资源全名:docker-recreate-1.4.0.tar.gz 资源来源:官方 安装方法:https://lanzao.blog.csdn.net/article/details/101784059

    RemObjects SDK for Delphi

    Advanced This example shows how to create a proxy server to redirect the calls to another server without having to recreate the RODL file, thus allowing the use of the same types of the original ...

    Raspberry.Pi.Gaming.2nd.Edition

    After learning how to set up a Raspberry Pi, you will begin by creating your own version of Flappy Bird and a clone of the classic game Pong in the Scratch programming language. You will also be ...

    CUDA11.0-C-Programming-Guide.pdf

    This feature provides more flexibility in modifying graph configurations without the need to recreate the entire graph. 10. **New Functionalities for Cooperative Groups** - Additional features for ...

    数位板压力测试

    • The user should be able to control how applications use the tablet. The user interface must be ef-ficient, consistent, and customizable. 2 DESIGN GOALS While the tablet interface design must ...

    svnplot 0.7.5

    IMPORTANT : Version 0.6.x users and 0.7.0 users, please upgrade to 0.7.4 and RECREATE the database. News/Updates NEW version 0.7.5 available (28 May 2011) Fixes critical bugs about wrong line count,...

    Gartner-Logo Usage Guidelines(11p)_大厂VI品牌视觉标准_外企业品牌手册.pdf

    Additionally, do not attempt to recreate the logo or apply effects like drop shadows, outlines, or filters. The logo should retain its original typography, colors, and proportions. Incorrect usage ...

    RealThinClientSDK_v610_BETA

    To add the RTC SDK paths to FPC, you will need to modify the file "xcode/&lt;ProjectName&gt;.xcodeproj/project.pbxproj". The path to the RTC SDK 揕ib?folder needs to be added as two new ?Fu?parameters. ...

    Raspberry Pi Gaming(PACKT,2ed,2015)

    After learning how to set up a Raspberry Pi, you will begin by creating your own version of Flappy Bird and a clone of the classic game Pong in the Scratch programming language. You will also be ...

    wamp5 a development environment

    WAMP5 is the unique utilities creation atmosphere which allows recreate the server where the elaborate content will be used. From a special section of this tool official website is offered to ...

    Figma Converter for Unity 1.2.6

    Thanks to the unique tagging system, the asset can understand what type of components you are using in the layout and recreate them in your project scene. The asset includes a detailed guide to the ...

    2020合肥一模英语答案与试题.docx

    Ken Merriam, a visitor who grew up on a farm in Honduras, brings his children to Butler's Orchard to recreate the nostalgic feelings of his childhood and expose them to the rural life they might ...

    ICS delphixe10源码版

    also includes the OpenSSL binaries needed to support SSL. ICS V8 supports Delphi 64-bit and Mac OS-X projects. Note that latest C++ Builder version supported is XE3 (lack of spare time, sorry). ICS ...

    Recovery Partition Creator 4.0.4.zip

    Recovery Partition Creator 4.0.4 is used to recreate the "Recovery Partition" of macOS system on MBP,iMac and Mac Mini etc. It is compatible with the macOS10.9 or greater. It can work on the last ...

    大金(Scenarist BD)常见报错说明

    2. **Please delete it and recreate it with the MUI Generator.警告** - **错误解释**:该警告指出流的多语言用户界面(MUI)信息未正确生成。 - **解决方法**:检查BD reauthor的MUI Generator路径是否正确设置...

    DevExpress VCL 13.1.4(v2013vol1.4) 源码-例子-帮助-part1

    Moving focus to TcxDBSpinEdit placed in TdxBarControlContainerItem does not fire the OnExit and OnEnter events and, as a result, does not fire the OnGetText event of a dataset field bound to the ...

    Color Correction Look Book

    Today's filmmakers often want to recreate the idiosyncrasies of older recording methods, or are looking for something completely new, to differentiate the look of a given project. Furthermore, end-to...

Global site tag (gtag.js) - Google Analytics