11g中_serial_direct_read是动态参数,可以在线修改

[oracle@rhel63single ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.4.0 Production on Sun Apr 26 13:54:56 2015

Copyright (c) 1982, 2013, Oracle.  All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> alter system set "_serial_direct_read" = false sid = '*';

System altered.

SQL> show parameter serial

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
_serial_direct_read                  string      FALSE
serial_reuse                         string      disable
SQL> show parameter pfile

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
spfile                               string      /u02/app/oracle/product/11.2.0
                                                 .4/db_1/dbs/spfiletest.ora
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.

Total System Global Area 1068937216 bytes
Fixed Size                  2260088 bytes
Variable Size             612369288 bytes
Database Buffers          448790528 bytes
Redo Buffers                5517312 bytes
Database mounted.
Database opened.
SQL> show parameter serial

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
_serial_direct_read                  string      FALSE
serial_reuse                         string      disable
SQL> select x.ksppinm, y.ksppstvl
  2  from x$ksppi x , x$ksppcv y
  3  where x.indx = y.indx
  4  and x.ksppinm like '_serial_direct_read'
  5  order by x.ksppinm; 

KSPPINM
--------------------------------------------------------------------------------
KSPPSTVL
--------------------------------------------------------------------------------
_serial_direct_read
FALSE


 

值得注意的是,_serial_direct_read的默认值是auto,

如下参考自:http://www.savedba.com/?p=619

在11gr2之后,当一个表的块数大于_small_table_threshold的时候,就被判定为大表,否则就视为小表。对于大表,在进行全表扫描的时候,oracle会根据_serial_direct_read的值来确定是否执行direct path read,如果值为auto,那就会direct path read。

 

参考文章:

http://www.eygle.com/archives/2012/05/oracle_11g_direct_path_read.html

http://www.savedba.com/?p=619


 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
以下是用Arduino编写的代码,通过PID算法控制舵机、DHT11温湿度传感器读取温湿度值: ``` #include <Servo.h> #include <dht.h> //定义引脚 #define dht11_pin 2 //DHT11连接的引脚 #define servo_pin 3 //舵机连接的引脚 //定义PID参数 double Setpoint_temp = 25.0; //设定温度值 double Input_temp, Output_temp; double Kp_temp = 4, Ki_temp = 0.2, Kd_temp = 1; //PID参数 double Setpoint_humi = 50.0; //设定湿度值 double Input_humi, Output_humi; double Kp_humi = 4, Ki_humi = 0.2, Kd_humi = 1; //PID参数 //创建PID对象 PID myPID_temp(&Input_temp, &Output_temp, &Setpoint_temp, Kp_temp, Ki_temp, Kd_temp, DIRECT); PID myPID_humi(&Input_humi, &Output_humi, &Setpoint_humi, Kp_humi, Ki_humi, Kd_humi, DIRECT); //创建dht11对象 dht DHT; //创建舵机对象 Servo myservo; void setup() { //初始化串口 Serial.begin(9600); //初始化舵机 myservo.attach(servo_pin); //设置初始位置 myservo.write(90); //初始化PID myPID_temp.SetMode(AUTOMATIC); myPID_humi.SetMode(AUTOMATIC); } void loop() { //读取温湿度 int chk = DHT.read11(dht11_pin); Input_temp = DHT.temperature; Input_humi = DHT.humidity; //如果读取成功 if (chk == DHTLIB_OK) { //计算PID myPID_temp.Compute(); myPID_humi.Compute(); //控制舵机 myservo.write(Output_temp); //输出温湿度值和舵机角度 Serial.print("Temperature = "); Serial.print(DHT.temperature); Serial.print(" *C, Humidity = "); Serial.print(DHT.humidity); Serial.print(" %%, Servo angle = "); Serial.println(Output_temp); //延时1秒 delay(1000); } } ``` 请注意,此代码仅供参考,并且需要根据实际硬件和应用场景进行修改和调整。

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值