欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

记一次oracle数据库迁移

程序员文章站 2022-03-06 21:02:59
...
--临时表空间
CREATE TEMPORARY TABLESPACE XXX TEMPFILE '/home/oracle/data/oracle/oradata/orcl/XXX.DBF' SIZE 32M AUTOEXTEND ON NEXT 32M MAXSIZE UNLIMITED EXTENT MANAGEMENT LOCAL;
--正式表空间
CREATE TABLESPACE XXX DATAFILE '/home/oracle/data/oracle/oradata/orcl/XXX.DBF' SIZE 32M AUTOEXTEND ON NEXT 32M MAXSIZE UNLIMITED EXTENT MANAGEMENT LOCAL;
--用户
CREATE USER XXX IDENTIFIED BY XXX DEFAULT TABLESPACE XXX TEMPORARY TABLESPACE XXX;
--赋权
GRANT CONNECT, RESOURCE, DBA TO  XXX;


--导出整库
expdp ECOE_YQ_HBHDSX/[email protected]:1521/orcl schemas=ECOE_YQ_HBHDSX directory=DATA_PUMP_DIR dumpfile=hbhdsx_yq.dmp logfile=hbhdsx_yq.log 

--导出指定表
expdp ECOE_YQ_HBHDSX/[email protected]:1521/ORCL directory=DATA_PUMP_DIR dumpfile=hbhdsx_yq_od.dmp logfile=hbhdsx_yq_od.log tables=CORIGINAL_DATA

--导出不包含指定表
expdp ECOE_YQ_HBHDSX/[email protected]:1521/orcl schemas=ECOE_YQ_HBHDSX directory=DATA_PUMP_DIR dumpfile=all_20191219.dmp EXCLUDE=TABLE:\"IN\(\'COLLECT_OBJ_DATA\'\)\"  logfile=all_20191219.log

--导入数据
impdp OA_1106_HBHDSX_O1_DBA/[email protected]:1521/orcl DIRECTORY=DATA_DMP_DIR DUMPFILE=hbhdsx_yq.dmp table_exists_action=replace REMAP_TABLESPACE=DB_ECOE_YQ_HBHDSX:DB_1106_HBHDSX_O1 REMAP_SCHEMA=ECOE_YQ_HBHDSX:OA_1106_HBHDSX_O1_DBA log=OA_1106_HBHDSX_O1_DBA_Import.log
相关标签: oracle