加入收藏 | 设为首页 | 会员中心 | 我要投稿 东莞站长网 (https://www.0769zz.com/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 站长百科 > 正文

【Oracle】RMAN duplicate复制库

发布时间:2020-12-27 08:23:02 所属栏目:站长百科 来源:网络整理
导读:基础环境: 172.17.4.60 操作系统:Linux 6.4 数据库:Oracle11gR2 (源数据库) 172.17.4.61 操作系统:Linux 6.4 数据库:Oracle11gR2 (测试库) 目的:从源数据库以RMAN的物理恢复的方式,恢复至测试库中。 如何验证,在源数据库,插入几条数据如下: [email?protec

测试库的监听启动:

[[email?protected] admin]$ lsnrctl start

LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 29-DEC-2018 16:03:01

Copyright (c) 1991,2013,Oracle.  All rights reserved.

Starting /u01/app/product/11.2.0/db_1/bin/tnslsnr: please wait...

TNSLSNR for Linux: Version 11.2.0.4.0 - Production
System parameter file is /u01/app/product/11.2.0/db_1/network/admin/listener.ora
Log messages written to /u01/app/diag/tnslsnr/db/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=db2)(PORT=1521)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=db2)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 11.2.0.4.0 - Production
Start Date                29-DEC-2018 16:03:01
Uptime                    0 days 0 hr. 0 min. 10 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/app/product/11.2.0/db_1/network/admin/listener.ora
Listener Log File         /u01/app/diag/tnslsnr/db/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=db2)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
Services Summary...
Service "oradb.zsd.com" has 1 instance(s).
  Instance "oradb",status UNKNOWN,has 1 handler(s) for this service...
The command completed successfully

源数据端:172.17.4.60

[[email?protected] ~]$ cat /u01/app/product/11.2.0/db_1/network/admin/listener.ora
# listener.ora Network Configuration File: /u01/app/product/11.2.0/db_1/network/admin/listener.ora
# Generated by Oracle configuration tools.

LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = db1)(PORT = 1521))
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
    )
  )
SID_LIST_LISTENER =  
(SID_LIST =  
  (SID_DESC =  
  (GLOBAL_DBNAME = oradb.zsd.com)
  (SID_NAME = oradb)
  )
)
ADR_BASE_LISTENER = /u01/app

源数据端的监听启动:

[[email?protected] admin]$ lsnrctl start

LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 29-DEC-2018 16:06:02

Copyright (c) 1991,Oracle.  All rights reserved.

Starting /u01/app/product/11.2.0/db_1/bin/tnslsnr: please wait...

TNSLSNR for Linux: Version 11.2.0.4.0 - Production
System parameter file is /u01/app/product/11.2.0/db_1/network/admin/listener.ora
Log messages written to /u01/app/diag/tnslsnr/db/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=db1)(PORT=1521)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=db1)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 11.2.0.4.0 - Production
Start Date                29-DEC-2018 16:06:03
Uptime                    0 days 0 hr. 0 min. 11 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/app/product/11.2.0/db_1/network/admin/listener.ora
Listener Log File         /u01/app/diag/tnslsnr/db/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=db1)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
Services Summary...
Service "oradb.zsd.com" has 1 instance(s).
  Instance "oradb",has 1 handler(s) for this service...
The command completed successfully

两端配置tns文件(60和61配置的相同)

vi $ORACLE_HOME/network/admin/tnsnames.ora

ZSDDB =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = db1)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = oradb.zsd.com)
    )
  )

aux =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = db2)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = oradb.zsd.com)
    )
  )

源数据端(172.17.4.60)连接测试库

[[email?protected] ~]$ tnsping aux

TNS Ping Utility for Linux: Version 11.2.0.4.0 - Production on 29-DEC-2018 16:16:52

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

Used parameter files:


Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = db2)(PORT = 1521))) (CONNECT_DATA = 

(SERVICE_NAME = oradb.zsd.com)))
OK (0 msec)
[[email?protected] ~]$ sqlplus sys/[email?protected] as sysdba

SQL*Plus: Release 11.2.0.4.0 Production on Sat Dec 29 16:17:06 2018

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

Connected to an idle instance.

[email?protected]>

(编辑:东莞站长网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!