Monday, 27 April 2009

Controlling Controlfile Backups

Did you know that you can control the name of your controfile trace backups? I didn't, until Bob Morgan of Stonehill College in Easton, MA pointed out some additional syntax in the ALTER DATABASE command.


I already knew that you could control the filename and location when backing up the controlfile in binary, via:


ALTER DATABASE BACKUP CONTROLFILE TO '<pathame>';


And I knew that you could get a text copy of the commands necessary to rebuild the controlfiles, via:


ALTER DATABASE BACKUP CONTROLFILE TO TRACE;


The resulting text commands are placed in the user's trace file for the session. To find the proper trace file requires knowing the session number; it's in the filename.  (Though I usually cheat, and go to the directory pointed to by the user_dump_dest parameter, sort by modification time, and my session is near the top.)


What Bob pointed out was the variation:


ALTER DATABASE BACKUP CONTROLFILE TO TRACE AS '<filename>';


This still writes to the backup_dump_dest directory, but names the tracefile with your choice of filename instead of the default one that includes the session number.  Much easier to find.


Thanks, Bob!



3 comments:

  1. Dairy Queen has a value of your all visit that is why they introduced an online survey called Dairy Queen Survey on the official website www.dqfansurvey.com.

    DQFanFeedback

    ReplyDelete
  2. Will you participate in the Culvers Opinion Survey, which may be found at www.TellCulvers.com? It is now available to all Culvers customers that shop there.
    tellculvers executed a connected with the WWW review to take an arrangement about tellculvers Helpline notwithstanding your support level thereafter visiting service Click here tellculvers

    ReplyDelete
  3. TellCulvers Around the country, there are currently more than 500 restaurants up for business. This company is owned and operated by a different family entirely.
    At Culvers, you can pick from a wide variety of unusual sandwiches, burgers, soups, and salads. visit here TellCulvers Survey

    ReplyDelete