oracle 数据库导入导出方法
【摘要】 #exp/imp 新数据库需要建立相关用户FEEMANFEEMANTMPCOTTAGEHEUSER#导出操作export ORACLE_SID=firstly1exp its/its owner=FEEMAN file=/exp/exp01/FEEMAN0929.dmp log=/exp/exp01/FEEMANexp.logexp its/its owner=FEEMANTMP file=...
#exp/imp 新数据库需要建立相关用户
FEEMAN
FEEMANTMP
COTTAGE
HEUSER
#导出操作
export ORACLE_SID=firstly1
exp its/its owner=FEEMAN file=/exp/exp01/FEEMAN0929.dmp log=/exp/exp01/FEEMANexp.log
exp its/its owner=FEEMANTMP file=/exp/exp01/exp/FEEMANTMP0929.dmp log=/exp/exp01/FEEMANTMPexp.log
exp its/its owner=COTTAGE file=/exp/exp01/COTTAGE0929.dmp log=/exp/exp01/COTTAGEexp.log
exp its/its owner=HEUSER file=/exp/exp01/HEUSER0929.dmp log=/exp/exp01/HEUSERexp.log
#导入操作
export ORACLE_SID=firstly1
创建用户
sqlplus / as sysdba
create user FEEMAN identified by FEEMAN;
create user FEEMANTMP identified by FEEMANTMP;
create user COTTAGE identified by COTTAGE;
create user HEUSER identified by HEUSER;
grant dba to FEEMAN;
grant dba to FEEMANTMP;
grant dba to COTTAGE;
grant dba to HEUSER;
执行导入操作:
export ORACLE_SID=firstly1
imp system/oracle fromuser=FEEMAN touser=FEEMAN file=/home/exp/exp01/FEEMAN0929.dmp log=/home/exp/exp01/FEEMANimp.log
imp system/oracle fromuser=FEEMANTMP touser=FEEMANTMP file=/home/exp/exp01/FEEMANTMP0929.dmp log=/home/exp/exp01/FEEMANTMPimp.log
imp system/oracle fromuser=COTTAGE touser=COTTAGE file=/home/exp/exp01/COTTAGE0929.dmp log=/home/exp/exp01/COTTAGEimp.log
imp system/oracle fromuser=HEUSER touser=HEUSER file=/home/exp/exp01/HEUSER0929.dmp log=/home/exp/exp01/HEUSERimp.log
#expdp/impdp
MOOC
HEUSER
POST
CMS
QLIB
RESCLOUD
PLANTATION
SAKAI
#
导出命令:
#导出之前指定环境变量ORACLE_SID
export ORACLE_SID=secondly1
#确认环境变量正确即可执行导入导出命令
#echo $ORACLE_SID
#建立目录
export ORACLE_SID=firstly1
sqlplus / as sysdba
create user its identified by its;
grant dba to its;
conn its/its
create or replace directory exp as '/export/home/oracle/exp';
expdp its/its schemas=MOOC dumpfile=MOOC0929.dmp DIRECTORY=exp logfile=MOOC0929.log
expdp its/its schemas=HEUSER dumpfile=HEUSER929.dmp DIRECTORY=exp logfile=HEUSER0929.log
expdp its/its schemas=POST dumpfile=POST929.dmp DIRECTORY=exp logfile=POST0929.log
expdp its/its schemas=CMS dumpfile=CMS929.dmp DIRECTORY=exp logfile=CMS0929.log
expdp its/its schemas=QLIB dumpfile=QLIB929.dmp DIRECTORY=exp logfile=QLIB0929.log
expdp its/its schemas=RESCLOUD dumpfile=RESCLOUD929.dmp DIRECTORY=exp logfile=RESCLOUD0929.log
expdp its/its schemas=PLANTATION dumpfile=PLANTATION929.dmp DIRECTORY=exp logfile=PLANTATION0929.log
expdp its/its schemas=SAKAI dumpfile=SAKAI929.dmp DIRECTORY=exp logfile=SAKAI0929.log
导入命令
#导入之前指定环境变量ORACLE_SID
export ORACLE_SID=secondly1
#建立目录
export ORACLE_SID=secondly1
sqlplus / as sysdba
create user its identified by its;
grant dba to its;
conn its/its
create or replace directory exp as '/home/exp';
#确认环境变量正确即可执行导入导出命令
#echo $ORACLE_SID
impdp its/its schemas=MOOC dumpfile=MOOC0929.dmp DIRECTORY=exp logfile=MOOCimp0929.log
impdp its/its schemas=HEUSER dumpfile=HEUSER929.dmp DIRECTORY=exp logfile=HEUSERimp0929.log
impdp its/its schemas=POST dumpfile=POST929.dmp DIRECTORY=exp logfile=POSTimp0929.log
impdp its/its schemas=CMS dumpfile=CMS929.dmp DIRECTORY=exp logfile=CMSimp0929.log
impdp its/its schemas=QLIB dumpfile=QLIB929.dmp DIRECTORY=exp logfile=QLIBimp0929.log
impdp its/its schemas=RESCLOUD dumpfile=RESCLOUD929.dmp DIRECTORY=exp logfile=RESCLOUDimp0929.log
impdp its/its schemas=PLANTATION dumpfile=PLANTATION929.dmp DIRECTORY=exp logfile=PLANTATIONimp0929.log
impdp its/its schemas=SAKAI dumpfile=SAKAI929.dmp DIRECTORY=exp logfile=SAKAIimp0929.log
【版权声明】本文为华为云社区用户原创内容,转载时必须标注文章的来源(华为云社区)、文章链接、文章作者等基本信息, 否则作者和本社区有权追究责任。如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱:
cloudbbs@huaweicloud.com
- 点赞
- 收藏
- 关注作者
评论(0)