记一次异机rman还原后的操作
当时从主库通过rman备份到目前测试库还原之后,由于备份是在备库备份的,所以数据库还原后状态为readonly,standby_file_management参数为auto。
首先需要通过alter database clear logfile group 日志组;让数据库在磁盘创建日志文件。
出现问题1、重做日志物理文件不存在,当时日志组4状态为current,无法在readonly模式下进行更改操作。问题2、参数文件的undo表空间与控制文件的不对应
SQL> alter database rename file '/redo1/redo/redo04a.log' to '/u3/redo1/redo/redo04a.log';
alter database rename file '/redo1/redo/redo04a.log' to '/u3/redo1/redo/redo04a.log'
*
ERROR at line 1:
ORA-01511: error in renaming log/data files
ORA-01621: cannot rename member of current log if database is open
ORA-00312: online log 4 thread 1: '/redo1/redo/redo04a.log'
ORA-00312: online log 4 thread 1: '/redo2/redo/redo04b.log'
SQL> alter database clear logfile group 4;
alter database clear logfile group 4
*
ERROR at line 1:
ORA-00349: failure obtaining block size for '/redo1/redo/redo04a.log'
ORA-27041: unable to open file
Linux-x86_64 Error: 2: No such file or directory
Additional information: 9
SQL> alter database drop logfile group 4; -----就算成功了,不会删除磁盘上的文件,需手动删除
alter database drop logfile group 4
*
ERROR at line 1:
ORA-01623: log 4 is current log for instance orcl (thread 1) - cannot drop
ORA-00312: online log 4 thread 1: '/redo1/redo/redo04a.log'
ORA-00312: online log 4 thread 1: '/redo2/redo/redo04b.log'
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount;
ORACLE instance started.
Total System Global Area 4.2758E+10 bytes
Fixed Size 2262656 bytes
Variable Size 4966058368 bytes
Database Buffers 3.7447E+10 bytes
Redo Buffers 342855680 bytes
Database mounted.
SQL> alter database rename file '/redo1/redo/redo04a.log' to '/u3/redo1/redo/redo04a.log';
alter database rename file '/redo1/redo/redo04a.log' to '/u3/redo1/redo/redo04a.log'
*
ERROR at line 1:
ORA-01511: error in renaming log/data files
ORA-01275: Operation RENAME is not allowed if standby file management is
automatic.
SQL> show parameter standby;
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
standby_archive_dest string ?/dbs/arch
standby_file_management string AUTO
SQL> alter system standby_file_management='manual';
alter system standby_file_management='manual'
*
ERROR at line 1:
ORA-02065: illegal option for ALTER SYSTEM
SQL> alter system set standby_file_management='manual' scope=both;
System altered.
SQL> alter database rename file '/redo1/redo/redo04a.log' to '/u3/redo1/redo/redo04a.log';
Database altered.
SQL> alter database rename file '/redo2/redo/redo04b.log' to '/u3/redo2/redo/redo04b.log';
Database altered.
SQL> alter database clear logfile group 4; ----让数据库在磁盘创建日志文件
Database altered.
SQL> alter database open;
Database altered.
SQL> select open_mode from v$database;
OPEN_MODE
--------------------
READ ONLY
SQL> desc v$log;
Name Null? Type
----------------------------------------- -------- ----------------------------
GROUP# NUMBER
THREAD# NUMBER
SEQUENCE# NUMBER
BYTES NUMBER
BLOCKSIZE NUMBER
MEMBERS NUMBER
ARCHIVED VARCHAR2(3)
STATUS VARCHAR2(16)
FIRST_CHANGE# NUMBER
FIRST_TIME DATE
NEXT_CHANGE# NUMBER
NEXT_TIME DATE
SQL> select GROUP# ,STATUS,MEMBERS from v$log;
GROUP# STATUS MEMBERS
---------- ---------------- ----------
1 UNUSED 2
2 UNUSED 2
3 UNUSED 2
4 CURRENT 2
5 UNUSED 2
6 UNUSED 2
7 UNUSED 2
8 UNUSED 2
8 rows selected.
SQL> alter system switch logfile;
alter system switch logfile
*
ERROR at line 1:
ORA-16000: database open for read-only access
SQL> alter database recover managed standby database finish force;
alter database recover managed standby database finish force
*
ERROR at line 1:
ORA-00283: recovery session canceled due to errors
ORA-16157: media recovery not allowed following successful FINISH recovery
SQL> alter database commit to switchover to primary;
Database altered.
SQL> select open_mode from v$database;
OPEN_MODE
--------------------
MOUNTED
SQL> alter database open;
alter database open
*
ERROR at line 1:
ORA-01092: ORACLE instance terminated. Disconnection forced
ORA-30012: undo tablespace 'UNDOTBS1' does not exist or of wrong type
Process ID: 20472
Session ID: 769 Serial number: 3
SQL> create undo tablespace undotbs2 datafile'/u3/undotbs2.dbf' size 10g autoextend off;
create undo tablespace undotbs2 datafile'/u3/undotbs2.dbf' size 10g autoextend off
*
ERROR at line 1:
ORA-01109: database not open
SQL> alter tablespace UNDOTBS1 offline;
alter tablespace UNDOTBS1 offline
*
ERROR at line 1:
ORA-01109: database not open
SQL> create pfile='/u3/pfile.ora' from spfile;
File created.
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@FIHSER68 ~]$ vi /u3/pfile.ora -----将undo_tablespace参数删除
[oracle@FIHSER68 ~]$ sqlplus "/as sysdba"
SQL*Plus: Release 11.2.0.4.0 Production on Wed Mar 27 11:57:12 2019
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> shutdown immediate;
ORA-01109: database not open
Database dismounted.
ORACLE instance shut down.
SQL> startup nomount pfile='/u3/pfile.ora';
ORACLE instance started.
Total System Global Area 4.2758E+10 bytes
Fixed Size 2262656 bytes
Variable Size 5234493824 bytes
Database Buffers 3.7178E+10 bytes
Redo Buffers 342855680 bytes
SQL> alter database mount;
Database altered.
SQL> alter database open;
Database altered.
SQL> show parameter undo;
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
undo_management string AUTO
undo_retention integer 900
undo_tablespace string UNDOTBS10 ----此为控制文件中记录的undo_tablespace.
SQL> select open_mode from v$database;
OPEN_MODE
--------------------
READ WRITE
SQL> create spfile from pfile='/u3/pfile.ora';
File created.
记一次异机rman还原后的操作的更多相关文章
- 基于RMAN的异机数据库克隆(rman duplicate)
对于基于生产环境下的数据库的版本升级或者测试新的应用程序的性能及其影响,备份恢复等等,我们可以采取从生产环境以克隆的方式将其克隆到本地而不影响生产数据库的正常使用.实现这个功能我们可以借助rman d ...
- Linux平台下RMAN异机恢复总结
下面总结.整理一下RMAN异机恢复这方面的知识点,这篇笔记在个人笔记里面躺了几年了,直到最近偶然被翻看到,遂整理.总结一下.如下所示,个人将整个RMAN异机恢复分为准备工作和操作步骤两大部分.当然,准 ...
- 基于RMAN从活动数据库异机克隆(rman duplicate from active DB)
Oracle 11g RMAN能够实现基于活动数据库进行异机克隆,从而省去需要先备份再ftp到辅助服务器的过程.这一切可以全部交给Oracle来搞定.在克隆期间,Oracle会读取Target DB的 ...
- 利用rman进行异机还原(目录相同)
利用rman进行异机还原(目录相同) 源始库:192.168.201.2 目标库:192.168.201.3 --192.168.201.2 --rman [oracle@db01 ~]$ rman ...
- RMAN异机恢复遭遇ORA-01547、ORA-01152、ORA-01110错误案例
测试环境: 操作系统 : Red Hat Enterprise Linux ES release 4 (Nahant Update 4) VMWARE 数据库 : O ...
- Hyper-V安装Oracle Linux6_4 Oracle db 12c并使用rman做异机恢复
本文记录在Windows Server 2012 R2上安装Oracle Enterprise Linux 6.4以及使用RMAN进行进行异机恢复的过程. Windows服务器增加Hyper-V功能 ...
- Oracle 单实例 迁移到 RAC 实例 -- 使用RMAN 异机恢复
Oracle 官网有关单实例迁移到RAC的一个步骤说明: How to Convert 10g Single-Instance database to 10g RAC using Manual Con ...
- 使用rman备份异机恢复数据库
一.RMAN备份源库注意点: 最好保留rman备份日志 $rman target / log=backup.log RMAN>run { allocate channel t1 type dis ...
- rman异机恢复,全部恢复和增量恢复
1.首先准备工作:hostname 192.168.222.11 ol7.localdomain ol7建立相关目录:mkdir -p /u01/app/oracle/oradata/DB11G/mk ...
随机推荐
- Java 实验案例(多态)
实验任务 任务一:图形面积周长计算小程序 任务二:饲养员喂养动物程序 实验内容: 任务一: 图形面积周长计算 任务目的: 掌握多态的含义及应用场合 掌握上转型对象和多态的实现 掌握abstract关键 ...
- Flutter:Slivers大家族,让滑动视图的组合变得很简单!
今天呢,我小拉面主要想给大家讲一讲Flutter中的Slivers大家族的使用场景和方法.开发过列表布局的同学们应该对Slivers系列的控件不陌生,或多或少都用过这个库中的控件,来解决复杂的滑动嵌 ...
- INFO: Font Metrics and the Use of Negative lfHeight
INFO: Font Metrics and the Use of Negative lfHeight Print Email Article translations Article ID ...
- Linux 环境下为VirtualBox安装增强功能
VirtualBox安装CentOS后,再安装增强功能就可以共享文件夹.粘贴板以及鼠标无缝移动,主要步骤如下: 1.yum -y update 2.yum -y install g++ gcc gcc ...
- 混淆矩阵(Confusion matrix)的原理及使用(scikit-learn 和 tensorflow)
原理 在机器学习中, 混淆矩阵是一个误差矩阵, 常用来可视化地评估监督学习算法的性能. 混淆矩阵大小为 (n_classes, n_classes) 的方阵, 其中 n_classes 表示类的数量. ...
- seo关键词
除非你站有很高的权重. 小道消息称keywords曾被百度.谷歌.雅虎等搜索引擎剔除,将不会再影响搜索引擎的排序结果,小编认为设置一下总没坏处,还是有一些搜索引擎比较重视keywords标签的. 用法 ...
- (转)Matlab增加块注释
1)方法一选中你要加注释的内容,然后选择工具菜单“text|comment”就可以了,如果要把注释变为语句,同样选中要转变的语句,然后用鼠标选择“text|uncomment”就可以了.用键盘的快捷键 ...
- 用eval似乎会执行结果一次性返回,结果显示的是一行
with open(r'商品资料','r',encoding='utf-8') as f1: lis_goods = eval(f1.read()) # 用eval似乎会执行结果一次性返回,结果显示的 ...
- C#基础学习之委托的理解和应用
委托的使用和语法定义 委托的使用是由四步来完成的,依次为:声明委托.创建委托对象.委托关联方法.调用 我们用一个例子来说明这四步如何操作,我们完成一个老板委托员工写报告的实例,看如何实现. 首先我们应 ...
- 将本地已有项目上传到github
1.在github上创建一个文件 2.看本地C盘中是否有.ssh文件夹 (C:\Users\用户名\.ssh) 检测有没有.ssh文件夹:执行命令 cd ~/.ssh 如果没有的话执行git命令: ...