调整oracle服务器时间,oracle数据库因一次服务器时间调整引发的实例宕机注意事项及解决方案...

详情:

问题描述:

1. 数据库实例突然crash,原因是ASMB有200多秒没有响应:

Mon Sep 04 15:07:47 2017

WARNING: ASMB has not responded for 200 seconds <<<<<<<<<<<< ASMB has not responsed for 200 seconds.

NOTE: ASM umbilicus running slower than expected, ASMB diagnostic requested after 200 seconds

NOTE: ASMB process state dumped to trace file /u01/app/oracle/diag/rdbms/iadw/iadw3/trace/iadw3_gen0_19179.trc

Mon Sep 04 15:07:49 2017

NOTE: ASMB terminating

Mon Sep 04 15:07:49 2017

Errors in file /u01/app/oracle/diag/rdbms/iadw/iadw3/trace/iadw3_asmb_19501.trc:

ORA-15064: communication failure with ASM instance

ORA-03113: end-of-file on communication channel

Process ID:

Session ID: 170 Serial number: 65161

Mon Sep 04 15:07:49 2017

Errors in file /u01/app/oracle/diag/rdbms/iadw/iadw3/trace/iadw3_asmb_19501.trc:

ORA-15064: communication failure with ASM instance

ORA-03113: end-of-file on communication channel

Process ID:

Session ID: 170 Serial number: 65161

USER (ospid: 19501): terminating the instance due to error 15064

2. 从system state dump上看,ASMB看起来没有什么问题:

Current Wait Stack:

Not in wait; last wait ended 3.321392 sec ago  <<<<<<<<<<<<<<< Not in wait.

Wait State:

fixed_waits=0 flags=0x21 boundary=(nil)/-1

Session Wait History:

elapsed time of 3.321404 sec since last wait

0: waited for 'ASM background timer'

=0x0, =0x0, =0x0

wait_id=37936676 seq_num=57511 snap_id=1

wait times: snap=2.682436 sec, exc=2.682436 sec, total=2.682436 sec

wait times: max=infinite

wait counts: calls=0 os=0

occurred after 0.000022 sec of elapsed time

1: waited for 'ASM file metadata operation'

msgop=0xc, locn=0x3, =0x0

wait_id=37936675 seq_num=57510 snap_id=1

wait times: snap=0.000454 sec, exc=0.000454 sec, total=0.000454 sec

wait times: max=infinite

wait counts: calls=0 os=0

occurred after 0.000017 sec of elapsed time

3. 但是从OSW上看,没有发现明显的资源匮乏情况,但是中间却缺了三分多钟的断档:

zzz ***Mon Sep 4 15:04:13 CST 2017

procs -----------memory---------- ---swap-- -----io---- -system-- ------cpu-----

r b swpd free buff cache si so bi bo in cs us sy id wa st

3 0 0 529160192 19412 31514216 0 0 82 48 0 0 1 0 99 0 0

0 0 0 529124032 19412 31514784 0 0 1545 23119 36620 37705 1 1 99 0 0

2 0 0 529126784 19412 31514712 0 0 1601 9056 28083 30263 1 0 99 0 0

zzz ***Mon Sep 4 15:04:23 CST 2017

procs -----------memory---------- ---swap-- -----io---- -system-- ------cpu-----

r b swpd free buff cache si so bi bo in cs us sy id wa st

5 0 0 529095360 19412 31514996 0 0 82 48 0 0 1 0 99 0 0

3 0 0 529118368 19412 31515228 0 0 1517 4540 20402 27856 1 1 98 0 0

52 0 0 529107936 19412 31515400 0 0 1206 3961 21105 31254 1 0 98 0 0

zzz ***Mon Sep 4 15:07:51 CST 2017

<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

procs -----------memory---------- ---swap-- -----io---- -system-- ------cpu-----

r b swpd free buff cache si so bi bo in cs us sy id wa st

41 0 0 570421952 19412 31556616 0 0 82 48 0 0 1 0 99 0 0

16 0 0 578182976 19412 31575888 0 0 2129 35 25702 15760 1 8 91 0 0

5 0 0 582348800 19412 31607740 0 0 5209 40002 22122 19062 1 4 96 0 0

zzz ***Mon Sep 4 15:08:02 CST 2017

procs -----------memory---------- ---swap-- -----io---- -system-- ------cpu-----

r b swpd free buff cache si so bi bo in cs us sy id wa st

4 0 0 617279552 19412 31615300 0 0 82 48 0 0 1 0 99 0 0

2 0 0 624415168 19412 31617816 0 0 922 2 25322 20023 1 2 98 0 0

2 0 0 631768448 19412 31615728 0 0 1497 3 25405 22582 1 1 98 0 0

看到这里,一般的思考是OSW中间断档了3分多钟,是不是系统性能太差导致OSW没法生成?但是一般来讲,在断档之前一般都能看到一些先兆,比如block queue 剧增。但是这个案例里面没有此现象。 继续看OS log:

4. 在OSlog中看到关键性的一句话:

Sep 4 15:04:01 hnpb05nc crond:

/usr/sbin/postdrop: /lib64/libssl.so.10: no version information

available (required by /usr/lib64/mysql/libmysqlclient.so.18)

Sep 4 15:04:21 hnpb05nc init.tfa: Checking/Starting TFA..

Sep 4 15:07:47 hnpb05nc systemd: Time has been changed

<<<<<<<<<<<<<<<<<<< 系统时间修改了。

5. 继续看看CTSSD 的trace:

2017-09-04 15:04:25.799241 :

CTSS:3933169408: ctssslave_swm19: The offset is [2311562070 usec] and

sync interval set to [4]<<< 偏移量为2311秒

2017-09-04 15:04:25.799251 : CTSS:3933169408: ctsselect_msm: Sync interval returned in [4]

2017-09-04 15:04:25.799260 : CTSS:3937371904: ctssslave_msg_handler4_3:

slave_sync_with_master finished sync process. Exiting

clsctssslave_msg_handler

2017-09-04 15:04:26.800845 :

CTSS:3933169408: ctssslave_swm19: The offset is [2311562609 usec] and

sync interval set to [4]<<< 偏移量为2311秒

2017-09-04 15:04:26.800856 : CTSS:3933169408: ctsselect_msm: Sync interval returned in [4]

2017-09-04 15:04:26.800864 : CTSS:3937371904: ctssslave_msg_handler4_3:

slave_sync_with_master finished sync process. Exiting

clsctssslave_msg_handler

2017-09-04 15:04:27.802328 :

CTSS:3933169408: ctssslave_swm19: The offset is [2311563057 usec] and

sync interval set to [4]<<< 偏移量为2311秒

2017-09-04 15:04:27.802337 : CTSS:3933169408: ctsselect_msm: Sync interval returned in [4]

2017-09-04 15:04:27.802346 : CTSS:3937371904: ctssslave_msg_handler4_3:

slave_sync_with_master finished sync process. Exiting

clsctssslave_msg_handler

2017-09-04 15:07:47.065051 :

CTSS:3933169408: ctssslave_swm19: The offset is [2509824742 usec] and

sync interval set to [4]<<< 偏移量剧增到2509秒

2017-09-04 15:07:47.065068 : CTSS:3933169408: ctsselect_msm: Sync interval returned in [4]

2017-09-04 15:07:47.065077 : CTSS:3937371904: ctssslave_msg_handler4_3: slave_sync_with_master finished sync process. Exiting

很明显,偏移量在问题期间发生了200秒左右的增长,而在之前,我们可以看到偏移量是相对稳定的!这个也间接说明了系统时间的调整。

这个故事:

事情是这样的,系统配置了ntp,由于一些问题ntp没有启动,但是由于已经配置了ntp,ctssd发现了ntp的配置文件所以ctssd只运行在观察者的角色。造成的结果就是系统时间不断出现偏差,直到系统管理员发现了这个问题并手工把系统时间往前调了200秒。。。

然后ASMB通过系统时间判断有200秒没有响应(当然情况不是这样了),然后就。。。

建议:

当然我们应该尽可能monitor系统并确保NTP的正常运行。如果我们确实需要手工大幅度调整系统时间,那么我们也应该先把RAC数据库关闭以后在做调整。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
### 回答1: 可以使用 Node.js 的 oracledb 模块来连接 Oracle 数据库。 首先,需要安装 oracledb 模块: ``` npm install oracledb ``` 然后,使用 oracledb.getConnection() 方法来获取数据库连接,并在 options 参数中设置连接超时时间: ``` const oracledb = require('oracledb'); oracledb.getConnection( { user: 'username', password: 'password', connectString: 'host:port/service_name', options: { connectTimeout: 5000, // 设置连接超时时间为 5 秒 ... } }, function(err, connection) { // 连接成功后执行的回调函数 } ); ``` 连接超时时间的单位是毫秒,默认值为 60 秒。 注意:连接超时时间只是指连接 Oracle 数据库的超时时间,并不是数据库操作的超时时间。如果要设置数据库操作的超时时间,可以使用 oracledb.outFormat 和 oracledb.fetchAsBuffer 属性来实现。 ### 回答2: 在 Node.js 中设置连接 Oracle 数据库的超时时间可以通过以下步骤实现: 1. 首先,需要安装或引入适用于 Node.js 的 Oracle 数据库驱动程序模块。常见的模块有 "oracledb"、"node-oracledb" 等。你可以通过 npm 包管理器来安装这些模块,例如,在终端中运行以下命令: ``` npm install oracledb ``` 2. 在代码中引入模块: ```javascript const oracledb = require('oracledb'); ``` 3. 创建 Oracle 数据库连接时,可以通过在连接选项中设置 `timeout` 属性来定义连接超时时间(以毫秒为单位)。例如: ```javascript const connectionOptions = { user: 'your_username', password: 'your_password', connectString: 'your_connection_string', timeout: 10000 // 设置连接超时时间为10秒 }; // 创建数据库连接 oracledb.getConnection(connectionOptions, function(err, connection) { if (err) { console.error(err.message); return; } // 连接成功,可以执行其他数据库操作 }); ``` 在上述代码中,`timeout` 属性被设置为 10000,即 10 秒。如果在 10 秒内无法成功建立数据库连接,则会触发超时错误。 通过上述步骤,你可以在 Node.js 中设置连接 Oracle 数据库的超时时间。根据你的需求,你可以根据实际情况调整超时时间。 ### 回答3: 在Node.js中,要设置连接Oracle数据库的超时时间,可以使用以下步骤进行操作: 1. 使用Node.js的包管理器(如npm)安装适用于Oracle数据库的适配器或驱动程序。一些常用的适配器包括oracledb、oracle-db、node-oracle、node-oci8等。可以从npm的官方网站或在终端中使用命令`npm install`来安装。 2. 在Node.js的代码文件中引入适配器包并创建一个数据库连接对象。例如,使用oracledb适配器,可以使用以下代码进行连接: ```javascript const oracledb = require('oracledb'); // 设置连接Oracle数据库超时时间 oracledb.getConnection({ user: 'your_username', password: 'your_password', connectString: 'your_connect_string', timeout: 5000 // 设置超时时间为5秒 }, (err, connection) => { if (err) { console.error(err); return; } // 成功连接到Oracle数据库 console.log('Connected to Oracle Database'); // 在这里可以执行其他数据库操作 }); ``` 在上述代码中,通过将timeout属性设置为5000,即设置超时时间为5秒。可以根据实际需求调整超时时间。 3. 在连接初始化时设置超时后,可以使用连接对象执行其他数据库操作,如查询数据、插入数据等。当数据库操作超过设置的超时时间后,连接将自动关闭,可以在回调函数中进行适当的错误处理。 总结:通过在创建数据库连接时设置timeout属性,可以在Node.js中设置连接Oracle数据库的超时时间

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值