关闭

RAC DATAGUARD primary listener

164人阅读 评论(0) 收藏 举报
分类:

这一步最为关键,一定要设置成静态监听,因为动态监听在rman连接时监听状态会立马变成locked,静态监听的状态一般是UNKNOWN

Service "PRODS" has 1instance(s).

 Instance "PROD", status UNKNOWN, has 1 handler(s) for this service...

The command completed successfully

然后监听这块有问题的话一定会报下面的的错:

allocated channel: ORA_DISK_1

channel ORA_DISK_1: SID=54 instance=PROD1device type=DISK

RMAN-00571: ===========================================================

RMAN-00569: =============== ERROR MESSAGESTACK FOLLOWS ===============

RMAN-00571:===========================================================

RMAN-03002: failure of Duplicate Db commandat 10/21/2015 16:54:08

RMAN-05501: aborting duplication of targetdatabase

RMAN-03015: error occurred in stored scriptMemory Script

RMAN-03009: failure of backup command onORA_DISK_1 channel at 10/21/2015 16:54:08

ORA-17629: Cannot connect to the remotedatabase server

ORA-17627: ORA-12514: TNS:listener does not currently know ofservice requested in connect descriptor

ORA-17629: Cannot connect to the remote database server

 

RMAN>

下面的lsnrctl status 报错要去查看service name和参数文件是否一致

SNMP                      OFF

Listener Parameter File   /u01/app/oracle/product/11.2/db_1/network/admin/listener.ora

Listener Log File        /u01/app/oracle/diag/tnslsnr/node2/listener/alert/log.xml

Listening Endpoints Summary...

 (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=node2)(PORT=1521)))

 (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))

The listener supports no services

The command completed successfully

[oracle@node2 admin]$

 

主库:

主库的监听是grid在管理,但tns会在oracle下

[oracle@node1 ~]$ cd$ORACLE_HOME/network/admin

[oracle@node1 admin]$ pwd

/u01/oracle/product/11.2.0/network/admin

[oracle@node1 admin]$ ll

total 12

drwxr-xr-x 2 oracle oinstall 4096 Oct 1514:40 samples

-rw-r--r-- 1 oracle oinstall  205 May 11 2011 shrept.lst

-rw-r----- 1 oracle oinstall 835 Oct 21 17:44 tnsnames.ora

[oracle@node1 admin]$

其实就是这么个东西,我们打开看一下:

[oracle@node1 admin]$ cat tnsnames.ora

# tnsnames.ora Network Configuration File:/u01/oracle/product/11.2.0/network/admin/tnsnames.ora

# Generated by Oracle configuration tools.

 

PROD =

 (DESCRIPTION =

   (ADDRESS = (PROTOCOL = TCP)(HOST = node-scan)(PORT = 1521))

   (CONNECT_DATA =

     (SERVER = DEDICATED)

     (SERVICE_NAME = PROD)

    )

  )

 

 

 

PROD2 =

 (DESCRIPTION =

   (ADDRESS_LIST =

     (ADDRESS = (PROTOCOL = TCP)(HOST = node3)(PORT = 1521))

    )

   (CONNECT_DATA =

     (SERVICE_NAME = PRODS)

    )

  )

 

PROD1 =

 (DESCRIPTION =

   (ADDRESS_LIST =

     (ADDRESS = (PROTOCOL = TCP)(HOST = node1)(PORT = 1521))

    )

   (CONNECT_DATA =

     (SERVICE_NAME = PROD)

    )

  )

 

 

PRODS =

 (DESCRIPTION =

   (ADDRESS_LIST =

     (ADDRESS = (PROTOCOL = TCP)(HOST = node2)(PORT = 1521))

    )

   (CONNECT_DATA =

     (SERVICE_NAME = PRODS)

    )

  )

[oracle@node1 admin]$

 

我们再去grid下面看真正的监听

[grid@node1 ~]$ cd$ORACLE_HOME/network/admin

[grid@node1 admin]$ pwd

/u01/11.2.0/ghome/network/admin

[grid@node1 admin]$

[grid@node1 admin]$ ll

total 32

-rw-r--r-- 1 grid oinstall 183 Oct 15 14:17 endpoints_listener.ora

-rw-r--r-- 1 grid oinstall 645 Oct 21 15:48 listener.ora

-rw-r--r-- 1 grid oinstall  184 Oct 15 14:09 listener.ora.bak.node1

drwxr-xr-x 2 grid oinstall 4096 Oct 1513:20 samples

-rw-r--r-- 1 grid oinstall  205 May 11 2011 shrept.lst

-rw-r--r-- 1 grid oinstall  215 Oct 19 10:33 sqlnet15101910AM3344.bak

-rw-r--r-- 1 grid oinstall  215 Oct 15 14:17 sqlnet.ora

-rw-r--r-- 1 grid oinstall 315 Oct 19 10:34 tnsnames.ora

[grid@node1 admin]$

这里面的tnsname.ora没什么东西,估计是连接自己的库用的

我们看一下就知道了

[grid@node1 admin]$ cat tnsnames.ora

# tnsnames.ora.node1 Network ConfigurationFile: /u01/11.2.0/ghome/network/admin/tnsnames.ora.node1

# Generated by Oracle configuration tools.

 

PROD =

 (DESCRIPTION =

   (ADDRESS_LIST =

     (ADDRESS = (PROTOCOL = TCP)(HOST = node2)(PORT = 1521))

    )

   (CONNECT_DATA =

     (SERVICE_NAME = PROD)

    )

  )

 

[grid@node1 admin]$

下面我们看listener.ora

[grid@node1 admin]$ cat listener.ora

# listener.ora Network Configuration File:/u01/11.2.0/ghome/network/admin/listener.ora

# Generated by Oracle configuration tools.

 

ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER_SCAN1= ON

 

SID_LIST_LISTENER =

  (SID_LIST=

   (SID_DESC =

     (GLOBAL_DBNAME = PROD1)

     (ORACLE_HOME = /u01/11.2.0/ghome)

     (SID_NAME = PROD)

    )

  )

 

LISTENER =

 (DESCRIPTION =

   (ADDRESS = (PROTOCOL = IPC)(KEY = LISTENER))

  )

 

ADR_BASE_LISTENER = /u01/11.2.0/gbase

 

ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER= ON

 

LISTENER_SCAN1 =

 (DESCRIPTION =

   (ADDRESS = (PROTOCOL = IPC)(KEY = LISTENER_SCAN1))

  )

 

ADR_BASE_LISTENER_SCAN1 = /u01/11.2.0/gbase

 

[grid@node1 admin]$

注:这个监听是安装建库时oracle自己建立的,但我后来有手动添加了静态监听,方法如下:

当然我们可以先netca

[grid@node1 admin]$ netmgr



点击你的监听配置,然后选择database services

这里Global Database Name 即是你的实例名


SID就是你的库名喽


当然上面的监听你还要注意这么一句

ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER= ON

[grid@node1 admin]$ catendpoints_listener.ora

LISTENER_NODE1=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=node1vip)(PORT=1521))(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.56.10)(PORT=1521)(IP=FIRST))))                   # line added by Agent

[grid@node1 admin]$

这也是grid监听重要的一部分




0
0

查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
    个人资料
    • 访问:129569次
    • 积分:4004
    • 等级:
    • 排名:第7809名
    • 原创:284篇
    • 转载:0篇
    • 译文:0篇
    • 评论:2条
    文章分类
    最新评论