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

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

0

积分

1

好友

2

主题
1#
发表于 2013-12-19 14:26:07 | 查看: 4198| 回复: 6
本帖最后由 wrx0815 于 2013-12-19 14:26 编辑



关于srvctl命令,大多数人和我应够都只停留在命令的使用上,但在RAC环境下,它和直接对实例的操作有什么具体的区别呢?特想maclean请教一下。也是最近发现了一个现象。
我的测试环境是10.2.0.1,RAC和单点都是这样。

当我使用 srvctl 命令启动RAC端的监听时,在单点上通过 tnsnames 中的连接字符串却无法正常连接到数据库。我使用的是:
RACDB =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = rac1-vip)(PORT = 1521))
    (ADDRESS = (PROTOCOL = TCP)(HOST = rac2-vip)(PORT = 1521))
    (FAILOVER=YES)
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = RACDB)
    )
  )

报错提示 no listener,但我使用lsnrctl命令启动每个节点监听后,单点通过tnsnames却可以正常连接数据库,每次连接都成功。

我自己没想明白为什么,srvctl 命令执行的时候,到底做了哪些工作?
2#
发表于 2013-12-19 15:23:11
你可以理解为 srvctl  做了组合拳, 具体如何组合的 你可以参考crsd.log

回复 只看该作者 道具 举报

3#
发表于 2013-12-19 15:39:21
Liu Maclean(刘相兵 发表于 2013-12-19 15:23
你可以理解为 srvctl  做了组合拳, 具体如何组合的 你可以参考crsd.log

一下是抓到的 srvctl 组合拳内容:
/u01/crs1020/jdk/jre/bin/java -classpath /u01/crs1020/jlib/netcfg.jar:/u01/crs1020/jdk/jre/lib/rt.jar:/u01/crs1020/jdk/jre/lib/i18n.jar:/u01/crs1020/jlib/srvm.jar:/u01/crs1020/jlib/srvmhas.jar:/u01/crs1020/jlib/srvmasm.jar:/u01/crs1020/srvm/jlib/srvctl.jar -DTRACING.ENABLED=true -DTRACING.LEVEL=2 oracle.ops.opsctl.OPSCTLDriver start listener -n rac2
[main] [1:42:55:159] [OPSCTLDriver.setInternalDebugLevel:165]  tracing is true at level 2 to file null
[main] [1:42:55:188] [OPSCTLDriver.<init>:95]  Security manager is set
[main] [1:42:55:205] [CommandLineParser.parse:173]  parsing cmdline args
[main] [1:42:55:206] [CommandLineParser.parse2WordCommandOptions:940]  parsing 2-word cmdline
[main] [1:42:55:228] [GetActiveNodes.create:213]  Going into GetActiveNodes constructor...
[main] [1:42:55:235] [HASContext.getInstance:190]  Module init : 16
[main] [1:42:55:235] [HASContext.getInstance:214]  Local Module init : 19
[main] [1:42:55:257] [Library.getInstance:95]  Created instance of Library.
[main] [1:42:55:258] [Library.load:195]  Loading libsrvmhas10.so...
[main] [1:42:55:261] [Library.load:201]  oracleHome null
[main] [1:42:55:262] [Library.load:236]  Loading  library srvmhas10 from path=
/u01/crs1020/jdk/jre/lib/i386/client:/u01/crs1020/jdk/jre/lib/i386:/u01/crs1020/jdk/jre/../lib/i386:/u01/crs1020/lib32:/u01/crs1020/srvm/lib32:/u01/crs1020/lib:/u01/crs1020/srvm/lib:
[main] [1:42:55:289] [Library.load:244]  Loaded library srvmhas10 from path=
/u01/crs1020/jdk/jre/lib/i386/client:/u01/crs1020/jdk/jre/lib/i386:/u01/crs1020/jdk/jre/../lib/i386:/u01/crs1020/lib32:/u01/crs1020/srvm/lib32:/u01/crs1020/lib:/u01/crs1020/srvm/lib:
[main] [1:42:55:292] [has.HASContextNative.Native]  prsr_trace: no lsf ctx, line=Native: allocHASContext

[main] [1:42:55:293] [has.HASContextNative.Native]  
allocHASContext: Came in
[main] [1:42:55:293] [has.HASContextNative.Native]  

回复 只看该作者 道具 举报

4#
发表于 2013-12-19 15:39:39
allocHASContext: META context [1]
[main] [1:42:55:295] [has.HASContextNative.Native]  
allocHASContext: LSF context [1]
[main] [1:42:55:296] [has.HASContextNative.Native]  prsr_trace: Native: prsr_initCLSS

[main] [1:42:55:308] [has.HASContextNative.Native]  
allocHASContext: CLSS context [1]
[main] [1:42:55:311] [has.HASContextNative.Native]  
allocHASContext: retval [1]
[main] [1:42:55:317] [HASContext.getInstance:249]  HAS Context Allocated: 1 to oracle.ops.mgmt.has.ClusterUtil@8a0d5d
[main] [1:42:55:318] [ClusterUtil.<init>:55]  ClusterUtil Instance created
[main] [1:42:55:319] [ClusterUtil.<init>:58]  ClusterUtil m_bSKGXN=true
[main] [1:42:55:320] [has.ClusterUtilNative.Native]  prsr_trace: Native: getLocalNodeName

[main] [1:42:55:321] [has.ClusterUtilNative.Native]  prsr_trace: Native: getLocalNodeName:nodenumber: 1

[main] [1:42:55:322] [has.ClusterUtilNative.Native]  prsr_trace: Native: getLocalNodeName:nodename: rac1

[main] [1:42:55:323] [has.ClusterUtilNative.Native]  prsr_trace: Native: getNodeNames

[main] [1:42:55:325] [has.ClusterUtilNative.Native]  prsr_trace: Native: getNodeNames:number of nodes: 2

[main] [1:42:55:325] [has.ClusterUtilNative.Native]  prsr_trace: Native: getNodeNames:node 1 is alive k = 0

[main] [1:42:55:327] [has.ClusterUtilNative.Native]  prsr_trace: Native: getNodeNames:1 nodename: rac1

[main] [1:42:55:327] [has.ClusterUtilNative.Native]  prsr_trace: Native: getNodeNames:node 2 is alive k = 1

[main] [1:42:55:329] [has.ClusterUtilNative.Native]  prsr_trace: Native: getNodeNames:2 nodename: rac2

回复 只看该作者 道具 举报

5#
发表于 2013-12-19 15:39:56
[main] [1:42:55:329] [GetActiveNodes.<init>:185]  Inside GetActiveNodes :rac1
[main] [1:42:55:333] [GetActiveNodes.<init>:197]  Started clusterware daemon thread
[main] [1:42:55:334] [GetActiveNodes.create:215]  Out of GetActiveNodes constructor.
[main] [1:42:55:334] [CommandLineParser.isValidNodeName:1570]  srvctl: nodes in cluster:
[main] [1:42:55:335] [CommandLineParser.isValidNodeName:1572]  srvctl: node 0: rac1
[main] [1:42:55:335] [CommandLineParser.isValidNodeName:1572]  srvctl: node 1: rac2
[main] [1:42:55:336] [OPSCTLDriver.execute:174]  executing srvctl command
[main] [1:42:55:336] [OPSCTLDriver.execute:199]  executing 2-word command verb=3 noun=107
[main] [1:42:55:362] [NodeApps.<init>:115]  in constructor with rac2
[main] [1:42:55:362] [Listener.<init>:193]  Creating listener with node name as rac2 and resource name as ora.rac2.LISTENER_RAC2.lsnr and listener name as LISTENER_RAC2
[main] [1:42:55:363] [Listener.isRunning:236]  Trying to find the status of ora.rac2.LISTENER_RAC2.lsnr on node rac2
[main] [1:42:55:365] [Operation.<init>:63]  Setting to be a synchronized operation
[main] [1:42:55:368] [HASContext.getInstance:190]  Module init : 6
[main] [1:42:55:369] [HASContext.getInstance:214]  Local Module init : 4
[main] [1:42:55:369] [has.HASContextNative.Native]  prsr_trace: Native: allocHASContext

[main] [1:42:55:370] [has.HASContextNative.Native]  
allocHASContext: Came in
[main] [1:42:55:370] [has.HASContextNative.Native]  prsr_trace: Native: prsr_initSCLS

[main] [1:42:55:371] [has.HASContextNative.Native]  
allocHASContext: SCLS context [1]
[main] [1:42:55:371] [has.HASContextNative.Native]  
allocHASContext: retval [1]
[main] [1:42:55:372] [HASContext.getInstance:249]  HAS Context Allocated: 2 to oracle.ops.mgmt.has.Util@1ccb029
[main] [1:42:55:373] [Util.<init>:86]  Util Instance created.
[main] [1:42:55:376] [has.UtilNative.Native]  prsr_trace: Native: getCRSHome

[main] [1:42:55:377] [has.UtilNative.Native]  prsr_trace: Native: getCRSHome crs_home=/u01/crs1020(**)

回复 只看该作者 道具 举报

6#
发表于 2013-12-19 15:40:13
[main] [1:42:55:377] [HASContext.getCRSHome:450]  /u01/crs1020
[main] [1:42:55:378] [Util.getCRSHome:428]  getCRSHome: ret=/u01/crs1020
[main] [1:42:55:378] [HAOperation.setCRSHome:148]  CRS_HOME: /u01/crs1020
[main] [1:42:55:379] [HAOperation.checkCommandVerb:211]  Checking an existence of CRS command
[GetActiveNodesThread] [1:42:55:380] [Semaphore.acquire:109]  SyncBufferFull:Acquire called by thread GetActiveNodesThread m_count=0
[main] [1:42:55:379] [NodeApps.nodeRunning:369]  Finding the status of ora.rac2.LISTENER_RAC2.lsnr on rac2
[main] [1:42:55:382] [LocalCommand.execute:54]  LocalCommand.execute: Calling run method
[main] [1:42:55:383] [HAStatusOperation.run:124]  Executing the HA operation /u01/crs1020/bin/crs_statora.rac2.LISTENER_RAC2.lsnr
[main] [1:42:55:389] [HAOperationImpl.runCommand:1254]  CRS cmd is: /u01/crs1020/bin/crs_stat -u ora.rac2.LISTENER_RAC2.lsnr
[main] [1:42:55:392] [RuntimeExec.runCommand:74]  Calling Runtime.exec() with the command
[main] [1:42:55:393] [RuntimeExec.runCommand:76]  /u01/crs1020/bin/crs_stat
[main] [1:42:55:393] [RuntimeExec.runCommand:76]  -u
[main] [1:42:55:394] [RuntimeExec.runCommand:76]  ora.rac2.LISTENER_RAC2.lsnr
[Thread-1] [1:42:55:420] [StreamReader.run:61]  In StreamReader.run
[main] [1:42:55:421] [RuntimeExec.runCommand:131]  runCommand: Waiting for the process
[main] [1:42:55:422] [RuntimeExec.runCommand:133]  runCommand: process returns 0
[Thread-0] [1:42:55:422] [StreamReader.run:61]  In StreamReader.run
[Thread-0] [1:42:55:423] [StreamReader.run:65]  OUTPUT>NAME=ora.rac2.LISTENER_RAC2.lsnr
[Thread-0] [1:42:55:424] [StreamReader.run:65]  OUTPUT>TYPE=application
[Thread-0] [1:42:55:424] [StreamReader.run:65]  OUTPUT>TARGET=OFFLINE
[Thread-0] [1:42:55:424] [StreamReader.run:65]  OUTPUT>STATE=OFFLINE
[Thread-0] [1:42:55:427] [StreamReader.run:65]  OUTPUT>
[main] [1:42:55:427] [RuntimeExec.runCommand:147]  RunTimeExec: output>
[main] [1:42:55:428] [RuntimeExec.runCommand:150]  NAME=ora.rac2.LISTENER_RAC2.lsnr
[main] [1:42:55:429] [RuntimeExec.runCommand:150]  TYPE=application
[main] [1:42:55:431] [RuntimeExec.runCommand:150]  TARGET=OFFLINE
[main] [1:42:55:431] [RuntimeExec.runCommand:150]  STATE=OFFLINE
[main] [1:42:55:432] [RuntimeExec.runCommand:150]  
[main] [1:42:55:432] [RuntimeExec.runCommand:155]  RunTimeExec: error>
[main] [1:42:55:433] [RuntimeExec.runCommand:175]  Returning from RunTimeExec.runCommand
[main] [1:42:55:433] [HAOperationImpl.runCommand:1283]  set status OK
[main] [1:42:55:435] [HAStatusOperation.run:127]  Returned from executing the HA Operation
[main] [1:42:55:435] [HAStatusOperation.run:132]  OUTPUT> NAME=ora.rac2.LISTENER_RAC2.lsnr
[main] [1:42:55:436] [HAStatusOperation.run:132]  OUTPUT> TYPE=application
[main] [1:42:55:436] [HAStatusOperation.run:132]  OUTPUT> TARGET=OFFLINE
[main] [1:42:55:437] [HAStatusOperation.run:132]  OUTPUT> STATE=OFFLINE
[main] [1:42:55:438] [HAStatusOperation.run:132]  OUTPUT>
[main] [1:42:55:439] [HAStatusOperation.run:138]  ERROR>
[main] [1:42:55:439] [LocalCommand.execute:56]  LocalCommand.execute: Returned from run method
[main] [1:42:55:441] [HAResourceStatus.parseHAStatusOutput:293]  got status: resource=ora.rac2.LISTENER_RAC2.lsnrtarget=OFFLINE status=OFFLINE host=null
[main] [1:42:55:441] [Listener.isRunning:250]  online status of ora.rac2.LISTENER_RAC2.lsnr on rac2 is false
[main] [1:42:55:442] [Listener.start:266]  Running new start ..
[main] [1:42:55:443] [Operation.<init>:63]  Setting to be a synchronized operation
[main] [1:42:55:443] [HASContext.getInstance:190]  Module init : 6
[main] [1:42:55:444] [HASContext.getInstance:214]  Local Module init : 0
[main] [1:42:55:444] [HASContext.getInstance:249]  HAS Context Allocated: 3 to oracle.ops.mgmt.has.Util@1764be1
[main] [1:42:55:445] [Util.<init>:86]  Util Instance created.
[main] [1:42:55:446] [has.UtilNative.Native]  prsr_trace: Native: getCRSHome

回复 只看该作者 道具 举报

7#
发表于 2013-12-19 15:40:33
[main] [1:42:55:447] [has.UtilNative.Native]  prsr_trace: Native: getCRSHome crs_home=/u01/crs1020(**)

[main] [1:42:55:448] [HASContext.getCRSHome:450]  /u01/crs1020
[main] [1:42:55:448] [Util.getCRSHome:428]  getCRSHome: ret=/u01/crs1020
[main] [1:42:55:448] [HAOperation.setCRSHome:148]  CRS_HOME: /u01/crs1020
[main] [1:42:55:449] [HAOperation.checkCommandVerb:211]  Checking an existence of CRS command
[main] [1:42:55:449] [NodeApps.start:420]  Starting service for ora.rac2.LISTENER_RAC2.lsnr on rac2
[main] [1:42:55:450] [LocalCommand.execute:54]  LocalCommand.execute: Calling run method
[main] [1:42:55:450] [HAStartOperation.run:81]  Executing the HA operation /u01/crs1020/bin/crs_startora.rac2.LISTENER_RAC2.lsnr
[main] [1:42:55:451] [HAOperationImpl.runCommand:1254]  CRS cmd is: /u01/crs1020/bin/crs_start ora.rac2.LISTENER_RAC2.lsnr -f
[main] [1:42:55:452] [RuntimeExec.runCommand:74]  Calling Runtime.exec() with the command
[main] [1:42:55:452] [RuntimeExec.runCommand:76]  /u01/crs1020/bin/crs_start
[main] [1:42:55:453] [RuntimeExec.runCommand:76]  ora.rac2.LISTENER_RAC2.lsnr
[main] [1:42:55:453] [RuntimeExec.runCommand:76]  -f
[Thread-3] [1:42:55:471] [StreamReader.run:61]  In StreamReader.run
[main] [1:42:55:472] [RuntimeExec.runCommand:131]  runCommand: Waiting for the process
[Thread-2] [1:42:55:473] [StreamReader.run:61]  In StreamReader.run
[Thread-2] [1:42:55:569] [StreamReader.run:65]  OUTPUT>Attempting to start `ora.rac2.LISTENER_RAC2.lsnr` on member `rac2`
[Thread-2] [1:42:55:886] [StreamReader.run:65]  OUTPUT>Start of `ora.rac2.LISTENER_RAC2.lsnr` on member `rac2` succeeded.
[main] [1:42:55:889] [RuntimeExec.runCommand:133]  runCommand: process returns 0
[main] [1:42:55:890] [RuntimeExec.runCommand:147]  RunTimeExec: output>
[main] [1:42:55:890] [RuntimeExec.runCommand:150]  Attempting to start `ora.rac2.LISTENER_RAC2.lsnr` on member `rac2`
[main] [1:42:55:891] [RuntimeExec.runCommand:150]  Start of `ora.rac2.LISTENER_RAC2.lsnr` on member `rac2` succeeded.
[main] [1:42:55:893] [RuntimeExec.runCommand:155]  RunTimeExec: error>
[main] [1:42:55:893] [RuntimeExec.runCommand:175]  Returning from RunTimeExec.runCommand
[main] [1:42:55:894] [HAOperationImpl.runCommand:1283]  set status OK
[main] [1:42:55:895] [HAStartOperation.run:84]  Returned from executing the HA Operation
[main] [1:42:55:896] [HAStartOperation.run:89]  OUTPUT> Attempting to start `ora.rac2.LISTENER_RAC2.lsnr` on member `rac2`
[main] [1:42:55:896] [HAStartOperation.run:89]  OUTPUT> Start of `ora.rac2.LISTENER_RAC2.lsnr` on member `rac2` succeeded.
[main] [1:42:55:897] [HAStartOperation.run:95]  ERROR>
[main] [1:42:55:900] [LocalCommand.execute:56]  LocalCommand.execute: Returned from run method

回复 只看该作者 道具 举报

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

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

GMT+8, 2024-5-19 06:23 , Processed in 0.051426 second(s), 20 queries .

Powered by Discuz! X2.5

© 2001-2012 Comsenz Inc.

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