国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 數據庫 > Oracle > 正文

Oracle9i新特點-SPFILE的使用

2024-08-29 13:29:52
字體:
來源:轉載
供稿:網友

商業源碼熱門下載www.html.org.cn


oracle9i新特點:spfile的使用

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

last updated: wednesday, 2004-10-27 0:40 eygle
    
 
本文發表于itpub技術叢書《oracle數據庫dba專題技術精粹》,未經許可,嚴禁轉載本文.




原文出處:

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


六. spfile的備份與恢復


在本文開篇我們提到,oracle把spfile也納入到rman的備份恢復策略當中,如果你配置了控制文件自動備份(autoback),那么oracle會
在數據庫發生重大變化(如增減表空間)時自動進行控制文件及spfile文件的備份。

下面我們來看一下這個過程:
a. 設置控制文件自動備份:

[[email protected] 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




這個設置可以在數據庫中通過如下方式查詢得到:



[[email protected] 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 - 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. 記錄數據庫變化

 

sql> create tablespace eygle
2 datafile '/data1/oracle/oradata/eygle01.dbf'
3 size 5m;

tablespace created.

 

 

如果新創建一個表空間,這時候檢查alert<sid>.log文件,你可以在其中發現這樣的備份信息:


sat jan 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’



如果使用rman進行備份,在提示中你可以看到如下信息:



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 delete 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

 



我們簡單看一下自動備份的控制文件及spfile文件的格式及命名規則:
c-iiiiiiiiii-yyyymmdd-qq
c ------------------------控制文件
iiiiiiiiii---------dbid
yyyymmdd------------時間戳
qq----------------------序號00-ff,16進制表示

 

c. 使用自動備份恢復spfile文件



 

[[email protected] 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.
[[email protected] bdump]$ ls -l /tmp/spfileeygle.ora
-rw-r----- 1 oracle dba 3584 1月 17 09:34 /tmp/spfileeygle.ora

 

你同樣可以通過這種方法恢復控制文件,示例如下:



 

[[email protected] 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.
[[email protected] bdump]$ ls -l /tmp/control*
-rw-r----- 1 oracle dba 1892352 1月 17 09:44 /tmp/control01.ctl

 

oracle9i自動備份控制文件的功能給我們帶來了極大的收益,通過自動備份,在數據庫出現緊急狀況的時候,你可能可以從這個自動備份中獲得更
為有效及時的控制文件.

缺省的,這個自動備份功能是關閉的,你可以用我們上面提到的方法打開該功能.


 


<<上一頁 下一頁>>



本文作者:
eygle,oracle技術關注者,來自中國最大的oracle技術論壇itpub.
www.eygle.com是作者的個人站點.你可通過[email protected]來聯系作者.歡迎技術探討交流以及鏈接交換.

原文出處:

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

 
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 永吉县| 叶城县| 柳林县| 永登县| 桂阳县| 新田县| 泸水县| 福建省| 阜新市| 杭州市| 鄂尔多斯市| 云安县| 裕民县| 离岛区| 余姚市| 芮城县| 兴和县| 苗栗市| 沾益县| 安宁市| 吉安市| 原阳县| 曲阳县| 哈密市| 丹江口市| 东台市| 珠海市| 陈巴尔虎旗| 册亨县| 博爱县| 卓尼县| 东宁县| 南康市| 县级市| 石屏县| 清远市| 莆田市| 金堂县| 分宜县| 岗巴县| 涡阳县|