`
edwards0307
  • 浏览: 25996 次
  • 性别: Icon_minigender_2
  • 来自: 北京
社区版块
存档分类
最新评论

manage controlfiles

阅读更多

 a binary file  1.what's controlfiles

 

Every Oracle Database has a control file, which is a small binary file that records the physical structure of the database.The database control file is a small binary file necessary for the database to start and operate successfully. A control file is updated continuously by Oracle during database use, so it must be available for writing whenever the database is open. If for some reason the control file is not accessible, then the database cannot function properly.Each control file is associated with only one Oracle database.The control file of an Oracle Database is created at the same time as the database.no database administrator or user can edit a control file.

 

2.controlfiles  contents

 

  • The database name

  • The timestamp of database creation

  • The names and locations of associated datafiles and redo log files

  • Tablespace information

  • Datafile offline ranges

  • The log history

  • Archived log information

  • Backup set and backup piece information

  • Backup datafile and redo log information

  • Datafile copy information

  • The current log sequence number

  • Checkpoint information

 

 

3. the Size of Control Files

    The main determinants of the size of a control file are the values set for t  he MAXDATAFILES, MAXLOGFILES, MAXLOGMEMBERS, MAXLOGHISTORY, and MAXINSTANCES parameters in the CREATE DATABASE

   

    maxdatafiles

    maxlogfiles

    maxlogmembers<=5

    maxloghistory

    maxinstances

 

4. Multiplexing the control file when using SPFILE

   1.select * from v$controlfile/show parameter control;

   2.show parameter spfile  if value not null,it means that you server is now using spfile,otherwise using pfile

   3.alter system set control_files=('','','') scope=spfile

   4.shutdown immediate

   5.cp one to one   //create the additional controlfile

   6.startup

   7.show parameter control

5. Multiplexing the control file when using PFILE 

     1. show parameter spfile

     2.shutdown immeidate

     3.cp one to one

     4.edit the pfile

     5.startup

     6.show parameter spfile;

6. create controlfiles

   if not exist controlfile,modify the db_name,modify maxlogfiles maxlogmembers,maxloghistory,maxinstances,maxdatafiles,we need create new controlfiles.

   1.get informations about datafiles and logfiles

      select * from v$logfile;

      select * from v$datafile;

      the database can not be opened,because of all of controlfiles was lost.we must find the datafiles and logfiles in the enviroment(server).

   2.shutdown immediate

   3.startup nomount;

   4.create controlfile

      set database "lsh"

      norestlogs/resetlogs

      archivelog

      character set al16utf16

      datafile

             '/u01/oradata/lsh/system01.dbf' size 300m,

              '/u01/oradata/lsh/sysaux01.dbf' size 300m,

              '/u01/oradata/lsh/undotbs01.dbf size 200m

          logfile

              group 1 '/u01/oradata/lsh/redo01a.dbf','/u01/oradata/lsh/redo01b.dbf',

              group 2 '/u01/oradata/lsh/redo02a.dbf','/u01/oradata/lsh/redo02b.dbf',

              group 3 '/u01/oradata/lsh/redo03a.dbf','/u01/oradata/lsh/redo03b.dbf'

         maxlogfiles 5

         maxlogmembers 3

         maxloghistory 10

         maxinstances 1

         maxdatafiles 4;

         note:‘resetlogs’ command basically forces the entire database to re-synchronise at time zero, which is fine for getting the database open, but is not exactly useful if you ever need to restore from your prior backups (taken when the database was at a time of, say, 10894329), or if you ever expect to be able to apply redo from priot archive logs (which were also taken when the database was at time 10894329 and earlier). Basically, a ‘resetlogs’ renders your database entirely vulnerable: there are no effective backups, and no effective archives. You are therefore supposed to immediately shut the newly-recovered database down, and perform a whole, closed backup of the entire database (which is not exactly a cheap option).

   5. alter database open /alter database open resetlogs

   6. select * from v$logfile;

          select * from v$datafile;

   7.backup controlfiles

        alter database backup controlfile to trace; textfile

        alter database backup controlfile to '/u01/oradata/lsh/control.bakl'  a binary file 

        note: a binary file record the scn ,the scn is not agree with the scn of the crush database

                we issue the command:

                    1.   recover database using backup controfile 

                    2.   alter database open resetlogs 

                a text file record the location of the datafile and logfile ,so it uses those locations to read the headers of all the data files, whereupon it picks the highest SCN it comes across as the one to write into the header of the Control File it is about to create. That means the re-constructed Control File is already in synchronisation with the data files, and no forced synchronisation to time Zero is therefore required.

So, what’s the best way of backing up the Control File? Answer: multiplex your Control Files so that a recovery is never needed in the first place. But if, despite that, you need some insurance, the Trace File is definitely the better way to go.  It doesn’t render your entire database exposed to failure, it doesn’t effectively trash all prior backups and archives, it works quickly, and well.

 

 

 8.drop the controlfile

        alter system set control_file=;

 

       

 

0
1
分享到:
评论

相关推荐

    RCS Command_V2_7

    The "RCS Commander" tool makes it easy to manage files on your PC and on SINUMERIK solution line control systems. The "RCS Commander" tool offers the following functions: Exchanging data between ...

    Version Control with Subversion (svn手册中英文版)

    That is, Subversion manages files and directories, and the changes made to them, over time. This allows you to recover older versions of your data or examine the history of how your data changed. In ...

    鬼客漏洞扫描器.rar

    ad_manage.asp add_admin.asp addmember.asp adduser.asp adm_login.asp admin/admin.asp admin/admin_login.asp admin/index.asp admin/login.asp admin/manage.asp admin_admin.asp admin_del.asp admin_delete....

    Version Control with Subversion 1.7(r5193)

    That is, Subversion manages files and directories, and the changes made to them, over time. This allows you to recover older versions of your data or examine the history of how your data changed. In ...

    Small.Sharp.Software.Tools.epub

    Turn tedious chores into quick tasks: read and write files, manage complex directory hierarchies, perform network diagnostics, download files, work with APIs, and combine individual programs to ...

    Pro Vim(Apress,2014)

    helping you to manage files across multiple servers and terminal sessions. Avoid common pitfalls and work with best practice ways to efficiently edit and control your files and sessions from the ...

    VisualSVN.1.7.3

    One-stop source control lets you perform all user level Subversion functions — manage project files, checkout, commit, and other operations — within Visual Studio. Compatible with the latest ...

    UE(官方下载)

    UltraEdit includes a Search and Replace Favorites feature that allows you to manage frequently used Find and Replace strings. Create, name, and edit your Search and Replace Favorites... Customizing ...

    WinZip Pro 18.5 Build 11111 (x86-x64)+SerialKey

    Save As, Rename, New Folder make it easier to manage Zip files • New! Zip Properties graphically displays compression savings • New! Encryption Column in Details View shows which files are ...

    ecm_titanium_1.61_www.dpfegr.ru.rar

    interface to create and manage projects for ECM Tuning V1.61 modified files. After reading the file stored in the ECU memory, all you have to do is upload the file and the software starts a search ...

    Oracle.RMAN.11g.Backup.and.Recovery.2010(Oracle RMAN 11g 备份和恢复)

    Work with Oracle RMAN catalogs, packages, and control files Use the Amazon Web Services cloud as an offsite storage solution Create online, offline, and incremental system backups Perform full and ...

    CentOS 7 Linux Server Cookbook(PACKT,2ed,2016).

    Gain best practice methods on sharing files and resources through a network Install and configure common standard services such as web, mail, FTP, database and domain name server technologies ...

    技术文件控制程序(英文版).pdf

    4.3 Other dept.: Responsible for receiving technical document issued by ENG, release and control and manage own department. 5 Work process & content 5.1.1technical documentation category Co., Ltd ...

    VB编程资源大全(英文控件)

    &lt;END&gt;&lt;br&gt;58,RebootPlus.zip Here Is Another OCX File That Logs Off, Shutdown, Restart, Displays Device Manage, And Display Properties.&lt;END&gt;&lt;br&gt;59,RetCal10.zip This Activex control creates retail...

    GE CHANGE MANAGEMENT

    manage a variety of popular automation products from Rockwell, Siemens, Schneider and others, including Modicon ProWORX, Logicmaster 90-30 and 90-70, and GE Fanuc CNC. ■ Factory Layouts: allows you ...

    AWS Certified Developer_Associate Guide-Packt Publishing(2017).pdf

    Create a secured Virtual Private Cloud (VPC) with Public and Private Subnets, Network Access Control, and Security groups Get started with Elastic Compute Cloud (EC2), launching your first EC2 ...

    [NuGet] NuGet 高级程序设计 第2版 (英文版)

    Whether you’re working entirely with .NET assemblies or also using CSS, HTML and JavaScript files within your applications this book will show you how to manage their requirements smoothly and ...

    Active Directory Cookbook, 3rd Edition.pdf

    Covers how to delegate control, view and modify permissions, view effective permissions, and manage Kerberos tickets. Chapter 15, Logging, Monitoring, and Quotas Covers how to enable auditing, ...

    Linux for Developers

    Learn how Linux organizes files and navigate its filesystem Use basic developer commands such as gzip and grep Edit programs with vi and vim, and explore alternative editors Perform basic sysadmin...

    Linux for Developers: Jumpstart Your Linux Programming Skills

    Learn how Linux organizes files and navigate its filesystem Use basic developer commands such as gzip and grep Edit programs with vi and vim, and explore alternative editors Perform basic sysadmin ...

Global site tag (gtag.js) - Google Analytics