谢谢!!!
6 个解决方案
#1
只要在目标服务器设好字符集,导入是会自动转换的.
#2
简体中文是英文的超集,应该没有什么问题.
1. EXPORT (英文session)
2. Upgrade your DB (简体中文)
3. IMPORT ( 简体中文session)
1. EXPORT (英文session)
2. Upgrade your DB (简体中文)
3. IMPORT ( 简体中文session)
#3
自动转换?如果自动能转换,那为什么有时导入后出现乱码?这怎么解释?
同时关于各个字符集的关系,能讲的详细点吗?谢谢!!!
同时关于各个字符集的关系,能讲的详细点吗?谢谢!!!
#4
http://expert.csdn.net/Expert/topic/1582/1582807.xml?temp=.2990686
很详细了
很详细了
#5
要保证导出和导入的字符集相同。
那么你导出时将现有的字符集改为中文,就可以了。
那么你导出时将现有的字符集改为中文,就可以了。
#6
Java过程修改dump文件成特定字符集
前一段时间在
http://www.itpub.net/showthread.php...15&pagenumber=1
中讨论的DMP不同字符集之间*转换工具,经过一位java朋友的帮忙,今天奉献上biti提议的java存储过程修改方法:
DumpChange.java脚本:
import java.io.*;
public class DumpChange
{
public static String ChangeCharSet(String fileName,String value)
throws IOException,NumberFormatException
{
try
{
value=value.trim();
if(value.length()<4)
value=new String("0000"+value).substring(value.length());
else if(value.length()>4)
throw new NumberFormatException(value+"is error,length>4.");
RandomAccessFile raf=new RandomAccessFile(fileName,"rw");
byte[] bts=new byte[2];
bts[0]=new Integer(Integer.parseInt(value.substring(0,2),16)).byteValue();
bts[1]=new Integer(Integer.parseInt(value.substring(2),16)).byteValue();
raf.seek(1);
raf.write(bts);
raf.close();
return "OK";
}
catch(Exception e)
{
return e.toString();
}
}
}
C:\>loadjava -user scott/tiger@128 -r -f -v c:\DumpChange.java
initialization complete
loading : DumpChange
creating : DumpChange
resolver :
resolving: DumpChange
C:\>sqlplus /nolog
SQL*Plus: Release 8.1.7.0.0 - Production on Tue Aug 13 15:35:00 2002
(c) Copyright 2000 Oracle Corporation. All rights reserved.
SQL> conn sys/change_on_install@ora8db1 as sysdba
Connected.
SQL> CREATE OR REPLACE FUNCTION SCOTT.DumpCharSet(FileName in varchar2,HexCharSet in varchar2) return varchar2 as language java name 'DumpChange.ChangeCharSet(java.lang.String,java.lang.String) return java.lang.String';
2 /
Function created.
SQL> CREATE OR REPLACE FUNCTION SCOTT.TO_CHARSET (Filename in varchar2,CharSet in varchar2) return varchar2 as
HexId varchar2(10);
ret varchar2(500);
begin
select to_char(NLS_CHARSET_ID(CharSet),'xxxx') into HexId from dual;
HexId:=trim(HexId);
select DumpCharSet(Filename,HexId) into ret from dual;
return ret;
end;
/
Function created.
SQL> execute dbms_java.grant_permission('SCOTT','SYS:java.io.FilePermission','C:\EXPDAT.DMP','read,write');
PL/SQL procedure successfully completed.
SQL> select SCOTT.to_charset('C:\EXPDAT.DMP','ZHS16GBK') from dual;
SCOTT.TO_CHARSET('C:\EXPDAT.DMP','ZHS16GBK')
--------------------------------------------------------------------------------
OK
前一段时间在
http://www.itpub.net/showthread.php...15&pagenumber=1
中讨论的DMP不同字符集之间*转换工具,经过一位java朋友的帮忙,今天奉献上biti提议的java存储过程修改方法:
DumpChange.java脚本:
import java.io.*;
public class DumpChange
{
public static String ChangeCharSet(String fileName,String value)
throws IOException,NumberFormatException
{
try
{
value=value.trim();
if(value.length()<4)
value=new String("0000"+value).substring(value.length());
else if(value.length()>4)
throw new NumberFormatException(value+"is error,length>4.");
RandomAccessFile raf=new RandomAccessFile(fileName,"rw");
byte[] bts=new byte[2];
bts[0]=new Integer(Integer.parseInt(value.substring(0,2),16)).byteValue();
bts[1]=new Integer(Integer.parseInt(value.substring(2),16)).byteValue();
raf.seek(1);
raf.write(bts);
raf.close();
return "OK";
}
catch(Exception e)
{
return e.toString();
}
}
}
C:\>loadjava -user scott/tiger@128 -r -f -v c:\DumpChange.java
initialization complete
loading : DumpChange
creating : DumpChange
resolver :
resolving: DumpChange
C:\>sqlplus /nolog
SQL*Plus: Release 8.1.7.0.0 - Production on Tue Aug 13 15:35:00 2002
(c) Copyright 2000 Oracle Corporation. All rights reserved.
SQL> conn sys/change_on_install@ora8db1 as sysdba
Connected.
SQL> CREATE OR REPLACE FUNCTION SCOTT.DumpCharSet(FileName in varchar2,HexCharSet in varchar2) return varchar2 as language java name 'DumpChange.ChangeCharSet(java.lang.String,java.lang.String) return java.lang.String';
2 /
Function created.
SQL> CREATE OR REPLACE FUNCTION SCOTT.TO_CHARSET (Filename in varchar2,CharSet in varchar2) return varchar2 as
HexId varchar2(10);
ret varchar2(500);
begin
select to_char(NLS_CHARSET_ID(CharSet),'xxxx') into HexId from dual;
HexId:=trim(HexId);
select DumpCharSet(Filename,HexId) into ret from dual;
return ret;
end;
/
Function created.
SQL> execute dbms_java.grant_permission('SCOTT','SYS:java.io.FilePermission','C:\EXPDAT.DMP','read,write');
PL/SQL procedure successfully completed.
SQL> select SCOTT.to_charset('C:\EXPDAT.DMP','ZHS16GBK') from dual;
SCOTT.TO_CHARSET('C:\EXPDAT.DMP','ZHS16GBK')
--------------------------------------------------------------------------------
OK
#1
只要在目标服务器设好字符集,导入是会自动转换的.
#2
简体中文是英文的超集,应该没有什么问题.
1. EXPORT (英文session)
2. Upgrade your DB (简体中文)
3. IMPORT ( 简体中文session)
1. EXPORT (英文session)
2. Upgrade your DB (简体中文)
3. IMPORT ( 简体中文session)
#3
自动转换?如果自动能转换,那为什么有时导入后出现乱码?这怎么解释?
同时关于各个字符集的关系,能讲的详细点吗?谢谢!!!
同时关于各个字符集的关系,能讲的详细点吗?谢谢!!!
#4
http://expert.csdn.net/Expert/topic/1582/1582807.xml?temp=.2990686
很详细了
很详细了
#5
要保证导出和导入的字符集相同。
那么你导出时将现有的字符集改为中文,就可以了。
那么你导出时将现有的字符集改为中文,就可以了。
#6
Java过程修改dump文件成特定字符集
前一段时间在
http://www.itpub.net/showthread.php...15&pagenumber=1
中讨论的DMP不同字符集之间*转换工具,经过一位java朋友的帮忙,今天奉献上biti提议的java存储过程修改方法:
DumpChange.java脚本:
import java.io.*;
public class DumpChange
{
public static String ChangeCharSet(String fileName,String value)
throws IOException,NumberFormatException
{
try
{
value=value.trim();
if(value.length()<4)
value=new String("0000"+value).substring(value.length());
else if(value.length()>4)
throw new NumberFormatException(value+"is error,length>4.");
RandomAccessFile raf=new RandomAccessFile(fileName,"rw");
byte[] bts=new byte[2];
bts[0]=new Integer(Integer.parseInt(value.substring(0,2),16)).byteValue();
bts[1]=new Integer(Integer.parseInt(value.substring(2),16)).byteValue();
raf.seek(1);
raf.write(bts);
raf.close();
return "OK";
}
catch(Exception e)
{
return e.toString();
}
}
}
C:\>loadjava -user scott/tiger@128 -r -f -v c:\DumpChange.java
initialization complete
loading : DumpChange
creating : DumpChange
resolver :
resolving: DumpChange
C:\>sqlplus /nolog
SQL*Plus: Release 8.1.7.0.0 - Production on Tue Aug 13 15:35:00 2002
(c) Copyright 2000 Oracle Corporation. All rights reserved.
SQL> conn sys/change_on_install@ora8db1 as sysdba
Connected.
SQL> CREATE OR REPLACE FUNCTION SCOTT.DumpCharSet(FileName in varchar2,HexCharSet in varchar2) return varchar2 as language java name 'DumpChange.ChangeCharSet(java.lang.String,java.lang.String) return java.lang.String';
2 /
Function created.
SQL> CREATE OR REPLACE FUNCTION SCOTT.TO_CHARSET (Filename in varchar2,CharSet in varchar2) return varchar2 as
HexId varchar2(10);
ret varchar2(500);
begin
select to_char(NLS_CHARSET_ID(CharSet),'xxxx') into HexId from dual;
HexId:=trim(HexId);
select DumpCharSet(Filename,HexId) into ret from dual;
return ret;
end;
/
Function created.
SQL> execute dbms_java.grant_permission('SCOTT','SYS:java.io.FilePermission','C:\EXPDAT.DMP','read,write');
PL/SQL procedure successfully completed.
SQL> select SCOTT.to_charset('C:\EXPDAT.DMP','ZHS16GBK') from dual;
SCOTT.TO_CHARSET('C:\EXPDAT.DMP','ZHS16GBK')
--------------------------------------------------------------------------------
OK
前一段时间在
http://www.itpub.net/showthread.php...15&pagenumber=1
中讨论的DMP不同字符集之间*转换工具,经过一位java朋友的帮忙,今天奉献上biti提议的java存储过程修改方法:
DumpChange.java脚本:
import java.io.*;
public class DumpChange
{
public static String ChangeCharSet(String fileName,String value)
throws IOException,NumberFormatException
{
try
{
value=value.trim();
if(value.length()<4)
value=new String("0000"+value).substring(value.length());
else if(value.length()>4)
throw new NumberFormatException(value+"is error,length>4.");
RandomAccessFile raf=new RandomAccessFile(fileName,"rw");
byte[] bts=new byte[2];
bts[0]=new Integer(Integer.parseInt(value.substring(0,2),16)).byteValue();
bts[1]=new Integer(Integer.parseInt(value.substring(2),16)).byteValue();
raf.seek(1);
raf.write(bts);
raf.close();
return "OK";
}
catch(Exception e)
{
return e.toString();
}
}
}
C:\>loadjava -user scott/tiger@128 -r -f -v c:\DumpChange.java
initialization complete
loading : DumpChange
creating : DumpChange
resolver :
resolving: DumpChange
C:\>sqlplus /nolog
SQL*Plus: Release 8.1.7.0.0 - Production on Tue Aug 13 15:35:00 2002
(c) Copyright 2000 Oracle Corporation. All rights reserved.
SQL> conn sys/change_on_install@ora8db1 as sysdba
Connected.
SQL> CREATE OR REPLACE FUNCTION SCOTT.DumpCharSet(FileName in varchar2,HexCharSet in varchar2) return varchar2 as language java name 'DumpChange.ChangeCharSet(java.lang.String,java.lang.String) return java.lang.String';
2 /
Function created.
SQL> CREATE OR REPLACE FUNCTION SCOTT.TO_CHARSET (Filename in varchar2,CharSet in varchar2) return varchar2 as
HexId varchar2(10);
ret varchar2(500);
begin
select to_char(NLS_CHARSET_ID(CharSet),'xxxx') into HexId from dual;
HexId:=trim(HexId);
select DumpCharSet(Filename,HexId) into ret from dual;
return ret;
end;
/
Function created.
SQL> execute dbms_java.grant_permission('SCOTT','SYS:java.io.FilePermission','C:\EXPDAT.DMP','read,write');
PL/SQL procedure successfully completed.
SQL> select SCOTT.to_charset('C:\EXPDAT.DMP','ZHS16GBK') from dual;
SCOTT.TO_CHARSET('C:\EXPDAT.DMP','ZHS16GBK')
--------------------------------------------------------------------------------
OK