Oracle export / import three modes of database

Export

  Mode 1: Full Export (caution)

    exp username / password @ database instance owner = user name file = log = log file storage path storage path full = y

    栗子:exp Mark/[email protected].*.156:1521/markdb owner=Mark file=d:/export/mark_db.emp log=d:/export/mark_db.log full=y owner=ds_planweb

  Mode 2: Export specified user (recommended)

    exp username / password @ database instance owner = user name file = log = log file storage path storage path specified user owner =

    栗子:exp Mark/[email protected].*.156:1521/markdb owner=Mark file=d:/export/mark_db.emp log=d:/export/mark_db.log owner=Mark

  Mode III: Export specified table

    exp username / password database instance @ owner = user name file = log = log file storage path storage path specified user owner = tables = (specified in Table)

    栗子:exp Mark/[email protected].*.156:1521/markdb owner=Mark file=d:/export/mark_db.emp log=d:/export/mark_db.log owner=Mark tables=(mark_user)

Importing

  Mode 1: the total amount of introduced (caution)

    imp username / password @ database instance file = file storage path full = y ignore = y

    栗子:imp Mark/[email protected].*.156:1521/markdb file=d:/export/mark_db.emp full=y ignore=y

    Note: ignore: whether to ignore create errors

  Mode 2: Importing specified user (recommended)

    imp username / password @ database instance file = file storage path fromuser = resource user name touser = target username ignore = y

    栗子:imp Mark/[email protected].*.156:1521/markdb file=d:/export/mark_db.emp fromuser=Mark touser=Mark_target ignore=y

    Note: All users SONIC such objects is introduced into a file. You must specify FROMUSER, TOUSER parameters, in order to import the data.

  Mode three: introducing the specified table

    imp username / password file = @ database instance owner = file storage path specified user tables = (specified in Table)

    栗子:imp Mark/[email protected].*.156:1521/markdb file=d:/export/mark_db.emp owner=Mark tables=(mark_user)

 Create a database for the user to receive import

  Create a user

  1. Through the command: create user identified by the username password [i.e. Password];
  2. Login system account, create a user directly

  delete users

    drop user username cascade;

    Note: If the user has an object, it can not be deleted, otherwise it will return an error value. Keyword cascade, the user can delete all objects, and then delete the user.

  User Authorization

  1. Authorization: grant connect, resource to username;
  2. Undo: revoke connect, resource from a user name;

  Note: oracle is compatible with previous versions, offers three standard roles (role): connect / resource and dba.

  After the above operation, the user may then be received into the database as a value of imp touser instruction.

---------- ----------- transition line

User does not have permission to operate above the table, empowerment script as follows:

GRANT CREATE ANY TABLE TO DS_PORTAL_SH_DEV_GZW;
GRANT SELECT ANY TABLE TO DS_PORTAL_SH_DEV_GZW;
GRANT COMMENT ANY TABLE TO DS_PORTAL_SH_DEV_GZW;
GRANT LOCK ANY TABLE TO DS_PORTAL_SH_DEV_GZW;
GRANT SELECT ANY DICTIONARY TO DS_PORTAL_SH_DEV_GZW;

 

Note: If the dmp file exported by dba user, dba user to import is not, then it will report the following error :( images from Reference blog)

solution:

  1. DBA account import using
  2. Dba privileges assigned to the user's need to import

Empowering statement:

  grant dba to Mark

reference:

Oracle export, import a user all the data (including tables, views, stored procedures, ...)

Export

  Mode 1: Full Export (caution)

    exp username / password @ database instance owner = user name file = log = log file storage path storage path full = y

    栗子:exp Mark/[email protected].*.156:1521/markdb owner=Mark file=d:/export/mark_db.emp log=d:/export/mark_db.log full=y owner=ds_planweb

  Mode 2: Export specified user (recommended)

    exp username / password @ database instance owner = user name file = log = log file storage path storage path specified user owner =

    栗子:exp Mark/[email protected].*.156:1521/markdb owner=Mark file=d:/export/mark_db.emp log=d:/export/mark_db.log owner=Mark

  Mode III: Export specified table

    exp username / password database instance @ owner = user name file = log = log file storage path storage path specified user owner = tables = (specified in Table)

    栗子:exp Mark/[email protected].*.156:1521/markdb owner=Mark file=d:/export/mark_db.emp log=d:/export/mark_db.log owner=Mark tables=(mark_user)

Importing

  Mode 1: the total amount of introduced (caution)

    imp username / password @ database instance file = file storage path full = y ignore = y

    栗子:imp Mark/[email protected].*.156:1521/markdb file=d:/export/mark_db.emp full=y ignore=y

    Note: ignore: whether to ignore create errors

  Mode 2: Importing specified user (recommended)

    imp username / password @ database instance file = file storage path fromuser = resource user name touser = target username ignore = y

    栗子:imp Mark/[email protected].*.156:1521/markdb file=d:/export/mark_db.emp fromuser=Mark touser=Mark_target ignore=y

    Note: All users SONIC such objects is introduced into a file. You must specify FROMUSER, TOUSER parameters, in order to import the data.

  Mode three: introducing the specified table

    imp username / password file = @ database instance owner = file storage path specified user tables = (specified in Table)

    栗子:imp Mark/[email protected].*.156:1521/markdb file=d:/export/mark_db.emp owner=Mark tables=(mark_user)

 Create a database for the user to receive import

  Create a user

  1. Through the command: create user identified by the username password [i.e. Password];
  2. Login system account, create a user directly

  delete users

    drop user username cascade;

    Note: If the user has an object, it can not be deleted, otherwise it will return an error value. Keyword cascade, the user can delete all objects, and then delete the user.

  User Authorization

  1. Authorization: grant connect, resource to username;
  2. Undo: revoke connect, resource from a user name;

  Note: oracle is compatible with previous versions, offers three standard roles (role): connect / resource and dba.

  After the above operation, the user may then be received into the database as a value of imp touser instruction.

---------- ----------- transition line

User does not have permission to operate above the table, empowerment script as follows:

GRANT CREATE ANY TABLE TO DS_PORTAL_SH_DEV_GZW;
GRANT SELECT ANY TABLE TO DS_PORTAL_SH_DEV_GZW;
GRANT COMMENT ANY TABLE TO DS_PORTAL_SH_DEV_GZW;
GRANT LOCK ANY TABLE TO DS_PORTAL_SH_DEV_GZW;
GRANT SELECT ANY DICTIONARY TO DS_PORTAL_SH_DEV_GZW;

 

Note: If the dmp file exported by dba user, dba user to import is not, then it will report the following error :( images from Reference blog)

solution:

  1. DBA account import using
  2. Dba privileges assigned to the user's need to import

Empowering statement:

  grant dba to Mark

reference:

Oracle export, import a user all the data (including tables, views, stored procedures, ...)

Guess you like

Origin www.cnblogs.com/lcword/p/11775639.html