由于生产的服务器空间不够了,所以考虑把生产服务器的数据库备份一份到自己电脑上
用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
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
恢复管理器: 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'; --备份整个数据库
.....
祝好~