[20150228]启动问题.txt

简介: [20150228]启动问题.txt --生产系统出现一个奇怪的问题,在服务器端看: $ rlsql SQL*Plus: Release 11.2.0.3.0 Production on Sat Feb 28 09:46:12 2015 Copyright (c) 1982, 2011, Oracle.  All rights reserved. Connected to an idle instance. SYS@test> quit Disconnected --奇怪服务端使用直接连接看不到数据库。

[20150228]启动问题.txt

--生产系统出现一个奇怪的问题,在服务器端看:

$ rlsql
SQL*Plus: Release 11.2.0.3.0 Production on Sat Feb 28 09:46:12 2015
Copyright (c) 1982, 2011, Oracle.  All rights reserved.
Connected to an idle instance.

SYS@test> quit
Disconnected

--奇怪服务端使用直接连接看不到数据库。

--仔细询问了一下,别人使用windows client 远程启动过这个数据库。
--如果在服务端使用sqlplus scott/xxxx@tns_alias 连接可以连上。我只好在自己的测试环境做这个测试。
--发现确实存在这个问题,自己做一个测试:

$ sysresv
IPC Resources for ORACLE_SID "test" :
Shared Memory
ID              KEY
No shared memory segments used
Semaphores:
ID              KEY
No semaphore resources used
Oracle Instance not alive for sid "test"
--没有相关信息。

SYS@40> oradebug setmypid;
Statement processed.
SYS@40> oradebug ipc
Information written to trace file.
SYS@40> oradebug tracefile_name;
/u01/app/oracle11g/diag/rdbms/test/test/trace/test_ora_25317.trc

Handle:          0x2a970040b0 `/u01/app/oracle11g/product/11.2.0/db_2/test'
Dump of unix-generic realm handle `/u01/app/oracle11g/product/11.2.0/db_2/test', flags = 00000000
Area #0 `Fixed Size' containing Subareas 0-0
  Total size 0000000000220230 Minimum Subarea size 00000000
   Area  Subarea    Shmid      Stable Addr      Actual Addr
      0        0 21889024 0x00000060000000 0x00000060000000
                              Subarea size     Segment size
                          0000000000221000 0000000001000000
....
-------------- system semaphore information -------------
------ Shared Memory Segments --------
key        shmid      owner      perms      bytes      nattch     status
0x00000000 21889024   oracle11g 640        4096       0
0x00000000 21921793   oracle11g 640        4096       0
0x7f1ca950 21954562   oracle11g 640        4096       0
------ Semaphore Arrays --------
key        semid      owner      perms      nsems
0xf0052be8 47546376   oracle11g 640        126
0xf0052be9 47579145   oracle11g 640        126
0xf0052bea 47611914   oracle11g 640        126
0xf0052beb 47644683   oracle11g 640        126
0xf0052bec 47677452   oracle11g 640        126
------ Message Queues --------
key        msqid      owner      perms      used-bytes   messages

*** 2015-02-28 09:58:50.420
--为什么sysres与使用oradebug ipc 看到的不同呢?

--远程停止后,在服务器启动数据库:

SYS@test> oradebug setmypid
Statement processed.
SYS@test> oradebug ipc
Information written to trace file.
SYS@test> oradebug tracefile_name
/u01/app/oracle11g/diag/rdbms/test/test/trace/test_ora_26282.trc

$ sysresv

IPC Resources for ORACLE_SID "test" :
Shared Memory:
ID              KEY
22020096        0x00000000
22052865        0x00000000
22085634        0x9e347558
Semaphores:
ID              KEY
48005128        0x8eb7ef30
48037897        0x8eb7ef31
48070666        0x8eb7ef32
48103435        0x8eb7ef33
48136204        0x8eb7ef34
Oracle Instance alive for sid "test"

--查看转储文件,马上明白为什么?

Handle:          0x2a970040b0 `/u01/app/oracle11g/product/11.2.0/db_2test'
Dump of unix-generic realm handle `/u01/app/oracle11g/product/11.2.0/db_2test', flags = 00000000
Area #0 `Fixed Size' containing Subareas 0-0
  Total size 0000000000220230 Minimum Subarea size 00000000
   Area  Subarea    Shmid      Stable Addr      Actual Addr
      0        0 22020096 0x00000060000000 0x00000060000000
                              Subarea size     Segment size
                          0000000000221000 0000000001000000

-------------- system semaphore information -------------
------ Shared Memory Segments --------
key        shmid      owner      perms      bytes      nattch     status
0x00000000 22020096   oracle11g 640        4096       0
0x00000000 22052865   oracle11g 640        4096       0
0x9e347558 22085634   oracle11g 640        4096       0
------ Semaphore Arrays --------
key        semid      owner      perms      nsems
0x8eb7ef30 48005128   oracle11g 640        126
0x8eb7ef31 48037897   oracle11g 640        126
0x8eb7ef32 48070666   oracle11g 640        126
0x8eb7ef33 48103435   oracle11g 640        126
0x8eb7ef34 48136204   oracle11g 640        126
------ Message Queues --------
key        msqid      owner      perms      used-bytes   messages

--看看Handle在db_2,test之间没有/.

--我只要修改ORACLE_HOME环境变量,加入/就可以了。重复测试看看。

$ echo $ORACLE_HOME
/u01/app/oracle11g/product/11.2.0/db_2
$ export ORACLE_HOME=/u01/app/oracle11g/product/11.2.0/db_2/
$ sysresv

IPC Resources for ORACLE_SID "test" :
Shared Memory:
ID              KEY
22151168        0x00000000
22183937        0x00000000
22216706        0x7f1ca950
Semaphores:
ID              KEY
48300040        0xf0052be8
48332809        0xf0052be9
48365578        0xf0052bea
48398347        0xf0052beb
48431116        0xf0052bec
Oracle Instance alive for sid "test"

$ rlsql
SQL*Plus: Release 11.2.0.3.0 Production on Sat Feb 28 10:14:32 2015
Copyright (c) 1982, 2011, Oracle.  All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SYS@test>

总结:
1.远程启动数据库,我测试了windows,linux都存在这个问题。
2.看来要避免sys口令泄露,或者回收sys口令,避免开发自己启动数据库。
3.另外说明1下,如果数据库没有开启,远程client要连接启动数据库,监听要配置静态注册。

目录
相关文章
|
9月前
|
Shell 开发工具
chmod -rw /tmp/file1,编写脚本/root/bin/per.sh,判 断当前用户对/tmp/fiile1文件 是否不可读且不可写 ?
chmod -rw /tmp/file1,编写脚本/root/bin/per.sh,判 断当前用户对/tmp/fiile1文件 是否不可读且不可写 ?
42 1
CentOS cp 复制隐藏文件提示 cp: cannot stat ?.xxx*?. No such file or directory
执行的命令与错误信息: # cp -a /etc/skel/* /home/postgrescp: cannot stat ?.etc/skel/*?. No such file or directory 使用cp复制普通文件时,可以使用 * 号通配符,而在复制隐藏文件时,需要使用.
4233 0
|
网络安全 网络协议
[20180504]检查sshd配置是否正确.txt
[20180504]检查sshd配置是否正确.txt --//有时候要修改sshd配置文件,有可能改错,如果这个时候远程重启sshd,可能导致无法再远程登录, --//必须有一种机制在重启前检查sshd的配置是否正确.
1513 0
|
Oracle 关系型数据库 Linux
[20180211]11g关闭AMM.txt
[20180211]11g关闭AMM.txt --//指点别人的系统关闭AMM,使用hugepages遇到问题,主要问题是对方设置如下参数在spfile文件中: *.
1279 0
将cmd中命令输出保存为TXT文本文件
转自:https://www.cnblogs.com/hongten/archive/2013/03/27/hongten_windows_cms.html 例如:将Ping命令的加长包输出到D盘的ping.txt文本文件。
1540 0
|
Linux Windows
[20171228]windwos批处理echo问题.txt
[20171228]windwos批处理echo问题.txt --//前几天写的文章,链接:http://blog.itpub.net/267265/viewspace-2149205/ --//里面提到windows的自带echo,实现一些特性太"复杂".
1039 0