Oracle 相關整理

2021-08-30 03:35:21 字數 1298 閱讀 2696

dba 相關

1 .資料庫與例項的區別

資料庫是相關作業系統檔案的集合(儲存在硬碟上的檔案集合)

例項是一組作業系統程序和記憶體區域的集合(即服務service)

乙個例項對應於乙個資料庫,乙個資料庫可以對應多個例項

2.1. 使用伺服器端net manager 對本地監聽等進行配置

2 使用客戶端的enterprise manager console 進行伺服器的管理

管理方案: 概要檔案(控制帳號控制&連線超時時間等)

使用客戶端的net configuration assistant 配置遠端訪問伺服器位址及服務名

3. schema 對應乙個使用者

schema 物件包括表,索引,儲存過程,觸發器等

非schema 物件包括表空間,角色,概要檔案等

3.許可權

使用者許可權:可以使用角色進行許可權管理

匯入指令碼語言@ d:\...

sql 相關

1. 字元與日期需要放在單引號中,字元區分大小寫, 別名需要使用as "" 之間使用between -- and

2. 模糊查詢中如搜尋欄位name 'c_colin%sheery'這種帶了 '_'與'%' 的模糊查詢此時就需要用到轉意字元'\'

模糊查詢條件如下:name like 'c\_colinerry' escape '\'

decode(job_id,'clerk',salary*1.5 1

'it eng',salary*2 2

salary )3 as "revise salary" 函式可以有2,3 也可以無/且1,2,3 資料型別需要一致

case 表示式 case lower(job_id) when 'clerk' then salary*1.5 1

when 'it eng' then salary*2 2

else salary 3

end as "revise salary" 其中end 必須/且1,2,3 資料型別需要一致

資料型別轉換

to_number('$456,934.12','$999,999.99') 字元轉換為數字

to_char(1234,'999,9') 數字轉換為字元

to_char(sysdate,'yyyy-mm-dd hh24:mi:ss') 日期轉化為字元

to_date('2009-12-31 12:32:12','yyyy-mm-dd hh24:mi:ss') 字元轉換為日期

注意 number<--->char<---->date 當number 轉換為date型時需要先char 再 date 反之亦然

Oracle 相關查詢整理

1 查詢表名及對應表注釋內容 select from user tab comments c where c.comments is not null 2 查詢表及對應欄位的注釋內容 表字段注釋 select from user col comments d where d.table name o...

oracle下使用者相關問題整理

首先,提供乙份oracle10g預設安裝的使用者名稱與密碼對照表 當然,也可以在資料庫安裝完成後,利用dbca database configuration assistant 來進行配置,啟動畫面如下 在sqlplus可以更改使用者的密碼,或者進行解鎖 登陸 sqlplus 使用者名稱 密碼 網域...

ORACLE時間相關的查詢整理

指定日期的季度 select to char sysdate,q from dual 指定日期的月份 select to char sysdate,mm from dual 當年第幾周 select to char sysdate,ww from dual 本月第幾周 select to char ...