当前位置:首页 > 开发 > 数据库 > 正文

How do I debug PL/SQL when connected to a RAC?

发表于: 2011-07-07   作者:ccfangle   来源:转载   浏览次数:
摘要: 用 TOAD 连接 Oracle RAC 数据库,调试存储过程的时候报错: Cannot debug session. In order to debug when connected to a RAC instance you must have SELECT privilege for GV$INSTANCE. 授予用户DBA角色后,继续抱错: Cannot debug session
用 TOAD 连接 Oracle RAC 数据库,调试存储过程的时候报错:
Cannot debug session. In order to debug when connected to a RAC instance you must have SELECT privilege for GV$INSTANCE.
授予用户DBA角色后,继续抱错:
Cannot debug session. In order to debug when connected to a RAC instance you must have entries for the individual RAC instance in your tnsnames.ora file or connect directly to an individual RAC instacne.
修改 tnsnames.ora 文件后,终于可以 debug 了!

asktoad 给出以下的解释:
How do I debug PL/SQL when connected to a RAC?
When using the PL/SQL Debugger with a RAC database, you must either have an additional entry in your TNSNames.ora file for the connected instance, or you must connect directly to an instance of the cluster without letting the server assign an instance.

During debugging, Toad creates two background sessions for handling debugger calls, called the Target and Debug sessions. These two sessions must be created on the same instance as the main Toad session, because Oracle does not support Debugging across RAC instances.

To accomplish this, Toad queries the data dictionary to find the current instance name, then searches the TNSNames.ora file, starting at the beginning, for the first entry which has either the SERVICE_NAME or INSTANCE_NAME equal to the name found in the data dictionary. Toad will then use this secondary TNSNames entry when creating the background debugger sessions.

For example, in a two node RAC environment, a user would have their main RAC entry looking something like this:

RAC =
  (DESCRIPTION =
      (ADDRESS_LIST =
          (ADDRESS = (PROTOCOL = TCP)(HOST = 192.0.0.1)(PORT = 1521))
          (ADDRESS = (PROTOCOL = TCP)(HOST = 192.0.0.2)(PORT = 1521))           
      )
      (LOAD_BALANCE = ON)
      (CONNECT_DATA =
          (SERVICE_NAME = RAC)
          (FAILOVER_MODE =
      (TYPE = SELECT)
      (METHOD = BASIC)
      (RETRIES = 180)
            (DELAY = 5)
          )
      )
  )

In this two node environment, the user would then need to have two additional TNSNames entries, one each for the individual instances in the RAC. In these entries, the can either use the syntax:

RAC1 =
  (DESCRIPTION =
      (ADDRESS_LIST =
          (ADDRESS = (PROTOCOL = TCP)(HOST = 192.0.0.1)(PORT = 1521))
      )
      (CONNECT_DATA =
          (SERVICE_NAME = RAC)       # notice the difference
          (INSTANCE_NAME = RAC1)     # betwen this
      )
  )Or:

RAC2 =
  (DESCRIPTION =
      (ADDRESS_LIST =
          (ADDRESS = (PROTOCOL = TCP)(HOST = 192.0.0.2)(PORT = 1521))
      )
      (CONNECT_DATA =
          (SERVICE_NAME = RAC2)      # and this
      )
  ) 

原文出处:http://asktoad.com/DWiki/doku.php/faq/answers/procedure_editor?DokuWiki=e217ad0ed5bdf990bcc4b95bb9be96b9#how_do_i_debug_plsql_when_connected_to_a_rac

How do I debug PL/SQL when connected to a RAC?

  • 0

    开心

    开心

  • 0

    板砖

    板砖

  • 0

    感动

    感动

  • 0

    有用

    有用

  • 0

    疑问

    疑问

  • 0

    难过

    难过

  • 0

    无聊

    无聊

  • 0

    震惊

    震惊

编辑推荐
网上千篇一律的介绍UiAutomator测试了,近期在用UiAutomator写UI自动自动化测试,在开发scripts过程
本篇是Linq to SQL How do I 的第二篇,难度系数100 ,定位为进阶级。 内容 l 对象之间的关系 对象之
发现几段移动开发的"How Do I?" 视频,包括如何配置Merge Replication、改善数据访问性能和创建网络
:“How do I get started in machine leraning?” 我是一个开发人员。我已经读过机器学习方面的一些
when you debug the code, some unexpected breakpoints come up. And you cannot move on because o
今天我要介绍如何使用 CollectionViewSource 对数据进行分组以及对各个组进行排序 示例中的数据源是
In other tutorials, we saw that log4j needs to be initialized in order to be used, and we saw
I actually like MY JavaScript files to be validated, but I definitely don't want to validate
SQL Server Management Studio is not equipped with the ability to debug the code. However, VS
一直用sql developer 进行存储过程的调试。今天装了PL/SQL,它的具体调试如下: 1), 打开PL/SQL.
版权所有 IT知识库 CopyRight © 2009-2015 IT知识库 IT610.com , All Rights Reserved. 京ICP备09083238号