Oracle Import SQL file

Source: Internet
Author: User
Tags sqlplus

The company used to use DMP Operation data import and export, recently from other places people to be SQL file database files, have to learn how to import large files of SQL, good response to various emergencies.
1, first you will use Sqlplus to connect to the remote database
Sqlplus username/password @ remote database IP: Port/Instance Name
2. Use command after successful connection

sql>@E:\areadata.sql;sql>@/opt/oracle/area.sql;

Sometimes the Chinese will appear garbled problem, or error. For example:

ERROR:ORA-01756: quoted string not properly terminated

At this point, you need to troubleshoot the database server's character set and the client's character set
1. Troubleshoot the database server character set:

sql>select userenv(‘language‘) from dual;---AMERICAN_AMERICA.ZHS16GBK【此处的字符集是这个】

2. Troubleshoot the client character set
Under the Windows platform, it is the Nls_lang of the corresponding oraclehome in the registry. You can also set it yourself in a DOS window, such as:
set nls_lang=AMERICAN_AMERICA.ZHS16GBK

Under Linux, modify the Bash_profile file

$ vi .bash_profileNLS_LANG=‘AMERICAN_AMERICA.ZHS16GBK‘; export NLS_LANG

This may also be related to SQL files, you can try to set the client character set, try two more should be.

In addition, some files may appear some characters such as spaces, into the sqlplus inside will become?, such as the following waiting for input, often affect the import time:
Sql>enter value for nbsp;

So you need to set the turn off substitution variable function when executing sql>@e:\areadata.sql
Sql>set difine off;
This way there will be no waiting on the import situation, greatly improving the efficiency of the import file.

Oracle Import SQL file

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.