摘要: --在我们无法修改源代码的时候,我们可以采用sqlprofile来改变执行计划 --新增一张测试表 create table test_emp as select * from scott.emp; --新建索引 create index idx_001 on test_emp(empno); --下面的语句正常是要走全表扫描的 select /*+ no_index(test_emp id... 阅读全文
posted @ 2017-12-05 09:47 xuzhong86 阅读(281) 评论(0) 推荐(0) 编辑
摘要: --在我们无法修改源代码的时候,我们可以采用sqlprofile来改变执行计划 --新增一张测试表 create table test_emp as select * from scott.emp; --新建索引 create index idx_001 on test_emp(empno); --下面的语句正常是要走全表扫描的 select /*+ no_index(test_emp id... 阅读全文
posted @ 2017-12-04 15:29 xuzhong86 阅读(487) 评论(0) 推荐(0) 编辑
摘要: -----sqlplus中执行(AWR时间段 ) @?/rdbms/admin/awrrpt.sql -----手工生成快照 exec dbms_workload_repository.create_snapshot();--语句三次执行,归入快照 --查询快照 select * from dba_hist_snapshot order by begin_interval_time ... 阅读全文
posted @ 2017-10-18 17:41 xuzhong86 阅读(145) 评论(0) 推荐(0) 编辑
摘要: -------------demo.ctl LOAD DATA INFILE * INTO TABLE DEPT APPEND FIELDS TERMINATED BY ',' ( DEPTNO, DNAME, LOC, LAST_UPDATA ) BEGINDATA 10,Sales,Virginia,2015-01-01 20,Accounting,Virginia,... 阅读全文
posted @ 2017-10-18 17:28 xuzhong86 阅读(328) 评论(0) 推荐(0) 编辑
摘要: --有些时时候需要提交别人你写的job脚本,用下面的存储就可以在命令窗口模式下输出全部的job代码;set serveroutput on size 1000000; create or replace procedure proc_generate_job_create_sql is begin DBMS_OUTPUT.ENABLE(buffer_size => null);... 阅读全文
posted @ 2017-10-09 11:59 xuzhong86 阅读(1655) 评论(0) 推荐(0) 编辑
摘要: ~~~待续 阅读全文
posted @ 2017-10-08 22:39 xuzhong86 阅读(719) 评论(0) 推荐(0) 编辑
摘要: 这里dname为空了。原因是一旦sqlldr遇到一个制表符,就会输出一个值(实际输出为:10,null,sales,null,virginia) 使用WHITESPACE加载正常 阅读全文
posted @ 2017-10-08 22:11 xuzhong86 阅读(2273) 评论(0) 推荐(0) 编辑
摘要: --生成错误日志表EMP_ERRbegin dbms_errlog.create_error_log('EMP','EMP_ERR'); end; --错误记录插入到EMP表中 insert into emp select * from emp log errors into EMP_ERR reject limit unlimited; 阅读全文
posted @ 2017-10-08 12:47 xuzhong86 阅读(175) 评论(0) 推荐(0) 编辑
摘要: -- Create table create table DEPT2 ( DEPTNO NUMBER(2) not null, DNAME VARCHAR2(14), LOC VARCHAR2(1000) ); alter table DEPT2 add constraint DEPT_PK primary key (DEPTNO); ------demo.c... 阅读全文
posted @ 2017-10-07 22:47 xuzhong86 阅读(849) 评论(0) 推荐(0) 编辑
摘要: create or replace directory MY_DIR as '/home/oracle/backup'; grant read,write on directory MY_DIR to public; drop directory MY_DIR; -- Data Pump Unload drop table all_objects_unload purge; --将表卸载成文... 阅读全文
posted @ 2017-10-07 20:14 xuzhong86 阅读(288) 评论(0) 推荐(0) 编辑