|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
要想在MySQL与其他数据库之间进行一个面面俱到的功能设置对比,并不是一件容易的MySQL学习教程。随着新软件版本的发布或一些补丁的推出。oracle
Oracle9i新特性:SPFILE的利用
--Howtobackupandrestorespfileandcontrolfileusingautobackupoption
LastUpdated:Wednesday,2004-10-270:40Eygle
本文宣布于itpub手艺丛书《Oracle数据库DBA专题手艺精炼》,未经允许,严禁转载本文.
原文出处:
http://www.eygle.com/faq/Oracle9i.New.Feature.Spfile.04.htm
六.SPFILE的备份与恢复
在本文开篇我们提到,Oracle把Spfile也归入到Rman的备份恢复战略傍边,假如你设置了把持文件主动备份(autoback),那末Oracle会
在数据库产生严重变更(如增减表空间)时主动举行把持文件及Spfile文件的备份。
上面我们来看一下这个历程:
a.设置把持文件主动备份:
[oracle@jumperoracle]$rmantarget/
RecoveryManager:Release9.2.0.3.0-Production
Copyright(c)1995,2002,OracleCorporation.Allrightsreserved.
connectedtotargetdatabase:HSJF(DBID=1052178311)
RMAN>CONFIGURECONTROLFILEAUTOBACKUPON;
usingtargetdatabasecontrolfileinsteadofrecoverycatalog
oldRMANconfigurationparameters:
CONFIGURECONTROLFILEAUTOBACKUPOFF;
newRMANconfigurationparameters:
CONFIGURECONTROLFILEAUTOBACKUPON;
newRMANconfigurationparametersaresuccessfullystored
RMAN>exit
这个设置能够在数据库中经由过程以下体例查询失掉:
[oracle@jumperbdump]$sqlplus"/assysdba"
SQL*Plus:Release9.2.0.3.0-ProductiononSatJan1701:08:052004
Copyright(c)1982,2002,OracleCorporation.Allrightsreserved.
Connectedto:
Oracle9iEnterpriseEditionRelease9.2.0.3.0-Production
WiththePartitioning,OLAPandOracleDataMiningoptions
JServerRelease9.2.0.3.0-Production
SQL>select*fromv$rman_configuration;
CONF#NAMEVALUE
---------------------------------------------
1CONTROLFILEAUTOBACKUPON
b.纪录数据库变更
SQL>createtablespaceeygle
2datafile/data1/oracle/oradata/eygle01.dbf
3size5M;
Tablespacecreated.
假如新创立一个表空间,这时候候反省alert<sid>.log文件,你能够在个中发明如许的备份信息:
SatJan1700:55:572004
Startingcontrolautobackup
ControlautobackupwrittentoDISKdevice
handle/opt/oracle/product/9.2.0/dbs/c-1052178311-20040117-00
Completed:createtablespaceeygle
datafile/data1/oracle/oradata/eygle01.dbf’
假如利用rman举行备份,在提醒中你能够看到以下信息:
RMAN>configurecontrolfileautobackupon;
oldRMANconfigurationparameters:
CONFIGURECONTROLFILEAUTOBACKUPOFF;
newRMANconfigurationparameters:
CONFIGURECONTROLFILEAUTOBACKUPON;
newRMANconfigurationparametersaresuccessfullystored
RMAN>run
2>{
3>allocatechannelch1typediskformat=e:oracleorabakpenny%t.arc;
4>backuparchivelogalldeleteallinput;
5>releasechannelch1;
6>}
allocatedchannel:ch1
channelch1:sid=13devtype=DISK
Startingbackupat02-DEC-03
currentlogarchived
channelch1:startingarchivelogbackupset
channelch1:specifyingarchivelog(s)inbackupset
inputarchivelogthread=1sequence=63recid=168stamp=511712617
inputarchivelogthread=1sequence=64recid=169stamp=511712620
inputarchivelogthread=1sequence=65recid=170stamp=511712626
inputarchivelogthread=1sequence=66recid=171stamp=511712690
channelch1:startingpiece1at02-DEC-03
channelch1:finishedpiece1at02-DEC-03
piecehandle=E:ORACLEORABAKPENNY511712693.ARCcomment=NONE
channelch1:backupsetcomplete,elapsedtime:00:00:03
channelch1:deletingarchivelog(s)
archivelogfilename=E:ORACLEORADATAPENNYARCHIVE1_63.DBFrecid=168stamp=511712617
archivelogfilename=E:ORACLEORADATAPENNYARCHIVE1_64.DBFrecid=169stamp=511712620
archivelogfilename=E:ORACLEORADATAPENNYARCHIVE1_65.DBFrecid=170stamp=511712626
archivelogfilename=E:ORACLEORADATAPENNYARCHIVE1_66.DBFrecid=171stamp=511712690
Finishedbackupat02-DEC-03
StartingControlFileandSPFILEAutobackupat02-DEC-03
piecehandle=E:ORACLEORA92DATABASEC-3627775766-20031202-01comment=NONE
FinishedControlFileandSPFILEAutobackupat02-DEC-03
releasedchannel:ch1
我们复杂看一下主动备份的把持文件及spfile文件的格局及定名划定规矩:
c-IIIIIIIIII-YYYYMMDD-QQ
c------------------------把持文件
IIIIIIIIII---------DBID
YYYYMMDD------------工夫戳
QQ----------------------序号00-FF,16进制暗示
c.利用主动备份恢复spfile文件
[oracle@jumperbdump]$rmantarget/
RecoveryManager:Release9.2.0.3.0-Production
Copyright(c)1995,2002,OracleCorporation.Allrightsreserved.
connectedtotargetdatabase:HSJF(DBID=1052178311)
RMAN>restorespfileto/tmp/spfileeygle.orafromautobackup;
Startingrestoreat17-JAN-04
usingtargetdatabasecontrolfileinsteadofrecoverycatalog
allocatedchannel:ORA_DISK_1
channelORA_DISK_1:sid=18devtype=DISK
channelORA_DISK_1:lookingforautobackuponday:20040117
channelORA_DISK_1:autobackupfound:c-1052178311-20040117-01
channelORA_DISK_1:SPFILErestorefromautobackupcomplete
Finishedrestoreat17-JAN-04
RMAN>exit
RecoveryManagercomplete.
[oracle@jumperbdump]$ls-l/tmp/spfileeygle.ora
-rw-r-----1oracledba35841月1709:34/tmp/spfileeygle.ora
你一样能够经由过程这类办法恢复把持文件,示比方下:
[oracle@jumperbdump]$rmantarget/
RecoveryManager:Release9.2.0.3.0-Production
Copyright(c)1995,2002,OracleCorporation.Allrightsreserved.
connectedtotargetdatabase:HSJF(DBID=1052178311)
RMAN>restorecontrolfileto/tmp/control01.ctlfromautobackup;
Startingrestoreat17-JAN-04
usingtargetdatabasecontrolfileinsteadofrecoverycatalog
allocatedchannel:ORA_DISK_1
channelORA_DISK_1:sid=10devtype=DISK
channelORA_DISK_1:lookingforautobackuponday:20040117
channelORA_DISK_1:autobackupfound:c-1052178311-20040117-02
channelORA_DISK_1:controlfilerestorefromautobackupcomplete
Finishedrestoreat17-JAN-04
RMAN>exit
RecoveryManagercomplete.
[oracle@jumperbdump]$ls-l/tmp/control*
-rw-r-----1oracledba18923521月1709:44/tmp/control01.ctl
Oracle9i主动备份把持文件的功效给我们带来了极年夜的收益,经由过程主动备份,在数据库呈现告急情况的时分,你大概能够从这个主动备份中取得更
为无效实时的把持文件.
缺省的,这个主动备份功效是封闭的,你能够用我们下面提到的办法翻开该功效.
<<上一页下一页>>
本文作者:
eygle,Oracle手艺存眷者,来自中国最年夜的Oracle手艺论坛itpub.
www.eygle.com是作者的团体站点.你可经由过程Guoqiang.Gai@gmail.com来接洽作者.接待手艺切磋交换和链接互换.
原文出处:
http://www.eygle.com/faq/Oracle9i.New.Feature.Spfile.04.htm
与其他数据库相比,MySQL易学易用。 |
|