随笔分类 -  oracle

摘要:Sequence: Define a Sequence to generate sequential numbers automatically example:可以在 update、select、insert语句中使用 阅读全文
posted @ 2019-09-11 11:00 酸奶加绿茶 阅读(215) 评论(0) 推荐(0)
摘要:使用 set unused 选项标记不再使用的列 使用 drop unsused columns 丢弃标记为unused的列 alter table tabName set unused column colName; 或alter table tabName set unused (colName 阅读全文
posted @ 2019-09-11 10:09 酸奶加绿茶 阅读(225) 评论(0) 推荐(0)
摘要:Put a table into read-only mode,which prevents DDL or DML changes during table maintenance Put the table back into read/write mode alter table XX READ 阅读全文
posted @ 2019-09-11 09:58 酸奶加绿茶 阅读(255) 评论(0) 推荐(0)
摘要:并集合 union/uinon all union 会去重,uinon all 不去重 交集 intersect 差集 minus 阅读全文
posted @ 2019-09-10 11:55 酸奶加绿茶 阅读(191) 评论(0) 推荐(0)
摘要:参考资料: 1.https://blog.csdn.net/li19236/article/details/41621179 阅读全文
posted @ 2019-09-02 11:24 酸奶加绿茶 阅读(1743) 评论(0) 推荐(0)
摘要:格式:TO_CHAR(number,'format_model') 9 -->Represents a number 0 --> Forces a zero to be displayed . -->Prints a decimal point , --> Prints a comma as a t 阅读全文
posted @ 2019-08-28 07:54 酸奶加绿茶 阅读(46772) 评论(0) 推荐(0)
摘要:举例: 查找姓名为M%的员工。 select * from employee where staff_name like 'M\%' escape '\'; 阅读全文
posted @ 2019-08-26 08:33 酸奶加绿茶 阅读(349) 评论(0) 推荐(0)
摘要:作用:Increase readability and usability (增加可读性和可用性) 用法:select q'[ select * from ]'||table_name|| ';' from all_tables; q'[ ]' 其中[] 可以改变为其他任意字符 阅读全文
posted @ 2019-08-25 13:34 酸奶加绿茶 阅读(1647) 评论(0) 推荐(0)
摘要:1.简单的例子 2.使用游标,loop循环 3.for循环 阅读全文
posted @ 2019-08-15 15:04 酸奶加绿茶 阅读(217) 评论(0) 推荐(0)
摘要:/* 1.求圆的面积 */ create or replace procedure proc_1 is pi constant number(9,7):=3.1415927; radius integer(5); area number(14,2); begin radius:=3; area:= pi*power(radius,2); insert into areas values(radiu 阅读全文
posted @ 2019-08-15 15:03 酸奶加绿茶 阅读(152) 评论(0) 推荐(0)
摘要:一、定义 同义词顾名思义,是数据库方案对象的一个别名。这里的数据库方案对象指表、视图、序列、存储过程、包等。 二、同义词的好处 1、不占内存空间,节省大量的数据库空间 2、简化了数据库对象的访问 3、提高了数据库对象访问的安全性 4、扩展的数据库的使用范围,能够在不同的数据库用户之间实现无缝交互;同 阅读全文
posted @ 2019-07-30 10:19 酸奶加绿茶 阅读(1628) 评论(0) 推荐(0)
摘要:临时表:像普通表一样,有结构,但是对数据的管理上不一样,临时表存储事务或会话的中间结果集,临时表中保存的数据只对当前会话可见,所有会话都看不到其他会话的数据,即使其他会话提交了,也看不到。临时表不存在并发行为,因为他们对于当前会话都是独立的。(它默认是事务级别的) 在oracle中临时表可分为会话级 阅读全文
posted @ 2019-07-24 11:50 酸奶加绿茶 阅读(360) 评论(0) 推荐(0)
摘要:什么是并行度: 并行度的优点就是能够最大限度的利用机器的多个cpu资源,是多个cpu同时工作,从而达到提高数据库工作效率的目的。在系统空闲时间,使用并行是个不错的选择,但是好东西总是相对而言,没有绝对的好坏,不当的使用,同样会引起数据库的新的问题产生。 1、查看并行度 2、修改并行度 3、在语句中指 阅读全文
posted @ 2019-07-23 18:30 酸奶加绿茶 阅读(1059) 评论(0) 推荐(0)
摘要:反键索引又叫反向索引,不是用来加速数据访问的,而是为了均衡IO,解决热块而设计的比如数据这样: 1000001 1000002 1000005 1000006 在普通索引中会出现在一个叶子上,如果部门数据需求极大,也就是热块,多个需求之间就会有请求竞争。 为了避开竞争 建反键索引 它会将数据逆转 1 阅读全文
posted @ 2019-07-23 13:02 酸奶加绿茶 阅读(882) 评论(0) 推荐(0)
摘要:1.oracle11g查看自动收集统计信息是否开启 https://blog.csdn.net/xqzhang8/article/details/72758208 2.手动分析某张表 exec dbms_stats.gather_table_ststs('ownname','tabname'); 3 阅读全文
posted @ 2019-07-18 16:34 酸奶加绿茶 阅读(465) 评论(0) 推荐(0)
摘要:https://docs.oracle.com/en/ 阅读全文
posted @ 2019-07-18 14:24 酸奶加绿茶 阅读(106) 评论(0) 推荐(0)
摘要:参考资料: 1.https://www.cnblogs.com/kaishirenshi/p/9151807.html 阅读全文
posted @ 2019-07-17 18:33 酸奶加绿茶 阅读(136) 评论(0) 推荐(0)
摘要:参考资料: 1.创建物化视图详解 2.https://www.cnblogs.com/jianshuai520/p/10246136.html 阅读全文
posted @ 2019-07-16 11:59 酸奶加绿茶 阅读(189) 评论(0) 推荐(0)
摘要:用户user1对表进行了更新操作,用户user2在user1还没有进行提交前读表中数据,而且是大批量的读取(打个比方:耗时3分钟)而在这3分钟内user1进行了提交操作,那又会产生什么影响呢?这个时候怎么保证读写一致性呢?这个时候DBMS就要保证有足够大的undo表空间来存放修改前的数值,,以保证u 阅读全文
posted @ 2019-07-12 10:37 酸奶加绿茶 阅读(718) 评论(0) 推荐(0)
摘要:1.当前时间加减一年 加一年 select sysdate,add_month(sysdate,12) from dual; 减一年 select sysdate,add_month(sysdate,-12) from dual; 2.字符串转时间 select to_date('2018-1-23 阅读全文
posted @ 2019-06-27 11:56 酸奶加绿茶 阅读(186) 评论(0) 推荐(0)