博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
[20150717]备份变大.txt
阅读量:5820 次
发布时间:2019-06-18

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

[20150717]备份变大.txt

--前几天别人系统升级,11.2.0.3升级到11.2.0.4出现备份增大的情况,我看了他升级的文档,感觉最大的可能建立了restore point。

--升级完成后没有删除。自己做一个测试。

1.建立测试环境:

SCOTT@test> @ &r/ver1
PORT_STRING                    VERSION        BANNER
------------------------------ -------------- ----------------------------------------------------------------
x86_64/Linux 2.4.xx            10.2.0.4.0     Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi

SCOTT@test> select FLASHBACK_ON from v$database ;

FLASHBACK_ON
------------------
NO

--建立新的表空间:

-- drop tablespace mssm including contents;

CREATE TABLESPACE MSSM DATAFILE

  '/mnt/ramdisk/test/mssm01.dbf' SIZE 64M AUTOEXTEND OFF
LOGGING
ONLINE
EXTENT MANAGEMENT LOCAL AUTOALLOCATE
BLOCKSIZE 8K
SEGMENT SPACE MANAGEMENT MANUAL
FLASHBACK ON;

SCOTT@test> create table t tablespace mssm as select rownum id ,cast('testtesttesttest' as varchar2(20)) name from xmltable('1 to 100000');

Table created.

--这样建立文件大小13M。

SCOTT@test> truncate table t ;

Table truncated.

2.开始备份:

RMAN> backup  datafile 6 format '/home/oracle/backup/DATAFILE6_%u' ;

$  ll -lh DATAFILE6_*

-rw-r----- 1 oracle oinstall 616K 2015-07-17 09:28:50 DATAFILE6_14qc8rii
--仅仅616K。

SCOTT@test> create restore point test0717 ;

Restore point created.

$  ll -lh DATAFILE6_*

-rw-r----- 1 oracle oinstall 616K 2015-07-17 09:28:50 DATAFILE6_14qc8rii
-rw-r----- 1 oracle oinstall 616K 2015-07-17 09:34:58 DATAFILE6_15qc8ru2
--没有变化。

SYS@test> create restore point test0717x guarantee flashback database;

create restore point test0717x guarantee flashback database
*
ERROR at line 1:
ORA-38784: Cannot create restore point 'TEST0717X'.
ORA-38787: Creating the first guaranteed restore point requires mount mode when flashback database is off.
--说明他升级在mount状态建立的guarantee flashback point。

SYS@test> shutdown immediate ;

Database closed.
Database dismounted.
ORACLE instance shut down.

SYS@test> startup mount

ORACLE instance started.
Total System Global Area    473956352 bytes
Fixed Size                    2084776 bytes
Variable Size               260046936 bytes
Database Buffers            201326592 bytes
Redo Buffers                 10498048 bytes
Database mounted.

SYS@test> create restore point test0717x guarantee flashback database;

Restore point created.

SYS@test> alter database open ;

Database altered.

RMAN> backup  datafile 6 format '/home/oracle/backup/DATAFILE6_%u' ;

..

$  ll -lh DATAFILE6_*

-rw-r----- 1 oracle oinstall 616K 2015-07-17 09:28:50 DATAFILE6_14qc8rii
-rw-r----- 1 oracle oinstall 616K 2015-07-17 09:34:58 DATAFILE6_15qc8ru2
-rw-r----- 1 oracle oinstall  13M 2015-07-17 09:38:41 DATAFILE6_16qc8s51

--很明显备份变成了13M。建立了restore point并且属性guarantee flashback database;

SYS@test> select * from V$RESTORE_POINT;

         SCN DATABASE_INCARNATION# GUA STORAGE_SIZE TIME                           NAME

------------ --------------------- --- ------------ ------------------------------ --------------------
12695497118                     1 YES      8192000 2015-07-17 09:38:02.000000000  TEST0717X
12695496814                     1 NO             0 2015-07-17 09:34:43.000000000  TEST0717

3.打开FLASHBACK_ON看看:

--10g仅仅在mount状态下打开。
SYS@test> alter database flashback  on;
Database altered.

SYS@test> alter database open ;

Database altered.

$  ll -lh DATAFILE6_*

-rw-r----- 1 oracle oinstall 616K 2015-07-17 09:28:50 DATAFILE6_14qc8rii
-rw-r----- 1 oracle oinstall 616K 2015-07-17 09:34:58 DATAFILE6_15qc8ru2
-rw-r----- 1 oracle oinstall  13M 2015-07-17 09:38:41 DATAFILE6_16qc8s51
-rw-r----- 1 oracle oinstall  13M 2015-07-17 09:49:06 DATAFILE6_17qc8soi

SYS@test> drop restore point TEST0717X;

Restore point dropped.

RMAN> backup  datafile 6 format '/home/oracle/backup/DATAFILE6_%u' ;

..

$  ll -lh DATAFILE6_*

-rw-r----- 1 oracle oinstall 616K 2015-07-17 09:28:50 DATAFILE6_14qc8rii
-rw-r----- 1 oracle oinstall 616K 2015-07-17 09:34:58 DATAFILE6_15qc8ru2
-rw-r----- 1 oracle oinstall  13M 2015-07-17 09:38:41 DATAFILE6_16qc8s51
-rw-r----- 1 oracle oinstall  13M 2015-07-17 09:49:06 DATAFILE6_17qc8soi
-rw-r----- 1 oracle oinstall 616K 2015-07-17 09:50:39 DATAFILE6_18qc8srf

--很明显正是建立了restore point并且属性guarantee flashback database;导致备份变大。

4.收尾还原:

SYS@test> drop restore point TEST0717;
Restore point dropped.

SYS@test> alter database flashback  off;

Database altered.

RMAN> delete backupset 31,32,33,34,35;

using channel ORA_DISK_1

List of Backup Pieces

BP Key  BS Key  Pc# Cp# Status      Device Type Piece Name
------- ------- --- --- ----------- ----------- ----------
31      31      1   1   AVAILABLE   DISK        /home/oracle/backup/DATAFILE6_14qc8rii
32      32      1   1   AVAILABLE   DISK        /home/oracle/backup/DATAFILE6_15qc8ru2
33      33      1   1   AVAILABLE   DISK        /home/oracle/backup/DATAFILE6_16qc8s51
34      34      1   1   AVAILABLE   DISK        /home/oracle/backup/DATAFILE6_17qc8soi
35      35      1   1   AVAILABLE   DISK        /home/oracle/backup/DATAFILE6_18qc8srf

Do you really want to delete the above objects (enter YES or NO)? yes

deleted backup piece
backup piece handle=/home/oracle/backup/DATAFILE6_14qc8rii recid=31 stamp=885288530
deleted backup piece
backup piece handle=/home/oracle/backup/DATAFILE6_15qc8ru2 recid=32 stamp=885288898
deleted backup piece
backup piece handle=/home/oracle/backup/DATAFILE6_16qc8s51 recid=33 stamp=885289121
deleted backup piece
backup piece handle=/home/oracle/backup/DATAFILE6_17qc8soi recid=34 stamp=885289746
deleted backup piece
backup piece handle=/home/oracle/backup/DATAFILE6_18qc8srf recid=35 stamp=885289839
Deleted 5 objects

--总结:

--注意这些细节,升级完成正常后删除这些restore point。

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

你可能感兴趣的文章
SettingsNotePad++
查看>>
没有JS的前端:体积更小、速度更快!
查看>>
数据指标/表现度量系统(Performance Measurement System)综述
查看>>
GitHub宣布推出Electron 1.0和Devtron,并将提供无限制的私有代码库
查看>>
论模式在领域驱动设计中的重要性
查看>>
有关GitHub仓库分支的几个问题
查看>>
云原生的浪潮下,为什么运维人员适合学习Go语言?
查看>>
EAServer 6.1 .NET Client Support
查看>>
锐捷交换机密码恢复(1)
查看>>
Method Swizzling对Method的要求
查看>>
佛祖保佑,永不宕机
查看>>
四、配置开机自动启动Nginx + PHP【LNMP安装 】
查看>>
Linux 目录结构及内容详解
查看>>
OCP读书笔记(24) - 题库(ExamD)
查看>>
解决Unable to load R3 module ...VBoxDD.dll (VBoxDD):GetLastError=1790
查看>>
.net excel利用NPOI导入oracle
查看>>
$_SERVER['SCRIPT_FLENAME']与__FILE__
查看>>
My97DatePicker 日历插件
查看>>
hive基本操作与应用
查看>>
excel快捷键设置
查看>>