- 浏览: 981489 次
- 性别:
- 来自: 杭州
文章分类
最新评论
-
孤星119:
好熟悉的数据库字段啊, 上家公司做的项目每天都跟这些字段打招呼 ...
Oracle exp compress参数引起的空间浪费 -
itspace:
quxiaoyong 写道遇到个问题,网上一搜,全他妈这篇文章 ...
数据库连接错误ORA-28547 -
quxiaoyong:
遇到个问题,网上一搜,全他妈这篇文章。你转来转去的有意思吗?
数据库连接错误ORA-28547 -
hctech:
关于version count过高的问题,不知博主是否看过ey ...
某客户数据库性能诊断报告 -
itspace:
invalid 写道写的不错,我根据这个来安装,有点理解错误了 ...
AIX 配置vncserver
rman自身提供了跳过read only,offline等表空间的备份,具体语法如下:
RMAN> RUN
{
SET MAXCORRUPT FOR DATAFILE 1 TO 10;
BACKUP DATABASE
SKIP INACCESSIBLE
SKIP READONLY
SKIP OFFLINE;
}
但也可以通过参数设置再次备份时跳过read only表空间备份,以下为测试过程,注意黑体部分
顺便提一句,在数据库非归档模式下,可以对read only,offline的表空间进行备份,原理不过多表述了。
RMAN> RUN
{
SET MAXCORRUPT FOR DATAFILE 1 TO 10;
BACKUP DATABASE
SKIP INACCESSIBLE
SKIP READONLY
SKIP OFFLINE;
}
但也可以通过参数设置再次备份时跳过read only表空间备份,以下为测试过程,注意黑体部分
引用
[ora11g@mchz ~]$ sqlplus "/as sysdba"
SQL*Plus: Release 11.1.0.6.0 - Production on Sat Nov 20 12:47:18 2010
Copyright (c) 1982, 2007, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> select name from v$tablespace;
NAME
------------------------------
SYSTEM
SYSAUX
UNDOTBS1
USERS
TEMP
SQL> alter tablespace users read only;
Tablespace altered.
RMAN> show all;
using target database control file instead of recovery catalog
RMAN configuration parameters for database with db_unique_name DB11G are:
CONFIGURE RETENTION POLICY TO REDUNDANCY 1; # default
CONFIGURE BACKUP OPTIMIZATION OFF; # default
CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default
CONFIGURE CONTROLFILE AUTOBACKUP OFF; # default
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '%F'; # default
CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET; # default
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE MAXSETSIZE TO UNLIMITED; # default
CONFIGURE ENCRYPTION FOR DATABASE OFF; # default
CONFIGURE ENCRYPTION ALGORITHM 'AES128'; # default
CONFIGURE COMPRESSION ALGORITHM 'BZIP2'; # default
CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default
CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/opt/ora11g/app/product/11.1/dbs/snapcf_db11g.f'; # default
RMAN> CONFIGURE BACKUP OPTIMIZATION ON;
new RMAN configuration parameters:
CONFIGURE BACKUP OPTIMIZATION ON;
new RMAN configuration parameters are successfully stored
RMAN> backup database;
Starting backup at 20-NOV-10
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=143 device type=DISK
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00002 name=/opt/ora11g/oradata/db11g/sysaux01.dbf
input datafile file number=00001 name=/opt/ora11g/oradata/db11g/system01.dbf
input datafile file number=00003 name=/opt/ora11g/oradata/db11g/undotbs01.dbf
input datafile file number=00004 name=/opt/ora11g/oradata/db11g/users01.dbf
channel ORA_DISK_1: starting piece 1 at 20-NOV-10
channel ORA_DISK_1: finished piece 1 at 20-NOV-10
piece handle=/opt/ora11g/flash_recovery_area/DB11G/backupset/2010_11_20/o1_mf_nnndf_TAG20101120T125122_6ggnyjnf_.bkp tag=TAG20101120T125122 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:01:46
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
including current control file in backup set
including current SPFILE in backup set
channel ORA_DISK_1: starting piece 1 at 20-NOV-10
channel ORA_DISK_1: finished piece 1 at 20-NOV-10
piece handle=/opt/ora11g/flash_recovery_area/DB11G/backupset/2010_11_20/o1_mf_ncsnf_TAG20101120T125122_6ggo210p_.bkp tag=TAG20101120T125122 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:02
Finished backup at 20-NOV-10
RMAN> CONFIGURE RETENTION POLICY TO NONE;
new RMAN configuration parameters:
CONFIGURE RETENTION POLICY TO NONE;
new RMAN configuration parameters are successfully stored
RMAN> backup database;
Starting backup at 20-NOV-10
using channel ORA_DISK_1
skipping datafile 4; already backed up 1 time(s)
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00002 name=/opt/ora11g/oradata/db11g/sysaux01.dbf
input datafile file number=00001 name=/opt/ora11g/oradata/db11g/system01.dbf
input datafile file number=00003 name=/opt/ora11g/oradata/db11g/undotbs01.dbf
channel ORA_DISK_1: starting piece 1 at 20-NOV-10
channel ORA_DISK_1: finished piece 1 at 20-NOV-10
piece handle=/opt/ora11g/flash_recovery_area/DB11G/backupset/2010_11_20/o1_mf_nnndf_TAG20101120T125943_6ggog50n_.bkp tag=TAG20101120T125943 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:01:56
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
including current control file in backup set
including current SPFILE in backup set
channel ORA_DISK_1: starting piece 1 at 20-NOV-10
channel ORA_DISK_1: finished piece 1 at 20-NOV-10
piece handle=/opt/ora11g/flash_recovery_area/DB11G/backupset/2010_11_20/o1_mf_ncsnf_TAG20101120T125943_6ggokz7m_.bkp tag=TAG20101120T125943 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 20-NOV-10
SQL*Plus: Release 11.1.0.6.0 - Production on Sat Nov 20 12:47:18 2010
Copyright (c) 1982, 2007, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> select name from v$tablespace;
NAME
------------------------------
SYSTEM
SYSAUX
UNDOTBS1
USERS
TEMP
SQL> alter tablespace users read only;
Tablespace altered.
RMAN> show all;
using target database control file instead of recovery catalog
RMAN configuration parameters for database with db_unique_name DB11G are:
CONFIGURE RETENTION POLICY TO REDUNDANCY 1; # default
CONFIGURE BACKUP OPTIMIZATION OFF; # default
CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default
CONFIGURE CONTROLFILE AUTOBACKUP OFF; # default
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '%F'; # default
CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET; # default
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE MAXSETSIZE TO UNLIMITED; # default
CONFIGURE ENCRYPTION FOR DATABASE OFF; # default
CONFIGURE ENCRYPTION ALGORITHM 'AES128'; # default
CONFIGURE COMPRESSION ALGORITHM 'BZIP2'; # default
CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default
CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/opt/ora11g/app/product/11.1/dbs/snapcf_db11g.f'; # default
RMAN> CONFIGURE BACKUP OPTIMIZATION ON;
new RMAN configuration parameters:
CONFIGURE BACKUP OPTIMIZATION ON;
new RMAN configuration parameters are successfully stored
RMAN> backup database;
Starting backup at 20-NOV-10
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=143 device type=DISK
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00002 name=/opt/ora11g/oradata/db11g/sysaux01.dbf
input datafile file number=00001 name=/opt/ora11g/oradata/db11g/system01.dbf
input datafile file number=00003 name=/opt/ora11g/oradata/db11g/undotbs01.dbf
input datafile file number=00004 name=/opt/ora11g/oradata/db11g/users01.dbf
channel ORA_DISK_1: starting piece 1 at 20-NOV-10
channel ORA_DISK_1: finished piece 1 at 20-NOV-10
piece handle=/opt/ora11g/flash_recovery_area/DB11G/backupset/2010_11_20/o1_mf_nnndf_TAG20101120T125122_6ggnyjnf_.bkp tag=TAG20101120T125122 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:01:46
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
including current control file in backup set
including current SPFILE in backup set
channel ORA_DISK_1: starting piece 1 at 20-NOV-10
channel ORA_DISK_1: finished piece 1 at 20-NOV-10
piece handle=/opt/ora11g/flash_recovery_area/DB11G/backupset/2010_11_20/o1_mf_ncsnf_TAG20101120T125122_6ggo210p_.bkp tag=TAG20101120T125122 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:02
Finished backup at 20-NOV-10
RMAN> CONFIGURE RETENTION POLICY TO NONE;
new RMAN configuration parameters:
CONFIGURE RETENTION POLICY TO NONE;
new RMAN configuration parameters are successfully stored
RMAN> backup database;
Starting backup at 20-NOV-10
using channel ORA_DISK_1
skipping datafile 4; already backed up 1 time(s)
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00002 name=/opt/ora11g/oradata/db11g/sysaux01.dbf
input datafile file number=00001 name=/opt/ora11g/oradata/db11g/system01.dbf
input datafile file number=00003 name=/opt/ora11g/oradata/db11g/undotbs01.dbf
channel ORA_DISK_1: starting piece 1 at 20-NOV-10
channel ORA_DISK_1: finished piece 1 at 20-NOV-10
piece handle=/opt/ora11g/flash_recovery_area/DB11G/backupset/2010_11_20/o1_mf_nnndf_TAG20101120T125943_6ggog50n_.bkp tag=TAG20101120T125943 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:01:56
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
including current control file in backup set
including current SPFILE in backup set
channel ORA_DISK_1: starting piece 1 at 20-NOV-10
channel ORA_DISK_1: finished piece 1 at 20-NOV-10
piece handle=/opt/ora11g/flash_recovery_area/DB11G/backupset/2010_11_20/o1_mf_ncsnf_TAG20101120T125943_6ggokz7m_.bkp tag=TAG20101120T125943 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 20-NOV-10
顺便提一句,在数据库非归档模式下,可以对read only,offline的表空间进行备份,原理不过多表述了。
引用
SQL> archive log list
Database log mode No Archive Mode
Automatic archival Disabled
Archive destination /tmp
Oldest online log sequence 1134
Current log sequence 1136
SQL> alter tablespace users read only;
Tablespace altered.
RMAN> backup tablespace users;
Starting backup at 20-NOV-10
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=140 device type=DISK
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00004 name=/opt/ora11g/oradata/db11g/users01.dbf
channel ORA_DISK_1: starting piece 1 at 20-NOV-10
channel ORA_DISK_1: finished piece 1 at 20-NOV-10
piece handle=/opt/ora11g/flash_recovery_area/DB11G/backupset/2010_11_20/o1_mf_nnndf_TAG20101120T140944_6ggskglt_.bkp tag=TAG20101120T140944 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 20-NOV-10
Database log mode No Archive Mode
Automatic archival Disabled
Archive destination /tmp
Oldest online log sequence 1134
Current log sequence 1136
SQL> alter tablespace users read only;
Tablespace altered.
RMAN> backup tablespace users;
Starting backup at 20-NOV-10
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=140 device type=DISK
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00004 name=/opt/ora11g/oradata/db11g/users01.dbf
channel ORA_DISK_1: starting piece 1 at 20-NOV-10
channel ORA_DISK_1: finished piece 1 at 20-NOV-10
piece handle=/opt/ora11g/flash_recovery_area/DB11G/backupset/2010_11_20/o1_mf_nnndf_TAG20101120T140944_6ggskglt_.bkp tag=TAG20101120T140944 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 20-NOV-10
发表评论
-
buffer cache 的内部结构
2020-03-18 14:21 584BUFFER CACHE作为数据块的 ... -
Oracle OMC介绍
2020-03-18 13:19 495Oracle管理云服务(OMC)的大数据平台,自动收集的企业 ... -
参加Oracle勒索病毒防范专题培训会议
2019-09-27 17:15 5312019年7月22日,受邀参加Oracle勒索病毒防范专题培训 ... -
记一次内存换IO的Oracle优化
2019-09-27 16:50 835某客户数据库从P595物理 ... -
如何定位Oracle SQL执行计划变化的原因
2019-07-03 14:49 1471性能优化最难的是能够 ... -
如何定位Oracle SQL执行计划变化的原因
2018-10-30 09:24 1185性能优化最难的是能够 ... -
数据库性能优化目标
2018-10-08 10:59 528从数据库性能优化的场 ... -
数据库无法打开的原因及解决办法
2018-10-05 20:45 2145数据库的启动是一个相当复杂的过程。比如,Oracle在启动之前 ... -
怎么样彻底删除数据库?
2018-09-18 11:10 608Oracle提供了drop database命令用来删除数据库 ... -
Oracle减少日志量的方法
2018-09-10 10:17 871LGWR进程将LOG BUFFER中的 ... -
如何快速关闭数据库
2018-09-09 13:14 1240“一朝被蛇咬,十年怕井绳”。在没被“蛇”咬之前,很多DBA喜欢 ... -
关于《如何落地智能化运维》PPT
2018-05-17 10:19 1137在DTCC 2018发表《如何落地智能化运维》演讲,主要内容如 ... -
记录在redhat5.8平台安装oracle11.2容易忽视的几个问题
2018-05-11 19:58 587问题一:ping不通问题 在虚拟机上安装好linux系统后, ... -
《Oracle DBA实战攻略》第一章
2018-05-11 10:42 952即日起,不定期更新《OracleDBA实战攻略》一书电子版,请 ... -
Oracle 12c新特性
2018-05-11 10:33 907查询所有pdb [oracle@gj4 ~]$ sqlplu ... -
关于修改memory_target的值后数据库无法启动的问题
2017-02-28 12:24 3990操作系统:RHEL6.5 数据库版本:11.2.0.4 ... -
10g rac安装error while loading shared libraries libpthread.so.0 问题
2017-02-28 12:22 70211g rac安装在二节点跑脚本一般会报此错误: 解决这个问 ... -
记一次Oracle会话共享模式故障处理过程
2017-02-27 19:16 805故障简述 XXX第八人民医院HIS数据库7月13日11点左右从 ... -
RESMGR:cpu quantum等待事件处理过程
2017-02-27 18:23 2654由于数据库上线过程中出现大量的RESMGR:cpu quant ... -
谈谈log file sync
2014-03-19 14:18 1776数据库中的log file sync等待事件指的是,当user ...
相关推荐
"手把手教你ORACLE RMAN异地备份" ...SKIP READONLY参数跳过那些所在表空间为read-only的数据文件。 该教程提供了一个详细的ORACLE RMAN异地备份解决方案,解决了服务器空间不足和备份恢复的困难问题。
本文详细讲解了 RMAN 的备份机制以及如何备份,涵盖了数据库备份和 RMAN 备份的概念、RMAN 备份的类型、备份集和镜像副本、备份路径、备份限制等知识点。 一、数据库备份与 RMAN 备份的概念 数据库备份是指将...
rman备份恢复详解 RMAN(Recovery Manager)是一种Oracle数据库备份和恢复工具,能够帮助DBA快速备份和恢复数据库。下面将详细介绍RMAN自动备份和恢复的相关知识点。 一、为什么需要设置自动归档模式? 在使用...
5. **压缩备份**:RMAN提供内置的压缩功能,通过`COMPRESSION ALGORITHM`选项启用,可以节省存储空间。 6. **标签和归档**:为方便管理,通常会给备份添加标签,例如`TAG 'DailyBackup'`。同时,`RUN { BACKUP ...;...
它提供了命令行接口和图形用户界面,支持多种备份类型,如完整备份、增量备份、表空间备份等,并能进行复杂的恢复操作。RMAN具备自动备份优化功能,能够根据数据库的状态和配置选择最佳备份策略。 二、RMAN备份基础...
执行自动备份后,应定期检查备份成功与否,以及备份空间的使用情况。可以使用RMAN的`list backup`和`report obsolete`命令列出备份集和过期的备份。 七、恢复流程 当需要恢复时,RMAN提供了便捷的恢复命令。根据...
如果已经是归档模式,可以跳过此步骤。具体命令如下: 1. %sqlplus /nolog 2. SQL> conn / as sysdba 3. SQL> shutdown immediate; 4. SQL> startup mount; 5. SQL> alter database archivelog; 6. SQL> alter ...
本文将以一个具体案例为基础,详细介绍如何通过RMAN将Oracle 19c RAC的备份数据恢复到单实例环境。 #### 准备阶段 1. **环境配置**: - 在目标服务器上配置环境变量,确保与源RAC环境一致。 - 安装相同版本的...
Oracle 11g R2 的 RMAN (Recovery Manager) 是 Oracle 数据库管理系统中的一个关键工具,主要用于数据库的备份和恢复。RMAN 提供了一种高效且灵活的方式来管理和保护数据库,确保在数据丢失或系统故障时能够快速恢复...
然后,通过RMAN的恢复命令将备份还原到目标表空间,最后执行数据块的回滚(即应用直到恢复时间点的重做日志),确保表空间数据与数据库其他部分保持一致。 在进行TSPITR之前,需要对数据库进行一系列配置,包括确认...
RMAN提供了多种恢复选项,包括恢复整个数据库和恢复单个表空间。 1. **恢复整个数据库**:在灾难情况下,可能需要恢复整个数据库。这通常涉及使用最新的完整备份,然后应用归档日志以达到一致的状态。 2. **恢复...
这将备份指定的表空间,包括归档的重做日志,并删除旧的归档日志。 备份归档日志 我们也可以备份归档日志。我们可以使用以下命令来备份归档日志: `RMAN> backup archivelog all delete input;` 恢复数据库 当...
rman> alter tablespace '表空间名' read only; ``` 6. **还原数据文件**: RMAN会自动还原相关数据文件,但有时可能需要指定具体文件: ``` rman> restore datafile '/path/to/datafile.dbf'; ``` 7. **...
可以单独备份某个表空间或一组表空间。例如: ``` backup tablespace users; ``` 此命令备份名为`users`的表空间。 **3.5 备份指定数据文件** 如果只想备份特定的数据文件,可以使用以下命令: ``` backup data...
2. **部分备份**:针对特定表空间,可以使用RMAN的`BACKUP TABLESPACE`命令,仅备份所需的表空间。这样可以减少备份时间并节省存储空间。 3. **导出导入(Data Pump)**:另一种方法是使用`EXPDP`和`IMPDP`工具来...
`针对特定表空间进行备份,例如`users`表空间。 10. **备份控制文件**:`backup current controlfile;`确保控制文件的安全,它是数据库恢复的关键组件。 11. **复制数据文件**:`copy datafile 9 to '/u01/flash_...
本文将详细介绍如何在`SYSTEM`表空间数据文件丢失的情况下,使用`RMAN`进行恢复。 首先,确保有有效的`RMAN`备份至关重要。这包括全量数据库备份以及归档日志备份。在示例中,数据库被备份到`/u01/app/oracle/...
在设计备份策略时,需要权衡备份空间、备份时间以及恢复效率。差异增量备份适合于对恢复速度要求不高但希望节省存储空间的情况,而累积增量备份则更适合于需要快速恢复但存储空间充足的情况。选择哪种策略应根据具体...
RMAN具有独特的优势,例如跳过未使用的数据块,当备份一个RMAN备份集时,RMAN不会备份从未被写入的数据块。 二、系统规划 在进行备份和恢复之前,需要进行系统规划,包括创建备份文件夹、归档日志文件夹等。同时,...
3. 表空间备份:针对特定表空间的需求,RMAN可以单独备份某个或多个表空间。 4. 数据文件备份:针对单个数据文件,RMAN也可以执行备份,适用于局部故障恢复。 二、RMAN恢复技术 RMAN恢复主要包括完整恢复、不完全...