Docker Oracle data pump exp/imp data backup and initialization

All contents between the two databases are exported and imported

PS: Because the export is window and the import is Linux, the encoding of the character set needs to be adjusted

https://blog.csdn.net/shipeng1022/article/details/53066558

window

CMD: set NLS_LANG=SIMPLIFIEDCHINESE_CHINA.ZHS16GBK

linux

export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK

One, export

Operate the CMD command window in the window environment

Export command: exp account/password @ip/orcl file=file name.bmp owner=account;

 

exp c##test/[email protected]/orcl file=d:lwtoracle.dmp owner=c##test

After the export is successful

Two, import

The following is the operation in the linxu environment

Upload the exported file to the server, and then transfer the server to the docker container

oracle11g is the name of the container started by the docker container, docker ps -a can be viewed

The directory path is a self-created directory, you can put it anywhere

docker cp /home/oracle_backups/lwtoracle.dmp oracle11g:/home/oracle/oracle_backups/

 Perform an import operation

Go inside the docker container, and then enter the oracle user su-oracle

Add without replace

imp khfw/passward@helowin file=/home/oracle/oracle_backups//lwtoracle.dmp fromuser=c##test touser=khfw log=/home/oracle/log/imp_tab.log

cover

imp khfw/khfwpas@helowin ignore=y file=/home/oracle/oracle_backups//lwtoracle.dmp fromuser=c##test touser=khfw log=/home/oracle/log/imp_tab.log

 

ps: The log folder also needs to be created first.

Imported command parameter description


USERID Username/Password
FULL Whether to import the whole database (Y or N), the default is N.
BUFFER The size of the data buffer.
The list of users exported by FROMUSER, that is, the list of users imported by
TOUSER from which user is the import file, that is, which user to go to In the
FILE import file, it is a dmp file.
SHOW only lists the contents of the file (Y or N), the default is N
TABLES The list of table names to be imported
IGNORE Whether to ignore errors during the import process, the default is N
RECORDLENGTH The length of the record, the default is operating system-dependent
GRANTS import permission (Y or N), the default is Y
INCTYPE Whether the imported type is incremental (Y or N), the default is N
INDEXES import index (Y or N), the default is Y
COMMIT During the import process, whether Import a row of data, submit a row (Y or N), the default is N, that is, after each table is imported, submit
ROWS Import row data (Y or N), the default is Y
PARFILE parameter file name
LOG output log file
DESTROY whether to cover The data file on the table space (Y or N) defaults to N
INDEXFILE writes the table or index information to the specified file
CHARSET The character set of the exported file, the default is NLS_LANG
ANALYZE The ANALYZE statement is executed during import (Y or N) The default is Y
FEEDBACK displays the progress in every few lines when importing, the default is 0

Reference: https://blog.csdn.net/z453588/article/details/83795172

Guess you like

Origin blog.csdn.net/qq_37203082/article/details/114526137