rman备份设置

通过oracle enterprise manager备份数据库

第一种方法,通过本地硬盘备份



1,建立备份文件夹
[root@tonykorn97 oracle]# mkdir backup
[root@tonykorn97 oracle]# chmod 755 backup
[root@tonykorn97 oracle]# chown -R oracle:dba backup
[root@tonykorn97 oracle]# ls -al
total 40
drwxr-xr-x 6 oracle oinstall 4096 Sep 2 22:34 .
drwxr-xr-x 25 root root 4096 Sep 1 14:43 ..
drwxr-xr-x 3 oracle oinstall 4096 Sep 1 14:22 app
drwxr-xr-x 2 oracle dba 4096 Sep 2 22:34 backup
drwx------ 2 oracle oinstall 16384 Sep 1 14:20 lost+found
drwxr-xr-x 3 oracle oinstall 4096 Sep 1 15:54 oradata
[root@tonykorn97 oracle]# pwd
/oracle
[root@tonykorn97 oracle]#

2,登录企业管理器
选择:
维护--备份设置--并行度出填入想要的并行度--在磁盘备份位置填入刚才建立的文件夹的位置--磁盘备份类型选择"压缩备份集"--在主机身份证明处填写用户名和口令,并点击另存为首选身份证明--点击测试备份设置测试是否可以。

3,按照上面设置,会弹出“磁盘备份测试成功!”

4,点击确定保存设置。

第二种方法,通过安装networker客户端备份到远端备份服务器上。
1,在备份服务器上增加一个客户端
在 /etc/hosts文件中增加一条记录,新增加的客户端ip和主机名。
增加 networker一个客户端

同理,在客户端上也增加一条服务器的ip和主机名。

2,客户端安装networker 软件
[root@tonykorn97 ~]# rpm -ivh lgtoclnt-7.3.1-1.i686.rpm
Preparing... ########################################### [100%]
1:lgtoclnt ########################################### [100%]
[root@tonykorn97 ~]# rpm -ivh lgtonmo-4.1-1.i686.rpm
Preparing... ########################################### [100%]
1:lgtonmo ########################################### [100%]
[root@tonykorn97 ~]#

3,link the networker module for oracle library file
1> login as teh ORACLE_HOME owner:
[root@tonykorn97 ~]# su - oracle
2> shutdown all oracle instances that use this ORACLE_HOME
[oracle@tonykorn97 ~]$ sqlplus / as sysdba

SQL*Plus: Release 10.2.0.1.0 - Production on Mon Sep 3 00:18:57 2007

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


Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options

SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL>

3>链接文件
[oracle@tonykorn97 ~]$ cd $ORACLE_HOME/lib
[oracle@tonykorn97 lib]$ ln -s /usr/lib/libnwora.so libobk.so
[oracle@tonykorn97 lib]$ ls -al libobk.so
lrwxrwxrwx 1 oracle oinstall 20 Sep 3 00:28 libobk.so -> /usr/lib/libnwora.so
[oracle@tonykorn97 lib]$


4>,enable the software
/etc/init.d/networker start
启动数据库


4,Using the OEM Backup Management Tools
维护---备份/恢复设置---备份设置
设备
磁带设置
选择压缩备份集
介质管理设置
介质管理供应商库参数:
STB_LIBRARY=/oracle/app/oracle/product/10.2.0/Database/lib/libobk.so,ENV=(NSR_SERVER=cwwb,NSR_DATA_VOLUME_POOL=Oracle Backup)
主机身份证明
oracle
oracle密码
测试磁带备份


5,测试报错:
Recovery Manager: Release 10.2.0.1.0 - Production on Mon Sep 3 00:32:51 2007

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

RMAN>
connected to target database: SZRRLCW (DBID=3346998235)
using target database control file instead of recovery catalog

RMAN>
echo set on


RMAN> run {
2> allocate channel oem_sbt_backup type 'sbt_tape' format '%U' parms 'STB_LIBRARY=/oracle/app/oracle/product/10.2.0/Database/lib/libobk.so,ENV=(NSR_SERVER=cwwb,NSR_DATA_VOLUME_POOL=Oracle Backup)';
3> backup as COMPRESSED BACKUPSET current controlfile tag '09032007123248';
4> restore controlfile validate from tag '09032007123248';
5> release channel oem_sbt_backup;
6> }
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03009: failure of allocate command on oem_sbt_backup channel at 09/03/2007 00:33:02
ORA-19554: error allocating device, device type: SBT_TAPE, device name:
ORA-27209: syntax error in device PARMS - unknown keyword or missing =


RMAN> allocate channel for maintenance type 'sbt_tape' parms 'STB_LIBRARY=/oracle/app/oracle/product/10.2.0/Database/lib/libobk.so,ENV=(NSR_SERVER=cwwb,NSR_DATA_VOLUME_POOL=Oracle Backup)';
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03009: failure of allocate command on ORA_MAINT_SBT_TAPE_1 channel at 09/03/2007 00:33:02
ORA-19554: error allocating device, device type: SBT_TAPE, device name:
ORA-27209: syntax error in device PARMS - unknown keyword or missing =


RMAN> delete noprompt backuppiece tag '09032007123248';
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=133 devtype=DISK
allocated channel: ORA_DISK_2
channel ORA_DISK_2: sid=132 devtype=DISK
allocated channel: ORA_DISK_3
channel ORA_DISK_3: sid=131 devtype=DISK
allocated channel: ORA_DISK_4
channel ORA_DISK_4: sid=130 devtype=DISK
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of delete command at 09/03/2007 00:33:08
RMAN-06168: no backup pieces with this tag found: 09032007123248


RMAN> exit;

Recovery Manager complete.


6,应该是介质管理供应商库参数设置有误,重新设置为如下:
ENV=(NSR_SERVER=cwwb,NSR_DATA_VOLUME_POOL=Oracle Backup)

报如下错误:
Recovery Manager: Release 10.2.0.1.0 - Production on Mon Sep 3 02:49:43 2007

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

RMAN>
connected to target database: SZRRLCW (DBID=3346998235)
using target database control file instead of recovery catalog

RMAN>
echo set on


RMAN> run {
2> allocate channel oem_sbt_backup type 'sbt_tape' format '%U' parms 'ENV=(NSR_SERVER=cwwb,NSR_DATA_VOLUME_POOL=Oracle Backup)';
3> backup as BACKUPSET current controlfile tag '09032007024936';
4> restore controlfile validate from tag '09032007024936';
5> release channel oem_sbt_backup;
6> }
allocated channel: oem_sbt_backup
channel oem_sbt_backup: sid=131 devtype=SBT_TAPE
channel oem_sbt_backup: NMO v4.1.0.0

Starting backup at 03-SEP-07
channel oem_sbt_backup: starting full datafile backupset
channel oem_sbt_backup: specifying datafile(s) in backupset
including current control file in backupset
channel oem_sbt_backup: starting piece 1 at 03-SEP-07
channel oem_sbt_backup: finished piece 1 at 03-SEP-07
piece handle=0hiqvq6g_1_1 tag=09032007024936 comment=API Version 2.0,MMS Version 4.1.0.0
channel oem_sbt_backup: backup set complete, elapsed time: 00:00:04
Finished backup at 03-SEP-07

Starting restore at 03-SEP-07

channel oem_sbt_backup: starting validation of datafile backupset
channel oem_sbt_backup: reading from backup piece 0hiqvq6g_1_1
channel oem_sbt_backup: restored backup piece 1
piece handle=0hiqvq6g_1_1 tag=09032007024936
channel oem_sbt_backup: validation complete, elapsed time: 00:00:55
Finished restore at 03-SEP-07

released channel: oem_sbt_backup


RMAN> allocate channel for maintenance type 'sbt_tape' parms 'ENV=(NSR_SERVER=cwwb,NSR_DATA_VOLUME_POOL=Oracle Backup)';
allocated channel: ORA_MAINT_SBT_TAPE_1
channel ORA_MAINT_SBT_TAPE_1: sid=131 devtype=SBT_TAPE
channel ORA_MAINT_SBT_TAPE_1: NMO v4.1.0.0


RMAN> delete noprompt backuppiece tag '09032007024936';

List of Backup Pieces
BP Key BS Key Pc# Cp# Status Device Type Piece Name
------- ------- --- --- ----------- ----------- ----------
6 6 1 1 AVAILABLE SBT_TAPE 0hiqvq6g_1_1
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03009: failure of delete command on ORA_MAINT_SBT_TAPE_1 channel at 09/03/2007 02:51:04
ORA-19509: failed to delete sequential file, handle="0hiqvq6g_1_1", parms=""
ORA-27027: sbtremove2 returned error
ORA-19511: Error received from media manager layer, error text:
nwora_remove: nwora_nsrmm_remove: nsrmm process failed with error - nsrmm: RAP
error: Permission denied, user 'oracle' on 'tonykorn97' does not have 'Operate NetWor
ker' privilege to perform this operation.

RMAN> exit;

Recovery Manager complete.


7,这个应该是networker中没有权限造成的。
在networker服务器端增加一个管理员权限为客户端的oracle名字。重新测试ok

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/312079/viewspace-245752/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/312079/viewspace-245752/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值