imp-导入小写字母表问题

简介: 1建立测试表“emp_bak"使用双引号建立的表,默认为小写字母的表.SQL> create table "emp_bak" as select * from emp;Table created.

1建立测试表“emp_bak"

使用双引号建立的表,默认为小写字母的表.

SQL>  create table "emp_bak" as select * from emp;

Table created.

SQL> slect * from tab;
SP2-0734: unknown command beginning "slect * fr..." - rest of line ignored.
SQL> select * from tab;

TNAME                   TABTYPE    CLUSTERID
------------------------------ ------- ----------
BONUS                   TABLE
DEPT                   TABLE
EMP                   TABLE
E_TMP                   TABLE
OD                   TABLE
OUTPUT                   TABLE
OUTPUT2                TABLE
SALGRADE               TABLE
TS1                   TABLE
TS2                   TABLE
emp_bak                TABLE

13 rows selected.

小写字母表特点

查询需要使用单引号:


SQL> select count(*) from emp_bak;
select count(*) from emp_bak
                     *
ERROR at line 1:
ORA-00942: table or view does not exist


SQL> select count(*) from "emp_bak";

  COUNT(*)
----------
    14

是否可以建立同名大写的表?

SQL> create table emp_bak as select * from emp;

Table created.

SQL> select * from tab;

TNAME                   TABTYPE    CLUSTERID
------------------------------ ------- ----------
BONUS                   TABLE
DEPT                   TABLE
EMP                   TABLE
EMP_BAK                TABLE
E_TMP                   TABLE
emp_bak                TABLE

如何单独导入小写字母的表呢?

exp 全用户导出

[oracle@prod04 ~]$ exp scott/snow file=snow1.dmp

Export: Release 11.2.0.4.0 - Production on Mon Jan 7 18:54:29 2019

Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.


Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Export done in US7ASCII character set and AL16UTF16 NCHAR character set
server uses AL32UTF8 character set (possible charset conversion)
. exporting pre-schema procedural objects and actions
. exporting foreign function library names for user SCOTT 
. exporting PUBLIC type synonyms
. exporting private type synonyms
. exporting object type definitions for user SCOTT 
About to export SCOTT's objects ...
. exporting database links
. exporting sequence numbers
. exporting cluster definitions
. about to export SCOTT's tables via Conventional Path ...
. . exporting table                          BONUS          0 rows exported
. . exporting table                           DEPT          4 rows exported
. . exporting table                            EMP         14 rows exported
EXP-00091: Exporting questionable statistics.
. . exporting table                        EMP_BAK         14 rows exported
. . exporting table                          E_TMP         14 rows exported
. . exporting table                             OD          4 rows exported
. . exporting table                         OUTPUT          5 rows exported
. . exporting table                        OUTPUT2          3 rows exported
. . exporting table                       SALGRADE          5 rows exported
. . exporting table                            TS1       7585 rows exported
EXP-00091: Exporting questionable statistics.
EXP-00091: Exporting questionable statistics.
EXP-00091: Exporting questionable statistics.
EXP-00091: Exporting questionable statistics.
EXP-00091: Exporting questionable statistics.
EXP-00091: Exporting questionable statistics.
EXP-00091: Exporting questionable statistics.
EXP-00091: Exporting questionable statistics.
. . exporting table                            TS2     288657 rows exported
EXP-00091: Exporting questionable statistics.
EXP-00091: Exporting questionable statistics.
. . exporting table                        emp_bak         14 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 with warnings.

解决方法:

[oracle@prod04 ~]$ imp scott/snow file=snow1.dmp tables='\"emp_bak\"'

Import: Release 11.2.0.4.0 - Production on Mon Jan 7 18:45:02 2019

Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.


Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options 
Export file created by EXPORT:V11.02.00 via conventional path
import done in US7ASCII character set and AL16UTF16 NCHAR character set
import server uses AL32UTF8 character set (possible charset conversion)
. importing SCOTT's objects into SCOTT
. importing SCOTT's objects into SCOTT
. . importing table                      "emp_bak"         14 rows imported
Import terminated successfully without warnings.
相关文章
|
SQL Oracle 关系型数据库
PowerDesigner生成的建表脚本中如何把对象的双引号去掉
PowerDesigner生成的建表脚本中如何把对象的双引号去掉
147 0
|
关系型数据库 MySQL
mysql列名名称包含特殊字符的处理
上问题    不做处理的话会报错,识别不了 处理方式就是 需要把列名以反引号“`”(一般键盘的左上角数字1左边的那个键)来处理。 即查询语句为 欢迎大家一起说出自己的想法。
2601 0
|
SQL Oracle 关系型数据库
oracle将指定的表中所有字段变为大写
最近在写一个项目,用到的是oracle数据库,但是在执行oracle语句的时候总是提示找不到字段,只有将字段名称用双引号引起来才可以解决问题,最后发现是由于数据库字段名称是小写造成的,但是一个一个的手动替换太过于麻烦,要是将所有的表都替换风险又太大,因为自己涉及到的只有新增的七八张表,所以用了一个指定表名称来替换的方法。
123 0
oracle将指定的表中所有字段变为大写
|
SQL 数据库
SQL语句大小写是否区分的问题,批量修改整个数据库所有表所有字段大小写
一、实例介绍 SQL语句大小写到底是否区分呢?我们先从下面的这个例子来看一下: 例: --> 创建表,插入数据: declare @maco table (number int,myvalue varchar(2)) insert into @maco select 1,'aa' ...
1432 0
|
Oracle 关系型数据库 OLAP
|
SQL 数据库
SQL去除数据库表中tab、空格、回车符等特殊字符的解决方法
原文:SQL去除数据库表中tab、空格、回车符等特殊字符的解决方法 按照ASCII码, SELECT char(64) 例如64 对应 @,则 SELECT REPLACE('abc@qq.
3796 0