|
本帖最后由 botang 于 2014-10-20 00:17 编辑
- select * from dba_objects o where o.owner='U2';
- grant all on directory dir1 to u2;
- select * from dba_tab_privs tp where tp.grantee='HR';<div class="blockcode"><blockquote>exp hr/oracle_4U file=myfile1 owner=hr triggers=n
- imp u1/oracle_4U file=myfile1 fromuser=hr touser=u1
- /etc/init.d/init.ohasd run >/dev/null 2>&1 </dev/null &
复制代码
grant all on directory dir2 to hr;
grant all on directory dir3 to hr;
drop table hr.ext_emp_query_results;
CREATE TABLE hr.ext_emp_query_results
ORGANIZATION EXTERNAL
(
TYPE ORACLE_DATAPUMP
DEFAULT DIRECTORY dir1
LOCATION ( dir1:'emp1.exp',dir2:'emp2.exp',dir3:'emp3.exp')
)
PARALLEL 10
AS
SELECT e.first_name first_name ,e.last_name last_name ,d.department_name department_name
FROM hr.employees e, hr.departments d
WHERE e.department_id = d.department_id
;
select * from dba_external_tables;
grant all on directory dir3 to u3;
CREATE TABLE u3.ext_emp_query_results
( first_name varchar2(50) , last_name varchar2(50) , department_name varchar2(60) )
ORGANIZATION EXTERNAL
(
TYPE ORACLE_DATAPUMP
DEFAULT DIRECTORY dir1
LOCATION ( dir1:'emp1.exp',dir2:'emp2.exp',dir3:'emp3.exp')
)
PARALLEL 10;
CREATE TABLE ext_emp_query_results
( first_name varchar2(50) , last_name varchar2(50) , department_name varchar2(60) )
ORGANIZATION EXTERNAL
(
TYPE ORACLE_DATAPUMP
DEFAULT DIRECTORY mydir
LOCATION ( 'emp1.exp','emp2.exp','emp3.exp')
)
PARALLEL 10;
CREATE TABLE emp_ext (
first_name, last_name, empID,
salary ENCRYPT IDENTIFIED BY "xIcf3T9u" )
ORGANIZATION EXTERNAL
( TYPE ORACLE_DATAPUMP
DEFAULT DIRECTORY "D_DIR"
LOCATION('emp_ext.dat') )
REJECT LIMIT UNLIMITED
as select * from employees;
|
|