oracle rman备份spfile,RMAN备份恢复之SPFILE的恢复(一)

缺少初始化文件,数据库是无法启动的。如果通过RMAN备份了初始化参数,那么可以通过RMAN对初始化参数进行恢复。

这篇文章简单介绍CATALOG方式下初始化参数的恢复问题。

初始化参数的丢失和损坏,并不会造成太严重的问题,即使是最坏的情况,导致无法进行恢复,也是可以通过手工编辑一个新的PFILE文件,来启动实例的。

而且,在数据库的alert文件中包含了每次数据库启动使用的所有非默认值初始化参数,因此重新编写一个初始化参数并不困难。

不过,既然对SPFILE进行了备份,那么完全可以采用恢复的方式来还原SPFILE。

对于CATALOG方式,SPFILE的恢复相对简单很多。不过Oracle文档上对于SPFILE的恢复的描述有些小问题:SET DBID这个步骤是不能省略的,否则会报错。

$ rman target / catalog "rman/rman@testcen"

Recovery Manager: Release 9.2.0.4.0 - Production

Copyright (c) 1995, 2002, Oracle Corporation. All rights reserved.

connected to target database (not started)

connected to recovery catalog database

RMAN> startup force nomount;

startup failed: ORA-01078: failure in processing system parameters

LRM-00109: could not open parameter file '/opt/ora9/product/9.2/dbs/inittestdata.ora'

trying to start the Oracle instance without parameter files ...

Oracle instance started

Total System Global Area 97588504 bytes

Fixed Size 451864 bytes

Variable Size 46137344 bytes

Database Buffers 50331648 bytes

Redo Buffers 667648 bytes

RMAN> restore spfile;

Starting restore at 27-6月-07

RMAN-00571: ===========================================================

RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============

RMAN-00571: ===========================================================

RMAN-03002: failure of restore command at 06/27/2007 10:36:46

RMAN-12010: automatic channel allocation initialization failed

RMAN-06004: ORACLE error from recovery catalog database: RMAN-20001: target database not found in recovery catalog

正确的方式如下:

$ rman target / catalog "rman/rman@testcen"

Recovery Manager: Release 9.2.0.4.0 - Production

Copyright (c) 1995, 2002, Oracle Corporation. All rights reserved.

connected to target database: DUMMY (not mounted)

connected to recovery catalog database

RMAN> set dbid 2270762593;

executing command: SET DBID

RMAN> startup force nomount

startup failed: ORA-01078: failure in processing system parameters

LRM-00109: could not open parameter file '/opt/ora9/product/9.2/dbs/inittestdata.ora'

trying to start the Oracle instance without parameter files ...

Oracle instance started

Total System Global Area 97588504 bytes

Fixed Size 451864 bytes

Variable Size 46137344 bytes

Database Buffers 50331648 bytes

Redo Buffers 667648 bytes

RMAN> restore spfile;

Starting restore at 27-6月-07

allocated channel: ORA_DISK_1

channel ORA_DISK_1: sid=9 devtype=DISK

allocated channel: ORA_DISK_2

channel ORA_DISK_2: sid=10 devtype=DISK

allocated channel: ORA_DISK_3

channel ORA_DISK_3: sid=11 devtype=DISK

channel ORA_DISK_1: starting datafile backupset restore

channel ORA_DISK_1: restoring SPFILE

output filename=/opt/ora9/product/9.2/dbs/spfiletestdata.ora

channel ORA_DISK_1: restored backup piece 1

piece handle=/data1/backup/testdata/c-2270762593-20070626-01 tag=null params=NULL

channel ORA_DISK_1: restore complete

Finished restore at 27-6月-07

RMAN> startup force

Oracle instance started

database mounted

database opened

Total System Global Area 1175525576 bytes

Fixed Size 452808 bytes

Variable Size 335544320 bytes

Database Buffers 838860800 bytes

Redo Buffers 667648 bytes

starting full resync of recovery catalog

full resync complete

SET DBID这个步骤是必须的。对于CATALOG模式,如果不知道数据库的ID,可以通过CATALOG用户登陆到CATALOG数据库中进行查询:

$ sqlplus rman/rman@testcen

SQL*Plus: Release 9.2.0.4.0 - Production on星期三6月27 15:36:30 2007

Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.

Connected to:

Oracle9i Enterprise Edition Release 9.2.0.4.0 - Production

With the Partitioning, OLAP and Oracle Data Mining options

JServer Release 9.2.0.4.0 - Production

Session altered.

SQL> select dbid from rc_database where name = 'TESTDATA';

DBID

----------

2270762593

恢复之后,重启数据库实例,使得SPFILE生效。

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/500819.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

c# 获取路径的盘符_c#获取驱动器盘符

在编写某些Windows管理应用程序时,能够从自定义的驱动器选择列表框中进行选择无疑是非常专业的,使用Delphi或者C的早期版本时我们都必须使用Win32所提供的许多关于获取磁盘信息的API函数来分别获取像卷标、序列号以及剩余空间等信息,现在我们…

php fckeditor demo,如何使用PHP添加fckeditor

[更新答案]你需要把你的fckeditor代码放在 标签而不是在顶部。此外,$_POST["FCKEditor"]需要放进去$oFCKeditor->Value变量。这样做:它在我的机器上工作正常,并在fckeditor文本区域内显示格式化的HTML:EditorTitle : include("fckeditor.php");$sBaseP…

php 命名空间通俗易懂_PHP进阶由浅入深掌握面向对象开发

视频教程出自黑马程序员PHP基础_由浅入深掌握面向对象开发【讲解方式】系统梳理和分解知识,各个点逐步讲解,由浅入深,通俗易懂,层层深入【课程亮点】1,已经完成PHP基础知识学习的朋友有帮助2,生动形象&…

qt读oracle时间戳,QT利用QDateTime获取当前时间戳的方法toTime_t

1.toTime_t()把2014年12月19日10:24:40这样的QDateTime的格式转变为1418955940这样的时间戳QDateTime time QDateTime::currentDateTime(); //获取当前时间int timeT time.toTime_t(); //将当前时间转为时间戳2.与toTime_t()功能相反的是fromTime_…

怎么查看父子级目录linux,如何查找linux中特定父目录的所有文件?

如何在linux命令终端中找到具有特定父目录的所有文件?我知道找到所有的文件,使用这样查找:find . -name filename.extension但是可以找到所有filename.extension文件与父目录的文件夹名吗?我尝试了以下操作,但这不行:find . -name…

如何在matlab里输入复杂公式_在MATLAB作图中输出漂亮的公式

函数语法效果语法效果语法效果\sin\theta\cos\theta\tan\theta\arcsin\frac{L}{r}\arccos\frac{T}{r}\arctan\frac{L}{T}\sinh g\cosh h\tanh i\operatorname{sh}j\operatorname{argsh}k\operatorname{ch}h\operatorname{argch}l\operatorname{th}i\operatorname{argth}mk(x)\l…

ln -s命令 linux,Linux下 ln -s 软链接用法

NAMEln - make links between filesSYNOPSISln [OPTION]... TARGET [LINK_NAME]ln [OPTION]... TARGET... DIRECTORYln [OPTION]... --target-directoryDIRECTORY TARGET...软链接用法是: ln -s 实际存在的目标目录 链接名称(不存在的) 。[rootDMDIDATAGUARD /]# cd…

cryptapi双向认证_[加密解密]CryptoAPI简介

CryptoAPI概述Windows CryptoAPI是Microsoft 公司提出的安全加密应用服务框架,也是PKI推荐使用的加密 API。它提供了在Win32 环境下使用认证、编码、加密和签名等安全服务时的标准加密接口,用于增强应用程序的安全性与可控性。应用开发者可以在不了解复杂…

vue前后分离session实现_vue2 前后端分离项目ajax跨域session问题解决

最近学习使用vuejs前后端分离,重构一个已有的后台管理系统,遇到了下面这个问题:实现跨域请求时,每次ajax请求都是新的session,导致无法获取登录信息,所有的请求都被判定为未登陆。1、 vuejs ajax跨域请求最…

win10时间和linux不同步时间,ubuntu16和windows10的时间同步问题

一句话搞定sudo hwclock --localtime --systohc命令: hwclock全称: hardware clock硬件时钟作用: Query or set the hardware clock.Functions:-h, --help show this help text and exit-r, --show read hardware clock and print result--get re…

linux直接用iso文件装服务,linux系统安装iso文件方法

摘要:linux系统下怎么安装iso文件?安装步骤:1、在/mnt目录下,创建相应的iso文件夹,例如iso。2、运行以下命令,挂载iso文...安装步骤:1、在/mnt目录下,创建相应…

smbus协议的command_SMBus总线概述

1.概述:系统管理总线是一种两线制接口。它基于I2C 总线原理演变而来,可以认为是简化版的I2C总线。SMBus最初是应用到智能电池,如电池充电器和一个微控制器。其提供一个系统和电源管理相关的任务控制总线。如今,SMBus总线可以连接的…

在电脑上显示未知发布者怎么办_电脑提示未知发布者 - 卡饭网

IE浏览器提示未知发布者安全警告怎么办IE浏览器提示未知发布者安全警告怎么办 IE浏览器提示未知发布者安全警告的解决方法, IE浏览器提示未知发布者怎么办?安下小编就来分析一下. 1.打开IE浏览器,从右上角打开Internet选项; 2.点击切换到"高级"选项卡; 3.在设置列表…

linux 邮件日志,linux下如何建立邮件日志

先关闭sendmailservice sendmail stopchkconfig sendmail off安装DNSmount /dev/cdrom /mntyum install bind-*配置主DNS服务器vim /var/named/chroot/etc/named.confoptions {directory "/var/named";};zone "daijingjie.com" {type master;file &qu…

linux 修改网卡报错xe,centos修改端口出现Failed to start OpenSSH server daemon 启动报错和-xe报错的解决方法...

修改SSH端口:# vi /etc/ssh/sshd_config里面找port 22,在前面加上#,去掉注释,然后把22改成你想要的端口。#port 22建议去掉注释之前,先增加你需要的端口,比如:12345端口,生效后在删除…

python中issubset是什么_python3解释器执行 {2, 3, 4}.issubset({2, 3, 4})的结果为__。

【单选题】一个1拖4的USB集线器,用外接电源供电的情况下,为下游USB供电的电流是()?【单选题】组成容量为128K32位的存储器,需用( )片具有16位地址码可同时存取8位数据的RAM集成芯片。【判断题】在排料过程中,系统可以自…

scp linux 自动化,expect(spawn) 自动化git提交和scp拷贝---centos(linux)

在进行SCP文件拷贝中,往往需要进行用户密码的输入,即用户交互。若采用自动化脚本的方式进行,则可用以下方式#!/usr/bin/expect# 设置参数set src [lindex $argv 0]set dest [lindex $argv 1]set password [lindex $argv 2]set appId [lindex …

java或异运算_java中与运算,或运算,异或运算,取反运算

//与运算 & 规则 :都为1时才为1System.out.println( 7 & 9);/** 7二进制 0111* 9二进制 1001* -----------* 0001 1* *///或运算 | 规则:有一个为1,则为1System.out.println(7 | 9);/** 7二进制 0111* 9二进制 1001* ---…

迷你linux操作系统,自己动手做一个迷你型Linux操作系统

本文要构建的这个迷你型的 Linux 系统只能在一台特定的单机上运行,如果读者朋友们有兴趣的话,在这个系统的基础上加以改进,是可以构建出通用的、可以在大多数常规 PC 机上即插即用的系统来的。但是这已经不在本文的话题之内了,读者…

linux查看vtk版本,vtk在linux下的安装(12月8日更新)

安装前准备运行环境:ubuntu14.04 LTS, 64bit //本人在ubuntu 14.10下安装失败安装版本:vtk6.1.0.tar.gz vtkdata6.1.0.tar.gz编译器:g$ sudo apt-cache search gcc*g以保证能搜索到g,然后$ sudo apt-get install gmak…