当前位置:数据库 > Oracle >>

ORACLE之rman备份加密

ORACLE之rman备份加密
 
oracle@oracle:~> rman target /
恢复管理器: Release 11.1.0.6.0 - Production on 星期四 3月 28 20:33:52 2013
Copyright (c) 1982, 2007, Oracle. All rights reserved.
连接到目标数据库: ORCL (DBID=1307032085)
RMAN> show all;
使用目标数据库控制文件替代恢复目录
db_unique_name 为 ORCL 的数据库的 RMAN 配置参数为:
CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 7 DAYS;
CONFIGURE BACKUP OPTIMIZATION OFF; # default
CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default
CONFIGURE CONTROLFILE AUTOBACKUP OFF;
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/opt/oracle/flash_recovery_area/ORCL/controlfile/c_%F';
CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET;
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/oracle/product/10.2/db_1/dbs/snapcf_orcl.f'; # default
第一种方式:使用明文密码:测试如下:
RMAN> set encryption on identified by "root" only;
正在执行命令: SET encryption
RMAN> host;
soracle@oracle:~> sqlplus "/as sysdba"
SQL*Plus: Release 11.1.0.6.0 - Production on 星期四 3月 28 20:34:26 2013
Copyright (c) 1982, 2007, Oracle. All rights reserved.
 
连接到: 
Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SYS@orcl#select tablespace_name from dba_tablespaces;
TABLESPACE_NAME
------------------------------------------------------------
SYSTEM
SYSAUX
UNDOTBS1
TEMP
USERS
VPN_HUADAN
已选择6行。
SYS@orcl#!
oracle@oracle:~> exit
exit
SYS@orcl#exit
从 Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options 断开
oracle@oracle:~> exit
exit
主机命令完成
RMAN> backup datafile 6;
启动 backup 于 28-3月 -13
分配的通道: ORA_DISK_1
通道 ORA_DISK_1: SID=132 设备类型=DISK
通道 ORA_DISK_1: 正在启动全部数据文件备份集
通道 ORA_DISK_1: 正在指定备份集内的数据文件
输入数据文件: 文件号=00006 名称=/opt/oracle/oradata/sysaux_add.dbf
通道 ORA_DISK_1: 正在启动段 1 于 28-3月 -13
通道 ORA_DISK_1: 已完成段 1 于 28-3月 -13
段句柄=/opt/oracle/flash_recovery_area/ORCL/backupset/2013_03_28/o1_mf_nnndf_TAG20130328T203507_8o8g86q7_.bkp 标记=TAG20130328T203507 注释=NONE
通道 ORA_DISK_1: 备份集已完成, 经过时间:00:00:26
完成 backup 于 28-3月 -13
RMAN> exit
 
恢复管理器完成。
oracle@oracle:~> exit
exit
SYS@orcl#su - oracle
SP2-0734: 未知的命令开头 "su - oracl..." - 忽略了剩余的行。
SYS@orcl#exit
已断开连接
oracle@oracle:~> exit
logout
oracle:~ # su - oracle
sqlploracle@oracle:~> cd oradata
oracle@oracle:~/oradata> ls
ORCL/ ORCL01/ sysaux_add.dbf sysaux_add.dbf_bak system_add.dbf system_add.dbf_bak
oracle@oracle:~/oradata> rm sysaux_add.dbf
oracle@oracle:~/oradata> sqlplus "/as sysdba"
SQL*Plus: Release 11.1.0.6.0 - Production on 星期四 3月 28 20:36:49 2013
Copyright (c) 1982, 2007, Oracle. All rights reserved.
 
连接到: 
Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SYS@orcl#desc dba_tablespaces;
名称 是否为空? 类型
----------------------------------------- -------- ----------------------------
TABLESPACE_NAME NOT NULL VARCHAR2(30)
BLOCK_SIZE NOT NULL NUMBER
INITIAL_EXTENT NUMBER
NEXT_EXTENT NUMBER
MIN_EXTENTS NOT NULL NUMBER
MAX_EXTENTS NUMBER
MAX_SIZE NUMBER
PCT_INCREASE NUMBER
MIN_EXTLEN NUMBER
STATUS VARCHAR2(9)
CONTENTS VARCHAR2(9)
LOGGING VARCHAR2(9)
FORCE_LOGGING VARCHAR2(3)
EXTENT_MANAGEMENT VARCHAR2(10)
ALLOCATION_TYPE VARCHAR2(9)
PLUGGED_IN VARCHAR2(3)
SEGMENT_SPACE_MANAGEMENT VARCHAR2(6)
DEF_TAB_COMPRESSION VARCHAR2(8)
RETENTION VARCHAR2(11)
BIGFILE VARCHAR2(3)
PREDICATE_EVALUATION VARCHAR2(7)
ENCRYPTED VARCHAR2(3)
COMPRESS_FOR VARCHAR2(18)
SYS@orcl#select file_name,tablespace_name from dba_data_files;
FILE_NAME
--------------------------------------------------------------------------------
TABLESPACE_NAME
------------------------------------------------------------
/opt/oracle/oradata/ORCL/datafile/o1_mf_users_8no75m69_.dbf
USERS
/opt/oracle/oradata/ORCL/datafile/o1_mf_undotbs1_8no736w0_.dbf
UNDOTBS1
/opt/oracle/oradata/ORCL/datafile/o1_mf_sysaux_8no736vh_.dbf
SYSAUX
 
FILE_NAME
--------------------------------------------------------------------------------
TABLESPACE_NAME
------------------------------------------------------------
/opt/oracle/oradata/ORCL/datafile/o1_mf_system_8no75lqw_.dbf
SYSTEM
/opt/oracle/oradata/ORCL/datafile/huadan
VPN_HUADAN
/opt/oracle/oradata/sysaux_add.dbf
SYSAUX
 
FILE_NAME
--------------------------------------------------------------------------------
TABLESPACE_NAME
------------------------------------------------------------
/opt/oracle/oradata/system_add.dbf
SYSTEM
 
已选择7行。
SYS@orcl#alter tablespace sysaux offline;
alter tablespace sysaux offline
*
第 1 行出现错误:
ORA-01116: 打开数据库文件 6 时出错
ORA-01110: 数据文件 6: '/opt/oracle/oradata/sysaux_add.dbf'
ORA-27041: 无法打开文件
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
 
SYS@orcl#shutdown immediate
ORA-01116: 打开数据库文件 6 时出错
ORA-01110: 数据文件 6: '/opt/oracle/oradata/sysaux_add.dbf'
ORA-27041: 无法打开文件
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
SYS@orcl#select open_mode from v$database;
OPEN_MODE
--------------------
READ WRITE
SYS@orcl#shutdown abort;
ORACLE 例程已经关闭。
SYS@orcl#
SYS@orcl#
SYS@orcl#exit
从 Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Tes
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,