08 2012 档案
17 PL/SQL DDL&&SYS触发器
摘要:create table log_table( username varchar2(20), logon_time date, logoff_time date, address varchar2(20));create or replace trigger sys_trig1after logon on databasebegin insert into log_table(username,logon_time,address) values(ora_login_user,sysdate,ora_client_ip_address);end;create or replace trigge 阅读全文
posted @ 2012-08-17 08:14 Chenyong Liu 阅读(189) 评论(0) 推荐(0)
16 PL/SQL DML触发器
摘要:create or replace trigger trig1after insert on scott.testbegin dbms_output.put_line('添加成功...');end;create or replace trigger trig2after update on scott.testfor each row/*行触发,默认是表触发*/begin dbms_output.put_line('修改成功...');end;create or replace trigger trig3before delete on scott.testbe 阅读全文
posted @ 2012-08-16 16:27 Chenyong Liu 阅读(151) 评论(0) 推荐(0)
15 PL/SQL视图(虚拟表)
摘要:create or replace view my_view as select ename,job,sal,comm from emp;create or replace view my_view as select ename,job,sal,comm from emp with read only;create or replace view my_view as select emp.ename,dept.deptno,dept.dname from emp,dept where emp.deptno=dept.deptno with read only;drop view my_vi 阅读全文
posted @ 2012-08-16 16:26 Chenyong Liu 阅读(182) 评论(0) 推荐(0)
14 PL/SQL游标与分页
摘要:create or replace procedure my_pro5(v_deptno number) istype my_cursor is ref cursor;v_cursor my_cursor;v_ename emp.ename%type;v_sal emp.sal%type;begin open v_cursor for select ename,sal from emp where deptno=v_deptno; loop fetch v_cursor into v_ename,v_sal;/***游标向下移动***/ exit when v_cursor%notfound; 阅读全文
posted @ 2012-08-16 12:10 Chenyong Liu 阅读(222) 评论(0) 推荐(0)
13 PL/SQL包
摘要:create or replace package my_pack isprocedure my_pro2(v_sal in number,v_name varchar2);function my_fun(v_name varchar2) return number;end;create or replace package body my_pack isprocedure my_pro2(v_sal in number,v_name varchar2) isbegin update test set sal=v_sal where name=v_name;end;function my_fu 阅读全文
posted @ 2012-08-14 21:45 Chenyong Liu 阅读(136) 评论(0) 推荐(0)
12 PL/SQL函数
摘要:create or replace function my_fun(v_name varchar2)return number isv_annual_sal number;begin select sal*13 into v_annual_sal from test where name=v_name; return v_annual_sal;end;select my_fun('Allen') from test; 阅读全文
posted @ 2012-08-14 17:30 Chenyong Liu 阅读(137) 评论(0) 推荐(0)
11 PL/SQL编程基础B
摘要:create or replace procedure my_pro6(v_empno number) isv_job emp.job%type;begin select job into v_job from emp where empno=v_empno; if v_job='PRESIDENTt' then update emp set sal=sal+1000 where empno=v_empno; else if v_job='MANAGER' then update emp set sal=sal+500 where empno=v_empno; 阅读全文
posted @ 2012-08-14 17:30 Chenyong Liu 阅读(138) 评论(0) 推荐(0)
10 PL/SQL编程基础A
摘要:1 注释单行--多行/*...*/2 命名规则变量:v_name常量:c_name游标:name_cursor异常:e_nameBlock(pl/sql编程基本单元)(过程、函数、触发器、包)set serveroutput on;/***控制台显示开启***/declarev_name varchar2(20);begin select name into v_name from test where id=&id; dbms_output.put_line(v_name);exception when no_data_found then dbms_output.put_line( 阅读全文
posted @ 2012-08-14 10:31 Chenyong Liu 阅读(132) 评论(0) 推荐(0)
9 存储过程
摘要:create procedure my_pro isbegin insert into test values(6,'Ivan',3800);end;exec my_pro;create or replace procedure my_pro2(v_sal in number,v_name varchar2) isbegin update test set sal=v_sal where name=v_name;end;exec my_pro2(2000,'Ivan');/***参数默认in,也可以执行call my_pro2(2000,'Ivan 阅读全文
posted @ 2012-08-14 10:31 Chenyong Liu 阅读(113) 评论(0) 推荐(0)
8 序列与索引
摘要:序列1 序列对象可以被多个用户共享2 一般用于主键或唯一键3 select my_seq.currval from test;/***查看当前序列值,之前必须使用过my_seq.nextval***/CREATE SEQUENCE my_seqSTART WITH 1000INCREMENT BY 1NOCACHE/***CACHE 10(预先分配10个序列值)***/NOCYCLE;drop sequence my_seq;insert into test value(my_seq.nextval,'Allen',8000);索引1 单列索引(单列)和复合索引(多列)2 单列 阅读全文
posted @ 2012-08-12 16:30 Chenyong Liu 阅读(179) 评论(0) 推荐(0)
7 事务与锁
摘要:事务开启:1 登陆数据库后,第一次执行DML语句2 当事务提交后,第一次执行DML语句set autocommit on/off/***设置每次执行DML语句都自动提交***/事务提交:1 commit;2 执行DDL语句,事务自动提交3 正常退出SQL*Plus时自动提交事务,非正常退出则rollback事务回滚savepoint aa;/***设置保存点aa***/rollback to aa;/***回滚到aa后,aa之后的保存点和锁将被释放***/set transaction isolation level read committed(默认)/***不会出现脏读,可能出现不可重复读 阅读全文
posted @ 2012-08-11 14:05 Chenyong Liu 阅读(132) 评论(0) 推荐(0)
02 css
摘要:--什么是div+css?1 区别于表格定位,内容与样式分离2 div元素,存放文字、图片、其他元素3 css文件用于说明div中元素的样式(大小、颜色、背景、位置...)--选择器id选择器、class选择器、html元素选择器、通配符选择器--inline element& block element//行内元素能容纳文本或其他行内元素,如:、//块元素能容纳其他行内元素和块元素,如:、区别:(1)行内元素只占内容的宽度,块元素不管内容多少占全行(2)某些css属性对行内元素不生效,如:margin、left、right、width、height(与浏览器版本和类型有关)--标准流 阅读全文
posted @ 2012-08-06 17:10 Chenyong Liu 阅读(116) 评论(0) 推荐(0)
01 html
摘要:Html是一种标记语言,主要的用途是开发网页,使用html可以展现文字、图片、视频、声音…Tim Berners Lee--基本结构1 标记和元素、属性、符号实体2 Html文件不区分大小写3 不管这个html文件有多复杂,它的基本结构式 内容 如果没有内容,可以这样写 //元素就是标记//超链接、图片元素//表格的主要用途是显示数据和图片,布局//无序列表和有序列表//Html的框架元素多网页合并 阅读全文
posted @ 2012-08-06 16:43 Chenyong Liu 阅读(201) 评论(0) 推荐(0)
11 linux系统启动
摘要:1 BIOS自检2 启动grub/lilo3 运行linux内核并检测硬件4 运行系统的第一个进程init5 init读取系统引导配置文件/etc/inittab进行初始化6 /etc/rc.d/rc.sysinit系统初始化脚本7 /etc/rc.d/rcX.d/[K/S]*根据运行级别X配置服务8 终止以"K"开头的服务9 启动以"S"开头的服务10/etc/rc.d/rc.local执行本地特殊配置11执行其他服务 阅读全文
posted @ 2012-08-04 09:11 Chenyong Liu 阅读(145) 评论(0) 推荐(0)
10 命令
摘要:--gcc编译c1 gcc -c hello.c2 gcc -o hello hello.o3 ./hello--RHEL5.0切换到超级用户su - root--统计目录或文件所占磁盘大小du -b /home/chenyong--查看当前目录pwd--删除目录rm -rf dir--拷贝文件夹aa到home(递归拷贝)cp -r aa/ /homecp -rf aa/ /home(不询问直接覆盖aa里的全部文件)--建立连接ln -s /home/chenyong/Hello.java Hello--.bash_profile用于配置用户的环境变量,如:vi /home/chenyong/ 阅读全文
posted @ 2012-08-03 23:39 Chenyong Liu 阅读(127) 评论(0) 推荐(0)
09 ssh
摘要:--ssh secure shell多用户远程操作linux,进行widows和linux之间的文件的上传和下载安装和使用1 下载SSHSecureShellClient3.2.9.zip,直接安装2 使用ping命令确保windows和linux主机间网络连通3 打开22号端口 执行命令:/etc/init.d/sshd start4 关闭windows防火墙5 quick connect HostName:linux主机ip UserName:linux用户名 阅读全文
posted @ 2012-08-03 22:47 Chenyong Liu 阅读(133) 评论(0) 推荐(0)
08 setup eclipse,tomcat,mysql
摘要:--eclipse,tomcat,mysql1、下载eclipse-java-juno-linux-gtk.tar.gzapache-tomcat-7.0.29.tar.gzMySQL-server-5.5.25a-1.rhel5.i386.rpmMySQL-client-5.5.25a-1.rhel5.i386.rpm2、安装//eclipse和tomcat直接解压缩即可//安装mysql(1)rpm -ivh MySQL-server-5.5.25a-1.rhel5.i386.rpmrpm -ivh MySQL-client-5.5.25a-1.rhel5.i386.rpm(2)安装完成后 阅读全文
posted @ 2012-08-01 11:20 Chenyong Liu 阅读(287) 评论(0) 推荐(0)