Databases Reference
In-Depth Information
9.
Create the directory TEST_DATA_DIR to point to the folder containing the
participationrates2010.txt ile:
CREATE OR REPLACE DIRECTORY TEST_DATA_DIR AS '/home/oracle/';
10. Create the external table MY_IMPORT_DATA :
CREATE TABLE MY_IMPORT_DATA (
GEO_ID VARCHAR2(12),
PLACE_NAME VARCHAR2(255),
TYPE VARCHAR2(255),
PCT_2000 NUMBER,
PCT_2010 NUMBER)
ORGANIZATION EXTERNAL(
TYPE ORACLE_LOADER
DEFAULT DIRECTORY TEST_DATA_DIR
ACCESS PARAMETERS
( FIELDS TERMINATED BY ' ||' )
LOCATION ('participationrates2010.txt')
);
11. Test the data in the external table:
SELECT COUNT(*) FROM MY_IMPORT_DATA;
12. Drop the external table MY_IMPORT_DATA :
DROP TABLE MY_IMPORT_DATA;
13. Export the CUSTOMERS and COUNTRIES tables using the Export Data Pump utility:
!expdp sh/sh DIRECTORY=TEST_DATA_DIR DUMPFILE=test_exp.dmp
TABLES=customers,countries
14. Import the CUSTOMERS and COUNTRIES tables using the Import Data Pump utility:
!impdp sh/sh DIRECTORY=TEST_DATA_DIR DUMPFILE=test_exp.dmp
15. Connect as SYSDBA and drop the directory TEST_DATA_DIR created in the
previous step:
CONNECT / AS SYSDBA
DROP DIRECTORY TEST_DATA_DIR;
 
Search WWH ::




Custom Search