解决Can not allocate log问题的方法

RAC环境ORACLE其中一个节点报告大量的cannot allocate new log提示,详细信息如下:

ORACLE Instance xxdb2 - Can not allocate log, archival required
Tue Dec 1 16:04:35 2009
Thread 2 cannot allocate new log, sequence 7466
All online logs needed archiving
Current log# 3 seq# 7465 mem# 0: +XXDBGROUP/xxdb/onlinelog/group_3.268.6409755
Current log# 3 seq# 7465 mem# 1: +XXDBGROUP/xxdb/onlinelog/group_3.269.6409755

检查上面的提示,其中有一行是"All online logs needed archiving". 说明所有的redo log都需要归档。

导致这个问题的原因是redo log的group太少,当大transaction运行的时候,将所有的redo log都用了,transaction还没有完成。

[@more@]

解决的方法是增加redolog 的group或增大group各member的尺寸,我选择增加group数量的方法。过程如下:

检查现在的归档日志情况:

SQL> select * from v$log;

GROUP# THREAD# SEQUENCE# BYTES MEMBERS ARC STATUS FIRST_CHANGE# FIRST_TIM
---------- ---------- ---------- ---------- ---------- --- ----------------------------- ---------

1 1 7501 104857600 1 NO CURRENT 504828041 01-DEC-09
2 1 7500 104857600 1 YES INACTIVE 503944970 01-DEC-09

GROUP# THREAD# SEQUENCE# BYTES MEMBERS ARC STATUS FIRST_CHANGE# FIRST_TIM
---------- ---------- ---------- ---------- ---------- --- ----------------------------- ---------
3 2 7464 104857600 1 NO ACTIVE 503944966 01-DEC-09
4 2 7465 104857600 1 NO CURRENT 504828036 01-DEC-09

4 rows selected.

发现现在数据库的两个节点上,每个节点有2组日志,计划每个节点增加到4组。过程如下:

SQL> alter database add logfile thread 1 group 5 ;

SQL> Database altered.

SQL> alter database add logfile thread 2 group 6 ;

SQL> Database altered.

SQL> alter database add logfile thread 1 group 7 ;

SQL> Database altered.

SQL> alter database add logfile thread 2 group 8 ;

SQL> Database altered.

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/22049049/viewspace-1029263/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/22049049/viewspace-1029263/

void AP_CANManager::init() { WITH_SEMAPHORE(_sem); // we need to mutate the HAL to install new CAN interfaces AP_HAL::HAL& hal_mutable = AP_HAL::get_HAL_mutable(); #if CONFIG_HAL_BOARD == HAL_BOARD_SITL if (AP::sitl() == nullptr) { AP_HAL::panic("CANManager: SITL not initialised!"); } #endif // We only allocate log buffer only when under debug if (_loglevel != AP_CANManager::LOG_NONE) { _log_buf = NEW_NOTHROW char[LOG_BUFFER_SIZE]; _log_pos = 0; } #if AP_CAN_SLCAN_ENABLED //Reset all SLCAN related params that needs resetting at boot _slcan_interface.reset_params(); #endif AP_CAN::Protocol drv_type[HAL_MAX_CAN_PROTOCOL_DRIVERS] = {}; // loop through interfaces and allocate and initialise Iface, // Also allocate Driver objects, and add interfaces to them for (uint8_t i = 0; i < HAL_NUM_CAN_IFACES; i++) { // Get associated Driver to the interface uint8_t drv_num = _interfaces[i]._driver_number; if (drv_num == 0 || drv_num > HAL_MAX_CAN_PROTOCOL_DRIVERS) { continue; } drv_num--; if (hal_mutable.can[i] == nullptr) { // So if this interface is not allocated allocate it here, // also pass the index of the CANBus hal_mutable.can[i] = NEW_NOTHROW HAL_CANIface(i); } // Initialise the interface we just allocated if (hal_mutable.can[i] == nullptr) { continue; } AP_HAL::CANIface* iface = hal_mutable.can[i]; // Find the driver type that we need to allocate and register this interface with drv_type[drv_num] = (AP_CAN::Protocol) _drv_param[drv_num]._driver_type.get(); bool can_initialised = false; // Check if this interface need hooking up to slcan passthrough // instead of a driver #if AP_CAN_SLCAN_ENABLED if (_slcan_interface.init_passthrough(i)) { // we have slcan bridge setup pass that on as can iface can_initialised = hal_mutable.can[i]->init(_interfaces[i]._bitrate, _interfaces[i]._fdbitrate*1000000, AP_HAL::CANIface::NormalMode); iface = &_slcan_interface; } else { #else if (true) { #endif can_initialised = hal_mutable.can[i]->init(_interfaces[i]._bitrate, _interfaces[i]._fdbitrate*1000000, AP_HAL::CANIface::NormalMode); } if (!can_initialised) { log_text(AP_CANManager::LOG_ERROR, LOG_TAG, "Failed to initialise CAN Interface %d", i+1); continue; } log_text(AP_CANManager::LOG_INFO, LOG_TAG, "CAN Interface %d initialized well", i + 1); if (_drivers[drv_num] != nullptr) { //We already initialised the driver just add interface and move on log_text(AP_CANManager::LOG_INFO, LOG_TAG, "Adding Interface %d to Driver %d", i + 1, drv_num + 1); _drivers[drv_num]->add_interface(iface); continue; } if (_num_drivers >= HAL_MAX_CAN_PROTOCOL_DRIVERS) { // We are exceeding number of drivers, // this can't be happening time to panic AP_BoardConfig::config_error("Max number of CAN Drivers exceeded\n\r"); }这段代码是关于ardupilot中的can的代码,这段代码功能是什么
最新发布
03-15
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值