详解Oracle创建表的参数
详解Oracle创建表的参数 create table mytable( idnumber(3), name varchar2(10))PCTFREE 20PCTUSED 70INITRANS 2MAXTRANS 255TABLESPACE usersSTORAGE ( IN...
经典SQL面试题4:高效的删除重复记录方法
经典SQL面试题4:高效的删除重复记录 需求:删除表中的重复记录,无需考虑排列顺序 1 创建表create table emp(idnumber(5), name varchar2(10)); 2 插入数据insert into emp(id, name)values(1,'刘大');insert into emp(id, name) values(2,'陈二...
Oracle批量插入测试数据的方法
Oracle批量插入测试数据的方法需要:经常碰到需要插入大量测试数据的情景,如果一条一条插入,太麻烦。可以采用序列+函数+匿名块(或存储过程)的方式解决。 下列步骤演示了插入1000条数据的方法: 1 创建表create table emp (id number(4),name varchar2(10)); 2 ...
SQL面试题3:获取平均工资最高的三个部门
SQL面试题3:获取平均工资最高的三个部门 1 创建表格并输入数据create table company(id int, name varchar2(10), salary number, deptnoint);insert into company values(101, 'Zheng', 5000, 1);insert into company values(102, 'Zhang', 6000, 1);insert into company values(103, 'Li...
Oracle dblink比较两个库中的表字段
Oracle dblink比较两个库中的表字段 1A库IP为10.0.30.65,olduser用户下有个表oldtable,该表只有一个列oldid。B库IP为10.0.30.64,newuser用户下有个表newtable,该表只有一个列newid。 在A库中执行create user olduser identified by old123;grant connect, resource to ...
Oracle Scheduler(5)job调用program
BEGINdbms_scheduler.create_program ( program_name=> 'my_program', program_action=> 'E:\mytest.bat', program_type=> 'EXECUTABLE', enabled=> TRUE );END;/上述程序中,E:\mytest.bat中的内容为mkdir mydir作用是创建一个名为mydir的文件夹。BEGINdbms_scheduler.creat...
Oracle Scheduler(4)job调用program和schedule
program决定做什么;schedule决定何时做;job则起到触发的作用:做。BEGINdbms_scheduler.create_program ( program_name=> 'my_program', program_action=> 'E:\mytest.bat', program_type=> 'EXECUTABLE', enabled=> TRUE );END;/BEGINdbms_scheduler.create_schedule (&nbs...
oracle根据分组查百分比
create table test20151026(id int, group_name varchar2(10));insert into test20151026 values (1, 'A');insert into test20151026 values (2, 'A');insert into test20151026 values (3, 'A');insert into test20151026 values (4, 'B');insert into test20151026 values (5, 'B');commit;select sum_G, sum_G/t...
Oracle Scheduler(3)调用批处理
Oracle Scheduler调用批处理(2) (一)用system用户创建一个表 create table test20151021(id int); (二)在D盘根目录下创建test.sql,内容为 declare i int; begin for i in 1..5 loop ...
Oracle Scheduler(2)调用批处理
Oracle Scheduler调用批处理(一)在D盘目录创建test.bat,其内容为mkdir mydir这个批处理的作用是创建一个名为mydir的文件夹(二)用Oracle Scheduler创建Job来调用test.batBEGIN DBMS_SCHEDULER.CREATE_JOB ( job_name &nbs...
Oracle PL/SQL循环示例
declare i int;begin for i in 1..10 loop insert into test20151021 values(i); end loop; commit;end;/
本机中查询远程Oracle中的blob对象
本机中查询远程Oracle中的blob对象 首先尝试用dblink的方式直接查询远程库中的blob对象 (1)远程库(IP为10.0.xx.xx)中用system用户创建带blog字段的表并插入一张图片 create tabletest20151016(a blob); create orreplace directory tmp as 'e:\'; ...
Oracle Scheduler(1)用法简介
OracleScheduler用法简介 (一)创建表和过程 create table test20151021 (id int); CREATE OR REPLACE PROCEDURE test_proc AS BEGIN insert into test20151021 values(1); END test_proc; / (二)创建Job BEGIN DBMS_SCHEDU...
Oracle插入Blob数据的方法
Oracle
Win8.1 中Administrator帐户无法修改tnsname.ora的解决方案
<span style="font-family:宋体;font-size:small;"> </span><p align="center" style="margin:0cm 0cm 10pt;text-align:center;line-height:11pt;"><span style="font-size:small;"><span lang="EN-US">Win8.1 </span><span style="font-family:"微软雅黑","sans-serif";mso-ascii-font-family:Taho...
Oracle Job定时执行任务
<span style="font-family:宋体;font-size:small;"> </span><p align="center" style="margin:0cm 0cm 0pt;"><span style="font-size:small;"><span style="font-family:Calibri;"><span lang="EN-US"><strong>Oracle Job</strong></span></span><span style="font-family:宋体;mso-ascii-font-family:Calibri;mso-ascii...
Oracle 11g无法导出空表的解决方案
<span style="font-family:宋体;font-size:small;"> </span><p align="center" style="margin:0cm 0cm 0pt;"><span style="font-size:small;"><span lang="EN-US" style="font-family:宋体;mso-ascii-theme-font:minor-fareast;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-hansi-theme-font...
Win7完全卸载Oracle
<span style="font-family:宋体;font-size:small;"> </span><h2 align="center" style="margin:13pt 0cm;text-align:center;"><span style="font-family:宋体;mso-ascii-theme-font:major-fareast;mso-fareast-font-family:宋体;mso-fareast-theme-font:major-fareast;mso-hansi-theme-font:major-fareast;"><span style...
Oracle全库导出和特定用户导入
<span style="font-family:宋体;font-size:small;"> </span><p align="center" style="margin:0cm 0cm 0pt;text-align:center;"><span style="font-size:small;"><b style="mso-bidi-font-weight:normal;"><span lang="EN-US" style="color:#1F497D;mso-themecolor:text2;"><span style="font-family:Calibri;">Oracle</...
PLSQL Develop打开不同字符集的数据库中文乱码解决方案
<span style="font-family:宋体;font-size:small;"> </span><h3 align="center" style="margin:13pt 0cm;"><a name="_Toc428462316"><span lang="EN-US" style="line-height:173%;font-family:宋体;font-size:14pt;mso-ascii-theme-font:major-fareast;mso-fareast-theme-font:major-fareast;mso-hansi-theme-font:major...