Bo's Oracle Station

查看: 2758|回复: 0

第56/57次:2015-09-05 星期六上下午

[复制链接]

1005

主题

1469

帖子

1万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
12012
发表于 2015-9-5 21:39:37 | 显示全部楼层 |阅读模式
本帖最后由 botang 于 2015-9-5 22:02 编辑

select  * from dba_indexes i where i.owner='HR'
  and i.table_name   like 'TBIG%';
  
select  * from dba_constraints c where c.owner='HR'
  and c.table_name   like 'TBIG%';
  
  
select  segment_name, bytes/1024/1024
from dba_segments s where s.owner='HR' and
   s.segment_name  like 'TBIG%';
   
   
   alter system flush buffer_Cache;
   
   alter system flush shared_pool;
   
   select  * from hr.emp;
   
   select  * from hr.dept;
   
   
   create table hr.tpasswd
    ( i_username  varchar2(100),
      i_password  char(1),
      i_uid  number(10),
      i_gid  number(10),
      i_comment  varchar2(100),
      i_home   varchar2(60),
      i_shell   varchar2(100) ) ;
      
   select  * from hr.tpasswd;
   truncate table hr.tpasswd;
   
   select  * from hr.emp;
   
   select  * from hr.proj  order by 1;
   
   
   truncate table  hr.emp;
   
   select  * from hr.t_bank_invoice;
   
   truncate table hr.t_bank_invoice;
   
   create directory  datadir1  as '/home/oracle/datadir1';
   
   create directory  datadir2  as '/home/oracle/datadir2';
   
   create directory  baddir  as '/home/oracle/baddir';
   
   create directory  logdir  as '/home/oracle/logdir';
   
   grant  read,write  on directory  datadir1   to hr;
   
   
   grant read,write on directory    datadir2  to hr;
   
    grant read, write on directory    logdir to hr;
   
   grant read,write on directory    baddir to hr;
   
   
   CREATE TABLE hr.extab_employees
                  (employee_id       NUMBER(4),
                   first_name        VARCHAR2(20),
                                      last_name         VARCHAR2(25),
                                         hire_date         DATE);

   
drop table hr.extab_employees;

select  * from dba_tables t where t.owner='HR' ;

select  * from dba_external_tables  t where t.owner='HR';

create directory  dirdump  as '/home/oracle/dirdump';

select  * from dba_datapump_jobs;

select  * from system.FULL_JOB1;


   

c.ctl:
  1. LOAD DATA
  2. infile 'data02.dat'
  3. APPEND
  4. INTO TABLE HR.EXTAB_EMPLOYEES
  5. FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
  6. trailing nullcols
  7. (
  8.   EMPLOYEE_ID INTEGER EXTERNAL,
  9.   FIRST_NAME CHAR,
  10.   LAST_NAME CHAR,
  11.   HIRE_DATE DATE(11)  "DD-mon-YYYY"
  12. )
复制代码
c.sql:
  1. CREATE TABLE hr.extab_employees
  2. (
  3.   "EMPLOYEE_ID" NUMBER(4),
  4.   "FIRST_NAME" VARCHAR2(20),
  5.   "LAST_NAME" VARCHAR2(25),
  6.   "HIRE_DATE" DATE
  7. )
  8. ORGANIZATION external
  9. (
  10.   TYPE oracle_loader
  11.   DEFAULT DIRECTORY DATADIR1
  12.   ACCESS PARAMETERS
  13.   (
  14.     RECORDS DELIMITED BY NEWLINE CHARACTERSET AL32UTF8
  15.     BADFILE BADDIR:'data%a_%p.bad'
  16.     LOGFILE LOGDIR:'data%a_%p.log'
  17.     READSIZE 1048576
  18.     FIELDS TERMINATED BY "," OPTIONALLY ENCLOSED BY '"' LDRTRIM
  19.     MISSING FIELD VALUES ARE NULL
  20.     REJECT ROWS WITH ALL NULL FIELDS
  21.     (
  22.       "EMPLOYEE_ID" CHAR(255)
  23.         TERMINATED BY "," OPTIONALLY ENCLOSED BY '"',
  24.       "FIRST_NAME" CHAR(255)
  25.         TERMINATED BY "," OPTIONALLY ENCLOSED BY '"',
  26.       "LAST_NAME" CHAR(255)
  27.         TERMINATED BY "," OPTIONALLY ENCLOSED BY '"',
  28.       "HIRE_DATE" CHAR(11)
  29.         TERMINATED BY "," OPTIONALLY ENCLOSED BY '"'
  30.         DATE_FORMAT DATE MASK "DD-mon-YYYY"
  31.     )
  32.   )
  33.   location
  34.   (
  35.     DATADIR2:'data02.dat', DATADIR1:'data01.dat'
  36.   )
  37. )
  38. parallel
  39. REJECT LIMIT UNLIMITED;
复制代码


[oracle@station90 ~]$ vim 1.txt
[oracle@station90 ~]$ cut -c 1 1.txt  
a
[oracle@station90 ~]$ cut -c 1 1.txt   > 1a.txt
[oracle@station90 ~]$ cut -c 3 1.txt   
b
[oracle@station90 ~]$ cut -c 3 1.txt   > 1b.txt
[oracle@station90 ~]$ cut -c 5 1.txt  
c
[oracle@station90 ~]$ cut -c 5 1.txt  > 1c.txt
[oracle@station90 ~]$ cut -c 7 1.txt  
d
[oracle@station90 ~]$ cut -c 7 1.txt   > 1d.txt
[oracle@station90 ~]$ paste -d ',' 1a.txt  1b.txt  
a,b
[oracle@station90 ~]$ paste -d ',' 1a.txt  1b.txt   > 1ab.txt
[oracle@station90 ~]$ paste -d ','  1ab.txt  1c.txt  > 1abc.txt
[oracle@station90 ~]$ paste -d ','  1abc.txt  1d.txt > 1abcd.txt
[oracle@station90 ~]$ vim 1abcd.txt
[oracle@station90 ~]$ vim 1.txt
[oracle@station90 ~]$ vim 1.txt

my2.par:

directory=dir1
dumpfile=my2.dmp  
schemas=hr
job_name=my2_job  
exclude=table:"in ('T_BANK_INVOICE')", procedure:"in ('SECURE_DML')"  
query='employees:where department_id=90'
flashback_time='2014-10-14:20:34:12'

bank.zip

2.26 KB, 下载次数: 800

dir.tar.gz

1.11 KB, 下载次数: 769

9isqlldr.tar.gz

933.43 KB, 下载次数: 756

bank.zip

2.26 KB, 下载次数: 808

回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|手机版|Bo's Oracle Station   

GMT+8, 2024-11-24 10:39 , Processed in 0.039142 second(s), 27 queries .

快速回复 返回顶部 返回列表