[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

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

--仔细询问了一下,别人使用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要连接启动数据库,监听要配置静态注册。

时间: 2024-07-29 11:51:05

[20150228]启动问题.txt的相关文章

[20150228]DBMS_STATS Tracing.txt

[20150228]DBMS_STATS Tracing.txt --这个是很久的链接,可以跟踪dbms_stats的操作过程,自己测试看看. http://www.pythian.com/blog/options-for-tracing-oracle-dbms_stats/ Tracing is enabled by calling dbms_stats.set_global_prefs('trace',) Following are the possible values for the t

[20160229]探究oracle的启动过程.txt

[20160229]探究oracle的启动过程.txt --昨天自己研究了sys.bootstrap$,链接http://blog.itpub.net/267265/viewspace-2016219/ --今天换一种方式探究,当加载某个对象时,会调用内部函数kqlobjlod,通过gdb设置断点,可以实现了解启动的过程. --还是通过测试来讲解: 1.建立测试环境: SYS@book> @ &r/ver1 PORT_STRING                    VERSION    

c语言-C语言system函数打开文件的几种方式的不同

问题描述 C语言system函数打开文件的几种方式的不同 用c语言的system函数打开一个文件,system("cmd /c start out.txt")和system("out.txt")都可以,请问这两个有什么区别 解决方案 C:>start /? 启动另一个窗口运行指定的程序或命令. START ["title"] [/D path] [/I] [/MIN] [/MAX] [/SEPARATE | /SHARED] [/LOW |

如何把LISTBOX最后一条内容保存到指定路径的TXT文件,软件启动后TEXTBOX显示被保存的最后一条内容

问题描述 如何把LISTBOX最后一条内容保存到指定路径的TXT文件,软件启动后TEXTBOX显示被曾经被保存的最后一条内容 解决方案 解决方案二:搜索下,CSDN中已经有人提问过了解决方案三:是吗!我想要自动保存,不需要OPEN,可以实现吗?读取也一样,希望有好心人帮帮新手吧

[20150228]Delayed Block Cleanout 2.txt

[20150228]Delayed Block Cleanout 2.txt --前几天我自己做了1次Delayed Block Cleanout的例子,我一直有一个疑问. --链接如下:http://blog.itpub.net/267265/viewspace-1441526/ --如果我很久不查询这些块,scn会是多少呢?这个一直是我的疑问,重复测试: 1.建立测试环境: SCOTT@test> @ver1 PORT_STRING                    VERSION   

[20170515]数据库启动的一个疑问.txt

[20170515]数据库启动的一个疑问.txt --//别人问的问题我自己以前也没有注意,做一个记录. 1.环境: SYS@book> startup   mount ORACLE instance started. Total System Global Area  634732544 bytes Fixed Size                  2255792 bytes Variable Size             197133392 bytes Database Buffe

[20170329]给oracle启动加入baner.txt

[20170329]给oracle启动加入baner.txt --//测试一下给oracle 启动加入一个banner,没有什么意思,仅仅为了玩. 1.环境: SYS@book> @ &r/ver1 PORT_STRING                    VERSION        BANNER ------------------------------ -------------- -------------------------------------------------

[20130116]ASM未正常启动,使用dd找回数据文件.txt

[20130116]ASM未正常启动,使用dd找回数据文件.txt 参考链接:http://www.xifenfei.com/3025.html,自己为了加强理解,重做一次. SQL> column name format a50 SQL> select file#,ts#,status,enabled,checkpoint_change#,name,bytes  from v$datafile;      FILE#        TS# STATUS  ENABLED    CHECKPO

以普通用户启动的Vim如何保存需要root权限的文件

在Linux上工作的朋友很可能遇到过这样一种情况,当你用Vim编辑完一个文件时,运行:wq保存退出,突然蹦出一个错误: E45: 'readonly' option is set (add ! to override) 这表明文件是只读的,按照提示,加上!强制保存::w!,结果又一个错误出现: "readonly-file-name" E212: Can't open file for writing 文件明明存在,为何提示无法打开?这错误又代表什么呢?查看文档:help E212: