上一页 1 2 3 4 5 6 ··· 8 下一页
  2017年2月6日
摘要: --type命令 >>> type(5) <class 'int'> >>> type(5.0) <class 'float'> >>> type('abc') <class 'str'> >>> type(None) <class 'NoneType'> --序列 字符串、元组、列表 正索引从0开 阅读全文
posted @ 2017-02-06 20:00 john2017 阅读(115) 评论(0) 推荐(0) 编辑
摘要: --查看内存相关参数SYS@ test10g> col name for a30SYS@ test10g> col value for a20SYS@ test10g> select name, value from v$parameter where name in('sga_max_size', 阅读全文
posted @ 2017-02-06 19:56 john2017 阅读(448) 评论(0) 推荐(0) 编辑
摘要: --内存分配建库时可以先分配系统内存的50%-80%给Oracle,后期根据业务再进行调整。SGA、PGA分配比例:OLTP:SGA %80 , PGA %20OLAP:SGA %50 , PGA %50混合:SGA %60 , PGA %40 --sga自动管理statistics_level 值 阅读全文
posted @ 2017-02-06 19:55 john2017 阅读(243) 评论(0) 推荐(0) 编辑
摘要: --查看执行计划方法1、关于Autotrace几个常用选项的说明:SET AUTOTRACE OFF -- 不生成AUTOTRACE 报告,这是缺省模式SET AUTOTRACE ON -- 包含执行计划和统计信息SET AUTOTRACE ON EXPLAIN -- AUTOTRACE只显示优化器 阅读全文
posted @ 2017-02-06 19:54 john2017 阅读(327) 评论(0) 推荐(0) 编辑
摘要: --得到所有表空间的ddl语句 SELECT DBMS_METADATA.GET_DDL('TABLESPACE', TS.tablespace_name)FROM DBA_TABLESPACES TS; --得到所有创建用户的ddl语句 SELECT DBMS_METADATA.GET_DDL(' 阅读全文
posted @ 2017-02-06 19:52 john2017 阅读(5437) 评论(0) 推荐(0) 编辑
摘要: merge into copy_emp1 c using employees e on (c.employee_id=e.employee_id)when matched then update set c.first_name=e.first_name, c.last_name=e.last_na 阅读全文
posted @ 2017-02-06 19:51 john2017 阅读(1144) 评论(0) 推荐(0) 编辑
摘要: SELECT first_name, last_nameFROM employeesWHERE REGEXP_LIKE (first_name, '^Ste(v|ph)en$'); FIRST_NAME LAST_NAME Steven KingSteven MarkleStephen Stiles 阅读全文
posted @ 2017-02-06 19:51 john2017 阅读(2336) 评论(0) 推荐(0) 编辑
摘要: --with 重用子查询对于多次使用相同子查询的复杂查询语句来说,用户可能会将查询语句分成两条语句执行。第一条语句将子查询结果存放到临时表,第二条查询语句使用临时表处理数据。从 Oracle 9i 开始,通过 with 子句可以给予子查询指定一个名称,并且使得在一条语句中可以完成所有任务,从而避免了 阅读全文
posted @ 2017-02-06 19:50 john2017 阅读(817) 评论(0) 推荐(0) 编辑
摘要: --合并(UNION、UNION ALL) select * from empwhere ename like '%A%'unionselect * from empwhere ename like '%M%' UNION ALL不会取消重复和排序 --和合并效果一样 select * from e 阅读全文
posted @ 2017-02-06 19:49 john2017 阅读(172) 评论(0) 推荐(0) 编辑
摘要: 1、嵌套循环联结(NESTED LOOPS)2、哈希联结(HASH JOIN)3、排序合并联结(MERGE JOIN)4、半联结(in/exists)5、反联结(not in/not exists)6、笛卡儿联结(MERGE JOIN CARTESIAN)7、外连联结 left outer join 阅读全文
posted @ 2017-02-06 19:48 john2017 阅读(2240) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 ··· 8 下一页