Linux下oracle資料庫常用操作及命令

來源:互聯網
上載者:User

本文出自 "高興F" 部落格,請務必保留此出處http://gaoxingf.blog.51cto.com/612518/121138

 

Linux下oracle資料庫常用命令

 

Oracle使用者下執行:

$ sqlplus system/manager @ file.sql 執行sql指令檔

$ sqlplus system/manager 登入sqlplus,使用system使用者

$ sqlplus /nolog 以不串連資料庫的方式啟動sqlplus,啟動資料時會用到

$ lsnrctl status/stop/start oracle的監聽器listener狀態查看/停止/啟動

$ imp system/manager file=/tmp/expfile.dmp log=/tmp/implogfile.log ignore=y fromuser=expuser touser=impuser 使用者模式表資料匯入,這裡我只使用了幾個參數,還有好多沒有用到的參數,如果沒有特別指定值,就使用預設的值。

$ exp username/password file=/tmp/expfile.dmp log=/tmp/proV114_exp.log 使用者模式表資料匯出,這是最簡單的匯出方法,還有好多參數沒有寫出來。

 

Sqlplus下執行:

SQL> conn / as sysdba sysdba使用者模式串連

SQL> startup 啟動資料庫

SQL> shutdown immediate 立即關閉資料庫

SQL> desc dba_users; 查詢dba_users表結構

SQL> select username from dba_users; 查詢當前sid下的所有使用者的username

SQL> select count(*) from username.tablename; 查詢tablename表的行數

SQL> drop user username cascade; 刪除名稱為username的oracle使用者

SQL> select distinct table_name from user_tab_columns; 查看當前user模式下所有表名 ~~~~~~今就想到這些,先寫到這,呵呵~~~

 

常用的資料庫操作工具: SQL Explorer eclipse的外掛程式工具,也可以下載單獨的包來運行,免費方便實用。 暫時就在使用這個,其它的好久沒用了,也不知啥版本了,呵呵~~~用到時再寫了~~~

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.