Oracle database remote import (EXP), export (IMP)

Use exp/imp remote (local) to operate the database

exp/imp remote (local) difference, the remote operation needs to create a service name corresponding to the server on the local client,
such as :
1. In D:\oracle\ora92\network\admin\ The following information is configured in tnsnames.ora:
PQPMS =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(Host = 10.9.64.22)(Port = 1521))
    )
    (CONNECT_DATA =
      (SID = pqpms)
    )
  )

2, Test whether the remote server is unblocked
and enter cmd --> tnsping pqpms
F:\>tnsping pqpms

1. Export (exp):
it is the next executable file storage directory of the operating system /ORACLE_HOME/bin
exp export tool compresses the data backup in the database It can be migrated between different OSs.
It has three modes:
       a. User mode: export all objects of the user and the data in the object;
       b. Table mode: export all the tables of the user or the specified table;
       c. the entire database : Export all objects in the database.

Sql code
1: exp username/password@PQPMS file=bak_filepath
2: exp username/password@PQPMS full=y file=bak_filepath
username username, password password, PQPMS client service name, bak_filepath backup file storage path
eg:
a. User mode:
F:\>exp rptdb/dm2426@pqpms file=E:\OracleBakup\Grace\grace.dmp owner=grace
b. Table mode:
F:\>exp rptdb/dm2426@pqpms file=E:\OracleBakup\ Grace\table1.dmp tables=(grace.a_prod_stage_flow,grace.a_test)
c. The whole database:
F:\>exp rptdb/dm2426@pqpms file=E:\OracleBakup\Grace\pqpms.dmp full=y
PS:folder It is best not to have spaces in the name, otherwise the name of the backup file address is uncontrollable (the default name is Oracle.DMP)

2. Import (imp):
it is the backup directory where the executable file is stored under the operating system /ORACLE_HOME/bin
imp will export the exp Data import database
Only
users with IMP_FULL_DATABASE and DBA privileges can do the whole database import . It has three modes:
       a. User mode: Export all objects of the user and the data in the objects;
       b. Table mode: Export all the tables of the user or the specified table;
       c. The whole database: Export all the objects in the database.
eg:
a. User mode:

b. Table mode:
F:\>imp rptdb/dm2426@pqpms file=E:\OracleBakup\Grace\grace.dmp fromuser=grace touser=grace tables=(a_test)

c. Entire database:

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326961976&siteId=291194637