oracle 導入sql文件 漢字亂碼_將現有的sql腳本導入 Oracle 數據庫,中文亂碼問題...

將現有的sql 腳本導入 Oracle數據庫

比如 在windows 系統下,可以寫一個 bat 來實現直接導入

如:bat 中的內容如下,logs.log 將會記錄執行日志

sqlplus user/password@dbname @create.sql > logs.log

create.sql 中的內容可以是需要執行的sql 語句,也可以是其他sql 腳本,如:

@leave_create.sql

exit

leave_create.sql 中的內容如下

create table a_employee (

id number(10) primary key ,

name varchar2(255) not null,

password varchar2(255) not null ,

email varchar2(255) ,

role varchar2(255) ,

manager_id number(10)

);

create sequence seq_employee minvalue 1 nomaxvalue start with 1 increment by 1 nocycle nocache;

INSERT INTO a_employee(id,name,password,email,role,manager_id) VALUES (seq_employee.nextval,'老板','123','ee@163.com','boss',NULL);

INSERT INTO a_employee(id,name,password,email,role,manager_id) VALUES (seq_employee.nextval,'主任','123','cc@163.com','manager',1);

INSERT INTO a_employee(id,name,password,email,role,manager_id) VALUES (seq_employee.nextval,'員工','123','aa@163.com','user',3););

commit;

執行bat 文件,理論上數據創建完成。

打開日志文件,發現文件中報錯

ERROR:

ORA-01756: quoted string not properly terminated

查詢數據,發現 中文顯示亂碼

解決方法:

檢查客戶端的編碼格式

使用sqlplus 連接數據庫 執行?Select?userenv('language')?from?dual; ?查詢結果為:AMERICAN_AMERICA.ZHS16GBK

設置windows 環境變量

NLS_LANG=AMERICAN_AMERICA.ZHS16GBK

TNS_ADMIN=D:\oracle\product\10.2.0\client_1\NETWORK\ADMIN (客戶端的安裝路徑下)

sql 腳本也有一定的編碼格式(可以使用客戶端連接工具保存的sql 文件 來保證sql 腳本文件的編碼正確性)

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/news/542973.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/542973.shtml
英文地址,請注明出處:http://en.pswp.cn/news/542973.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

html圖片多邊形怎么寫,使用CSS3構建的圖像多邊形裁剪動畫特效

CSS語言:CSSSCSS確定html {background: #333;}.polygon {-webkit-clip-path: polygon(50% 0%, 79.38926% 9.54915%, 97.55283% 34.54915%, 97.55283% 65.45085%, 79.38926% 90.45085%, 50% 100%, 20.61074% 90.45085%, 2.44717% 65.45085%, 2.44717% 34.54915%, 20.…

python函數示例_帶Python示例的complex()函數

python函數示例Python complex()函數 (Python complex() function) complex() function is a library function in Python, it is used to get the complex number from given a real number or/and an imaginary number (which is an optional part), it accepts either a rea…

windows 下 git 禁用 CRLF 轉換 LF

2019獨角獸企業重金招聘Python工程師標準>>> windows中的換行符為 CRLF, 而在linux下的換行符為LF,所以在執行add . 時出現提示,解決辦法: 刪除根目錄 .git 文件夾禁用自動轉換 > git config --global core.autocrl…

cmd執行sql文件路徑 oracle_oracle 基礎 執行sql文件

Oracle執行外部文件:sql>new.sql執行多個sql文件:1.把所有的文件都放在同一個目錄下,然后在命令行里執行命令:c:>dir/b > d:/1.sql會把所有的sql文件名都輸出到一個sql文件中。2.用UltraEdit打開生成的sql文件,altC切換到…

獲取天氣html,使用htmlparser獲取sohu的天氣預報

首先,我們新建一個類,存放天氣信息/** Created on 2005-3-8** To change the template for this generated file go to* Window>Preferences>Java>Code Generation>Code and Comments*/packageorg.exoplatform.portlets.chinaweather.compon…

使用gulp構建前端(三)

為什么80%的碼農都做不了架構師?>>> 使用gulp構建前端(三) 緊接著上述文章內容,開始新的插件的使用 插件三 gulp-clean-css,作用減小文件大小,并給引用url添加版本號避免緩存,一個需…

c++中atan2函數_atan2()函數以及C ++中的示例

c中atan2函數C atan2()函數 (C atan2() function) atan2() function is a library function of cmath header, it is used to find the principal value of the arc tangent of y/x, where y is the proportion of the y-coordinate and x is the proportion of the x-coordin…

python不合法的布爾表達式_python測試題

一、填空題 1.Python使用符號標示注釋;以劃分語句塊。 2、Python序列類型包括 、、三種; 是Python中唯一的映射類型。 3、Python中的可變數據類型有,不可變數據類 型有。 4、Python的數字類型分為、、等子類型。 5、設s=‘abcdefg’,則s[3]值是 ,s[3:5]值是 , s[:5]值是…

網站html標簽如何優化,網站HTML標簽優化教程

真正需要SEOer掌握并經常使用的HTML標簽也就那么幾個,本小節丈哥seo帶來的是頁面HTML標簽優化。title標簽 – 標題標簽1)title標簽用法網站SEOHTML標簽優化教程 – 丈哥seo2)標題標簽的作用關于網站標題寫法與操作技巧有許多,需要怎么優化標題的朋友可以…

hypot函數_hypot()函數與C ++中的示例

hypot函數C hypot()函數 (C hypot() function) hypot() function is a library function of cmath header, it is used to find the hypotenuse of the given numbers, it accepts two numbers and returns the calculated result of hypotenuse i.e. sqrt(x*x y*y). hypot()…

docker 磁盤問題:device or resource busy

問題:[roothdp-gp-dk02 ~]# docker start 01ea65845e45Error response from daemon: Cannot start container 01ea65845e45: Error getting container 01ea65845e4547be24bc3db0bc3b424faf52b8a0534eb525aa829dd9fd6081c2 from driver devicemapper: Error mounting…

axure form列表_常見的列表頁如何用Axure畫出來

列表頁是PM畫原型的時候最容易碰到的頁面類型,那么如何快速畫出并且展現交互呢?我們從具體的例子開始講解其中的技巧,和各種不同的演變場景。希望初級PM可以通過這篇文章改進下自己的畫法。列表頁基本是由頁面框架,上導航&#xf…

python中divmod_divmod()函數以及Python中的示例

python中divmodPython divmod()函數 (Python divmod() function) divmod() function is a library function, it is used to get the quotient and remainder of given values (dividend and divisor), it accepts two arguments 1) dividend and 2) divisor and returns a tup…

html 輪播圖的鼠標事件,這是圖片輪播的代碼 html+css,怎么加上鼠標懸停移出繼續功能?...

該樓層疑似違規已被系統折疊 隱藏此樓查看此樓.one {position: absolute;width: 500px;height: 400px;overflow: hidden;}.one_cantent img {width: 500px;height: 300px;float: left;}.one_cantent {width: 2500px;height: 400px;position: absolute;left: 0px;animation-name…

微軟Azure云之企業Exchange 2016部署12—配置負載平衡

上幾節我們把Exchange2016郵箱系統配置完畢了,本節我們來配置開通需要對外的端口,并對這些端口進行負載均衡配置,如下圖紅框所示:1.Exchange服務端口Exchange2016需要對外開通以下的端口,來對外提供不同的服務&#xf…

linux多線程求和_linux多線程pthread系列函數詳解

linux多線程pthread系列函數詳解(一)為什么要引入線程線程技術早在60年代就被提出,但是在80年代才真正使用到操作系統中。傳統UNIX也支持多線程概念,但在一個進程中只允許有一個線程,這樣多線程就意味著多進程。現在多線程技術已經被很多操作…

python獨立log示例_帶有Python示例的math.log()方法

python獨立log示例Python math.log()方法 (Python math.log() method) math.log() method is a library method of math module, it is used to get the natural logarithm of a given number to base e (by default). It accepts the number and a base (which an optional) a…

搭建云計算機win10,win10電腦做云服務器

彈性云服務器 ECS彈性云服務器(Elastic Cloud Server)是一種可隨時自助獲取、可彈性伸縮的云服務器,幫助用戶打造可靠、安全、靈活、高效的應用環境,確保服務持久穩定運行,提升運維效率三年低至5折,多種配置可選了解詳情Windows遠…

聚類分析在用戶行為中的實例_用戶關注行為數據分析過程詳解-描述統計+聚類...

以下是基于一小段用戶關注產品的行為數據分析過程詳細描述,各位老師如有不同意見或優化建議,還請不吝賜教。一、數據大致是這樣的(已經脫敏處理)二、數據預處理從年款提取出年限,從價格標識出價格區間,隨便寫一下SQL如下&#xff…

centos下升級jdk版本

2019獨角獸企業重金招聘Python工程師標準>>> 由于安裝的centos系統,自帶了jdk1.6和1.7的版本,介于在平時開發,用了1.8.為了保持開發環境的一致,故此需要升級,放辦maven打包等工具的使用。 查看系統的jdk版本…