rman的连接

1 本地连接 
[oracle@pc6 ~]$ rman target /
Recovery Manager: Release 11.2.0.1.0 - Production on Sat Mar 24 21:23:15 2018
Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.
connected to target database: HYYK (DBID=2117284640)

2.远处连接

首先在远程创建tnsnames
[oracle@ogg-80 admin]$ vim tnsnames.ora
HYYK =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.51)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = hyyk)
    )
  )

其次在远程链接
[oracle@ogg-80 ~]$ rman target sys/oracle@hyyk
Recovery Manager: Release 11.2.0.4.0 - Production on Sat Mar 24 21:38:51 2018
Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.
PL/SQL package SYS.DBMS_BACKUP_RESTORE version 11.02.00.01 in TARGET database is not current
PL/SQL package SYS.DBMS_RCVMAN version 11.02.00.01 in TARGET database is not current
connected to target database: HYYK (DBID=2117284640)

这里说明一下rman和数据库的权限RMAN 需要访问目标数据库上sys用户存在的各种数据包,还需要具有启动和关闭目标数据库的权限。因此RMAN 通常以sysdba 用户身份连接到目标数据库。 如果以不具有sysdba 权限的用户连接到目标数据库,RMAN 会报ORA-01031: insufficient privileges 错误。
 
做以下实验

创建一个用户
SYS@hyyk> create user rman identified by rman;

授予权限
SYS@hyyk> grant connect,resource to rman;

测试连接
[oracle@pc6 ~]$ rman target rman/rman
Recovery Manager: Release 11.2.0.1.0 - Production on Sat Mar 24 21:43:04 2018

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

connected to target database: HYYK (DBID=2117284640)


如果在远程用rman用户连接

[oracle@ogg-80 ~]$ rman target rman/rman@hyyk
Recovery Manager: Release 11.2.0.4.0 - Production on Sat Mar 24 21:45:03 2018

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

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-00554: initialization of internal recovery manager package failed
RMAN-04005: error from target database:
ORA-01031: insufficient privileges

这里在本机授予rman用户sysdba权限
SYS@hyyk> grant sysdba to rman;

Grant succeeded.

在次从远程连连接,显示连接成功
[oracle@ogg-80 ~]$ rman target rman/rman@hyyk
Recovery Manager: Release 11.2.0.4.0 - Production on Sat Mar 24 21:59:32 2018

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

PL/SQL package SYS.DBMS_BACKUP_RESTORE version 11.02.00.01 in TARGET database is not current
PL/SQL package SYS.DBMS_RCVMAN version 11.02.00.01 in TARGET database is not current
connected to target database: HYYK (DBID=2117284640)




  




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

转载于:http://blog.itpub.net/31485142/viewspace-2152201/

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值