Home » RDBMS Server » Server Utilities » copy table from one instance to another
copy table from one instance to another [message #178600] Wed, 21 June 2006 14:20 Go to next message
AlinaC
Messages: 45
Registered: November 2005
Location: India
Member

I need to copy some tables from Oracle9i instance to 10G and I have written the sctipt as-
set pagesize 0
set timing off
set echo off
set feed off
set verify off
set head off
set line 200
col X for a150 word_wrapped
col Y for a200 word_wrapped
accept TABLE_NAME prompt "Enter any TABLE_NAME or HIT ENTER for ALL TABLES listed under current ownership:"
accept UPSD prompt "Enter username/passsword@source_database_name:"
accept UPDD prompt "Enter username/passsword@destination_database_name:"
set trimspool on
spool c:\data_copy.sql

def TABLE_NAME = '&&TABLE_NAME%';

select
'-- '||
rownum||
' Copy data to new '||
A.TABLE_NAME
X,
'copy from' ||' &UPSD'||' to '||' &UPDD'||
' replace ' || A.TABLE_NAME || ' using select * from' || ' '|| A.TABLE_NAME
from ALL_TABLES A where A.OWNER like USER
and A.TABLE_NAME like upper('&TABLE_NAME')
order by A.BLOCKS;
spool off
set termout on
set verify on
prompt
prompt Check the spool file at c:\data_copy.sql
prompt You may edit and run this file in destination database as the owner
prompt
set feed on
set verify on
set head on
set pagesize 64
undef TABLE_NAME

But using the script I'm unable to copy those tables having CLOB datatype as it is not supported. Is there any other way to copy those tables having CLOB datatype?

Regards,
Alina
Re: copy table from one instance to another [message #178609 is a reply to message #178600] Wed, 21 June 2006 16:19 Go to previous messageGo to next message
Littlefoot
Messages: 21823
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Why wouldn't you do it using EXP / IMP utilities?
Re: copy table from one instance to another [message #178614 is a reply to message #178600] Wed, 21 June 2006 16:44 Go to previous message
ebrian
Messages: 2794
Registered: April 2006
Senior Member
Have you considered INSERT...AS SELECT.
Previous Topic: load lob data using Length-Value Pair Fields
Next Topic: SQL*Loader-704: Internal error: ulconnect: OCIServerAttach [0]
Goto Forum:
  


Current Time: Thu Dec 26 07:54:05 CST 2024