串連Linux伺服器操作Oracle資料庫

來源:互聯網
上載者:User

標籤:linu   執行個體   命令   串連   青海   sqlplus   product   ddr   commit   

1.串連到Linux伺服器(輸入伺服器的ip地址) 

ssh 10.199.94.227 

 

串連成功後會提示輸入密碼,輸入成功會提示。 

 

2.切換到操作Oracle資料庫 

su - oracle 

 

切換成功會提示相關資料庫的執行個體。例如:[email protected]:~>  

 

3.切換到sqlplus操作 

sqlplus /nolog 

 

切換成功會提示相關的提示:例如: 

 

SQL*Plus: Release 11.2.0.2.0 Production on Thu Jan 19 11:19:48 2012 

 

Copyright (c) 1982, 2010, Oracle.  All rights reserved. 

 

4.輸入資料庫的使用者名稱和密碼 

conn personal/personal 

 

5.會提示Connected.(串連成功),顯示 SQL> : 

 

6.以下是相關的SQL語句操作: 

 

(1) 查詢的語句後面要一定要加 ; ,否則不能執行查詢,相當於plsqldev.exe工具的命令視窗的操作 

 

select *from newuseraccount (記得查詢的時候一定要加;) 

 

select email,password from userreg where  accountstype=1  and userstate=1; 

 

(2)插入或更新的語句記得還要加提交語句,才能提交事務。相當於plsqldev.exe工具的命令視窗的操作。 

 

update newuseraccount set address=‘20-青海-0-西寧市‘ where userid=638 ; 

commit ; 

串連Linux伺服器操作Oracle資料庫

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.