oracle exacc,【学习笔记】Oracle 11GR2新特性Adaptive Cursor Sharing(ACS)

天萃荷净

Oracle研究中心学习笔记:分享一篇关于Oracle 11.2.0.1 11Gr2数据库最新版本中最新特性Adaptive Cursor Sharing(ACS)深入研究笔记。

本站文章除注明转载外,均为本站原创: 转载自love wife & love life —Roger 的Oracle技术博客

本文链接地址: 11gR2 新特性之(一)Adaptive Cursor Sharing(ACS)

关于该特性,其实并不是11gR2开始引入的,其实在11gR1就引入了,只不过其问题较多,

并未引起太多关注而已(bug不少)。该特性主要解决了哪些问题?

● data skew (数据倾斜)

● bind peeking (绑定变量窥视)– oracle 9i 引入

1.如何理解ACS?

ACS will allow multiple execution plans for a statement that use bind variables

ensuring that the best execution plan will be used for a specific value of the bind variable.

通俗的讲,就是会根据绑定变量的值来智能判断选择最优的执行计划

例如:select * from tab_a where a=:x  可能存在多个不同的执行计划

关于该特性也是通过几个隐含参数来控制的,11gR2 默认为true,如下:

SQL> SHOW parameter _optimizer_adaptive

NAME                                 TYPE        VALUE

------------------------------------ ----------- ------------------------------

_optimizer_adaptive_cursor_sharing   BOOLEAN     TRUE

SQL> SHOW parameter optim_peek

NAME                                 TYPE        VALUE

------------------------------------ ----------- ------------------------------

_optim_peek_user_binds               BOOLEAN     TRUE

说明:

_optimizer_adaptive_cursor_sharing ==> ACS特性

_optim_peek_user_binds             ==> 绑定变量窥视

2.创建测试表

SQL> CREATE TABLE ht1 AS SELECT owner,object_id,object_name FROM dba_objects;

TABLE created.

SQL> SELECT COUNT(object_id) FROM ht1;

COUNT(OBJECT_ID)

----------------

71878

SQL> SELECT MAX(object_id) FROM ht1;

MAX(OBJECT_ID)

--------------

73406

SQL> UPDATE ht1 SET object_id=100 WHERE object_id < 73405;

71876 ROWS updated.

SQL> commit;

Commit complete.

SQL> UPDATE ht1 SET object_id=100 WHERE object_id < 73000;

71679 ROWS updated.

SQL> commit;

Commit complete.

SQL> UPDATE ht1 SET object_id=1000 WHERE object_id > 73000 AND object_id < 73300;

150 ROWS updated.

SQL> commit;

Commit complete.

SQL> UPDATE ht1 SET object_id=10000 WHERE object_id > 73329;

34 ROWS updated.

SQL> commit;

Commit complete.

SQL> UPDATE ht1 SET object_id=10000 WHERE object_id > 70000;

15 ROWS updated.

SQL> commit;

Commit complete.

SQL> SELECT object_id,COUNT(*) FROM ht1 GROUP BY object_id;

OBJECT_ID   COUNT(*)

---------- ----------

100      71679

1000        150

10000         49

SQL> CREATE INDEX idx_id ON ht1(object_id);

INDEX created.

SQL> EXEC dbms_stats.gather_table_stats(USER,'HT1',method_opt=>'for all columns size skewonly');

PL/SQL PROCEDURE successfully completed.

SQL> SELECT TABLE_NAME,COLUMN_NAME,DENSITY,HISTOGRAM

2  FROM user_tab_columns

3  WHERE TABLE_NAME='HT1';

TABLE_NAME                     COLUMN_NAME                       DENSITY HISTOGRAM

------------------------------ ------------------------------ ---------- ---------------

HT1                            OWNER                          6.9461E-06 FREQUENCY

HT1                            OBJECT_ID                      6.9461E-06 FREQUENCY

HT1                            OBJECT_NAME                    .000035426 HEIGHT BALANCED

SQL> ALTER system FLUSH shared_pool;

System altered.

SQL> var a NUMBER;

SQL> EXEC :a :=1000;

PL/SQL PROCEDURE successfully completed.

SQL> SELECT * FROM ht1 WHERE object_id =:a;

OWNER                           OBJECT_ID OBJECT_NAME

------------------------------ ---------- -----------------------------------

APEX_030200                          1000 WWV_MIG_ACC_LOAD

... ... ...                          ... ... ...

SYS                                  1000 WRH$_SQLSTAT_PK

SYS                                  1000 WRH$_SYSTEM_EVENT

150 ROWS selected.

SQL> SELECT * FROM TABLE(dbms_xplan.display_cursor);

PLAN_TABLE_OUTPUT

------------------------------------------------------------------------------------------

SQL_ID  9zq6asm9yfrc9, child NUMBER 0

-------------------------------------

SELECT * FROM ht1 WHERE object_id =:a

Plan hash VALUE: 2446245938

--------------------------------------------------------------------------------------

| Id  | Operation                   | Name   | ROWS  | Bytes | Cost (%CPU)| TIME     |

--------------------------------------------------------------------------------------

|   0 | SELECT STATEMENT            |        |       |       |     3 (100)|          |

|   1 |  TABLE ACCESS BY INDEX ROWID| HT1    |   223 |  7582 |     3   (0)| 00:00:01 |

|*  2 |   INDEX RANGE SCAN          | IDX_ID |   223 |       |     1   (0)| 00:00:01 |

--------------------------------------------------------------------------------------

Predicate Information (IDENTIFIED BY operation id):

---------------------------------------------------

2 - access("OBJECT_ID"=:A)

19 ROWS selected.

SQL> SELECT hash_value FROM v$sql WHERE sql_id='9zq6asm9yfrc9';

HASH_VALUE

----------

3555155337

SQL> SELECT CHILD_NUMBER,PLAN_HASH_VALUE,EXECUTIONS,

2         BUFFER_GETS/EXECUTIONS BG_PER_EX,

3         IS_BIND_SENSITIVE BS,IS_BIND_AWARE BA,IS_SHAREABLE S

4    FROM v$sql

5   WHERE hash_value='&hash_value';

Enter VALUE FOR hash_value: 3555155337

CHILD_NUMBER PLAN_HASH_VALUE EXECUTIONS  BG_PER_EX B B S

------------ --------------- ---------- ---------- - - -

0      2446245938          1        137 Y N Y

SQL> SELECT IS_OBSOLETE ,IS_BIND_SENSITIVE,IS_BIND_AWARE,IS_SHAREABLE,BIND_DATA

2  FROM v$sql

3  WHERE SQL_ID='9zq6asm9yfrc9';

I I I I BIND_DATA

- - - - ------------------------------------------------------------

N Y N Y BEDA0B2001004DFE20CD000101C0021602C20B

SQL> SELECT * FROM v$sql_cs_selectivity WHERE sql_id='9zq6asm9yfrc9';

no ROWS selected

3.测试说明:

这里有几个字段,需要解释一下,如下:

IS_OBSOLETE        ==> 是否废弃(cursor被废弃,起执行计划可能发生变化,通常情况下,其child cursor太大了,该游标将被obsolete)

IS_BIND_SENSITIVE  ==> 为Y表示启用了绑定变量窥视,SQL的执行计划取决于变量值

IS_BIND_AWARE      ==> 表示是否启动extended cursor sharing

IS_SHAREABLE       ==> 是否共享,如果不能共享,那么该SQL被page OUT出shared pool。

关于 extended cursor sharing,有2个参数,如下:

SQL> SHOW parameter extended_cursor

NAME                                    TYPE        VALUE

------------------------------------    ----------- ------------------------------

_optimizer_extended_cursor_sharing      string      UDO

_optimizer_extended_cursor_sharing_rel  string      SIMPLE

关于这2个隐含参数,还需要进一步研究。

SQL> var a NUMBER;

SQL> EXEC :a :=100;

PL/SQL PROCEDURE successfully completed.

SQL> SELECT * FROM ht1 WHERE object_id =:a;

OWNER                           OBJECT_ID OBJECT_NAME

------------------------------ ---------- -----------------------------------

... ... ...                           ... ... ...

... ... ...                           ... ... ...

APEX_030200                           100 APEX_MIGRATION_ACC_RPTS

APEX_030200                           100 APEX_MIGRATION_ACC_QUERIES

APEX_030200                           100 APEX_MIGRATION_REV_FORMS

APEX_030200                           100 APEX_MIGRATION_REV_RPTS

APEX_030200                           100 APEX_MIGRATION_REV_QUERIES

71679 ROWS selected.

SQL> SELECT * FROM TABLE(dbms_xplan.display_cursor);

PLAN_TABLE_OUTPUT

--------------------------------------------------------------------------------------

SQL_ID  9zq6asm9yfrc9, child NUMBER 0

-------------------------------------

SELECT * FROM ht1 WHERE object_id =:a

Plan hash VALUE: 2446245938

--------------------------------------------------------------------------------------

| Id  | Operation                   | Name   | ROWS  | Bytes | Cost (%CPU)| TIME     |

--------------------------------------------------------------------------------------

|   0 | SELECT STATEMENT            |        |       |       |     3 (100)|          |

|   1 |  TABLE ACCESS BY INDEX ROWID| HT1    |   223 |  7582 |     3   (0)| 00:00:01 |

|*  2 |   INDEX RANGE SCAN        | IDX_ID |   223 |       |     1   (0)| 00:00:01 |

--------------------------------------------------------------------------------------

Predicate Information (IDENTIFIED BY operation id):

---------------------------------------------------

2 - access("OBJECT_ID"=:A)  ###### 这里居然是INDEX range scan ######

###### 由于id=100的选择性非常差,此时走全表扫描才是正常的执行计划 ######

19 ROWS selected.

SQL> SELECT CHILD_NUMBER,PLAN_HASH_VALUE,EXECUTIONS,

2         BUFFER_GETS/EXECUTIONS BG_PER_EX,

3         IS_BIND_SENSITIVE BS,IS_BIND_AWARE BA,IS_SHAREABLE S

4    FROM v$sql

5   WHERE sql_id='9zq6asm9yfrc9';

CHILD_NUMBER PLAN_HASH_VALUE EXECUTIONS  BG_PER_EX B B S

------------ --------------- ---------- ---------- - - -

0      2446245938          2       5101 Y N Y

这里EXECUTIONS为2,说明这次的执行计划实际上是沿用的上次object_id为1000的执行计划。

再次执行相同的绑定变量值:

SQL> EXEC :a :=100;

PL/SQL PROCEDURE successfully completed.

SQL> SELECT * FROM ht1 WHERE object_id =:a;

OWNER                           OBJECT_ID OBJECT_NAME

------------------------------ ---------- -----------------------------------

... ... ...                           ... ... ...

... ... ...                           ... ... ...

APEX_030200                           100 APEX_MIGRATION_ACC_PROJECTS

APEX_030200                           100 APEX_MIGRATION_ACC_TABLES

APEX_030200                           100 APEX_MIGRATION_ACC_FORMS

APEX_030200                           100 APEX_MIGRATION_ACC_RPTS

APEX_030200                           100 APEX_MIGRATION_ACC_QUERIES

APEX_030200                           100 APEX_MIGRATION_REV_FORMS

APEX_030200                           100 APEX_MIGRATION_REV_RPTS

APEX_030200                           100 APEX_MIGRATION_REV_QUERIES

71679 ROWS selected.

SQL> SELECT * FROM TABLE(dbms_xplan.display_cursor);

PLAN_TABLE_OUTPUT

-------------------------------------------------------------------------

SQL_ID  9zq6asm9yfrc9, child NUMBER 1

-------------------------------------

SELECT * FROM ht1 WHERE object_id =:a

Plan hash VALUE: 3708914037

--------------------------------------------------------------------------

| Id  | Operation         | Name | ROWS  | Bytes | Cost (%CPU)| TIME     |

--------------------------------------------------------------------------

|   0 | SELECT STATEMENT  |      |       |       |   116 (100)|          |

|*  1 |  TABLE ACCESS FULL| HT1  | 71590 |  2377K|   116   (1)| 00:00:02 |

--------------------------------------------------------------------------

Predicate Information (IDENTIFIED BY operation id):

---------------------------------------------------

1 - FILTER("OBJECT_ID"=:A)    ###### 此时的执行计划就正确,变成了全表扫描 ######

18 ROWS selected.

SQL> SELECT CHILD_NUMBER,PLAN_HASH_VALUE,EXECUTIONS,

2         BUFFER_GETS/EXECUTIONS BG_PER_EX,

3         IS_BIND_SENSITIVE BS,IS_BIND_AWARE BA,IS_SHAREABLE S

4    FROM v$sql

5   WHERE sql_id='9zq6asm9yfrc9';

CHILD_NUMBER PLAN_HASH_VALUE EXECUTIONS  BG_PER_EX B B S

------------ --------------- ---------- ---------- - - -

0      2446245938          2       5101 Y N Y

1      3708914037          1       5159 Y Y Y

这里我们可以发现,该游标多了一个child,child 1就是对于前面的全表扫描执行计划,其执行次数为1.

如果我们再次执行相同的SQL,那么child 1的executions 必然会增加1.

如下:

SQL> EXEC :a :=100;

PL/SQL PROCEDURE successfully completed.

SQL> SELECT * FROM ht1 WHERE object_id =:a;

OWNER                           OBJECT_ID OBJECT_NAME

------------------------------ ---------- -----------------------------------

... ... ...                           ... ... ...

... ... ...                           ... ... ...

APEX_030200                           100 APEX_MIGRATION_REV_RPTS

APEX_030200                           100 APEX_MIGRATION_REV_QUERIES

71679 ROWS selected.

SQL> SELECT CHILD_NUMBER,PLAN_HASH_VALUE,EXECUTIONS,

2         BUFFER_GETS/EXECUTIONS BG_PER_EX,

3         IS_BIND_SENSITIVE BS,IS_BIND_AWARE BA,IS_SHAREABLE S

4    FROM v$sql

5   WHERE sql_id='9zq6asm9yfrc9';

CHILD_NUMBER PLAN_HASH_VALUE EXECUTIONS  BG_PER_EX B B S

------------ --------------- ---------- ---------- - - -

0      2446245938          2       5101 Y N Y

1      3708914037          2       5159 Y Y Y

SQL> SELECT CHILD_NUMBER,PREDICATE,RANGE_ID,LOW,HIGH

2  FROM v$sql_cs_selectivity

3  WHERE hash_value='3555155337';

CHILD_NUMBER PREDICATE                                  RANGE_ID LOW        HIGH

------------ ---------------------------------------- ---------- ---------- ----------

1 =A                                                0 0.896393   1.095591

在11.2的官方文档中,居然没有v$sql_cs_selectivity的说明,oracle也太扯淡了。

为什么说11gR2之前,这个新功能问题相对比较多多,metalink 搜索v$sql_cs_selectivity,居然有3个跟这个新特性相关的bug。

Bug 7213010  Adaptive cursor sharing generates lots of child cursors   --11.1.0.6

Bug 6644714 - High number of child cursors with adaptive cursor sharing  --11.1.0.6

Bug 8491399 - Adaptive Cursor Sharing does not match the correct cursor version for queries using CHAR datatype  --11.1.0.7

意外的收获是发现了一个查询V$SQL_CS_SELECTIVITY的 bug,如下:

Bug 10058195 - V$SQL_CS_SELECTIVITY columns are padded with chr(0) characters

不过这个bug不影响数据库正常使用。

补充:

跟11g自适应游标共享功能相关的有几个新的视图,平时我们可以借此来进行监控,如下:

V$SQL_CS_SELECTIVITY

V$SQL_CS_STATISTICS

V$SQL_CS_HISTOGRAM

关于这3个视图,oracle metalink的解释如下:

V$SQL_CS_SELECTIVITY exposes the valid selectivity ranges for a child cursor in extended

cursor sharing mode. Ahttp://www.oracleplus.net valid range consists of a low and high value

for each predicate containing binds. Each predicate's selectivity (with the current bind value) must

fall between the corresponding low and high values in order for the child cursor to be shared.

V$SQL_CS_STATISTICS contains the raw execution statistics used by the monitoring component

of adaptive cursor sharing. A sample of the executions is monitored.

This view exposes which executions were sampled, and what the statistics were for those

executions. The statistics are cumulative for each distinct set of bind values.

V$SQL_CS_HISTOGRAM summarizes the monitoring information stored by adaptive cursor

sharing. This information is used to decide whether to enable extended cursor sharing for a query. It

is stored in a histogram, whose bucket's contents are exposed by this view.

下面来查询一下看看;

SQL> SELECT * FROM V$SQL_CS_SELECTIVITY;

ADDRESS  HASH_VALUE SQL_ID        CHILD_NUMBER PREDICATE                                  RANGE_ID LOW        HIGH

-------- ---------- ------------- ------------ ---------------------------------------- ---------- ---------- ----------

2998C51C 3555155337 9zq6asm9yfrc9            1 =A                                                0 0.896393   1.095591

SQL> SELECT * FROM V$SQL_CS_STATISTICS WHERE sql_id='9zq6asm9yfrc9';

ADDRESS  HASH_VALUE SQL_ID        CHILD_NUMBER BIND_SET_HASH_VALUE P EXECUTIONS ROWS_PROCESSED BUFFER_GETS   CPU_TIME

-------- ---------- ------------- ------------ ------------------- - ---------- -------------- ----------- ----------

2998C51C 3555155337 9zq6asm9yfrc9            1           336594526 Y          1          71679        5159          0

2998C51C 3555155337 9zq6asm9yfrc9            0          3036353656 Y          1            300         137          0

SQL> SELECT * FROM V$SQL_CS_HISTOGRAM

2  WHERE sql_id='9zq6asm9yfrc9'

3  ORDER BY CHILD_NUMBER;

ADDRESS  HASH_VALUE SQL_ID        CHILD_NUMBER  BUCKET_ID      COUNT

-------- ---------- ------------- ------------ ---------- ----------

2998C51C 3555155337 9zq6asm9yfrc9            0          1          1

2998C51C 3555155337 9zq6asm9yfrc9            0          0          1

2998C51C 3555155337 9zq6asm9yfrc9            0          2          0

2998C51C 3555155337 9zq6asm9yfrc9            1          1          2

2998C51C 3555155337 9zq6asm9yfrc9            1          0          0

2998C51C 3555155337 9zq6asm9yfrc9            1          2          0

6 ROWS selected.

4.如下结论

V$SQL_CS_SELECTIVITY 用于查询cursor的最高值和最低值的选择性,oracle也正是根据其选择性来决定起执行计划的,不过内部机制现

在我还无法得知,比如 object_id 有1000个值,不可能每次不同的绑定变量值,oracle都去生成一个执行计划或产生一个child cursor,

那样的话,代价就非常高了。– 这个需要进一步研究。

V$SQL_CS_STATISTICS 从上面的查询,我们就可以看出,该视图用于查询每个child cursor的统计信息,比如buffer gets。

其实,从这个我们也可以用来判断sql的效率,这个不就是我们常说的逻辑读吗?

V$SQL_CS_HISTOGRAM 类似直方图一样,用于记录cursor的执行次数,从上面的查询,我们可以发现每个child cursor一共有3个bucket。

关于这里的bucket,目前还不知道是不是就是固定的3个bucket。– 这里也需要进一步研究证明。

另外如果修改了参数curso_sharing为similar或force的话,也可能会导致比较严重的后果,可能会出现大量的 mutex X waits for cursor等待。

故我们仍然建议设置为EXACT,从应用角度进行绑定变量。

既然我们说ACS功能很强悍,假如不想用这个功能呢,是否能关闭呢? 回答是肯定的,通过如下的方式:

ALTER system SET "_optimizer_extended_cursor_sharing_rel"=NONE;

ALTER system SET "_optimizer_extended_cursor_sharing"=NONE;

ALTER system SET "_optimizer_adaptive_cursor_sharing"=FALSE;

另外我在阅读metalink 文档Adaptive Cursor Sharing Overview [ID 740052.1] 的时候,还发现了如下的信息:

If any of the following checks fail ECS will be disabled

- Extended cursor sharing is disabled

- The query has no binds

- Parallel query is used

- Certain parameters like ("bind peeking"=false) are set

- Hints are in use

- Outlines are being used

- It is a recursive query

- The number of binds in a given sql statement are greater than 14.

换句话说,就是ACS功能,在上面几种情况下是起作用的。

--------------------------------------ORACLE-DBA----------------------------------------

最权威、专业的Oracle案例资源汇总之【学习笔记】Oracle 11GR2新特性Adaptive Cursor Sharing(ACS)

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/264428.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

鼠标屏幕取词-技术

二、小故事串起来&#xff0c;就是秘密所在 别以为刚才那几个小故事都是杂乱无章地堆在一起&#xff0c;只要你把它们看明白了&#xff0c;那取词的秘密也就大白于天下了。让我们看看词霸在几个小故事中各扮演了什么角色…… 1.获得鼠标当前位置 通过HOOK机制钩住系统中的鼠标消…

C# 之 HttpResponse 类

Response 对象&#xff0c;派生自HttpResponse 类&#xff0c;该类封装来自 ASP.NET 操作的 HTTP 响应信息。存在于System.Web命名空间下。 注&#xff1a;MIME(Multipurpose Internet Mail Extensions)多用途互联网邮件扩展类型就是设定某种扩展名的文件用一种应用程序来打开的…

oracle时间类型插入,oracle 插入时间字符串 Date类型

和MysqL不同&#xff0c;MysqL 可以直接插入 时间字符串的&#xff0c;UPDATE HR_EFF_EVALUATORSET LEVEL_ 2,ROLE_NAME_ 他评,ASSESS_ROLE_ 具体人员,ASSESS_WAY_ 10,WEIGHT_ 百分制,NOTE_ 欧敏测试,PLAN_ID_ 110001231000002,STATUS_ 0,CREATE_TIME_TO_DATE(2016-12-…

esper(4-3)-Non-Overlapping Context

语法 create context context_name start start_condition end end_condition 如&#xff1a; // 9点到17点此context才可用&#xff08;以引擎的时间为准&#xff09;。如果事件进入的事件不在此范围内&#xff0c;则不受该context影响 create context NineToFive start (0,…

牢骚贴

如果你不是在科研机构工作&#xff0c;抑或你不是自己做自己的项目&#xff0c;那么或许你会有我一样的情况。 老总要的是效率、效率、效率。。。。。。还是效率。他不管你用了什么oo或者设计技巧&#xff0c;他要的是在最短的时间完成项目&#xff0c;至于这个项目的可维护性、…

11个实用的CSS学习工具

为什么80%的码农都做不了架构师&#xff1f;>>> 1. 盒子模型的幻灯片 通过3D转换效果产生的互动的幻灯片。按向左或向右箭头键切换&#xff0c;全屏观看会有更好的效果。 2. CSS Diner 通过一个简单的小游戏让你学习CSS selector&#xff0c;输入正确的selector来完…

linux什么用户什么任务,Linux 用户

查看所有用户cat /etc/passwd查看linux下用户组cat /etc/group用cat /etc/passwd |cut -f 1 -d :系统默认用户 http://zhidao.baidu.com/question/133424460Linux 用户user和用户组group管理 概念主要讲在Linux 系统中用户和用户组管理的概念,相关命令&#xff1b;对单用户多任…

使用字符缓冲流读取数据

package text;import java.io.BufferedReader;import java.io.FileReader;import java.io.IOException; public class Buff5 { public static void main(String[] args) {          BufferedReader bosnull;          try {//      …

Google 节日徽标全集 (1999-2009) (下)

这是 Google 节日徽标全集的第三部分&#xff0c;也是最后一部分&#xff0c;包含 Google 2006 至 2009 年 2 月全部节日徽标。需要指出的是&#xff0c;这些徽标均来自 Google 国际站点&#xff0c;也就是 www.google.com&#xff0c;Google 在众多本地站点上还有大量本土化的…

HBuilder:最快的Web开发IDE

HBuilder&#xff1a;最快的Web开发IDE http://www.csdn.net/article/2014-02-07/2818326-HBuilder-the-fastest-web-ide发表于2014-02-11 10:38| 26194次阅读| 来源CSDN| 59 条评论| 作者CSDN移动前端开发HBuilder数字天堂王安Web开发HTML5DCloud摘要&#xff1a;HBuilder是DC…

linux如何利用命令保存文件,如何在Linux中将命令输出保存到文件?

有时&#xff0c;Unix命令的输出可以使我们了解到这种情况的重要性&#xff0c;在这种情况下&#xff0c;我们想保存结果以供以后参考&#xff0c;在本文中&#xff0c;我们将看到如何将命令的输出保存到文件中。创建一个新文件可以使用>符号和新文件名来保存磁盘使用命令的…

Pycharm 项目无法导入自己写的模块(问题记录贴)

问题&#xff1a; 从外部导入一个Python项目后&#xff0c;发现包错误&#xff0c;如图&#xff1a; 解决步骤&#xff1a; 1.将目录下的"5-6——apriori.py"复制一份&#xff0c;重命名为”apriori.py"&#xff1b; 2.查资料知&#xff0c;pycharm不会将当前文…

Win2000/XP/2003路由制作之Nat共享上网

Win2000/XP/2003&#xff08;必须SERVER&#xff08;服务&#xff09;版本的&#xff09;ROUTEROS不会或则你的路由器突然坏了。紧急情况下&#xff0c;为了让老板的网吧正常营业&#xff0c;随手找个电脑就可以正常工作了。好吧。言归正传。NAT服务器软硬件准备俗话说“巧妇难…

Linux中的Interrupted system call错误

2019独角兽企业重金招聘Python工程师标准>>> 最近公司的一个项目&#xff0c;上线时候遇到了一些问题&#xff0c;服务跑一段时间后连接不上。 发现报了Interrupted system call这个错误引起的。 查了下资料&#xff0c;大致原因是系统繁忙处理不过来导致的。 根据网…

linux进程通信发送方式,Linux服务器编程——Linux系统编程之进程通信

进程通信又称IPCIPC方法方法&#xff1a;管道(最简单)信号(开销最小)共享映射区/共享内存(无血缘关系)本地套接字(最稳定)Linux文件类型&#xff1a; - 文件d 目录l 符号链接s 套接字 伪文件b 块设备 伪文件c字符设备 伪文件p管道 …

EMOS 如何停止反病毒和防垃圾邮件功能

1、修改main.cf配置文件&#xff0c;红色部分为需要注释的部分vim /etc/postfix/main.cf# smtpd related configsmtpd_recipient_restrictions permit_mynetworks,permit_sasl_authenticated,reject_non_fqdn_hostname,reject_non_fqdn_sender,reject_non_fqdn_recipient,rejec…

图论部分简单总结

总的感受: 这里大概囊括了一下图论的基础知识&#xff0c;图论是一个比较考验思维的部分。 尤其是后面有关二分图,网络流等的分支,对建模转化的要求还是很高的。 进入正题了&#xff1a; 一、最短路&#xff1a; 这一个部分不想多讲&#xff0c;虽然是很基础的一个部分&#xf…

Oracle学习笔记:数据字典

oracle数据字典 说起字典&#xff0c;下面让我来打个比方。我们读书写字&#xff0c;靠的是什么&#xff1f;你会说&#xff1a;字&#xff01;那我问你&#xff0c;你所用的字又是什么呢&#xff1f;&#xff01;这时&#xff0c;你只可能把字典&#xff08;新华字典、康熙字典…

linux分区转换gpt命令,Linux中磁盘如何转换GPT格式

Fdisk命令虽然很交互&#xff0c;操作也方便&#xff0c;但是对于大于2T的磁盘无法操作&#xff0c;假如我们想用大于2T的磁盘怎么办?可以把磁盘转化为GPT格式。GPT格式的磁盘相当于原来MBR磁盘中原来保留4个partition table的416个字节只留第一个16个字节&#xff0c;类似于扩…

JAVA格式化当前日期或者取年月日

Date d new Date(); System.out.println(d); SimpleDateFormat sdf new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); String dateNowStr sdf.format(d); System.out.println("格式化后的日期&#xff1a;" dateNowStr); 转载于:https://www.cnblo…