Beruflich Dokumente
Kultur Dokumente
Syntax : exp scott/tiger file=emp.dmp log=emp.log tables=emp rows=yes indexes=no exp scott/tiger file=emp.dmp tables=(emp,dept) imp scott/tiger file=emp.dmp full=yes imp scott/tiger file=emp.dmp fromuser=scott touser=scott tables=dept
Using parameter file exp userid=scott/tiger@orcl parfile=export.txt where export.txt is like BUFFER=100000 FILE=account.dmp FULL=n OWNER=scott GRANTS=y COMPRESS=y
Note:From Oracle 10g, we can choose between using the old imp/exp utilities, or the newly introduced Datapump utilities, called expdp and impdp. These new utilities introduce much needed performance improvements, network based exports and imports, etc. Link: http://www.orafaq.com/wiki/Import_Export_FAQ Oracle Data Pump in Oracle Database 10g: Oracle Data Pump is a newer, faster and more flexible alternative to the exp and imp utilities available in previous oracle version. In addition to basic import and export functionality, data pump provides a PL/SQL API ( DBMS_DATAPUMP API ), a mechanism to allow users to move all or parts of a database between databases, thereby, provides a server-side infrastructure for fast data and metadata movement. New Export (expdp) and Import (impdp) utilities are available to make use of the API. Prerequisites: Before running Data Pump Export or Data Pump Import, a directory object must be created by a DBA or by any user with CREATE ANY DIRECTORY privilege. Create directory as mentioned below. alter user scott identified by tiger account unlock; grant create any directory to scott; create or replace directory test_dir as '/u01/app/oracle/oradata/'; grant read, write on directory test_dir to scott; Once directory is created run below scripts to export and import tables. The parameter TABLES is used to specify the tables to be exported. The TABLE_EXISTS_ACTION=APPEND parameter allows data to be imported into existing tables. expdp scott/tiger@db10g tables=emp,dept directory=test_dir dumpfile=emp_dept.dmp logfile=expdpemp_dept.log impdp scott/tiger@db10g tables=emp,dept directory=test_dir dumpfile=emp_dept.dmp logfile=impdpemp_dept.log Schema Exports/Imports: expdp scott/tiger@db10g schemas=SCOTT directory=TEST_DIR dumpfile=SCOTT.dmp logfile=expdpSCOTT.log impdp scott/tiger@db10g schemas=SCOTT directory=TEST_DIR dumpfile=SCOTT.dmp logfile=impdpSCOTT.log Database Export/Import: expdp system/password@db10g full=Y directory=TEST_DIR dumpfile=DB10G.dmp logfile=expdpDB10G.log impdp system/password@db10g full=Y directory=TEST_DIR dumpfile=DB10G.dmp logfile=impdpDB10G.log
Links : http://www.orafaq.com/wiki/Datapump http://www.oracle-base.com/articles/10g/OracleDataPump10g.php http://www.oracle.com/technology/obe/obe10gdb/storage/datapump/datapump.htm COPY Command: COPY command is one of the fastest way of copying data between databases and schemas. Format of copy command is as copy from <database> to <database> {append|create|insert|replace} <destination_table> [(column, column, column, ...)] using <query>; COPY command supports the following data types: CHAR DATE LONG NUMBER VARCHAR2 Example: copy from scott/tiger@local_db to scott/tiger@remote_db create image_table using select image_no, image from images; copy from scott/tiger@local_db to scott/tiger@remote_db create tgt using select * from src where x < 5;