Oracle数据库数据恢复、性能优化

找回密码
注册
搜索
热搜: 活动 交友 discuz
发新帖

109

积分

0

好友

9

主题
1#
发表于 2012-4-27 10:35:28 | 查看: 4773| 回复: 6
数据库服务器上有两块网卡,IP分别为
192.168.11.23
192.168.12.23
因为EM配置的原因,需要对同一个实例配置 两个监听,
现listener.ora文件配置如下
SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (SID_NAME = PLSExtProc)
      (ORACLE_HOME = /u0/oracle/product/10g)
      (PROGRAM = extproc)
    )
  )

list1 =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.11.23)(PORT = 1521))
    )
  )

list2 =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.12.23)(PORT = 1522))
    )
  )
配置后启动监听
[oracle@OCPDemo admin]$ lsnrctl start list1

LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 26-APR-2012 19:29:28

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

Starting /u0/oracle/product/10g/bin/tnslsnr: please wait...

TNSLSNR for Linux: Version 10.2.0.1.0 - Production
System parameter file is /u0/oracle/product/10g/network/admin/listener.ora
Log messages written to /u0/oracle/product/10g/network/log/list1.log
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.11.23)(PORT=1521)))

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.11.23)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias                     list1
Version                   TNSLSNR for Linux: Version 10.2.0.1.0 - Production
Start Date                26-APR-2012 19:29:29
Uptime                    0 days 0 hr. 0 min. 0 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u0/oracle/product/10g/network/admin/listener.ora
Listener Log File         /u0/oracle/product/10g/network/log/list1.log
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.11.23)(PORT=1521)))
The listener supports no services
The command completed successfully
[oracle@OCPDemo admin]$ lsnrctl start list2

LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 26-APR-2012 19:29:36

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

Starting /u0/oracle/product/10g/bin/tnslsnr: please wait...

TNSLSNR for Linux: Version 10.2.0.1.0 - Production
System parameter file is /u0/oracle/product/10g/network/admin/listener.ora
Log messages written to /u0/oracle/product/10g/network/log/list2.log
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.12.23)(PORT=1522)))

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.12.23)(PORT=1522)))
STATUS of the LISTENER
------------------------
Alias                     list2
Version                   TNSLSNR for Linux: Version 10.2.0.1.0 - Production
Start Date                26-APR-2012 19:29:36
Uptime                    0 days 0 hr. 0 min. 0 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u0/oracle/product/10g/network/admin/listener.ora
Listener Log File         /u0/oracle/product/10g/network/log/list2.log
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.12.23)(PORT=1522)))
The listener supports no services
The command completed successfully
启动后查看监听状态如下
[oracle@OCPDemo admin]$ lsnrctl status list1

LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 26-APR-2012 19:30:12

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

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.11.23)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias                     list1
Version                   TNSLSNR for Linux: Version 10.2.0.1.0 - Production
Start Date                26-APR-2012 19:29:29
Uptime                    0 days 0 hr. 0 min. 43 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u0/oracle/product/10g/network/admin/listener.ora
Listener Log File         /u0/oracle/product/10g/network/log/list1.log
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.11.23)(PORT=1521)))
Services Summary...
Service "OCPDemo" has 1 instance(s).
  Instance "OCPDemo", status READY, has 1 handler(s) for this service...
Service "OCPDemoXDB" has 1 instance(s).
  Instance "OCPDemo", status READY, has 1 handler(s) for this service...
Service "OCPDemo_XPT" has 1 instance(s).
  Instance "OCPDemo", status READY, has 1 handler(s) for this service...
The command completed successfully
[oracle@OCPDemo admin]$ lsnrctl status list2

LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 26-APR-2012 19:30:15

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

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.12.23)(PORT=1522)))
STATUS of the LISTENER
------------------------
Alias                     list2
Version                   TNSLSNR for Linux: Version 10.2.0.1.0 - Production
Start Date                26-APR-2012 19:29:36
Uptime                    0 days 0 hr. 0 min. 38 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u0/oracle/product/10g/network/admin/listener.ora
Listener Log File         /u0/oracle/product/10g/network/log/list2.log
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.12.23)(PORT=1522)))
The listener supports no services
The command completed successfully
请问红色部分是什么意思?
这么配置后,监听运行正常么?
2#
发表于 2012-4-27 14:55:31
  1. “The listener supports no services”
复制代码
这个话的意思是,监听没有检测到相应的服务。

自己做了个实验,发现需要写一个给listner写一个sid_list。

过程如下:

说明下,这是在一个rac环境上(RHEL 5.4 64bit, Oracle 10.2.0.4 )的一节点做的实验。

ip地址如下, 要做的是把100.100.100.1加入监听里:
  1. [oracle@rac1 ~]$ cat /etc/hosts
  2. # Do not remove the following line, or various programs
  3. # that require network functionality will fail.
  4. 127.0.0.1       localhost.localdomain localhost
  5. ::1             localhost6.localdomain6 localhost6

  6. 192.168.0.31   rac1
  7. 100.100.100.1  rac1-priv
  8. 192.168.0.231  rac1-vip
复制代码



1. 首先,查看现有监听情况:
  1. [oracle@rac1 ~]$ lsnrctl status LISTENER_RAC1

  2. LSNRCTL for Linux: Version 10.2.0.4.0 - Production on 27-APR-2012 14:16:56

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

  4. Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=rac1-vip)(PORT=1521)(IP=FIRST)))
  5. STATUS of the LISTENER
  6. ------------------------
  7. Alias                     LISTENER_RAC1
  8. Version                   TNSLSNR for Linux: Version 10.2.0.4.0 - Production
  9. Start Date                27-APR-2012 14:16:34
  10. Uptime                    0 days 0 hr. 0 min. 21 sec
  11. Trace Level               off
  12. Security                  ON: Local OS Authentication
  13. SNMP                      OFF
  14. Listener Parameter File   /opt/oracle/product/10.2.0/db1/network/admin/listener.ora
  15. Listener Log File         /opt/oracle/product/10.2.0/db1/network/log/listener_rac1.log
  16. Listening Endpoints Summary...
  17.   (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.0.231)(PORT=1521)))
  18.   (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.0.31)(PORT=1521)))
  19. Services Summary...
  20. Service "PLSExtProc" has 1 instance(s).
  21.   Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
  22. Service "racdb" has 1 instance(s).
  23.   Instance "racdb1", status READY, has 2 handler(s) for this service...
  24. Service "racdbXDB" has 1 instance(s).
  25.   Instance "racdb1", status READY, has 1 handler(s) for this service...
  26. Service "racdb_XPT" has 1 instance(s).
  27.   Instance "racdb1", status READY, has 2 handler(s) for this service...
  28. The command completed successfully
  29. [oracle@rac1 ~]$ netstat -antpl | grep :15
  30. (Not all processes could be identified, non-owned process info
  31. will not be shown, you would have to be root to see it all.)
  32. tcp        0      0 192.168.0.31:1521           0.0.0.0:*                   LISTEN      9298/tnslsnr        
  33. tcp        0      0 192.168.0.231:1521          0.0.0.0:*                   LISTEN      9298/tnslsnr        
  34. tcp        0      0 192.168.0.231:63769         192.168.0.231:1521          ESTABLISHED 5231/ora_pmon_racdb
  35. tcp        0      0 192.168.0.231:63766         192.168.0.231:1521          TIME_WAIT   -                  
  36. tcp        0      0 192.168.0.231:63761         192.168.0.231:1521          TIME_WAIT   -                  
  37. tcp        0      0 192.168.0.231:1521          192.168.0.231:63769         ESTABLISHED 9298/tnslsnr        
  38. tcp        0      0 192.168.0.231:1521          192.168.0.231:63771         TIME_WAIT   -                  
  39. tcp        0      0 192.168.0.231:1521          192.168.0.231:11566         TIME_WAIT   -                  
  40. tcp        0      0 192.168.0.31:1521           192.168.0.31:50224          ESTABLISHED 9298/tnslsnr        
  41. tcp        0      0 192.168.0.31:50224          192.168.0.31:1521           ESTABLISHED 5231/ora_pmon_racdb
  42. tcp        0      0 192.168.0.31:1521           192.168.0.31:24380          TIME_WAIT   -                  
  43. tcp        0      0 192.168.0.31:1521           192.168.0.31:24378          TIME_WAIT   -                  
复制代码

现有监听会监听192.168.0.31和192.168.0.231的1521端口。





2. 此时修改listener.ora文件,加入监听名为“LISTENER_RAC11”
加入如下内容:
  1. LISTENER_RAC11 =
  2.   (DESCRIPTION_LIST =
  3.     (DESCRIPTION =
  4.       (ADDRESS = (PROTOCOL = TCP)(HOST = 100.100.100.1)(PORT = 1522)(IP = FIRST))
  5.     )
  6.   )
复制代码
3. 启动该监听
  1. [oracle@rac1 ~]$ lsnrctl start LISTENER_RAC11

  2. LSNRCTL for Linux: Version 10.2.0.4.0 - Production on 27-APR-2012 14:17:26

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

  4. Starting /opt/oracle/product/10.2.0/db1/bin/tnslsnr: please wait...

  5. TNSLSNR for Linux: Version 10.2.0.4.0 - Production
  6. System parameter file is /opt/oracle/product/10.2.0/db1/network/admin/listener.ora
  7. Log messages written to /opt/oracle/product/10.2.0/db1/network/log/listener_rac11.log
  8. Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=100.100.100.1)(PORT=1522)))

  9. Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=100.100.100.1)(PORT=1522)(IP=FIRST)))
  10. STATUS of the LISTENER
  11. ------------------------
  12. Alias                     LISTENER_RAC11
  13. Version                   TNSLSNR for Linux: Version 10.2.0.4.0 - Production
  14. Start Date                27-APR-2012 14:17:26
  15. Uptime                    0 days 0 hr. 0 min. 0 sec
  16. Trace Level               off
  17. Security                  ON: Local OS Authentication
  18. SNMP                      OFF
  19. Listener Parameter File   /opt/oracle/product/10.2.0/db1/network/admin/listener.ora
  20. Listener Log File         /opt/oracle/product/10.2.0/db1/network/log/listener_rac11.log
  21. Listening Endpoints Summary...
  22.   (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=100.100.100.1)(PORT=1522)))
  23. The listener supports no services
  24. The command completed successfully
  25. [oracle@rac1 ~]$ sqlplus  / as sysdba

  26. SQL*Plus: Release 10.2.0.4.0 - Production on Fri Apr 27 14:17:31 2012

  27. Copyright (c) 1982, 2007, Oracle.  All Rights Reserved.


  28. Connected to:
  29. Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
  30. With the Partitioning, Real Application Clusters, OLAP, Data Mining
  31. and Real Application Testing options

  32. SYS#10g@racdb1>alter system register;

  33. System altered.

  34. SYS#10g@racdb1>exit
  35. Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
  36. With the Partitioning, Real Application Clusters, OLAP, Data Mining
  37. and Real Application Testing options
  38. [oracle@rac1 ~]$
  39. [oracle@rac1 ~]$
  40. [oracle@rac1 ~]$

  41. [oracle@rac1 ~]$ lsnrctl status LISTENER_RAC11

  42. LSNRCTL for Linux: Version 10.2.0.4.0 - Production on 27-APR-2012 14:17:50

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

  44. Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=100.100.100.1)(PORT=1522)(IP=FIRST)))
  45. STATUS of the LISTENER
  46. ------------------------
  47. Alias                     LISTENER_RAC11
  48. Version                   TNSLSNR for Linux: Version 10.2.0.4.0 - Production
  49. Start Date                27-APR-2012 14:17:26
  50. Uptime                    0 days 0 hr. 0 min. 24 sec
  51. Trace Level               off
  52. Security                  ON: Local OS Authentication
  53. SNMP                      OFF
  54. Listener Parameter File   /opt/oracle/product/10.2.0/db1/network/admin/listener.ora
  55. Listener Log File         /opt/oracle/product/10.2.0/db1/network/log/listener_rac11.log
  56. Listening Endpoints Summary...
  57.   (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=100.100.100.1)(PORT=1522)))
  58. The listener supports no services
  59. The command completed successfully
复制代码
出现了和你一样的情况。

[ 本帖最后由 miloluo 于 2012-4-27 14:57 编辑 ]

回复 只看该作者 道具 举报

3#
发表于 2012-4-27 14:57:42
4. listener.ora的文件里加入sid为监听加入sid list
加入如下代码到listener.ora里
  1. SID_LIST_LISTENER_[b]RAC11[/b] =
  2.   (SID_LIST =
  3.     (SID_DESC =
  4.       (SID_NAME = [b]racdb1[/b])
  5.       (ORACLE_HOME = /opt/oracle/product/10.2.0/db1)
  6.       (PROGRAM = extproc)
  7.     )
  8.   )
复制代码
5. 重新启动下监听:
  1. [oracle@rac1 ~]$ lsnrctl start LISTENER_RAC11

  2. LSNRCTL for Linux: Version 10.2.0.4.0 - Production on 27-APR-2012 14:21:21

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

  4. Starting /opt/oracle/product/10.2.0/db1/bin/tnslsnr: please wait...

  5. TNSLSNR for Linux: Version 10.2.0.4.0 - Production
  6. System parameter file is /opt/oracle/product/10.2.0/db1/network/admin/listener.ora
  7. Log messages written to /opt/oracle/product/10.2.0/db1/network/log/listener_rac11.log
  8. Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=100.100.100.1)(PORT=1522)))

  9. Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=100.100.100.1)(PORT=1522)(IP=FIRST)))
  10. STATUS of the LISTENER
  11. ------------------------
  12. Alias                     LISTENER_RAC11
  13. Version                   TNSLSNR for Linux: Version 10.2.0.4.0 - Production
  14. Start Date                27-APR-2012 14:21:21
  15. Uptime                    0 days 0 hr. 0 min. 0 sec
  16. Trace Level               off
  17. Security                  ON: Local OS Authentication
  18. SNMP                      OFF
  19. Listener Parameter File   /opt/oracle/product/10.2.0/db1/network/admin/listener.ora
  20. Listener Log File         /opt/oracle/product/10.2.0/db1/network/log/listener_rac11.log
  21. Listening Endpoints Summary...
  22.   (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=100.100.100.1)(PORT=1522)))
  23. Services Summary...
  24. Service "racdb1" has 1 instance(s).
  25.   Instance "racdb1", status UNKNOWN, has 1 handler(s) for this service...
  26. The command completed successfully
复制代码
6. 发现100.100.100.1:1522口已经监听。
  1. [oracle@rac1 ~]$ netstat -antpl | grep 100.100.100.1
  2. (Not all processes could be identified, non-owned process info
  3. will not be shown, you would have to be root to see it all.)
  4. tcp        0      0 100.100.100.1:49895         0.0.0.0:*                   LISTEN      -                  
  5. tcp        0      0 100.100.100.1:49896         0.0.0.0:*                   LISTEN      -                  
  6. tcp        0      0 100.100.100.1:49897         0.0.0.0:*                   LISTEN      3992/evmd.bin      
  7. tcp        0      0 100.100.100.1:49898         0.0.0.0:*                   LISTEN      3992/evmd.bin      
  8. [b]tcp        0      0 100.100.100.1:1522          0.0.0.0:*                   LISTEN      11212/tnslsnr[/b]
复制代码
我做了这个实验,发现这么做事行的。 有什么不足,大家接着补充。
谢谢。

回复 只看该作者 道具 举报

4#
发表于 2012-4-27 15:00:44
@Maclean:
建议下,我原来编辑的格式会在预览后,看不到code tag以为是不起作用,后面发出来了才看到。
并且所有文字的格式会都连成一条。字大于1000还有限制,以后回的时候,还得估算下字个数,看需要分几段。
浏览器使用的是firefox 12。
谢谢。

回复 只看该作者 道具 举报

5#
发表于 2012-4-27 16:48:35
在tnsnames.ora里增加

LISTENERS =
  (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.11.23)(PORT = 1521))
    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.11.24)(PORT = 1522))

设置实例的local_listener参数为LISTENERS

回复 只看该作者 道具 举报

6#
发表于 2012-4-27 23:00:59

回复 4# 的帖子

这是 discuz 6的bug ,尽可能在文本编辑器 中 编辑好内容再贴出来吧

回复 只看该作者 道具 举报

7#
发表于 2012-4-28 07:43:11
谢谢,我昨天自己捣腾,后来也发现了这个问题,最后得出的方法与maclean的方法是一样的。呵呵!
方法一:
SID_LIST_LIST1 =
  (SID_LIST =
    (SID_DESC =
      (SID_NAME = PLSExtProc)
      (ORACLE_HOME = /u0/oracle/product/10g)
      (PROGRAM = extproc)
    )
    (SID_DESC =
        (GLOBAL_DBNAME = OCPDemo)
        (ORACLE_HOME = /u0/oracle/product/10g)
        (SID_NAME = OCPDemo)
    )
  )
SID_LIST_LIST2 =
  (SID_LIST =
    (SID_DESC =
      (SID_NAME = PLSExtProc)
      (ORACLE_HOME = /u0/oracle/product/10g)
      (PROGRAM = extproc)
    )
    (SID_DESC =
        (GLOBAL_DBNAME = OCPDemo)
        (ORACLE_HOME = /u0/oracle/product/10g)
        (SID_NAME = OCPDemo)
    )
  )

LIST1 =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.11.23)(PORT = 1521))
      (ADDRESS = (protocol = IPC)(key  = extproc))
    )
  )
LIST2 =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.12.23)(PORT = 1522))
      (ADDRESS = (protocol = IPC)(key  = extproc_1))
    )
  )
方法二:
SID_LIST_LIST1 =
  (SID_LIST =
    (SID_DESC =
      (SID_NAME = PLSExtProc)
      (ORACLE_HOME = /u0/oracle/product/10g)
      (PROGRAM = extproc)
    )
    (SID_DESC =
        (GLOBAL_DBNAME = OCPDemo)
        (ORACLE_HOME = /u0/oracle/product/10g)
        (SID_NAME = OCPDemo)
    )
  )


LIST1 =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.11.23)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.12.23)(PORT = 1522))
      (ADDRESS = (protocol = IPC)(key  = extproc))
    )
  )

方法一麻烦一点,但是配置完以后,192.168.11.23和192.168.12.23两个IP可以独立监听,相互不影响,方法二简单一点,但是配置完以后,两个IP上的监听只能同时启动或停止。

回复 只看该作者 道具 举报

您需要登录后才可以回帖 登录 | 注册

QQ|手机版|Archiver|Oracle数据库数据恢复、性能优化

GMT+8, 2024-11-15 12:29 , Processed in 0.051082 second(s), 21 queries .

Powered by Discuz! X2.5

© 2001-2012 Comsenz Inc.

回顶部
TEL/電話+86 13764045638
Email service@parnassusdata.com
QQ 47079569