RMAN 备份详解
http://blog.csdn.net/leshami/article/details/6032739
RMAN 配置、监控与管理
http://blog.csdn.net/leshami/article/details/6032597
ORACLE RMAN备份及还原
http://blog.163.com/thomas_shen/blog/static/66579972201091914319302/
使用RMAN连接到数据库
http://www.cnblogs.com/snake-hand/archive/2011/07/06/2452281.html
rman配置参数详解
http://www.2cto.com/database/201208/149465.html
RMAN配置参数解释
http://www.itpub.net/thread-1586529-1-1.html
rman连接本地、远程数据库方法解析
http://www.68idc.cn/help/mysqldata/20150614368075.html
ora-12514:TNS:listener does not currently know of service requested in connect descriptor
http://blog.csdn.net/kingsonl/article/details/8062757
rman-03009错误的一个原因
http://blog.csdn.net/mituan1234567/article/details/8350219
测试环境:
OS: CentOS 5
DB: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Prod
试验一: 仅在一个虚拟机上进行RMAN的试验
建了三个数据库,其中一个开了归档
数据库1:
SQL> select dbid,name,log_mode from v$database;
DBID NAME LOG_MODE
---------- --------- ------------
1418146094 ORCL NOARCHIVELOG
数据库2:
SQL> select dbid,name,log_mode from v$database;
DBID NAME LOG_MODE
---------- --------- ------------
1730113078 OCPONE ARCHIVELOG
数据库3:
SQL> select dbid,name,log_mode from v$database;
DBID NAME LOG_MODE
---------- --------- ------------
1802360993 OCPTWO NOARCHIVELOG
#在开了归档的数据库上创建一个永久表空间,用于存放恢复资料
[root@localhost ~]# su - oracle
[oracle@localhost ~]$ export ORACLE_SID=ocpone
[oracle@localhost ~]$ echo $ORACLE_SID
ocpone
[oracle@localhost ~]$sqlplus /nolog
SQL>connect / as sysdba
SQL>startup
SQL> select dbid,name,log_mode from v$database;
DBID NAME LOG_MODE
---------- --------- ------------
1730113078 OCPONE ARCHIVELOG
SQL> create tablespace SPACE_FOR_BACKUP DATAFILE '/u01/app/oracle/oradata/ocpone/SPACE_FOR_BACKUP001.dbf' SIZE 512M;
Tablespace created.
SQL> CREATE USER RMAN IDENTIFIED BY rman1 TEMPORARY TABLESPACE temp DEFAULT TABLESPACE SPACE_FOR_BACKUP QUOTA UNLIMITED ON SPACE_FOR_BACKUP;
User created.
SQL> GRANT RECOVERY_CATALOG_OWNER TO RMAN;
Grant succeeded
#换一个终端,用RMAN登录:
[root@localhost ~]# su - oracle
[oracle@localhost ~]$ export ORACLE_SID=ocpone
[oracle@localhost ~]$ echo $ORACLE_SID
ocpone
[oracle@localhost ~]$ rman
Recovery Manager: Release 10.2.0.1.0 - Production on Fri Oct 16 23:56:35 2015
Copyright (c) 1982, 2005, Oracle. All rights reserved.
RMAN> connect catalog rman/
recovery catalog database Password:
connected to recovery catalog database
#创建恢复资料/目录
RMAN> create catalog TABLESPACE SPACE_FOR_BACKUP;
recovery catalog created
#注册数据库
RMAN> register database;
database registered in recovery catalog
starting full resync of recovery catalog
full resync complete
#创建用于备份的文件夹
[oracle@localhost oradata]$ mkdir ocpone_backup
[oracle@localhost oradata]$ cd ocpone_backup/
[oracle@localhost ocpone_backup]$ pwd
/u01/app/oracle/oradata/ocpone_backup
#备份整个数据库
RMAN> backup database format '/u01/app/oracle/oradata/ocpone_backup/bk01_%s_%p_%t';
Starting backup at 17-OCT-15
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=142 devtype=DISK
channel ORA_DISK_1: starting full datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
input datafile fno=00003 name=/u01/app/oracle/oradata/ocpone/undo01.dbf
input datafile fno=00005 name=/u01/app/oracle/oradata/ocpone/SPACE_FOR_BACKUP001.dbf
input datafile fno=00001 name=/u01/app/oracle/oradata/ocpone/system01.dbf
input datafile fno=00002 name=/u01/app/oracle/oradata/ocpone/sysaux01.dbf
input datafile fno=00004 name=/u01/app/oracle/oradata/ocpone/tablespaceone01.dbf
channel ORA_DISK_1: starting piece 1 at 17-OCT-15
channel ORA_DISK_1: finished piece 1 at 17-OCT-15
piece handle=/u01/app/oracle/oradata/ocpone_backup/bk01_1_1_893291033 tag=TAG20151017T002352 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:01:25
channel ORA_DISK_1: starting full datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
including current control file in backupset
including current SPFILE in backupset
channel ORA_DISK_1: starting piece 1 at 17-OCT-15
channel ORA_DISK_1: finished piece 1 at 17-OCT-15
piece handle=/u01/app/oracle/oradata/ocpone_backup/bk01_2_1_893291118 tag=TAG20151017T002352 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:04
Finished backup at 17-OCT-15
#查看备份后的文件
[oracle@localhost ocpone_backup]$ ls
bk01_1_1_893291033 bk01_2_1_893291118
RMAN> list backup;
List of Backup Sets
===================
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
108 Full 304.00M DISK 00:01:19 17-OCT-15
BP Key: 110 Status: AVAILABLE Compressed: NO Tag: TAG20151017T002352
Piece Name: /u01/app/oracle/oradata/ocpone_backup/bk01_1_1_893291033
List of Datafiles in backup set 108
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- --------- ----
1 Full 380833 17-OCT-15 /u01/app/oracle/oradata/ocpone/system01.dbf
2 Full 380833 17-OCT-15 /u01/app/oracle/oradata/ocpone/sysaux01.dbf
3 Full 380833 17-OCT-15 /u01/app/oracle/oradata/ocpone/undo01.dbf
4 Full 380833 17-OCT-15 /u01/app/oracle/oradata/ocpone/tablespaceone01.dbf
5 Full 380833 17-OCT-15 /u01/app/oracle/oradata/ocpone/SPACE_FOR_BACKUP001.dbf
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
109 Full 7.39M DISK 00:00:03 17-OCT-15
BP Key: 111 Status: AVAILABLE Compressed: NO Tag: TAG20151017T002352
Piece Name: /u01/app/oracle/oradata/ocpone_backup/bk01_2_1_893291118
Control File Included: Ckp SCN: 380864 Ckp time: 17-OCT-15
SPFILE Included: Modification time: 17-OCT-15
试验二: 开两个虚拟机,A虚拟机备份B虚拟机上的数据库
开归档的数据库1,catalog
[root@localhost ~]# ifconfig
eth0
inet addr:192.168.3.131 Bcast:192.168.3.255 Mask:255.255.255.0
oracle_sid=ocpone
开归档的数据库2,target
[root@localhost ~]# ifconfig
eth0
inet addr:192.168.3.153 Bcast:192.168.3.255 Mask:255.255.255.0
oracle_sid=ocptwo
#测试一下网络:
[root@localhost ~]# ping 192.168.3.153
PING 192.168.3.153 (192.168.3.153) 56(84) bytes of data.
64 bytes from 192.168.3.153: icmp_seq=1 ttl=64 time=6.00 ms
64 bytes from 192.168.3.153: icmp_seq=2 ttl=64 time=0.513 ms
64 bytes from 192.168.3.153: icmp_seq=3 ttl=64 time=2.02 ms
192.168.3.131 虚拟机上
/u01/app/oracle/product/10.2.0/db_1/network/admin/tnsnames.ora
#ocptwo153
OCPTWO153 =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.3.153)(PORT = 1521))
)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = ocptwo)
)
)
#测试一下,发现没有连不上
SQL> connect test01/密码@ocptwo153
ERROR:
ORA-12514: TNS:listener does not currently know of service requested in connect
descriptor
#192.168.3.153机器上的listener.ora加了一段
/u01/app/oracle/product/10.2.0/db_1/network/admin/listener.ora
SID_LIST_OCPTWO =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = /u01/app/oracle/product/10.2.0/db_1)
(PROGRAM = extproc)
)
(SID_DESC =
(GLOBAL_DBNAME = ocptwo)
(ORACLE_HOME = /u01/app/oracle/product/10.2.0/db_1)
(SID_NAME = ocptwo)
)
)
OCPTWO =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.3.153)(PORT = 1521))
)
)
#192.168.3.153启动监听
[oracle@localhost admin]$ lsnrctl start ocptwo
LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 20-OCT-2015 01:49:30
Copyright (c) 1991, 2005, Oracle. All rights reserved.
Starting /u01/app/oracle/product/10.2.0/db_1/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 10.2.0.1.0 - Production
System parameter file is /u01/app/oracle/product/10.2.0/db_1/network/admin/listener.ora
Log messages written to /u01/app/oracle/product/10.2.0/db_1/network/log/ocptwo.log
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.3.153)(PORT=1521)))
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1)))
STATUS of the LISTENER
------------------------
Alias ocptwo
Version TNSLSNR for Linux: Version 10.2.0.1.0 - Production
Start Date 20-OCT-2015 01:49:30
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/oracle/product/10.2.0/db_1/network/admin/listener.ora
Listener Log File /u01/app/oracle/product/10.2.0/db_1/network/log/ocptwo.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.3.153)(PORT=1521)))
Services Summary...
Service "ORACLE" has 1 instance(s).
Instance "ocptwo", status UNKNOWN, has 1 handler(s) for this service...
Service "PLSExtProc" has 1 instance(s).
Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
#检查一下启动情况
[oracle@localhost admin]$ ps -ef|grep tnslsnr |grep -v grep
oracle 4819 1 0 01:49 ? 00:00:00 /u01/app/oracle/product/10.2.0/db_1/bin/tnslsnr ocptwo -inherit
回到192.168.3.131虚拟机上,连接成功
SQL> connect test01/密码@ocptwo153
Connected.
#切换到RMAN
RMAN> connect target sys/密码@ocptwo153
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-06004: ORACLE error from recovery catalog database: RMAN-20001: target database not found in recovery catalog
#注册目标数据库
RMAN> REGISTER DATABASE;
database registered in recovery catalog
starting full resync of recovery catalog
full resync complete
RMAN> REPORT SCHEMA;
Report of database schema
List of Permanent Datafiles
===========================
File Size(MB) Tablespace RB segs Datafile Name
---- -------- -------------------- ------- ------------------------
1 480 SYSTEM YES /u01/app/oracle/oradata/ocptwo/system01.dbf
2 345 UNDOTBS1 YES /u01/app/oracle/oradata/ocptwo/undotbs01.dbf
3 250 SYSAUX NO /u01/app/oracle/oradata/ocptwo/sysaux01.dbf
4 5 USERS NO /u01/app/oracle/oradata/ocptwo/users01.dbf
5 50 OCPTWOSPACE NO /u01/app/oracle/oradata/ocptwo/ocptwospace01.dbf
List of Temporary Files
=======================
File Size(MB) Tablespace Maxsize(MB) Tempfile Name
---- -------- -------------------- ----------- --------------------
1 26 TEMP 32767 /u01/app/oracle/oradata/ocptwo/temp01.dbf
#修改一下通道数
RMAN> CONFIGURE DEVICE TYPE DISK PARALLELISM 3;
new RMAN configuration parameters:
CONFIGURE DEVICE TYPE DISK PARALLELISM 3 BACKUP TYPE TO BACKUPSET;
new RMAN configuration parameters are successfully stored
starting full resync of recovery catalog
full resync complete
#开启控制文件自动备份模式
RMAN> CONFIGURE CONTROLFILE AUTOBACKUP ON;
New RMAN configuration parameters:
CONFIGURE CONTROLFILE AUTOBACKUP ON;
new RMAN configuration parameters are successfully stored
starting full resync of recovery catalog
full resync complete
#修改控制文件备份的路径
RMAN> CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/u01/app/oracle/oradata/ocptwo_153/control%d__%T_%F';
#开归档时flashback 没有开启,补一下
#查询是否开了flashback
SQL> select flashback_on from v$database;
FLASHBACK_ON
------------------
NO
#切换到mount状态
SQL>startup mount
#开启flashback
SQL> alter database flashback on;
Database altered.
SQL> archive log list;
Database log mode Archive Mode
Automatic archival Enabled
Archive destination /u01/app/oracle/oradata/ocpone/arch3
Oldest online log sequence 103
Next log sequence to archive 105
Current log sequence 105
SQL> alter database open;
Database altered.
SQL> alter system archive log start;
System altered.
SQL> alter system switch logfile;
System altered.
SQL> archive log list;
Database log mode Archive Mode
Automatic archival Enabled
Archive destination /u01/app/oracle/oradata/ocpone/arch3
Oldest online log sequence 104
Next log sequence to archive 106
Current log sequence 106
SQL> quit
#192.168.3153虚拟机上创建备份用的文件夹
[oracle@localhost oradata]$ mkdir /u01/app/oracle/oradata/ocptwo_153
[oracle@localhost oradata]$ ls
create ocpone ocpone_bak ocptwo ocptwo_153 orcl
[oracle@localhost oradata]$ chmod -R 775 ocptwo_153
[oracle@localhost oradata]$ ll
total 44
-rw-rw-r-- 1 oracle oracle 0 Oct 19 01:04 create
drwxr-xr-x 2 oracle oracle 4096 Oct 20 04:16 ocpone
drwxrwxr-x 2 oracle oracle 4096 Oct 21 17:34 ocpone_bak
drwxr-x--- 3 oracle oracle 4096 Oct 19 23:34 ocptwo
drwxrwxr-x 2 oracle oracle 4096 Oct 21 21:26 ocptwo_153
drwxr-x--- 2 oracle oracle 4096 Sep 14 03:42 orcl
[oracle@localhost oradata]$
192.168.3.131虚拟机上
#备份控制文件
RMAN> backup current controlfile;
Starting backup at 21-OCT-15
using channel ORA_DISK_1
using channel ORA_DISK_2
using channel ORA_DISK_3
channel ORA_DISK_1: starting full datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
including current control file in backupset
channel ORA_DISK_1: starting piece 1 at 21-OCT-15
channel ORA_DISK_1: finished piece 1 at 21-OCT-15
piece handle=/u01/app/oracle/flash_recovery_area/OCPTWO/backupset/2015_10_21/o1_mf_ncnnf_TAG20151021T212714_c2jsf2fq_.bkp tag=TAG20151021T212714 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 21-OCT-15
Starting Control File and SPFILE Autobackup at 21-OCT-15
piece handle=/u01/app/oracle/oradata/ocptwo_153/controlOCPTWO__20151021_c-1802360993-20151021-0e comment=NONE
Finished Control File and SPFILE Autobackup at 21-OCT-15
#备份spfile
RMAN> backup spfile;
Starting backup at 21-OCT-15
using channel ORA_DISK_1
using channel ORA_DISK_2
using channel ORA_DISK_3
channel ORA_DISK_1: starting full datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
including current SPFILE in backupset
channel ORA_DISK_1: starting piece 1 at 21-OCT-15
channel ORA_DISK_1: finished piece 1 at 21-OCT-15
piece handle=/u01/app/oracle/flash_recovery_area/OCPTWO/backupset/2015_10_21/o1_mf_nnsnf_TAG20151021T222930_c2jx1w73_.bkp tag=TAG20151021T222930 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:02
Finished backup at 21-OCT-15
Starting Control File and SPFILE Autobackup at 21-OCT-15
piece handle=/u01/app/oracle/oradata/ocptwo_153/controlOCPTWO__20151021_c-1802360993-20151021-0f comment=NONE
Finished Control File and SPFILE Autobackup at 21-OCT-15
#192.168.3.131虚拟机上,查一下目录下的文件
[oracle@localhost oradata]$ cd ocptwo_153/
[oracle@localhost ocptwo_153]$ ls
controlOCPTWO__20151021_c-1802360993-20151021-0e
controlOCPTWO__20151021_c-1802360993-20151021-0f
List of Backup Sets
===================
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
185 Full 80.00K DISK 00:00:00 20-OCT-15
BP Key: 191 Status: AVAILABLE Compressed: NO Tag: TAG20151020T041625
Piece Name: /u01/app/oracle/oradata/ocpone/ocptwo_spfile_OCPTWO_1gqk5d8p_1_1
SPFILE Included: Modification time: 20-OCT-15
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
285 Full 161.25M DISK 00:00:49 21-OCT-15
BP Key: 295 Status: AVAILABLE Compressed: NO Tag: TAG20151021T191030
Piece Name: /u01/app/oracle/flash_recovery_area/OCPTWO/backupset/2015_10_21/o1_mf_nnndf_TAG20151021T191030_c2jkdttj_.bkp
List of Datafiles in backup set 285
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- --------- ----
3 Full 541472 21-OCT-15 /u01/app/oracle/oradata/ocptwo/sysaux01.dbf
5 Full 541472 21-OCT-15 /u01/app/oracle/oradata/ocptwo/ocptwospace01.dbf
BS Key Size Device Type Elapsed Time Completion Time
------- ---------- ----------- ------------ ---------------
286 124.00K DISK 00:00:02 21-OCT-15
BP Key: 296 Status: AVAILABLE Compressed: NO Tag: TAG20151021T191124
Piece Name: /u01/app/oracle/flash_recovery_area/OCPTWO/backupset/2015_10_21/o1_mf_annnn_TAG20151021T191124_c2jkgfxn_.bkp
List of Archived Logs in backup set 286
Thrd Seq Low SCN Low Time Next SCN Next Time
---- ------- ---------- --------- ---------- ---------
1 36 541343 21-OCT-15 541505 21-OCT-15
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
341 Full 80.00K DISK 00:00:01 21-OCT-15
BP Key: 343 Status: AVAILABLE Compressed: NO Tag: TAG20151021T212303
Piece Name: /u01/app/oracle/flash_recovery_area/OCPTWO/backupset/2015_10_21/o1_mf_nnsnf_TAG20151021T212303_c2js596m_.bkp
SPFILE Included: Modification time: 21-OCT-15
BS Key Size Device Type Elapsed Time Completion Time
------- ---------- ----------- ------------ ---------------
353 995.50K DISK 00:00:02 21-OCT-15
BP Key: 357 Status: AVAILABLE Compressed: NO Tag: TAG20151021T212326
Piece Name: /u01/app/oracle/flash_recovery_area/OCPTWO/backupset/2015_10_21/o1_mf_annnn_TAG20151021T212326_c2js5yvz_.bkp
List of Archived Logs in backup set 353
Thrd Seq Low SCN Low Time Next SCN Next Time
---- ------- ---------- --------- ---------- ---------
1 31 445929 18-OCT-15 446930 18-OCT-15
BS Key Size Device Type Elapsed Time Completion Time
------- ---------- ----------- ------------ ---------------
354 45.49M DISK 00:00:03 21-OCT-15
BP Key: 358 Status: AVAILABLE Compressed: NO Tag: TAG20151021T212326
Piece Name: /u01/app/oracle/flash_recovery_area/OCPTWO/backupset/2015_10_21/o1_mf_annnn_TAG20151021T212326_c2js5ys5_.bkp
List of Archived Logs in backup set 354
Thrd Seq Low SCN Low Time Next SCN Next Time
---- ------- ---------- --------- ---------- ---------
1 32 446930 18-OCT-15 496493 19-OCT-15
BS Key Size Device Type Elapsed Time Completion Time
------- ---------- ----------- ------------ ---------------
355 45.49M DISK 00:00:03 21-OCT-15
BP Key: 359 Status: AVAILABLE Compressed: NO Tag: TAG20151021T212326
Piece Name: /u01/app/oracle/flash_recovery_area/OCPTWO/backupset/2015_10_21/o1_mf_annnn_TAG20151021T212326_c2js5yp6_.bkp
List of Archived Logs in backup set 355
Thrd Seq Low SCN Low Time Next SCN Next Time
---- ------- ---------- --------- ---------- ---------
1 33 496493 19-OCT-15 504127 19-OCT-15
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
372 Full 6.77M DISK 00:00:00 21-OCT-15
BP Key: 374 Status: AVAILABLE Compressed: NO Tag: TAG20151021T212352
Piece Name: /u01/app/oracle/flash_recovery_area/OCPTWO/backupset/2015_10_21/o1_mf_ncnnf_TAG20151021T212352_c2js6rbn_.bkp
Control File Included: Ckp SCN: 545940 Ckp time: 21-OCT-15
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
387 Full 6.77M DISK 00:00:00 21-OCT-15
BP Key: 389 Status: AVAILABLE Compressed: NO Tag: TAG20151021T212714
Piece Name: /u01/app/oracle/flash_recovery_area/OCPTWO/backupset/2015_10_21/o1_mf_ncnnf_TAG20151021T212714_c2jsf2fq_.bkp
Control File Included: Ckp SCN: 546051 Ckp time: 21-OCT-15
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
402 Full 6.80M DISK 00:00:00 21-OCT-15
BP Key: 404 Status: AVAILABLE Compressed: NO Tag: TAG20151021T212718
Piece Name: /u01/app/oracle/oradata/ocptwo_153/controlOCPTWO__20151021_c-1802360993-20151021-0e
Control File Included: Ckp SCN: 546061 Ckp time: 21-OCT-15
SPFILE Included: Modification time: 21-OCT-15
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
431 Full 80.00K DISK 00:00:05 21-OCT-15
BP Key: 436 Status: AVAILABLE Compressed: NO Tag: TAG20151021T222207
Piece Name: /u01/app/oracle/flash_recovery_area/OCPTWO/backupset/2015_10_21/o1_mf_nnsnf_TAG20151021T222207_c2jwnwno_.bkp
SPFILE Included: Modification time: 21-OCT-15
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
432 Full 344.16M DISK 00:00:35 21-OCT-15
BP Key: 437 Status: AVAILABLE Compressed: NO Tag: TAG20151021T222207
Piece Name: /u01/app/oracle/flash_recovery_area/OCPTWO/backupset/2015_10_21/o1_mf_nnndf_TAG20151021T222207_c2jwn0c6_.bkp
List of Datafiles in backup set 432
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- --------- ----
2 Full 550992 21-OCT-15 /u01/app/oracle/oradata/ocptwo/undotbs01.dbf
4 Full 550992 21-OCT-15 /u01/app/oracle/oradata/ocptwo/users01.dbf
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
433 Full 353.95M DISK 00:00:44 21-OCT-15
BP Key: 438 Status: AVAILABLE Compressed: NO Tag: TAG20151021T222207
Piece Name: /u01/app/oracle/flash_recovery_area/OCPTWO/backupset/2015_10_21/o1_mf_nnndf_TAG20151021T222207_c2jwn01g_.bkp
List of Datafiles in backup set 433
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- --------- ----
1 Full 550991 21-OCT-15 /u01/app/oracle/oradata/ocptwo/system01.dbf
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
457 Full 80.00K DISK 00:00:01 21-OCT-15
BP Key: 459 Status: AVAILABLE Compressed: NO Tag: TAG20151021T222930
Piece Name: /u01/app/oracle/flash_recovery_area/OCPTWO/backupset/2015_10_21/o1_mf_nnsnf_TAG20151021T222930_c2jx1w73_.bkp
SPFILE Included: Modification time: 21-OCT-15
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
475 Full 6.80M DISK 00:00:01 21-OCT-15
BP Key: 477 Status: AVAILABLE Compressed: NO Tag: TAG20151021T222934
Piece Name: /u01/app/oracle/oradata/ocptwo_153/controlOCPTWO__20151021_c-1802360993-20151021-0f
Control File Included: Ckp SCN: 551245 Ckp time: 21-OCT-15
SPFILE Included: Modification time: 21-OCT-15
//差不多备份好了。后面计划测试恢复。
#为了测试数据库的恢复,先建个测试用的用户
#创建表空间
SQL> CREATE TABLESPACE OCPTWOSPACE
DATAFILE '/u01/app/oracle/oradata/ocptwo/ocptwospace01.dbf' SIZE 50M
AUTOEXTEND ON MAXSIZE UNLIMITED
LOGGING
EXTENT MANAGEMENT LOCAL
SEGMENT SPACE MANAGEMENT AUTO;
Tablespace created.
SQL> select file_name,TABLESPACE_NAME from dba_data_files;
FILE_NAME TABLESPACE_NAME
------------------------------
/u01/app/oracle/oradata/ocptwo/system01.dbf SYSTEM
/u01/app/oracle/oradata/ocptwo/undotbs01.dbf UNDOTBS1
/u01/app/oracle/oradata/ocptwo/sysaux01.dbf SYSAUX
/u01/app/oracle/oradata/ocptwo/users01.dbf USERS
/u01/app/oracle/oradata/ocptwo/ocptwospace01.dbf OCPTWOSPACE
#创建测试用户
SQL> CREATE USER TEST01 IDENTIFIED BY "密码"
DEFAULT TABLESPACE OCPTWOSPACE
QUOTA UNLIMITED ON OCPTWOSPACE
TEMPORARY TABLESPACE TEMP
ACCOUNT UNLOCK;
User created.
#给用户授权
SQL>GRANT
CREATE SESSION, CREATE ANY TABLE, CREATE ANY VIEW ,CREATE ANY INDEX, CREATE ANY PROCEDURE,
ALTER ANY TABLE, ALTER ANY PROCEDURE,
DROP ANY TABLE, DROP ANY VIEW, DROP ANY INDEX, DROP ANY PROCEDURE,
SELECT ANY TABLE, INSERT ANY TABLE, UPDATE ANY TABLE, DELETE ANY TABLE
TO TEST01;
Grant succeeded.
#创建表
SQL> CREATE TABLE YHB
(USER_ID NUMBER(6),
CONSTRAINT "PK_YHB" PRIMARY KEY("USER_ID"),
USER_NAME NVARCHAR2(25),
MEMO NVARCHAR2(50)
)
TABLESPACE OCPTWOSPACE
STORAGE( BUFFER_POOL DEFAULT );
Table created.
#插入数据
INSERT INTO YHB (USER_ID,USER_NAME) VALUES (1,'ZHANG');
INSERT INTO YHB (USER_ID,USER_NAME) VALUES (2,'WANG');
INSERT INTO YHB (USER_ID,USER_NAME) VALUES (3,'ZHU');
INSERT INTO YHB (USER_ID,USER_NAME) VALUES (4,'QIAN');
//待续.....