博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
[Oracle]System 表空间的文件丢失
阅读量:7082 次
发布时间:2019-06-28

本文共 2689 字,大约阅读时间需要 8 分钟。

如果system 表空间的文件丢失,假设有备份的情况,可以恢复。数据库需要设置为mount 状态,然后restore/recover datafile

模拟实验:
SQL> select name from v $ datafile;
NAME
-------------------------------------------------------------------- ------------------------------
/u01/app/oracle/oradata/ORA11204/datafile/o1_mf_system_9grvc6rn_.dbf
/u01/app/oracle/oradata/ORA11204/datafile/o1_mf_sysaux_9grvc6st_.dbf
/u01/app/oracle/oradata/ORA11204/datafile/o1_mf_undotbs1_9grvc6t7_.dbf
/u01/app/oracle/oradata/ORA11204/datafile/o1_mf_users_9grvc6tr_.dbf
/u01/app/oracle/oradata/ORA11204/datafile/o1_mf_example_9grvht2m_.dbf
/home/oracle/data5.dbf
6 rows were selected.
[oracle @ db 11204 ~] $ rman target /
Recovery Manager: Release 11.2.0.4.0 - Production on Friday September 22 10:51:37 2017
Copyright (c) 1982, 2011, Oracle and / or its affiliates. All rights reserved.
Target database: Connected to ORA 11204 (database ID = 1382856929)
RMAN> backup database plus archivelog;
SQL> shu immediate
$ mv /u01/app/oracle/oradata/ORA11204/datafile/o1_mf_system_9grvc6rn_.dbf /u01/app/oracle/oradata/ORA11204/datafile/o1_mf_system_9grvc6rn_.dbf.bak
SQL> startup mount
[oracle @ db 11204 ~] $ rman target /
Recovery Manager: Release 11.2.0.4.0 - Production on Friday September 22 11: 00: 16 2017
Copyright (c) 1982, 2011, Oracle and / or its affiliates. All rights reserved.
Target · Database: Connected to ORA 11204 (DBID = 1382856929, not open)
RMAN> restore datafile 1;
restore started (start time: 17-09-22)
I use the target database control file instead of the recovery catalog
Channel: ORA_DISK_1 assigned
Channel ORA_DISK_1: SID = 10 Device Type = DISK
Channel ORA_DISK_1: Restoring the data file · backup set is starting
Channel ORA_DISK_1: specifies the data file to be restored from the backup set
Channel ORA_DISK_1: Restores data file 00001 to /u01/app/oracle/oradata/ORA11204/datafile/o1_mf_system_9grvc6rn_.dbf
Channel ORA_DISK_1: Backup piece / u01 / app / oracle / fast_recovery_area / ORA11204 / backupset / 2017_09_22 / o1_mf_nnndf_TAG20170922T105151_dw8v5rbq_.bkp
Channel ORA_DISK_ 1: Piece handle = / u 01 / app / oracle / fast_recovery_area / ORA 11204 / backupset / 2017 _ 09 _ 22 / o 1 _ mf _ nnndf _ TAG 20170922 T 105151 _ dw 8 v 5 rbq _. Bkp tag = TAG 20170922 T 105151
Channel ORA_DISK_1: Backup piece 1 has been restored
Channel ORA_DISK_1: Restore complete. Elapsed time: 00: 01: 35
restore completed (completion time: 17-09-22)
RMAN>
RMAN> recover datafile 1;
recover started (start time: 17-09-22)
Use of channel ORA_DISK_1
Media recovery is starting
Media recovery is completed. Elapsed time: 00: 00: 01
recover completed (completion time: 17-09-22)
RMAN> exit
Recovery Manager has completed.
[oracle @ db 11204 ~] $

转载地址:http://zplml.baihongyu.com/

你可能感兴趣的文章
0622 总结与回顾
查看>>
[转]SharePoint 2010 Download as Zip File Custom Ribbon Action
查看>>
面向对象-对象和类
查看>>
ROS系统玩转自主移动机器人(4)-- 嵌入式硬件平台
查看>>
[转]Python 资源大全中文版
查看>>
Unlock PeopleSoft Objects All at Once
查看>>
style定义
查看>>
在服务器上搭建git仓库
查看>>
五子棋js
查看>>
ansible命令
查看>>
六种设计原则
查看>>
怎么查看被占用的端口号
查看>>
输入十个数,最大的数和第最后一个数对换,最小的数和第一个数字对换
查看>>
Linux指令--mv
查看>>
Python中如何实现im2col和col2im函数(sliding类型)
查看>>
IP校验shell脚本
查看>>
软件工程——《你的灯亮着吗》读书笔记
查看>>
Android平台刷机包制作研究(1)
查看>>
wamp下修改mysql root用户的登录密码方法
查看>>
怎样使用1M的内存排序100万个8位数
查看>>