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

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

[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

–//很显著那样要生成1个公文,然后比较,实际上选拔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二,六叁就是开荒的文本句柄.当然实践完马上关闭.

$  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脚本就很好掌握了(注意那种写法不是异常的小心):
–//作者直接读取句柄六三,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

–//有时候必要比较三个指令输出的结果举办比较,相比笨的办法如下,例子:

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

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

–//有时候需求相比二个指令输出的结果开展比较,相比笨的措施如下,例子:

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

$  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
grid用户启动和停止监听报错无权力,diff相比推行结果的始末。< 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.

–//很显明那样要生成3个文本,然后相比较,实际上利用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_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
–//有时候必要比较2个指令输出的结果实行比较,相比笨的…

$  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二,陆三就是开荒的文本句柄.当然推行完马上关闭.

–//如何理解呢?
$  echo  <(lsnrctl status LISTENER_SCAN2) <(lsnrctl status
LISTENER_SCAN3)
/dev/fd/63 /dev/fd/62
–//实际上62,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

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

–//写二个简短的shell脚本就很好明白了(注意那种写法不是很严酷):
–//小编直接读取句柄6三,6二的内容.

–//写一个简练的shell脚本就很好理解了(注意那种写法不是十分小心):
–//笔者直接读取句柄6三,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文件属主产生变化导致的。

澳门金沙国际 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#1152一.① 中的115二一为经过号,经查明是监听的经过号

那么这几个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用户。

 

相关文章