CentOS7使用exp/imp時報錯:bash: syntax error near unexpected token `(

Hoegh發表於2017-11-01
今天在CentOS7下使用exp語句匯出資料時遇到報錯,使用的指令碼都是其他環境下驗證過的指令碼,很是奇怪。

1.測試環境

CentOS 7+Oracle11.2.0.3.0

點選(此處)摺疊或開啟

  1. [root@localhost hoegh]# cat /etc/centos-release
  2. CentOS Linux release 7.2.1511 (Core)
  3. [root@localhost hoegh]#
  4. [root@localhost hoegh]# sqlplus sys/sys as sysdba

  5. SQL*Plus: Release 11.2.0.3.0 Production on 星期三 11月 1 11:43:51 2017

  6. Copyright (c) 1982, 2011, Oracle. All rights reserved.


  7. Connected to:
  8. Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
  9. With the Partitioning, OLAP, Data Mining and Real Application Testing options

  10. SQL> select * from v$version;

  11. BANNER
  12. --------------------------------------------------------------------------------
  13. Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
  14. PL/SQL Release 11.2.0.3.0 - Production
  15. CORE    11.2.0.3.0    Production
  16. TNS for Linux: Version 11.2.0.3.0 - Production
  17. NLSRTL Version 11.2.0.3.0 - Production

  18. SQL>
  19. SQL>
  20. SQL> exit
  21. Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
  22. With the Partitioning, OLAP, Data Mining and Real Application Testing options
  23. [root@localhost hoegh]#

2.exp語句報錯


點選(此處)摺疊或開啟

  1. [root@localhost hoegh]#
  2. [root@localhost hoegh]# exp hoegh/hoegh tables=(HOEGH1,HOEGH2,HOEGH3,HOEGH4,HOEGH5) file=/home/hoegh/hoegh.dmp
  3. bash: syntax error near unexpected token `(

3.解決

需要在括號上添加雙引號才行。

點選(此處)摺疊或開啟

  1. [root@localhost hoegh]#
  2. [root@localhost hoegh]# exp hoegh/hoegh tables="(HOEGH1,HOEGH2,HOEGH3,HOEGH4,HOEGH5)" file=/home/hoegh/hoegh.dmp

  3. Export: Release 11.2.0.3.0 - Production on 星期三 11月 1 11:44:58 2017

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


  5. Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
  6. With the Partitioning, OLAP, Data Mining and Real Application Testing options
  7. Export done in AL32UTF8 character set and AL16UTF16 NCHAR character set

  8. About to export specified tables via Conventional Path ...
  9. . . exporting table HOEGH1 2 rows exported
  10. . . exporting table HOEGH2 500 rows exported
  11. . . exporting table HOEGH3 1500 rows exported
  12. . . exporting table HOEGH4 2 rows exported
  13. . . exporting table HOEGH5 500 rows exported
  14. Export terminated successfully without warnings.
  15. [root@localhost hoegh]#

~~~~~~~ the end~~~~~~~~~
hoegh
2017.11.1

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/30162081/viewspace-2146700/,如需轉載,請註明出處,否則將追究法律責任。

相關文章