The use of new features of Oracle9i-spfile

Source: Internet
Author: User
Tags exit dba log new features reserved thread oracle database backup
Oracle
Oracle9i new features: the use of SPFile

--how to backup and restore SPFile and controlfile using autobackup option

Last Updated:wednesday, 2004-10-27 0:40 eygle


This article is published in the Itpub Technology series "Oracle Database DBA Special Technology Essence", without permission, is prohibited reproduced this article.




Original source:

Http://www.eygle.com/faq/Oracle9i.New.Feature.Spfile.04.htm


Six. Backup and recovery of SPFile


As we mentioned at the beginning of this article, Oracle has included SPFile in the Rman backup recovery strategy, and if you have configured automatic backup of control files (autoback), Oracle will
Automatically control files and SPFile files when a significant change in the database occurs, such as the addition or decrease of table space.

Now let's take a look at this process:
A. Set 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 catalog
Old 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 in the database in the following way:



[Oracle@jumper bdump]$ Sqlplus "/As SYSDBA"

Sql*plus:release 9.2.0.3.0-production on Sat 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-production
With the partitioning, OLAP and Oracle Data Mining options
Jserver Release 9.2.0.3.0-production

Sql> select * from V$rman_configuration;
conf# NAME VALUE
---------- ------------------------- ----------
1 Controlfile autobackup on







B. Recording database changes



sql> Create Tablespace Eygle
2 datafile '/data1/oracle/oradata/eygle01.dbf '
3 Size 5M;

Tablespace created.





If you create a new tablespace and then check the Alert<sid>.log file, you can find the backup information in it:


Sat 17 00:55:57 2004
Starting Control Autobackup
Control autobackup written to DISK device
Handle '/opt/oracle/product/9.2.0/dbs/c-1052178311-20040117-00 '
Completed:create tablespace Eygle
DataFile '/data1/oracle/oradata/eygle01.dbf '



If you use Rman for backup, you can see the following message in the prompt:



Rman> Configure Controlfile autobackup on;

Old RMAN configuration parameters:
CONFIGURE Controlfile autobackup off;
New RMAN configuration parameters:
CONFIGURE Controlfile autobackup on;
New RMAN configuration parameters are successfully stored

Rman> Run
2> {
3> Allocate channel CH1 type disk format= ' E:\oracle\orabak\penny%t.arc ';
4> backup Archivelog all deletes all input;
5> release channel CH1;
6>}

Allocated Channel:ch1
Channel Ch1:sid=13 Devtype=disk

Starting backup at 02-dec-03
Current log Archived
Channel ch1:starting Archive Log backupset
Channel ch1:specifying archive log (s) in backup set
Input archive log thread=1 sequence=63 recid=168 stamp=511712617
Input archive log thread=1 sequence=64 recid=169 stamp=511712620
Input archive log thread=1 sequence=65 recid=170 stamp=511712626
Input archive log thread=1 sequence=66 recid=171 stamp=511712690
Channel ch1:starting piece 1 at 02-dec-03
Channel ch1:finished piece 1 at 02-dec-03
Piece handle=e:\oracle\orabak\penny511712693. ARC Comment=none
Channel Ch1:backup set complete, elapsed time:00:00:03
Channel ch1:deleting archive log (s)
Archive Log filename=e:\oracle\oradata\penny\archive\1_63.dbf recid=168 stamp=511712617
Archive Log filename=e:\oracle\oradata\penny\archive\1_64.dbf recid=169 stamp=511712620
Archive Log filename=e:\oracle\oradata\penny\archive\1_65.dbf recid=170 stamp=511712626
Archive Log filename=e:\oracle\oradata\penny\archive\1_66.dbf recid=171 stamp=511712690
Finished backup at 02-dec-03

Starting control File and SPFILE autobackup at 02-dec-03
Piece handle=e:\oracle\ora92\database\c-3627775766-20031202-01 Comment=none
Finished control File and SPFILE autobackup at 02-dec-03

Released Channel:ch1





Let's take a quick look at the automatic backup control file and spfile file format and naming rules:
C-iiiiiiiiii-yyyymmdd-qq
C------------------------Control files
IIIIIIIIII---------DBID
YYYYMMDD------------time Stamp
QQ----------------------Serial Number 00-ff,16 system representation



C. Using automatic Backup to recover SPFile files





[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 catalog
Allocated Channel:ora_disk_1
Channel Ora_disk_1:sid=18 Devtype=disk
Channel ora_disk_1:looking for Autobackup on day:20040117
Channel Ora_disk_1:autobackup found:c-1052178311-20040117-01
Channel Ora_disk_1:spfile Restore from Autobackup complete
Finished restore at 17-jan-04

Rman> exit


Recovery Manager complete.
[Oracle@jumper bdump]$ ls-l/tmp/spfileeygle.ora
-RW-R-----1 Oracle DBA 3584 January 09:34/tmp/spfileeygle.ora



You can also recover the control file in this way, as shown in the following example:





[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 Controlfile to '/tmp/control01.ctl ' from autobackup;

Starting restore at 17-jan-04

Using target database Controlfile instead of recovery catalog
Allocated Channel:ora_disk_1
Channel ora_disk_1:sid=10 Devtype=disk
Channel ora_disk_1:looking for Autobackup on day:20040117
Channel Ora_disk_1:autobackup found:c-1052178311-20040117-02
Channel Ora_disk_1:controlfile Restore from Autobackup complete
Finished restore at 17-jan-04

Rman> exit


Recovery Manager complete.
[Oracle@jumper bdump]$ ls-l/tmp/control*
-RW-R-----1 Oracle DBA 1892352 January 09:44/TMP/CONTROL01.CTL



The Oracle9i automatic backup control file provides us with a great deal of revenue, and by automating backups, you may be able to get more from this automated backup when the database is in an emergency situation
For effective and timely control of documents.

By default, this automatic backup function is turned off, and you can turn it on by using the method we mentioned above.





<< previous page next page >>



The author of this article:
Eygle,oracle technology concern, from China's largest Oracle technology forum Itpub.
Www.eygle.com is the author's personal site. You can contact the author by Guoqiang.Gai@gmail.com. Welcome technical discussions and exchange of links.

Original source:

Http://www.eygle.com/faq/Oracle9i.New.Feature.Spfile.04.htm




Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.