July 19, 2006
Oracle10gR2 ORA-3136 错误解决
作者:eygle
出处:http://blog.eygle.com
最近一台新上线的Oracle10gR2数据库在警告日志文件中(alert.log)持续出现如下错误:
| Tue Jul 18 23:09:22 2006 WARNING: inbound connection timed out (ORA-3136) Tue Jul 18 23:09:23 2006 WARNING: inbound connection timed out (ORA-3136) Tue Jul 18 23:09:25 2006 WARNING: inbound connection timed out (ORA-3136) Tue Jul 18 23:09:30 2006 WARNING: inbound connection timed out (ORA-3136) Tue Jul 18 23:12:15 2006 WARNING: inbound connection timed out (ORA-3136) |
同时在sqlnet.log中记录了如下错误:
|
Fatal NI connect error 12170. VERSION INFORMATION: |
这是和网络连接相关的一个错误,Metalink上给出了如下的解决方案:
1.set INBOUND_CONNECT_TIMEOUT_<listenername>=0 in listener.ora
2. set SQLNET.INBOUND_CONNECT_TIMEOUT = 0 in sqlnet.ora of server.
3. stop and start both listener and database.
4. Now try to connect to DB and observe the behaviour
这里重起数据库和Listener我认为是没有必要的,我们reload一下Listner应该就可以了.
|
[oracle@order admin]$ lsnrctl LSNRCTL for Linux: Version 10.2.0.2.0 - Production on 19-JUL-2006 15:26:33 Copyright (c) 1991, 2005, Oracle. All rights reserved. Welcome to LSNRCTL, type "help" for information. LSNRCTL> reload LSNRCTL> show inbound_connect_timeout |
修改之后,观察了一段时间,目前正常.
关于SQLNET.INBOUND_CONNECT_TIMEOUT参数,Oracle建议修改该参数,以避免denial-of-service攻击.
引用一段Oracle文档说明如下:
SQLNET.INBOUND_CONNECT_TIMEOUT
Purpose
Use the SQLNET.INBOUND_CONNECT_TIMEOUT parameter to specify the time, in seconds, for a client to connect with the database server and provide the necessary authentication information.
If the client fails to establish a connection and complete authentication in the time specified, then the database server terminates the connection. In addition, the database server logs the IP address of the client and an ORA-12170: TNS:Connect timeout occurred error message to the sqlnet.log file. The client receives either an ORA-12547: TNS:lost contact or an ORA-12637: Packet receive failed error message.
Without this parameter, a client connection to the database server can stay open indefinitely without authentication. Connections without authentication can introduce possible denial-of-service attacks, whereby malicious clients attempt to flood database servers with connect requests that consume resources.
To protect both the database server and the listener, Oracle Corporation recommends setting this parameter in combination with the INBOUND_CONNECT_TIMEOUT_listener_name parameter in the listener.ora file. When specifying values for these parameters, consider the following recommendations:
Set both parameters to an initial low value.
Set the value of the INBOUND_CONNECT_TIMEOUT_listener_name parameter to a lower value than the SQLNET.INBOUND_CONNECT_TIMEOUT parameter.
For example, you can set INBOUND_CONNECT_TIMEOUT_listener_name to 2 seconds and INBOUND_CONNECT_TIMEOUT parameter to 3 seconds. If clients are unable to complete connections within the specified time due to system or network delays that are normal for the particular environment, then increment the time as needed.
See Also:
Oracle9i Net Services Administrator's Guide for information about configuring these parameters
Default
None
Example
SQLNET.INBOUND_CONNECT_TIMEOUT=3
Posted by eygle at 11:20 AM | Comments (5)
Oracle10g v$database视图SCN增强
作者:eygle
出处:http://blog.eygle.com
在Oracle10g中,Oracle对v$database视图做出增强,增加了很多字段,其中一个重要字段是:CURRENT_SCN,代表数据库当前的SCN:
|
SQL> select * from v$version; BANNER SQL> desc v$database |
这个字段来自底层基础表x$kccdi ,其中的字段为:DICUR_SCN , DI代表Database Information ,cur_scn 代表 current SCN:
| SQL> desc x$kccdi Name Null? Type ----------------------------------------- -------- ----------------- ADDR RAW(4) INDX NUMBER ............... DIPLID NUMBER DIPLN VARCHAR2(101) DICUR_SCN VARCHAR2(16) DIDBUN VARCHAR2(30) DIFSTS NUMBER DIFOPR NUMBER DIFTHS NUMBER DIFTGT VARCHAR2(30) DIFOBS VARCHAR2(512) |
这个SCN值和9i中引入的dbms_flashback.get_system_change_number获得的值相同:
|
SQL> select A B |
v$database在Oracle10g中构建的语句如下,引用供参考:
| SELECT di.inst_id, di.didbi, di.didbn, TO_DATE (di.dicts, 'MM/DD/RR HH24:MI:SS', 'NLS_CALENDAR=Gregorian'), TO_NUMBER (di.dirls), TO_DATE (di.dirlc, 'MM/DD/RR HH24:MI:SS', 'NLS_CALENDAR=Gregorian'), TO_NUMBER (di.diprs), TO_DATE (di.diprc, 'MM/DD/RR HH24:MI:SS', 'NLS_CALENDAR=Gregorian'), DECODE (di.dimla, 0, 'NOARCHIVELOG', 1, 'ARCHIVELOG', 'MANUAL'), TO_NUMBER (di.discn), TO_NUMBER (di.difas), DECODE (BITAND (di.diflg, 256), 256, 'CREATED', DECODE (BITAND (di.diflg, 1024), 1024, 'STANDBY', DECODE (BITAND (di.diflg, 32768), 32768, 'CLONE', DECODE (BITAND (di.diflg, 4096), 4096, 'BACKUP', 'CURRENT' ) ) ) ), TO_DATE (di.dicct, 'MM/DD/RR HH24:MI:SS', 'NLS_CALENDAR=Gregorian'), di.dicsq, TO_NUMBER (di.dickp_scn), TO_DATE (di.dickp_tim, 'MM/DD/RR HH24:MI:SS', 'NLS_CALENDAR=Gregorian'), DECODE (BITAND (di.diflg, 4), 4, 'REQUIRED', DECODE (di.diirs, 0, 'NOT ALLOWED', 'ALLOWED') ), TO_DATE (di.divts, 'MM/DD/RR HH24:MI:SS', 'NLS_CALENDAR=Gregorian'), DECODE (di.didor, 0, 'MOUNTED', DECODE (di.didor, 1, 'READ WRITE', 'READ ONLY') ), DECODE (BITAND (di.diflg, 65536), 65536, 'MAXIMUM PROTECTION', DECODE (BITAND (di.diflg, 128), 128, 'MAXIMUM AVAILABILITY', DECODE (BITAND (di.diflg, 134217728), 134217728, 'RESYNCHRONIZATION', DECODE (BITAND (di.diflg, 8), 8, 'UNPROTECTED', 'MAXIMUM PERFORMANCE' ) ) ) ), DECODE (di.diprt, 1, 'MAXIMUM PROTECTION', 2, 'MAXIMUM AVAILABILITY', 3, 'RESYNCHRONIZATION', 4, 'MAXIMUM PERFORMANCE', 5, 'UNPROTECTED', 'UNKNOWN' ), DECODE (di.dirae, 0, 'DISABLED', 1, 'SEND', 2, 'RECEIVE', 3, 'ENABLED', 'UNKNOWN' ), TO_NUMBER (di.diacid), TO_NUMBER (di.diacid), DECODE (BITAND (di.diflg, 33554432), 33554432, 'LOGICAL STANDBY', DECODE (BITAND (di.diflg, 1024), 1024, 'PHYSICAL STANDBY', 'PRIMARY' ) ), TO_NUMBER (di.diars), DECODE (BITAND (difl2, 1), 1, 'ENABLED', 'DISABLED'), DECODE (di.disos, 0, 'IMPOSSIBLE', 1, 'NOT ALLOWED', 2, 'SWITCHOVER LATENT', 3, 'SWITCHOVER PENDING', 4, 'TO PRIMARY', 5, 'TO STANDBY', 6, 'RECOVERY NEEDED', 7, 'SESSIONS ACTIVE', 8, 'PREPARING SWITCHOVER', 9, 'PREPARING DICTIONARY', 10, 'TO LOGICAL STANDBY', 'UNKNOWN' ), DECODE (di.didgd, 0, 'DISABLED', 'ENABLED'), DECODE (BITAND (di.diflg, 1048576), 1048576, 'ALL', DECODE (BITAND (di.diflg, 2097152), 2097152, 'STANDBY', 'NONE' ) ), DECODE (BITAND (diflg, 1073741824), 1073741824, 'YES', DECODE (BITAND (diflg, 131072 + 262144 + 524288), 0, DECODE (BITAND (difl2, 2), 0, 'NO', 'IMPLICIT'), 'IMPLICIT' ) ), DECODE (BITAND (di.diflg, 131072), 131072, 'YES', 'NO'), DECODE (BITAND (di.diflg, 262144), 262144, 'YES', 'NO'), DECODE (BITAND (di.diflg, 268435456), 268435456, 'YES', 'NO'), di.diplid, di.dipln, di2.di2rdi, di2.di2inc, TO_NUMBER (di.dicur_scn), DECODE (BITAND (di2.di2flag, 1), 1, 'YES', DECODE (di2.di2rsp_oldest, 0, 'NO', 'RESTORE POINT ONLY') ), DECODE (BITAND (diflg, 524288), 524288, 'YES', 'NO'), DECODE (BITAND (difl2, 2), 2, 'YES', 'NO'), di.didbun, TO_NUMBER (di2.di2actiscn), DECODE (di.difsts, 0, 'DISABLED', 1, 'BYSTANDER', 2, 'SYNCHRONIZED', 3, 'UNSYNCHRONIZED', 4, 'SUSPENDED', 5, 'STALLED', 6, 'LOADING DICTIONARY', 7, 'PRIMARY UNOBSERVED', 8, 'REINSTATE REQUIRED', 9, 'REINSTATEIN PROGRESS', 10, 'REINSTATE FAILED', '' ), di.diftgt, di.difths, DECODE (di.difopr, 1, 'YES', 2, 'NO', 3, 'UNKNOWN', ''), di.difobs FROM x$kccdi di, x$kccdi2 di2 |
此前获取SCN可以通过如下方法:
http://www.eygle.com/faq/How.To.Get.Current.SCN.of.Database.htm
Posted by eygle at 10:34 AM | Comments (0)
