Home > Database > Mysql Tutorial > body text

利用RMAN自动备份转储Spfile

WBOY
Release: 2016-06-07 16:49:21
Original
915 people have browsed it

以上过程就是通过rman的自动备份生成的spfile文件,这种方法适用于丢失了服务器的参数文件时,并且要保证rman设置了控制文件的自


【情景简介】
 
生产环境丢失了服务器的参数文件,rman已开启自动备份设置。
 
【操作过程简述】
 
----启动rman
 
$rman target /
 
----检查rman设置
 
RMAN> show all;
 
----配置一遍rman自动备份控制文件,模拟初次设置rman自动备份控制文件
 
RMAN>CONFIGURE CONTROLFILEAUTOBACKUP ON;
 
RMAN>CONFIGURE CONTROLFILEAUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '%F'; 

----根据维护人员所制定的执行计划完成了控制文件自动备份之后
 
----到相应目录下查看自动备份的控制文件的格式
 
$ls
 
----格式说明:控制文件备份名_参数文件-数据库ID(DBID)-备份日期-序列号
 
ctl_spfile_c-2712710828-20140526-38
 
ctl_spfile_c-2712710828-20140526-39
 
----查询数据库的DBID,,rman中自动备份的控制文件会以此命名
 
----生产环境下查看v$database需要管理员赋权
 
SQL> select  DBID,NAME from v$database;
 
DBID        NAME
 
----------      ---------
 
2712710828  DRON
 
$export ORALCE_SID=DRON
 
----创建一个简单的pfile文件启动实例或者从$Oracle_HOME/dbs下cp一个pfile文件
 
$vi initDRON.ora   

"initDRON.ora" [New file]

db_name='DRON'
 
db_block_size=8192
 
$sqlplus / as sysdba
 
----用新创建的pfile启动实例
 
SQL> startup nomount pfile ='/home/oracle/initDRON.ora'; 

$export ORACLE_SID=DRON
 
$rman target/
 
RMAN> set dbid=2712710828   

----转储spfile从自动控制文件的备份
 
RMAN> restore spfile [to '/home/oracle/initDRON.ORA'] from autobackup; 

【小结】
 
以上过程就是通过rman的自动备份生成的spfile文件,这种方法适用于丢失了服务器的参数文件时,并且要保证rman设置了控制文件的自动备份,用此方法便可以解决。

--------------------------------------推荐阅读 --------------------------------------

RMAN 配置归档日志删除策略

Oracle基础教程之通过RMAN复制数据库

RMAN备份策略制定参考内容

RMAN备份学习笔记

Oracle数据库备份加密 RMAN加密

--------------------------------------分割线 --------------------------------------

本文永久更新链接地址:

linux

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!