ITPUB??ì3
ITPUB论坛 » Oracle数据库管理 » 是不是原因字符集

标题: 是不是原因字符集
离线 Arraymissroad20
初级会员



精华贴数 0
个人空间 0
技术积分 26 (43191)
社区积分 0 (630441)
注册日期 2005-9-27
论坛徽章:0
      
      

发表于 2005-10-17 18:07 
是不是原因字符集

从其它数据库备份出来的dmp,导入到本数据库时发现所有的表名为中文的表都没有导进来,而且如果存储过程中用到中文表时,导过来时表名变为????,乱码!
同样的道理如果从本机导出dmp,如果表名为中文的话,导的时候显示为I_????(本来为I_光缆接头),这些表根本导不出来!
用select  *  from  V$NLS_PARAMETERS;查看发现:
NLS_LANGUAGE------AMERICAN,
NLS_TERRITORY----AMERICA,
NLS_DATE_LANGUAGE---AMERICAN,

NLS_CHARACTERSET却是ZHS16GBK,
总觉得有点不对!
请问各位大哥大姐这个问题如何解决!不胜感激!
谢谢!
紧急!


只看该作者    顶部
离线 zflying2000
好好学习天天向上


精华贴数 0
个人空间 30
技术积分 1810 (855)
社区积分 523 (1267)
注册日期 2003-4-9
论坛徽章:8
会员2006贡献徽章每日论坛发贴之星    
      

发表于 2005-10-17 18:38 
查看一下备份文件的文件头。或者你的导入日志应该可以看出来原来的数据库字符集!


__________________
---------------------------------------------------------------
MSN GROUP:oracle.dba.china@hotmail.com
电信相关群:2596683 只添加从事电信相关的人,请自觉!
-----------------------------
越学习越发现自己无知.很困惑!学习学习在学习...
-----------------------------
不懂不懂真不懂!!
---------------------------
只看该作者    顶部
离线 missroad2004
初级会员



精华贴数 0
个人空间 0
技术积分 26 (43191)
社区积分 0 (630441)
注册日期 2005-9-27
论坛徽章:0
      
      

发表于 2005-10-18 10:39 
我看了一下备份日志!是这样的:
连接到: Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.1.0 - Production
已导出 ZHS16GBK 字符集和 AL16UTF16 NCHAR 字符集
那是不是说我用的备份的dmp文件字符集是ZHS16GBK ,与我现在的是一样啊!为什么中文表名导不进去!


只看该作者    顶部
离线 eygle
天下有雪


精华贴数 65
个人空间 0
技术积分 206389 (1)
社区积分 6443 (214)
注册日期 2001-10-8
论坛徽章:56
现任管理团队成员2007年度ITPUB杰出贡献ITPUB长老会成员ITPUB元老ITPUB维基人授权会员
生肖徽章2007版:鼠2008年新春纪念徽章生肖徽章2007版:龙生肖徽章2007版:猴ITPUB新首页上线纪念徽章生肖徽章:蛇

发表于 2005-10-18 11:27 
不建议使用中文表名,俺是从来没有用过
不过测试一下也是没有问题的,请看
PHP code:


SQL
create table 测试 as select username from dba_users;



Table created.



Elapsed00:00:00.08

SQL
select from 测试;



USERNAME

------------------------------

SYS

SYSTEM

OUTLN

EYGLE

CSMIG

TEST

REPADMIN

SCOTT

CJH

CJWEE

MLQIN



USERNAME

------------------------------

DBSNMP

WMSYS



13 rows selected
.



Elapsed00:00:00.00

SQL
> !

[
oracle@jumper oracle]$ exp eygle/eygle file=a.dmp          



Export
Release 9.2.0.4.0 Production on Tue Oct 18 10:58:24 2005



Copyright 
(c19822002Oracle Corporation.  All rights reserved.





Connected toOracle9i Enterprise Edition Release 9.2.0.4.0 Production

With the Partitioning option

JServer Release 9.2.0.4.0 
Production

Export done in ZHS16GBK character set 
and AL16UTF16 NCHAR character set



About to export specified users 
...

exporting pre-schema procedural objects and actions

exporting foreign function library names for user EYGLE 

exporting PUBLIC type synonyms

exporting private type synonyms

exporting object type definitions for user EYGLE 

About to export EYGLE
's objects ...

. exporting database links

. exporting sequence numbers

. exporting cluster definitions

. about to export EYGLE'
s tables via Conventional Path ...

. . 
exporting table                     PLAN_TABLE          0 rows exported

. . exporting table                             T1          5 rows exported

. . exporting table                             T2         13 rows exported

. . exporting table                           测试         13 rows exported

exporting synonyms

exporting views

exporting stored procedures

exporting operators

exporting referential integrity constraints

exporting triggers

exporting indextypes

exporting bitmapfunctional and extensible indexes

exporting posttables actions

exporting materialized views

exporting snapshot logs

exporting job queues

exporting refresh groups and children

exporting dimensions

exporting post-schema procedural objects and actions

exporting statistics

Export terminated successfully without warnings
.

[
oracle@jumper oracle]$ exit

exit



SQLdrop table 测试

  2  
/



Table dropped.



Elapsed00:00:00.36

SQL


SP2
-0042unknown command "" - rest of line ignored.

SQL> !

[
oracle@jumper oracle]$ imp eygle/eygle file=a.dmp tables=测试



Import
Release 9.2.0.4.0 Production on Tue Oct 18 10:59:03 2005



Copyright 
(c19822002Oracle Corporation.  All rights reserved.





Connected toOracle9i Enterprise Edition Release 9.2.0.4.0 Production

With the Partitioning option

JServer Release 9.2.0.4.0 
Production



Export file created by EXPORT
:V09.02.00 via conventional path

import done in ZHS16GBK character set 
and AL16UTF16 NCHAR character set

importing EYGLEs objects into EYGLE

. . importing table                         "测试"         13 rows imported

Import terminated successfully without warnings
.

[
oracle@jumper oracle]$ exit

exit



SQLselect from 测试



USERNAME

------------------------------

SYS

SYSTEM

OUTLN

EYGLE

CSMIG

TEST

REPADMIN

SCOTT

CJH

CJWEE

MLQIN



USERNAME

------------------------------

DBSNMP

WMSYS



13 rows selected
.



Elapsed00:00:00.01

SQL
>




__________________
只看该作者    顶部
 
    

相关内容


CopyRight 1999-2006 itpub.net All Right Reserved.
北京皓辰广域网络信息技术有限公司. 版权所有
E-mail:Webmaster@itpub.net
京ICP证:010037号 联系我们 法律顾问