1、初始化数据
JZH@jzh>create table t as select * from dba_objects;
Table created.
JZH@jzh>select count(*) from t;
COUNT(*)
----------
74756
JZH@jzh>select bytes/1024/1024 from dba_segments where segment_name='T';
BYTES/1024/1024
---------------
9
2、备份数据库
[oracle@jzh5 oradata]$ rman target /
Recovery Manager: Release 11.2.0.3.0 - Production on Mon Dec 5 08:25:42 2016
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
connected to target database: JZH (DBID=249975939)
RMAN> run{
2> allocate channel d1 type disk;
3> allocate channel d2 type disk;
4> crosscheck archivelog all;
5> delete noprompt expired archivelog all;
6> backup as compressed backupset database format '/home/oracle/backup20161205/full_%d_%T_%s.bak';
7> sql 'alter system archive log current';
8> backup as compressed backupset filesperset 2 format '//home/oracle/backup20161205/arch_%d_%T_%s.bak' archivelog all;
9> backup current controlfile format '/home/oracle/backup20161205/ctl_%d_%T_%s.bak';
10> release channel d1;
11> release channel d2;
12> }
3、数据库启到nomount状态
SYS@jzh>shu immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SYS@jzh>startup nomount
ORACLE instance started.
Total System Global Area 835104768 bytes
Fixed Size 2232960 bytes
Variable Size 482348416 bytes
Database Buffers 348127232 bytes
Redo Buffers 2396160 bytes
RMAN> restore controlfile from '/home/oracle/backup20161205/ctl_JZH_20161205_20.bak'