ITPUB论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

返回列表 发新帖
更多
查看: 4397|回复: 3

是不是原因字符集 [复制链接]

注册会员

初级会员

精华贴数
0
技术积分
26
社区积分
0
注册时间
2005-9-27
论坛徽章:
0
发表于 2005-10-17 18:07:03 |显示全部楼层
从其它数据库备份出来的dmp,导入到本数据库时发现所有的表名为中文的表都没有导进来,而且如果存储过程中用到中文表时,导过来时表名变为????,乱码!
同样的道理如果从本机导出dmp,如果表名为中文的话,导的时候显示为I_????(本来为I_光缆接头),这些表根本导不出来!
用select  *  from  V$NLS_PARAMETERS;查看发现:
NLS_LANGUAGE------AMERICAN,
NLS_TERRITORY----AMERICA,
NLS_DATE_LANGUAGE---AMERICAN,

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

注册会员

该如何选择呢?

精华贴数
0
技术积分
1884
社区积分
522
注册时间
2003-4-9
论坛徽章:
8
每日论坛发贴之星
日期:2005-08-15 01:01:12会员2006贡献徽章
日期:2006-04-17 13:46:34
发表于 2005-10-17 18:38:11 |显示全部楼层
查看一下备份文件的文件头。或者你的导入日志应该可以看出来原来的数据库字符集!

使用道具 举报

注册会员

初级会员

精华贴数
0
技术积分
26
社区积分
0
注册时间
2005-9-27
论坛徽章:
0
发表于 2005-10-18 10:39:40 |显示全部楼层
我看了一下备份日志!是这样的:
连接到: 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 ,与我现在的是一样啊!为什么中文表名导不进去!

使用道具 举报

超级版主

天下有雪

精华贴数
66
技术积分
208411
社区积分
6479
注册时间
2001-10-8
论坛徽章:
100
ITPUB元老
日期:2005-02-28 12:57:00ITPUB官方微博粉丝徽章
日期:2011-06-28 19:45:36现任管理团队成员
日期:2011-05-07 01:45:08ITPUB9周年纪念徽章
日期:2010-10-08 09:28:52ITPUB技术丛书作者
日期:2010-09-26 15:00:232010系统架构师大会纪念
日期:2010-09-03 16:39:572010数据库技术大会纪念徽章
日期:2010-05-13 10:04:282009架构师大会纪念徽章
日期:2010-01-18 13:43:21祖国60周年纪念徽章
日期:2009-10-09 08:28:00ITPUB8周年纪念徽章
日期:2009-09-27 10:21:212009日食纪念
日期:2009-07-22 09:30:00参与2009年中国云计算大会纪念
日期:2009-06-05 10:02:28
发表于 2005-10-18 11:27:02 |显示全部楼层
不建议使用中文表名,俺是从来没有用过
不过测试一下也是没有问题的,请看

[PHP]
SQL> create table 测试 as select username from dba_users;

Table created.

Elapsed: 00:00:00.08
SQL> select * from 测试;

USERNAME
------------------------------
SYS
SYSTEM
OUTLN
EYGLE
CSMIG
TEST
REPADMIN
SCOTT
CJH
CJWEE
MLQIN

USERNAME
------------------------------
DBSNMP
WMSYS

13 rows selected.

Elapsed: 00: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 (c) 1982, 2002, Oracle Corporation.  All rights reserved.


Connected to: Oracle9i 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 bitmap, functional 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

SQL> drop table 测试
  2  /

Table dropped.

Elapsed: 00:00:00.36
SQL> !
SP2-0042: unknown 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 (c) 1982, 2002, Oracle Corporation.  All rights reserved.


Connected to: Oracle9i 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 EYGLE's objects into EYGLE
. . importing table                         "测试"         13 rows imported
Import terminated successfully without warnings.
[oracle@jumper oracle]$ exit
exit

SQL> select * from 测试;

USERNAME
------------------------------
SYS
SYSTEM
OUTLN
EYGLE
CSMIG
TEST
REPADMIN
SCOTT
CJH
CJWEE
MLQIN

USERNAME
------------------------------
DBSNMP
WMSYS

13 rows selected.

Elapsed: 00:00:00.01
SQL>

[/PHP]

使用道具 举报

相关内容推荐
您需要登录后才可以回帖 登录 | 注册

TOP技术积分榜 社区积分榜 徽章 电子杂志 团队 统计 邮箱 虎吧 老博客 文本模式 帮助
  ITPUB首页 | ITPUB论坛 | 数据库技术 | 企业信息化 | 开发技术 | 微软技术 | 软件工程与项目管理 | IBM技术园地 | 行业纵向讨论 | IT招聘 | IT文档 | IT博客
CopyRight 1999-2011 itpub.net All Right Reserved. 北京皓辰网域网络信息技术有限公司版权所有 联系我们 网站律师 隐私政策 知识产权声明
京ICP证:060528号 北京市公安局海淀分局网监中心备案编号:1101082001 广播电视节目制作经营许可证:编号(京)字第1149号
  
回顶部