Export Import For Students
Export Import For Students
a) Parameter mode
(exp SYSTEM/password FILE=myexp.dmp FULL=y LOG=myexp.log
b) Interactive mode
(exp SYSTEM/password)
EXPORT
1. Table Mode:
In table mode, you can export table data or the table definitions. (If no rows are exported,
the CREATE TABLE statement is placed in the export file, with grants and indexes, if they
are specified.)
A user with the EXP_FULL_DATABASE role can use table mode to export tables from any
user's schema by specifying TABLES=schemaname.tablename.
Pattern matching is used to export various tables for users scott and
blake.
exp SYSTEM/password FILE=misc.dmp TABLES=(scott.%P%,blake.%,scott.%S%)
Table definitions, table data (all or selected rows), Owner tables (grants, indexes), Table
Constraints.
.
2. User Mode:
User mode exports can be used to back up one or more database users. For example, a
DBA may want to back up the tables of deleted users for a period of time. User mode is
also appropriate for users who want to back up their own data or who want to move
objects from one owner to another. In this example, user scott is exporting his own
tables.
Table definitions, table data, Owner tables (grants, indexes), Table constraints.
3. Full Database Mode:
Only users with the DBA role or the EXP_FULL_DATABASE role can export in full database
mode. In this example, an entire database is exported to the file dba.dmp with all GRANTS
and all data. All objects are exported.
4. Tablespace mode:
Examples:
IMPORT
Modes:
Table mode: import specified table
User mode: import all objects that belong to a user.
Tablespace: import all objects within the tablespace.
Full database: import all objects of the database.
Examples:
[Export everything that has make the user such as: tablespace, profiles, roles, dblinks,
sequences, user definitions, tables, data dictionary tables etc]
Exporting a USER:
[exp PARFILE=filename
exp username/password PARFILE=filename]
TABLES=(scott.%P%,blake.%,scott.%S%)
$ exp scott/tiger file=c:/test.dmp tables=e%,d%
Export as Sysdba:
File=c:/emp.dmp
Tables=dept,salgrade # ( used for comments)
Export as Sysdba:
Importing as Sysdba:
Use of Show:
Default: n
When SHOW=y, the contents of the export file are listed to the display and not imported.
The SQL statements contained in the export are displayed in the order in which Import
will execute them.
The SHOW parameter can be used only with the FULL=y, FROMUSER, TOUSER, or TABLES
parameter.
Parameter Files:
FILE=dba.dmp
SHOW=n
IGNORE=n
GRANTS=y
FROMUSER=scott
TABLES=(dept,emp)