ITPub博客

首页 > Linux操作系统 > Linux操作系统 > Oracle9i传输表空间到10g测试过程

Oracle9i传输表空间到10g测试过程

原创 Linux操作系统 作者:wdnmg 时间:2011-03-15 10:28:40 0 删除 编辑


create tablespace wdnmg datafile '/home/oracle9/oradata/db9/wdnmg.dbf' size 10M;
create tablespace wdnmg_idx datafile '/home/oracle9/oradata/db9/wdnmg_idx.dbf' size 10M;


create user wdnmg identified by wdnmg default tablespace wdnmg;

grant connect,resource to wdnmg;

connect wdnmg/wdnmg

create table wdnmg as select * from dict;
create index picture_album_idx on wdnmg (table_name) tablespace wdnmg_idx;

select index_name,tablespace_name from user_indexes where table_name='WDNMG';
select count(*) from wdnmg;

alter tablespace wdnmg read only;
alter tablespace wdnmg_idx read only;

select file_name from dba_data_files where tablespace_name in ('WDNMG','WDNMG_IDX');


exp \'/ as sysdba\' tablespaces=wdnmg,wdnmg_idx transport_tablespace=y file=trans_wdnmg.dmp

==================================================================================================
EXP-00091: Exporting questionable statistics.
select * from nls_database_parameters t where t.parameter='NLS_CHARACTERSET';
PARAMETER            VALUE
------------        --------------------------------------------------------------------------------
NLS_CHARACTERSET    ZHS16CGB231280

export NLS_LANG=AMERICAN_AMERICA.ZHS16CGB231280
exp \'/ as sysdba\' tablespaces=wdnmg,wdnmg_idx transport_tablespace=y file=trans_wdnmg.dmp
------------------------------------------------------------------------------------
==================================================================================================


gzip -d wdnmg.tar.gz
tar -xvf wdnmg.tar

dd if=owad01.dbf f=header.dbf bs=8192 count=1

dd if=WDNMG.DBF.AIX f=wdnmg.dbf.bak bs=8192 skip=1
dd if=WDNMG_IDX.DBF.AIX f=wdnmg_idx.dbf.bak bs=8192 skip=1

copy /b header.dbf+wdnmg.dbf.bak wdnmg.dbf.new
copy /b header.dbf+wdnmg_idx.dbf.bak wdnmg_idx.dbf.new

 

create user wdnmg identified by wdnmg;
grant connect ,resource to wdnmg;

imp '/ as sysdba' fromuser=wdnmg touser=wdnmg tablespaces=(wdnmg,wdnmg_idx) transport_tablespace=y file=wdnmg.dmp datafiles=c:\oradata\wdnmg\wdnmg.dbf,c:\oradata\wdnmg\wdnmg_idx.dbf

FILE=/oracle/oradata/expdat.dmp
DATAFILES=('/dev/testvg/rlvol4')
TABLESPACES=(users)
TTS_OWNERS=(system,kamus) 
FROMUSER=(system,kamus)
TOUSER=(system,system)


rman target /
CONVERT DATAFILE
'C:\oradata\wdnmg.dbf','C:\oradata\wdnmg_idx.dbf'
FROM PLATFORM='Microsoft Windows IA (32-bit)'
TO PLATFORM='AIX-Based Systems (64-bit)'
DB_FILE_NAME_CONVERT='C:\oradata\ora10g','/u01/oraprod/proddata';


rman target /
CONVERT TABLESPACE wdnmg
TO PLATFORM. 'AIX-Based Systems (64-bit)'
db_file_name_convert 'c:\oradata\wdnmg\wdnmg.dbf','c:\oradata\wdnmg\wdnmg.dbf.aix'

CONVERT TABLESPACE wdnmg_idx
TO PLATFORM. 'AIX-Based Systems (64-bit)'
db_file_name_convert 'c:\oradata\wdnmg\wdnmg_idx.dbf','c:\oradata\wdnmg\wdnmg_idx.dbf.aix'

--PARALLELISM 3;

 

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/70109/viewspace-689472/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2011-01-31

  • 博文量
    53
  • 访问量
    145422