Oracle9i傳輸表空間到10g測試過程

wdnmg發表於2011-03-15


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/,如需轉載,請註明出處,否則將追究法律責任。

相關文章