易截截图软件、单文件、免安装、纯绿色、仅160KB

Oracle Database 的学习笔记

SQL:结构化查询语言
C R U D: 增删改查
table :  name  age  score
desc+表名    ---> 查询表结构
或者用 describe 命令 (desc是describe的简写)
查询语言:SELECT [DISTINCT] {*,column[alias],...} from table;
  SELECT identifies what columns from identifies which table
 ******* SELECT  查什么  from  从哪里查 *******
 
 SELECT dept_id,last_name,manager_id from s_emp;
 遇到空值时可以这样操作:
  SELECT last_name,title,salary*NVL(commission_pct,0)/100 COMM from s_emp;
 排除查询时出现重名现象 ,用关键字 DISTINCT
   eg:  SELECT DISTINCT name from s_dept;
 排除两个字段连合起来还有重复的现象:
   eg:  SELECT DISTINCT dept_id,title from s_emp;
 对查询的结果进行排序用 ORDER BY;
   eg:  SELECT last_name "姓名",salary "工资" from s_emp ORDER BY salary;
   (默认是升序排序)
   eg:  SELECT last_name "姓名",salary "工资" from s_emp ORDER BY salary asc;
   (asc指定为升序排序)
   eg:  SELECT last_name "姓名",salary "工资" from s_emp ORDER BY salary desc;
   (desc指定为降序排序)
 
  总结:order by 排序
        asc      升序
        desc     降序
  select last_name EMPLOYEE,start_date from s_emp order by EMPLOYEE desc;
  (在排序的时候可以用别名当做字段[排序的根据]进行排序)--->这里是(EMPLOYEE)。
  select last_name,salary*12 from s_emp order by 2;
  (这里的2是用来指定字段的位置,这里指向 salary*12 ,即按员工的年薪排序)
  select last_name,dept_id,salary from s_emp order by dept_id,salary desc;
  (先按dept_id的升序进行排序,排完后再按salary的降序进行排序)
  注:这里dept_id后没有直接指排序规则,按默认的升序排序。
 
  WHERE关键字:
  SELECT 姓名,部门ID from s_emp WHERE dept_id = 42;
  (


相关文档:

oracle database system parameters on sol9

* start Oracle *
set noexec_user_stack=1
set msgsys:msginfo_msgmax=65535
set msgsys:msginfo_msgmnb=65535
set msgsys:msginfo_msgmap=258
set msgsys:msginfo_msgmni=1792
set msgsys:msginfo_msgssz=32
set msgsys:msginfo_msgtql=1792
set msgsys:msginfo_msgseg=32767
set shmsys:shminfo_shmmax=4294967 ......

如何导入ORACLE 备份文件

--创建用户
create user iagent identified by ia
profile default 
default  tablespace users
temporary tablespace temp
account unlock;
 
--给创建的用户授权
grant create user,drop user,alter user,create any view,drop any view,exp_full_database,imp_full_database,dba,connect,resour ......

oracle里的常用命令

第四章:索引
1.creating function-based indexes
sql> create index summit.item_quantity on summit.item(quantity-quantity_shipped);
 
2.create a B-tree index
sql> create [unique] index index_name on table_name(column,.. asc/desc) tablespace
sql> tablespace_name [pctfree integer] ......

Windows下命令行下启动ORACLE服务


    * 检查监听器状态:
      C:\>lsnrctl status
      LSNRCTL for 32-bit Windows: Version 9.2.0.1.0 - Production on 30-6月 -2009 21:08
      :04
      Copyright (c) 1991, 2002, ......

【转】 Oracle中分析表的作用

Oracle中分析表的作用
http://diegoball.javaeye.com/blog/568009
文章分类:数据库
1.分析更新表的统计信息,,有可能导致执行计划改变..
2.以的analyze table abc compute statistics;这条为例,生成的统计信息会存在于user_tables这个视图,查看一下select * from user_tables where table_name='ABC';
观察一下NUM_RO ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号