ITPub博客

首页 > 数据库 > Oracle > 异地rman备份到本机,rman 怎么知道自己连接的是哪个库,远程rman tnsnXX.ora文件配置

异地rman备份到本机,rman 怎么知道自己连接的是哪个库,远程rman tnsnXX.ora文件配置

原创 Oracle 作者:maohaiqing0304 时间:2013-04-29 17:56:08 0 删除 编辑

由于生产的服务器空间不够了,所以考虑把生产服务器的数据库备份一份到自己电脑上

用rman target user/password@链接名

链接名在 $ORACLE_HOME\NETWORK\ADMIN\tnsnames.ora 文件里编辑

KFDB49 =   #要唯一,免得链接别的服务器
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.49)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = kfdb)
    )
  )

 

-- rman 怎么知道自己连接的是哪个数据库

1、先tnsping 看下tnsnames.ora 文件是否生效

E:\oracle\product\10.2.0\db_1\BIN>tnsping kfdb49

TNS Ping Utility for 32-bit Windows: Version 10.2.0.1.0 - Production on 01-2月 -2013 09:44:12

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

已使用的参数文件:
E:\oracle\product\10.2.0\db_1\network\admin\sqlnet.ora
已使用 TNSNAMES 适配器来解析别名
Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.
0.49
)(PORT = 1521))) (CONNECT_DATA = (SERVICE_NAME = kfdb)))
OK (0 毫秒)

 2、连接远程的49服务器  看下DBID

E:\oracle\product\10.2.0\db_1\BIN>sqlplus sinokfdb/sinokfdb@kfdb49

SQL*Plus: Release 11.2.0.1.0 - Production on 星期四 1月 31 10:33:08 2013

Copyright (c) 1982, 2005, Oracle.  All rights reserved.
连接到:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL>  select dbid from v$database;

      DBID
----------
3736824605

3、rman链接49服务器看DBID是否一致(或者看表用户/数据...能识别即可)

E:\oracle\product\10.2.0\db_1\BIN>rman.exe target sys/sysadmin@kfdb49

恢复管理器: Release 10.2.0.1.0 - Production on 星期五 2月 1 09:43:31 2013

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

连接到目标数据库: KFDB (DBID=3736824605)

RMAN> 

RMAN> backup database format 'E:\rmanbak\fullfull_%d_%T_%s'; --备份整个数据库

.....

祝好~

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

请登录后发表评论 登录
全部评论
.

注册时间:2013-03-13

  • 博文量
    117
  • 访问量
    2626246