随笔分类 -  数据库

DATABASE
摘要:--查询用户scott下所有的表名 select table_name from all_tables where owner='SCOTT'; --查询表EMP所有字段的信息 select * from all_tab_columns where table_name='EMP' ; --表中的索 阅读全文
posted @ 2017-04-11 14:02 FoxLegend 阅读(216) 评论(0) 推荐(0)
摘要:1.少用in操作字符 2.not exists 或者外连接替代not in 无法使用索引 3.不用<>或!= 对全表进行了扫描,无法使用索引 4.设计表,把索引设置为not null. 判断为空无法应用索引,b树索引不索引空值 5.不用'%'和 '_'作为第一个操作符. 无法使用索引,且对表进行全表 阅读全文
posted @ 2017-04-11 13:57 FoxLegend 阅读(470) 评论(0) 推荐(0)
摘要:--禁止工作人员在休息日改变雇员信息触发器 create or replace trigger tr_src_emp before insert or update or delete on emp begin if to_char(sysdate,'DY','nls_date_langage=AM 阅读全文
posted @ 2017-02-21 10:14 FoxLegend 阅读(250) 评论(0) 推荐(0)
摘要:绕过管理员身份进行登录: sqlplus /nolog conn /as sysdba 如何创建一个普通用户: 1.create user jsd1412 identified by jsd1412 授权: grant connect to jsd1412 >连接oracle的权限 grant re 阅读全文
posted @ 2017-02-21 10:07 FoxLegend 阅读(607) 评论(0) 推荐(0)