Oracle9i New Features - Use of SPFile

xiaoxiao2021-03-06  132

Oracle9i new features: SPFILE use

--How to Backup and Restore SPFile and ControlFile Using Autoback Option

Last Updated:

Wednesday, 2004-10-27 0:40

Eygle

This paper is published in the ITPUB Technology Series "Oracle Database DBA Special Technology", which is strictly prohibited to reprint this article without permission.

Original source:

http://www.eygle.com/faq/oracle9i.new.feature.spfile.04.htm

6. SPFILE backup and recovery

In this article, it is mentioned that Oracle is also imported into the RMAN's backup recovery policy. If you configure the control file automatic backup (Autoback), Oracle will automatically perform major changes in the database (such as increasing and subtiles) Control files and spfile files backup.

Let's take a look at this process: a. Set the control file automatic backup:

[Oracle @ Jumper Oracle] $ RMAN Target /

Recovery Manager: Release 9.2.0.3.0 - Production

CopyRight (C) 1995, 2002, Oracle Corporation. All Rights Reserved.

Connected to Target Database: HSJF (DBID = 1052178311)

Rman> Configure ControlFile Autobackup ON;

using target database controlfile instead of recovery catalogold RMAN configuration parameters: CONFIGURE CONTROLFILE AUTOBACKUP OFF; new RMAN configuration parameters: CONFIGURE CONTROLFILE AUTOBACKUP ON; new RMAN configuration parameters are successfully stored

Rman> EXIT

This setting can be queried by the database in the database:

[Oracle @ Jumper Bdump] $ SQLPLUS "/ as sysdba"

SQL * Plus: Release 9.2.0.3.0 - Production on sat Jan 17 01:08:05 2004

CopyRight (C) 1982, 2002, Oracle Corporation. All Rights Reserved.

Connected to: Oracle9i Enterprise Edition Release 9.2.0.3.0 - Productionwith The Partitioning, OLAP AND ORACLE DATA MINING OPTIONSJSERVER Release 9.2.0.3.0 - Production

SQL> Select * from v $ rman_configuration; conf # name value -------------------------------------------------------------------------------------------------------------------------------------------------------------------- -------- 1 ControlFile AutoBackup ON

b. Record database changes

SQL> CREATE TABLESPACE EYGLE 2 DATAFILE '/DATA1/Oracle/oradata/eygle01.dbf'3 size 5m;

TableSpace created.

If you create a table space, check the alert .log file, you can find such backup information:

Sat Jan 17 00:55:57 2004Starting control autobackupControl autobackup written to DISK devicehandle '/opt/oracle/product/9.2.0/dbs/c-1052178311-20040117-00'Completed: create tablespace eygledatafile' / data1 / oracle / oradata /EGLE01.DBF 'If you use RMAN to back up, you can see the following information in your prompt:

Rman> Configure ControlFile Autobackup ON;

Old Rman Configuration Parameters: Configure ControlFile Autoback Off; New RMAN Configuration Parameters: Configure ControlFile Autobackup on; New Rman Configuration Parameters Are SuccessFully Stored

RMAN> RUN2> {3> Allocate CHANNEL CH1 TYPE DISK FORMAT = 'E: /oracle/orabak/penny%t.arc'; 4> Backup ArchiveLog All delete All Input; 5> Release CHANNEL CH1; 6>}

Allocated Channel: Ch1channel Ch1: SID = 13 DevType = Disk

Starting backup at 02-DEC-03current log archivedchannel ch1: starting archive log backupsetchannel ch1: specifying archive log (s) in backup setinput archive log thread = 1 sequence = 63 recid = 168 stamp = 511712617input archive log thread = 1 sequence = 64 recid = 169 stamp = 511712620input archive log thread = 1 sequence = 65 recid = 170 stamp = 511712626input archive log thread = 1 sequence = 66 recid = 171 stamp = 511712690channel ch1: starting piece 1 at 02-DEC-03channel ch1: finished piece 1 at 02-DEC-03piece handle = E: /ORACLE/ORABAK/PENNY511712693.ARC comment = NONEchannel ch1: backup set complete, elapsed time: 00: 00: 03channel ch1: deleting archive log (s) archive log filename = E: / ORACLE /ORADATA/PENNY/ARCHIVE/1_63.DBF recid = 168 stamp = 511712617archive log filename = E: /ORACLE/ORADATA/PENNY/ARCHIVE/1_64.DBF recid = 169 stamp = 511712620archive log filename = E: / ORACLE / ORADATA / PENNY /Archive/1_65.dbf recid = 170 stamp = 511712626archive log filename = E: /oracle/oradata/penny/archive/1_66.dbf recid = 171 stamp = 511712690finished backup at 02-DEC-03Starting Control File and SPFILE Autobackup at 02-DEC-03piece handle = E: / ORACLE / ORA92 / DATABASE / C-3627775766-20031202-01 comment = NONEFinished Control File and SPFILE Autobackup at 02-DEC-03

Released Channel: CH1

We briefly look at the automatic backup control file and the format of the spfile file and naming rules: C-IIIIIIII-YYYYMMDD-QQC ---------------------- Control Document IIIIIIIIII --------- DBIDYYYYMMDD ------------ Time stamp QQ -------------------- Serial number 00-ff, 16 credit

c. Recover spfile files with automatic backup

[Oracle @ Jumper Bdump] $ RMAN Target /

Recovery Manager: Release 9.2.0.3.0 - Production

CopyRight (C) 1995, 2002, Oracle Corporation. All Rights Reserved.

Connected to Target Database: HSJF (DBID = 1052178311) RMAN> Restore SPFile to '/tmp/spfileeygle.ora' from Autobackup;

Starting Restore AT 17-JAN-04

using target database controlfile instead of recovery catalogallocated channel: ORA_DISK_1channel ORA_DISK_1: sid = 18 devtype = DISKchannel ORA_DISK_1: looking for autobackup on day: 20040117channel ORA_DISK_1: autobackup found: c-1052178311-20040117-01channel ORA_DISK_1: SPFILE restore from autobackup completeFinished restore at 17 -JAN-04

Rman> EXIT

Recovery Manager Complete. [Oracle @ Jumper Bdump] $ ls -l /tmp/spfileeygle.ora-rw-r ------ 1 Oracle DBA 3584 Jan 201 09:34 / TMP/spfileeygle.ora

You can also resume the control file through this method, as follows:

[Oracle @ Jumper Bdump] $ RMAN Target /

Recovery Manager: Release 9.2.0.3.0 - Production

CopyRight (C) 1995, 2002, Oracle Corporation. All Rights Reserved.

Connected to Target Database: HSJF (DBID = 1052178311)

Rman> rest/control01.ctl 'from autobackup;

Starting Restore AT 17-JAN-04

using target database controlfile instead of recovery catalogallocated channel: ORA_DISK_1channel ORA_DISK_1: sid = 10 devtype = DISKchannel ORA_DISK_1: looking for autobackup on day: 20040117channel ORA_DISK_1: autobackup found: c-1052178311-20040117-02channel ORA_DISK_1: controlfile restore from autobackup completeFinished restore at 17 -JAN-04

Rman> EXIT

Recovery Manager Complete. [Oracle @ Jumper Bdump] $ ls -l / tmp / control * -rw-r ----- 1 Oracle DBA 1892352 Jan 201 09:44 / TMP/Control01.ctl

Oracle9i automatic backup control file features a great income, through automatic backup, you may be able to get more efficient and promptly control files from this automatic backup in this automatic backup.

By default, this automatic backup function is closed, you can open this feature with the methods mentioned above.

<< Previous Next >>

Author: eygle, Oracle technology followers, Oracle technical forum itpub.www.eygle.com from China is the biggest author's personal site you may contact the author by Guoqiang.Gai@gmail.com welcome to explore technical exchanges and links. Exchange. Original article:

http://www.eygle.com/faq/oracle9i.new.feature.spfile.04.htm

转载请注明原文地址:https://www.9cbs.com/read-99867.html

New Post(0)