diff相比执行结果的始末,grid用户启停监听报错无权力

By admin in 美高梅手机版4858 on 2019年4月13日

[20170705]diff比较执行结果的内容.txt

[20170705]diff相比较执行结果的内容.txt,20170705diff

[20170705]diff相比执行结果的内容.txt

–//有时候须求相比二个指令输出的结果进行比较,相比笨的点子如下,例子:

$  lsnrctl status LISTENER_SCAN2 > /tmp/b2.txt
$  lsnrctl status LISTENER_SCAN3 > /tmp/b3.txt
$  diff -Nur /tmp/b2.txt /tmp/b3.txt

–//很明显那样要生成二个文件,然后比较,实际上选用shell可以很简短的贯彻.

$  lsnrctl status LISTENER_SCAN3 | diff /tmp/2.txt –
–//那样减弱三个文本的浮动,可以再减去文件生成吗?

$  diff <(lsnrctl status LISTENER_SCAN2) <(lsnrctl status
LISTENER_SCAN3)

–//怎样精通吧?
$  echo  <(lsnrctl status LISTENER_SCAN2) <(lsnrctl status
LISTENER_SCAN3)
/dev/fd/63 /dev/fd/62
–//实际上6二,63就是开辟的文本句柄.当然执行完马上关闭.

$  ls -l /dev/fd
lrwxrwxrwx 1 root root 13 2014-12-11 02:24:57 /dev/fd ->
/proc/self/fd

$  ls -l /dev/fd/
total 0
lrwx—— 1 grid oinstall 64 2017-07-05 16:16:07 0 -> /dev/pts/4
lrwx—— 1 grid oinstall 64 2017-07-05 16:16:07 1 -> /dev/pts/4
lrwx—— 1 grid oinstall 64 2017-07-05 16:16:07 2 -> /dev/pts/4
lr-x—— 1 grid oinstall 64 2017-07-05 16:16:07 3 ->
/proc/101318/fd

–//写三个简练的shell脚本就很好了解了(注意那种写法不是不大心):
–//笔者直接读取句柄陆3,6二的内容.

$  cat a.sh
#! /bin/bash
echo  <(lsnrctl status LISTENER_SCAN2) <(lsnrctl status
LISTENER_SCAN3)
diff /dev/fd/63 /dev/fd/62

$  . a.sh
/dev/fd/63 /dev/fd/62
6c6
< Connecting to

[20170705]diff相比较执行结果的内容.txt

[grid@max1 ~]$ lsnrctl stop

–//有时候要求比较三个指令输出的结果实行相比较,相比笨的不2诀窍如下,例子:

(DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN2)))

> Connecting to
(DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN3)))
9c9

–//有时候需求比较2个指令输出的结果开始展览相比,比较笨的办法如下,例子:

LSNRCTL for Linux: Version 11.2.0.3.0 – Production on 04-NOV-2016
00:20:54

diff相比执行结果的始末,grid用户启停监听报错无权力。$  lsnrctl status LISTENER_SCAN2 > /tmp/b2.txt
$  lsnrctl status LISTENER_SCAN3 > /tmp/b3.txt
$  diff -Nur /tmp/b2.txt /tmp/b3.txt

< Alias                     LISTENER_SCAN2

> Alias                     LISTENER_SCAN3
11,12c11,12
< Start Date                30-JUN-2017 12:00:03

$  lsnrctl status LISTENER_SCAN2 > /tmp/b2.txt
$  lsnrctl status LISTENER_SCAN3 > /tmp/b3.txt
$  diff -Nur /tmp/b2.txt /tmp/b3.txt

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

–//很显明那样要生成三个公文,然后相比较,实际上利用shell可以很简短的落实.

< Uptime                    5 days 4 hr. 18 min. 37 sec

> Start Date                30-JUN-2017 12:00:58
> Uptime                    5 days 4 hr. 17 min. 43 sec
17c17
< Listener Log File        

–//很鲜明那样要生成一个文本,然后相比较,实际上选拔shell能够极粗略的完结.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER)))
TNS-01190: The user is not authorized to execute the requested listener
command

$  lsnrctl status LISTENER_SCAN3 | diff /tmp/2.txt –
–//这样减弱三个文件的更动,能够再减弱文件生成吗?

/u01/app/11.2.0.4/grid/network/log/listener_scan2.log

> Listener Log File        
/u01/app/11.2.0.4/grid/network/log/listener_美高梅手机版4858 ,scan3.log
19,20c19,20
<   (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER_SCAN2)))
<  

$  lsnrctl status LISTENER_SCAN3 | diff /tmp/2.txt –
–//那样减弱二个公文的扭转,能够再削减文件生成吗?

 

$  diff <(lsnrctl status LISTENER_SCAN2) <(lsnrctl status
LISTENER_SCAN3)

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

>   (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER_SCAN3)))
>  
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.100.107)(PORT=1521)))

–//想到此处,笔者到底精晓exp/imp on the fly.例子:

$ exp scott/book file=>(gzip >t.dmp.gz) tables=emp
$ imp scott/book full=y  file=<(gunzip <t.dmp.gz)

[20170705]diff相比较执行结果的内容.txt
–//有时候须求相比较一个指令输出的结果进行比较,比较笨的…

$  diff <(lsnrctl status LISTENER_SCAN2) <(lsnrctl status
LISTENER_SCAN3)

[root@max1 tmp]# srvctl start listener
PRCR-1079 : Failed to start resource ora.LISTENER.lsnr
CRS-5016: Process “/g01/11g/grid/bin/lsnrctl” spawned by agent
“/g01/11g/grid/bin/oraagent.bin” for action “start” failed: details at
“(:CLSN00010:)” in
“/g01/11g/grid/log/max2/agent/crsd/oraagent_grid/oraagent_grid.log”
CRS-5016: Process “/g01/11g/grid/bin/lsnrctl” spawned by agent
“/g01/11g/grid/bin/oraagent.bin” for action “start” failed: details at
“(:CLSN00010:)” in
“/g01/11g/grid/log/max2/agent/crsd/oraagent_grid/oraagent_grid.log”

–//怎么着明白呢?
$  echo  <(lsnrctl status LISTENER_SCAN2) <(lsnrctl status
LISTENER_SCAN3)
/dev/fd/63 /dev/fd/62
–//实际上6二,63正是打开的文书句柄.当然执行完立时关闭.

–//怎么样驾驭啊?
$  echo  <(lsnrctl status LISTENER_SCAN2) <(lsnrctl status
LISTENER_SCAN3)
/dev/fd/63 /dev/fd/62
–//实际上6贰,6叁正是开拓的文本句柄.当然执行完即刻关闭.

CRS-2674: Start of ‘ora.LISTENER.lsnr’ on ‘max2’ failed

$  ls -l /dev/fd
lrwxrwxrwx 1 root root 13 2014-12-11 02:24:57 /dev/fd ->
/proc/self/fd

$  ls -l /dev/fd
lrwxrwxrwx 1 root root 13 2014-12-11 02:24:57 /dev/fd ->
/proc/self/fd

 

$  ls -l /dev/fd/
total 0
lrwx—— 1 grid oinstall 64 2017-07-05 16:16:07 0 -> /dev/pts/4
lrwx—— 1 grid oinstall 64 2017-07-05 16:16:07 1 -> /dev/pts/4
lrwx—— 1 grid oinstall 64 2017-07-05 16:16:07 2 -> /dev/pts/4
lr-x—— 1 grid oinstall 64 2017-07-05 16:16:07 3 ->
/proc/101318/fd

$  ls -l /dev/fd/
total 0
lrwx—— 1 grid oinstall 64 2017-07-05 16:16:07 0 -> /dev/pts/4
lrwx—— 1 grid oinstall 64 2017-07-05 16:16:07 1 -> /dev/pts/4
lrwx—— 1 grid oinstall 64 2017-07-05 16:16:07 2 -> /dev/pts/4
lr-x—— 1 grid oinstall 64 2017-07-05 16:16:07 3 ->
/proc/101318/fd

只是过1会lsnrctl status发现监听起来了。

–//写三个粗略的shell脚本就很好通晓了(注意那种写法不是很谨慎):
–//小编直接读取句柄六叁,6二的内容.

–//写三个简约的shell脚本就很好理解了(注意那种写法不是很谨慎):
–//小编直接读取句柄陆③,6二的内容.

 

$  cat a.sh
#! /bin/bash
echo  <(lsnrctl status LISTENER_SCAN2) <(lsnrctl status
LISTENER_SCAN3)
diff /dev/fd/63 /dev/fd/62

$  cat a.sh
#! /bin/bash
echo  <(lsnrctl status LISTENER_SCAN2) <(lsnrctl status
LISTENER_SCAN3)
diff /dev/fd/63 /dev/fd/62

[root@max2 ~]# srvctl start listener -n max2
PRCR-1013 : Failed to start resource ora.LISTENER.lsnr
PRCR-1064 : Failed to start resource ora.LISTENER.lsnr on node max2
CRS-5016: Process “/g01/11g/grid/bin/lsnrctl” spawned by agent
“/g01/11g/grid/bin/oraagent.bin” for action “start” failed: details at
“(:CLSN00010:)” in
“/g01/11g/grid/log/max2/agent/crsd/oraagent_grid/oraagent_grid.log”
CRS-5016: Process “/g01/11g/grid/bin/lsnrctl” spawned by agent
“/g01/11g/grid/bin/oraagent.bin” for action “start” failed: details at
“(:CLSN00010:)” in
“/g01/11g/grid/log/max2/agent/crsd/oraagent_grid/oraagent_grid.log”
CRS-2674: Start of ‘ora.LISTENER.lsnr’ on ‘max2’ failed

$  . a.sh
/dev/fd/63 /dev/fd/62
6c6
< Connecting to

$  . a.sh
/dev/fd/63 /dev/fd/62
6c6
< Connecting to

 

(DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN2)))

> Connecting to
(DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN3)))
9c9

(DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN2)))

> Connecting to
(DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN3)))
9c9

[root@max2 ~]# lsnrctl status

< Alias                     LISTENER_SCAN2

> Alias                     LISTENER_SCAN3
11,12c11,12
< Start Date                30-JUN-2017 12:00:03

< Alias                     LISTENER_SCAN2

> Alias                     LISTENER_SCAN3
11,12c11,12
< Start Date                30-JUN-2017 12:00:03

LSNRCTL for Linux: Version 11.2.0.3.0 – Production on 04-NOV-2016
00:49:03

< Uptime                    5 days 4 hr. 18 min. 37 sec

> Start Date                30-JUN-2017 12:00:58
> Uptime                    5 days 4 hr. 17 min. 43 sec
17c17
< Listener Log File        

< Uptime                    5 days 4 hr. 18 min. 37 sec

> Start Date                30-JUN-2017 12:00:58
> Uptime                    5 days 4 hr. 17 min. 43 sec
17c17
< Listener Log File        

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

/u01/app/11.2.0.4/grid/network/log/listener_scan2.log

> Listener Log File        
/u01/app/11.2.0.4/grid/network/log/listener_scan3.log
19,20c19,20
<   (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER_SCAN2)))
<  

/u01/app/11.2.0.4/grid/network/log/listener_scan2.log

> Listener Log File        
/u01/app/11.2.0.4/grid/network/log/listener_scan3.log
19,20c19,20
<   (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER_SCAN2)))
<  

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER)))
TNS-12541: TNS:no listener
TNS-12560: TNS:protocol adapter error
TNS-00511: No listener
Linux Error: 111: Connection refused

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

>   (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER_SCAN3)))
>  
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.100.107)(PORT=1521)))

–//想到此处,笔者毕竟掌握exp/imp on the fly.例子:

$ exp scott/book file=>(gzip >t.dmp.gz) tables=emp
$ imp scott/book full=y  file=<(gunzip <t.dmp.gz)

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

>   (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER_SCAN3)))
>  
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.100.107)(PORT=1521)))

–//想到此地,小编终于通晓exp/imp on the fly.例子:

$ exp scott/book file=>(gzip >t.dmp.gz) tables=emp
$ imp scott/book full=y  file=<(gunzip <t.dmp.gz)

 

 

询问资料发现是出于在root用户使用srvctl命令导致/var/tmp/.oracle大概/tmp/.oracle文件属主爆发变化导致的。

美高梅手机版4858 1

 

[oracle@max1 .oracle]$ ps -ef|grep 11521
grid 11521 1 0 03:01 ? 00:00:00 /g01/11g/grid/bin/tnslsnr LISTENER
-inherit
oracle 13012 12634 0 03:47 pts/1 00:00:00 grep 11521

那么些文件均是 socket 文件, 且s#115二1.壹 中的1152一为经过号,经调查是监听的进程号

那么这个scoket 是用来干嘛的啊?

ODM find:

The hidden directory  ‘/var/tmp/.oracle’ (or /tmp/.oracle on some
platforms) or its content was removed while instances & the CRS stack
were up and running. Typically this directory contains a number of
“special” socket files that are used by local clients to connect via the
IPC protocol (sqlnet) to various Oracle processes including the TNS
listener, the CSS, CRS & EVM daemons or even  database or ASM
instances. These files are created when the “listening” process
starts.  

固然说:这一个socket
文被当做本地客户端选择进程间通讯协议(ipc)和见仁见智的oracle的进程通讯,而那些进度包蕴:tns
监听,css ,crs,evm 守护进度;甚至数据库和asm 实例。那么些socket
由‘主动监听’的历程创立。在此间oracle tns listener 创造那么些socket
文件根本行使用作pmon 和 tnslsnr  通讯从报错音讯里就足以看出难题.

chown -R grid:oinstall /var/tmp/.oracle

使用grid用户srvctl start listener -n max2,正常。

 

就此日常操作集群建议选择grid用户,不要使用root用户。

 

发表评论

电子邮件地址不会被公开。 必填项已用*标注

网站地图xml地图
Copyright @ 2010-2019 美高梅手机版4858 版权所有