Oracle 常用技巧

2021-04-09 06:27:01 字數 801 閱讀 9058

<<>>

啟動、關閉

在服務管理器中啟動 oracleservice*** (***代表例項名) 如:oracleserviceoradb10g

在服務管理器中啟動 oracleoradb10g_home1tnslistener

使用者管理

//解鎖使用者

alter user testuser account unlock;

//鎖定使用者

alter user testuser account lock;

//使用者的建立

sql>create user jxzy

>identified by jxzy_password

>default tablespace system

>quata 5m on system; //供使用者使用的最大空間限額

//授予系統特權

sql>grant create user,alter user,drop user

>to jxzy_new

>with admin option;

//刪除使用者及其所建物件

sql>drop user jxzy cascade; //同時刪除其建立的實體

//匯出匯入資料(使用者user要有dba許可權)

exp user/password file='' full=y

imp user/password file='' full=y

//命令列 sqplus 啟動

sqlplus /nolog

sqlplus sys/password as sysdba

Oracle常用技巧記錄

當一段查詢sql執行特別慢的時候,需要對其進行優化,此時藉助plsql developer工具,檢視sql的執行計劃,所有問題一目瞭然。這裡只是舉個簡單的例子,如何讀懂執行計劃,可以參考博文 1.1方式一 如何進入執行計劃的頁面?可以選中要執行的sql,然後單擊工具欄上的按鈕 如下圖 也可以選中要執...

ORACLE的常用知識技巧

對資料表要進行備份可以在同一表空間裡新建一張表 create table t bak as select from t 如果要對某些表或檢視建立同義詞可以通過語句執行 select create or replace public synonym table name for user.table ...

ORACLE 常用技巧(持續更新ing)

1 爬樹 with t as select 00 as code child,1 as code parent from dual union select 01 as code child,00 as code parent from dual union select 02 as code ch...

Oracle資料庫SqlLoad常用技巧總結

ad 線下活動 三大新銳html 5企業匯聚51cto 大話移動前端技術 oracle資料庫sqlload常用技巧的相關知識是本文我們主要要介紹的內容,本文我們總結了14種sqlload的使用技巧,並給出了測試用的檔案原始碼,接下來我們就開始一一介紹這部分內容,希望能夠對您有所幫助。1 控制檔案中註...

不可不知的Oracle常用技巧

1.方法一 複製表結構和資料 create table temp clientloginuser asselect distinct userid from tbuserloginlog 2.方法二 僅複製資料 如果表結構一樣 insert into mytable select from your...