Chinaunix首页 | 论坛 | 博客
  • 博客访问: 75624
  • 博文数量: 18
  • 博客积分: 10
  • 博客等级: 民兵
  • 技术积分: 200
  • 用 户 组: 普通用户
  • 注册时间: 2011-02-20 17:43
个人简介

生活的本质不是索取而是奋斗

文章分类

全部博文(18)

文章存档

2017年(4)

2016年(14)

我的朋友

分类: Oracle

2016-11-28 17:17:56

[oracle@single ~]$ env |grep SID
ORACLE_SID=wangnan



连接本地数据库,打开系统认证方式的方法
[oracle@single ~]$ rman target /

Recovery Manager: Release 11.2.0.4.0 - Production on Fri Nov 4 22:31:51 2016

Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.

connected to target database: WANGNAN (DBID=3740253739)

RMAN>



开启归档模式
RMAN> shutdown immediate;

database closed
database dismounted
Oracle instance shut down

RMAN> startup mount;

connected to target database (not started)
Oracle instance started
database mounted

Total System Global Area 1068937216 bytes

Fixed Size 2260088 bytes
Variable Size 671089544 bytes
Database Buffers 390070272 bytes
Redo Buffers 5517312 bytes

RMAN> sql 'alter database archivelog';

sql statement: alter database archivelog

RMAN>

查看归档模式
[root@single ~]# su - oracle
[oracle@single ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.4.0 Production on Fri Nov 4 23:19:40 2016

Copyright (c) 1982, 2013, Oracle. All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> archive log list;
Database log mode Archive Mode
Automatic archival Enabled
Archive destination USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence 7
Next log sequence to archive 9
Current log sequence 9

备份以及查看备份
RMAN> backup database;

Starting backup at 04-NOV-16
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=129 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=00001 name=/u01/app/oracle/oradata/wangnan/datafile/system01.dbf
input datafile file number=00002 name=/u01/app/oracle/oradata/wangnan/datafile/sysaux01.dbf
input datafile file number=00003 name=/u01/app/oracle/oradata/wangnan/datafile/undotbs01.dbf
input datafile file number=00004 name=/u01/app/oracle/oradata/wangnan/datafile/users01.dbf
channel ORA_DISK_1: starting piece 1 at 04-NOV-16
channel ORA_DISK_1: finished piece 1 at 04-NOV-16
piece handle=/u01/app/oracle/fast_recovery_area/WANGNAN/backupset/2016_11_04/o1_mf_nnndf_TAG20161104T232233_d1s9xsxp_.bkp tag=TAG20161104T232233 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:12
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 04-NOV-16
channel ORA_DISK_1: finished piece 1 at 04-NOV-16
piece handle=/u01/app/oracle/fast_recovery_area/WANGNAN/backupset/2016_11_04/o1_mf_ncsnf_TAG20161104T232233_d1s9y89v_.bkp tag=TAG20161104T232233 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 04-NOV-16

RMAN> list backup;
xxx
xxx
5 Full 244.98M DISK 00:00:11 04-NOV-16
BP Key: 5 Status: AVAILABLE Compressed: NO Tag: TAG20161104T232233
Piece Name: /u01/app/oracle/fast_recovery_area/WANGNAN/backupset/2016_11_04/o1_mf_nnndf_TAG20161104T232233_d1s9xsxp_.bkp
List of Datafiles in backup set 5
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- --------- ----
1 Full 254198 04-NOV-16 /u01/app/oracle/oradata/wangnan/datafile/system01.dbf
2 Full 254198 04-NOV-16 /u01/app/oracle/oradata/wangnan/datafile/sysaux01.dbf
3 Full 254198 04-NOV-16 /u01/app/oracle/oradata/wangnan/datafile/undotbs01.dbf
4 Full 254198 04-NOV-16 /u01/app/oracle/oradata/wangnan/datafile/users01.dbf

BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
6 Full 9.14M DISK 00:00:03 04-NOV-16
BP Key: 6 Status: AVAILABLE Compressed: NO Tag: TAG20161104T232233
Piece Name: /u01/app/oracle/fast_recovery_area/WANGNAN/backupset/2016_11_04/o1_mf_ncsnf_TAG20161104T232233_d1s9y89v_.bkp
SPFILE Included: Modification time: 04-NOV-16
SPFILE db_unique_name: WANGNAN
Control File Included: Ckp SCN: 254198 Ckp time: 04-NOV-16



阅读(1247) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~