conn sys/sys as sysdba
alter system set O7_DICTIONARY_ACCESSIBILITY = true scope=spfile;
O7_DICTIONARY_ACCESSIBILITY is static parameter restart is necessary
shutdown immediate
startup
conn sys/sys
Analyst Programmer - OCE JWCD 6. OCP JAVA SE 6. OCP in 10g DBA. SQL Expert
This is a blog of programming, database administration and
problem analysis. This blog is for sharing knowledge to help me. I like to analysis and play with code and I've intention to solve any kind Java, Struts 2, Java EE, JSF 2, Enterprise Java Bean, Spring, Web Service, GlassFish, Weblogic, JBOSS and Advanced PL/SQL puzzle. If you've any technical question just mail me, i'll reply in short.
Wednesday, June 23, 2010
Monday, June 14, 2010
To create an external table you have to create a directory.
this directory contains a file, book1.csv
so logon to sys as sysdba
then issue the command
create or replace directory EXTERNAL as 'E:\EXTERNAL\';
GRANT READ, WRITE ON DIRECTORY EXTERNAL TO SCOTT;
Now connect scott
now issue the following script :
But the CSV files are comma-seperated.
Any field of the csv file may contain comma.
So the previous script will be the following with highlighted portion:
this directory contains a file, book1.csv
so logon to sys as sysdba
then issue the command
create or replace directory EXTERNAL as 'E:\EXTERNAL\';
GRANT READ, WRITE ON DIRECTORY EXTERNAL TO SCOTT;
Now connect scott
now issue the following script :
create table extern_emp
(
id varchar2(10),
name varchar2(200),
address varchar2(1000)
)
organization external
(
default directory EXTERNAL
access parameters
(
records delimited by newline
fields terminated by ','
)
location('book1.csv')
)
parallel
;
But the CSV files are comma-seperated.
Any field of the csv file may contain comma.
So the previous script will be the following with highlighted portion:
create table extern_emp
(
id varchar2(10),
name varchar2(200),
address varchar2(1000)
)
organization external
(
default directory EXTERNAL
access parameters
(
records delimited by newline
fields terminated by ','
optionally enclosed by '"'
)
location('book1.csv')
)
parallel
;
Subscribe to:
Posts (Atom)