Home PC Games Linux Windows Database Network Programming Server Mobile  
  Home \ Database \ Oracle to create an external table     - Win7 used Eclipse to connect the virtual machine in Ubuntu Hadoop2.4 (Server)

- Nginx request processing (Server)

- SUSE Firewall Configuration (Linux)

- Linux firewall Iptables study notes (Linux)

- Linux operating system security management skills (Linux)

- Linux operating system Samba server configuration and use (Server)

- Linux operating system, the internal and external security overview (Linux)

- Some Linux networking tools you might not know (Linux)

- High-performance JavaScript DOM programming (Programming)

- Sqoop data export import command (Database)

- Linux SSH remote connection service slow Solutions (Linux)

- Linux System Administrator common interview questions and answers 30 (Linux)

- Executable file format Explanation under Linux (Linux)

- MySQL tmpdir parameter modification (Database)

- Hardware Firewall Basics (Linux)

- Windows 7 hard disk to install Ubuntu 15.04 (Linux)

- Differences Shell scripting languages and compiled languages (Programming)

- Android Sets the system screen brightness (Programming)

- Java framework for parallel study - ForkJoin (Programming)

- Deploy the project to the server from GitHub (Server)

  Oracle to create an external table
  Add Date : 2017-08-31      
  Oracle db allows read-only queries in the form of an external table. External table can be stored in any storage device that can be read in oracle db, its contents are not stored in db, db saves only the external table metadata, db can query (join, sort) external table, you can create a view, synonym, but not You can execute DML statements.

Create an external table syntax create table ...... orginzition external, can put a hypothetical external table view, you can do a normal select.
analyze and virtual column table analysis does not use external tables

Create an external table syntax
External table file:
360, Jane, Janus, ST_CLERK, 121,17-MAY-2001,3000,0,50, jjanus
361, Mark, Jasper, SA_REP, 145,17-MAY-2001,8000, .1,80, mjasper
362, Brenda, Starr, AD_ASST, 200,17-MAY-2001,5500,0,10, bstarr
363, Alex, Alda, AC_MGR, 145,17-MAY-2001,9000, .15,80, aalda
401, Jesse, Cromwell, HR_REP, 203,17-MAY-2001,7000,0,40, jcromwel
402, Abby, Applegate, IT_PROG, 103,17-MAY-2001,9000, .2,60, aapplega
403, Carol, Cousins, AD_VP, 100,17-MAY-2001,27000, .3,90, ccousins
404, John, Richardson, AC_ACCOUNT, 205,17-MAY-2001,5000,0,110, jrichard
Create an external table oracle path can be identified:

SQL> conn / as sysdba
SQL> create directory external_dir as '/ u01 / app / oracle / oradata / external';

Directory created.

SQL> grant read, write on directory external_dir to kevin;

Grant succeeded.
User external table kevin, create an external table

SQL> CREATE TABLE ex_employees
  2 (employee_id NUMBER (4),
  3 first_name VARCHAR2 (20),
  4 last_name VARCHAR2 (25),
  5 job_id VARCHAR2 (10),
  6 manager_id NUMBER (4),
  7 hire_date DATE,
  8 salary NUMBER (8,2),
  9 commission_pct NUMBER (2,2),
10 department_id NUMBER (4),
11 email VARCHAR2 (25)
14 (
16 DEFAULT DIRECTORY external_dir
18 (
19 records delimited by newline
20 badfile external_dir: 'empxt% a_% p.bad'
21 logfile external_dir: 'empxt% a_% p.log'
22 fields terminated by ','
23 missing field values are null
24 (employee_id, first_name, last_name, job_id, manager_id,
25 hire_date char date_format date mask "dd-mon-yyyy",
26 salary, commission_pct, department_id, email
29 LOCATION ( 'example1.txt', 'example2.txt')

Table created.
You can import the data by cats when you are finished to a table in the database, if the data more, you can open the session level parallel import

alter session enable parallel;
create table employee as select * from ex_employee;

----------- -------------------- ------------------- ------ ---------- ---------- --------- ---------- ----- --------- ------------- -------------------------
        360 Jane Janus ST_CLERK 121 17-MAY-01 3000 0 50 jjanus
        361 Mark Jasper SA_REP 145 17-MAY-01 8000 .1 80 mjasper
        362 Brenda Starr AD_ASST 200 17-MAY-01 5500 0 10 bstarr
        363 Alex Alda AC_MGR 145 17-MAY-01 9000 .15 80 aalda

        401 Jesse Cromwell HR_REP 203 17-MAY-01 7000 0 40 jcromwel
        402 Abby Applegate IT_PROG 103 17-MAY-01 9000 .2 60 aapplega
        403 Carol Cousins AD_VP 100 17-MAY-01 27000 .3 90 ccousins
        404 John Richardson AC_ACCOUNT 205 17-MAY-01 5000 0 110 jrichard

10 rows selected.
Created, external table can be used normally
- Go constructed using an interpreted language (Programming)
- Linux System Getting Started Tutorial: permission to permanently modify the USB device in Linux (Linux)
- Ubuntu 10.10 install Oracle 10g Installation Guide (Database)
- Nginx1.8 version upgrade method AMH4.2 Free manually compile (Server)
- Simple RPM package production (Linux)
- To use yum install VLC under CentOS (Linux)
- RVM installation instructions (Linux)
- Performance comparison Fibonacci recursive and non-recursive (Programming)
- Linux System Getting Started Learning: Using yum to download the RPM package without installing (Linux)
- Java reflection mechanism explained in detail and Method.invoke explanation (Programming)
- What factors affect the performance of Java calls (Programming)
- CentOS7 compile and install Tengine + PHP + MariaDB notes (Server)
- Gentoo: startx appeared Failed to load module Problem Solving (Linux)
- Python kills corresponding process according to pid (Programming)
- Graphing tool: Gnuplot (Linux)
- How Bluetooth turned off by default in Ubuntu 14.04 (Linux)
- Python variable type (Programming)
- Linux cd command Detailed (Linux)
- Valgrind * not * leak check tool (Linux)
- ASM learning overview (Database)
  CopyRight 2002-2020 newfreesoft.com, All Rights Reserved.