设为首页 收藏本站
查看: 873|回复: 0

[经验分享] oracle数据迁移建表空间用户数据泵

[复制链接]
YunVN网友  发表于 2016-8-15 07:35:35 |阅读模式
  simpdp ttptest/********@longge:1521/orcl remap_schema=ttp:ttptest dumpfile=sx_export20140613.dmp logfile=imp1.log directory=dir_dp
  TBS_TTP_DATA
TBS_TTP_DATA_IDX
TTP_DATA_TABLESPACE
  步骤:
创建表空间 :DIC_DATA_TABLESPACE
  CREATE USER "TTPTEST" PROFILE "DEFAULT" IDENTIFIED BY "ttptest" DEFAULT TABLESPACE "DIC_DATA_TABLESPACE" TEMPORARY TABLESPACE "TEMP" ACCOUNT UNLOCK;
GRANT "CONNECT" TO "TTPTEST";
GRANT "RESOURCE" TO "TTPTEST";
  
  创建路径,分配权限
create directory dir_dp as 'c:\';
grant read,write on directory dir_dp to ttptest;
  
表空间报错。
TBS_TTP_DATA TTP_DATA_TABLESPACE
  impdp ttptest/ttptest123@longge:1521/orcl remap_tablespace=TBS_TTP_DATA:DIC_DATA_TABLESPACE  remap_tablespace=TTP_DATA_TABLESPACE:DIC_DATA_TABLESPACE remap_schema=ttp:ttptest dumpfile=sx_export20140613.dmp logfile=imp1.log directory=dir_dp
  
  
  
表空间创建:
  
20140621
2、创建用户
  drop user sx_ttp cascade;
drop user liqiansx cascade;
  create user sx_ttp identified by sx_ttp default tablespace dic_data_tablespace temporary tablespace temp account unlock;
grant resource to sx_ttp;
grant connect to sx_ttp;
  
create user liqiansx identified by liqiansx default tablespace dic_data_tablespace temporary tablespace temp account unlock;
--grant resource to liqiansx ;
grant connect to liqiansx ;
  
  --短信用户ttpsms 
  create user ttpsms identified by ttpsms default tablespace dic_data_tablespace temporary tablespace temp account unlock;
grant connect to ttpsms ;
 
  grant read,write on directory dir_dp to sx_ttp;
imp sx_ttp/sx_ttp@longge:1521/orcl  fromuser=ttp touser=sx_ttp file=sx_export20140621.dmp log=imp20140621.log
  impdp sx_ttp/sx_ttp@longge:1521/orcl  directory=dir_dp  remap_tablespace=TBS_TTP_DATA:DIC_DATA_TABLESPACE  remap_tablespace=TTP_DATA_TABLESPACE:DIC_DATA_TABLESPACE remap_schema=ttp:sx_ttp dumpfile=sx_export20140613.dmp logfile=impdp20140621.log
  短信用户ttpsms 
  
*****************创建 湖南用户   dmp文件  ttp_hn0620.dmp
需要创建表空间:
select tablespace_name,file_id,round(bytes/(1024*1024),0) total_space,file_name from dba_data_files;
---C:\APP\TYDIC\ORADATA\ORCL\DIC_DATA01
  CREATE SMALLFILE TABLESPACE "TTP_DATA_TABLESPACE"
DATAFILE '/oradata/yfxdb/ttp_yfx_data01' SIZE 2048M
 AUTOEXTEND ON NEXT 20M MAXSIZE UNLIMITED LOGGING
 EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTO
  
---TTP_DATA_TABLESPACE   /oradata/yfxdb/users01.dbf
  
  drop user TTP2_HN cascade;
  
create user TTP2_HN identified by hn_ttp default tablespace dic_data_tablespace temporary tablespace temp account unlock;
grant resource to TTP2_HN ;
grant connect to TTP2_HN ;
grant dba to TTP2_HN;
  
  drop user sx_ttp cascade;
  
create user sx_ttp identified by sx_ttp default tablespace TTP_DATA_TABLESPACE temporary tablespace temp account unlock;
grant resource to sx_ttp ;
grant connect to sx_ttp ;
grant dba to sx_ttp
  imp system/system@longge:1521/orcl  fromuser=TTP2_HN touser=TTP2_HN file=ttp_hn0620.dmp  log=imphn20140623.log
  drop user ttp_ty cascade;
create user ttp_ty identified by ttp_ty default tablespace TTP_DATA_TABLESPACE temporary tablespace temp account unlock;
grant resource to ttp_ty ;
grant connect to ttp_ty ;
  
imp system/system@11.0.2.67:1521/yfxdb  fromuser=ttp_ty touser=ttp_ty file=ttp_ty0627.dmp  log=imphn20140628.log
  
  
drop user sx_ttp1  cascade;
create user sx_ttp1 identified by sx_ttp1 default tablespace TTP_DATA_TABLESPACE temporary tablespace temp account unlock;
grant resource to sx_ttp1 ;
grant connect to sx_ttp1 ;
grant dba to sx_ttp1;
  create user liqiansx identified by liqiansx default tablespace TTP_DATA_TABLESPACE temporary tablespace temp account unlock;
--grant resource to liqiansx ;
grant connect to liqiansx ;
  
CREATE SMALLFILE TABLESPACE "TBS_TTP_DATA"
DATAFILE '/oradata/yfxdb/ttp_yfx_data02' SIZE 1024M
 AUTOEXTEND ON NEXT 20M MAXSIZE UNLIMITED LOGGING
 EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTO
 
imp system/system@137.64.43.98:1521/yfxdb  fromuser=ttp touser=sx_ttp1 file=sx_export20140621.dmp  log=impttp20140703.log
  
drop user tj_ttp  cascade;
create user tj_ttp identified by tj_ttp default tablespace TTP_DATA_TABLESPACE temporary tablespace temp account unlock;
grant resource to tj_ttp ;
grant connect to tj_ttp ;
grant dba to tj_ttp;
  
imp tj_ttp/tj_ttp@137.64.43.98:10088/yfxdb  fromuser=ttp touser=tj_ttp file=tj_export20131122.dmp  log=imptjttp20140703.log
  
  天津配置oracle客户端环境:
# User specific environment and startup programs
export ORACLE_BASE=/oracle
export ORACLE_HOME=/oracle/product/10.2.0/db_1
  PATH=/root/jrockit-R27.5.0-jdk1.6.0_03/bin:$ORACLE_HOME/bin:$PATH:$HOME/bin
export PATH
  
  drop user sx_ttp2  cascade;
create user sx_ttp2 identified by sx_ttp2 default tablespace TTP_DATA_TABLESPACE temporary tablespace temp account unlock;
grant resource to sx_ttp2 ;
grant connect to sx_ttp2 ;
grant dba to sx_ttp2;
  
imp sx_ttp2/sx_ttp2@137.64.43.98:10088/yfxdb  fromuser=ttp2_sxi touser=sx_ttp2 file=ttp2_sxi07042.dmp  log=imp2.0_base.dmp.log
  
export  NLS_LANG=AMERICAN_AMERICA.ZHS16GBK
  
  drop user test_ty  cascade;
create user test_ty identified by test_ty default tablespace TTP_DATA_TABLESPACE temporary tablespace temp account unlock;
grant resource to test_ty ;
grant connect to test_ty ;
grant dba to test_ty;
  imp test_ty/test_ty@137.64.43.98:10088/yfxdb  fromuser=TEST_TY touser=test_ty  file=test_ty0709.dmp  log=imp2.0_test.dmp.log
 ignore=y
  imp test_ty/test_ty@137.64.43.98:10088/yfxdb  fromuser=TEST_TY touser=test_ty  file=test_ty0725.dmp  log=imp2.0725_test.dmp.log
  
***注意ttpsms帐号的密码 
需要建立的用户有ttpsms
-- Create the user
create user "TTPSMS" PROFILE "DEFAULT" IDENTIFIED BY "ttptest"
  default tablespace TBS_TTP_DATA
  temporary tablespace TEMP
  profile DEFAULT;
 
 
    
  imp yfxttp/Ttp_2829app@137.64.25.27:1522/ttprac  fromuser=TTP2_SXI touser=yfxttp  file=ttp2_sxi07042.dmp  log=0801dmp.log
  exp yfxttp/Ttp_2829app@137.64.25.26:1522/ttprac    file=0822V2.0.dmp  log=0822V2.0.log
 
 imp system/xx@ip:port/ttprac  fromuser=yfxttp touser=ttp3_ty  file=0822V2.0.dmp  log=0822.log
 imp ttp3_ty/xx@ip:port/ttprac  fromuser=yfxttp touser=ttp3_ty  file=0822V2.0.dmp  log=0822.log
 
 
 
 exp yfxttp/Ttp_2829app@137.64.25.26:1522/ttprac    file=20141012.dmp  log=20141012exp.log
  山西数据库测试 :端口 10088   ip   137.64.43.98 测试数据库帐号密码:user=test_ty/test_ty
  imp test_ty/test_ty@137.64.43.98:10088/yfxdb  fromuser=yfxttp  touser=test_ty  file=20141012.dmp  log=20141012imp.log
  
 

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-258007-1-1.html 上篇帖子: Oracle 批量更新 中merge into的使用 下篇帖子: Oracle出现ORA-01006: 赋值变量不存在 错误的解决办法
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表