标签:
我们在利用EXP/IMP进行跨平台迁移的时候,由于表空间路径变更,需要先手工创建在目标端创建与源端一致的表空间和数据文件,以下为创建生成语句的脚本。
select 'create tablespace ' || b.NAME || ' DATAFILE ' || chr(39) || a.NAME || chr(39) || ' SIZE ' || a.BYTES / 1024 / 1024 || ' m;' from v$datafile a, v$tablespace b where a.ts# = b.TS# And b.INCLUDED_IN_DATABASE_BACKUP='YES' Union All select 'Create Temporary Tablespace ' || b.NAME || ' Tempfile ' || chr(39) || a.NAME ||chr(39) || ' SIZE ' || a.BYTES / 1024 / 1024 || ' m;' from v$tempfile a, v$tablespace b where a.ts# = b.TS# And b.INCLUDED_IN_DATABASE_BACKUP='NO' Union All select 'alter database datafile ' ||chr(39) ||a.NAME ||chr(39)||' autoextend on ;' from v$datafile a, v$tablespace b where a.ts# = b.TS# And b.INCLUDED_IN_DATABASE_BACKUP='YES' Union All select 'alter database Tempfile ' ||chr(39) ||a.NAME ||chr(39)||' autoextend on ;' from v$tempfile a, v$tablespace b where a.ts# = b.TS# And b.INCLUDED_IN_DATABASE_BACKUP='NO'
标签:
原文地址:http://blog.csdn.net/wenzhongyan/article/details/43562387