oracle数据迁移建表空间用户数据泵

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/[email protected]: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/[email protected]: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/[email protected]: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/[email protected]: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/[email protected]:10088/yfxdb  fromuser=TEST_TY touser=test_ty  file=test_ty0709.dmp  log=imp2.0_test.dmp.log
 ignore=y

imp test_ty/[email protected]: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/[email protected]:1522/ttprac  fromuser=TTP2_SXI touser=yfxttp  file=ttp2_sxi07042.dmp  log=0801dmp.log

  exp yfxttp/[email protected]: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/[email protected]:1522/ttprac    file=20141012.dmp  log=20141012exp.log

山西数据库测试 :端口 10088   ip   137.64.43.98 测试数据库帐号密码:user=test_ty/test_ty

imp test_ty/[email protected]:10088/yfxdb  fromuser=yfxttp  touser=test_ty  file=20141012.dmp  log=20141012imp.log


 

猜你喜欢

转载自longge308.iteye.com/blog/2169511
今日推荐