Time of Update: 2018-07-24
皓月蒼狼 2017-11-27 23:17:37 在oracle中,資料表別名不能加as,如: select a.appname from appinfo a;--正確; select a.appname from appinfo as a;--錯誤 可能與oracle中的預存程序中的關鍵字as發生衝突 在預存程序中,select 某一欄位時,後面必須緊跟into,如果select整個記錄,利用遊標的話就另當別論了。 select
Time of Update: 2018-07-24
Top-N,根據某一規則進行排序,然後取其前N行資料。 rownum:偽列,資料表中本身沒有這樣的列,是oracle資料庫為每個資料表加上的列,可以標識別行號,預設情況下,rownum按主索引來排序,若沒有主索引則自然排序。 對oracle進行分頁必須使用rownum: select employee_id,last_name,salaryfrom (select rownum rn,employee_id,last_name,salary from
Time of Update: 2018-07-24
oracle 中的 || 起連結作用,如下例: [sql] view plain copy select 'aaa' || ',' || 'bbb' || ',' || 'ccc' from dual
Time of Update: 2018-07-24
轉自:http://www.jb51.net/article/53576.htm 實際例子如下: update SYS_DICTIONARY_BAK set display_name = trim(display_name) where table_name='T_GUARDIAN' and column_name='zy' ; 引申: 如 trim('字元1' from '字串2') ,字元1隻能是單個字元。 1. trim()刪除字串兩邊的空格。 2
Time of Update: 2018-07-24
create user cmsuser identified by "cmsuser"; SQL> create user uumcuser identified by "password"; User created. SQL> grant connect,dba to uumcuser; Grant succeeded. SQL> grant exp_full_database,imp_full_
Time of Update: 2018-07-24
max min avg count sum1,整個結果集是一個組 1) 求部門30 的最高工資,最低工資,平均工資,總人數,有工作的人數,工種數量及工資總和 複製代碼 代碼如下: select max(ename),max(sal), min(ename),min(sal), &
Time of Update: 2018-07-24
1.系統預設的幾個使用者: sys ——–網路系統管理使用者,具有最高資料庫系統管理權限 system——本地系統管理使用者,許可權次於sys scott——-普通使用者,預設是鎖住的(不可用) 預設情況下:scott 密碼是 tiger (自己設定) sys 密碼是安裝的時候輸入的密碼 system 密碼是安裝的時候輸入的密碼 2.登入使用者: sqlplus sys/密碼 as sysdba (sys網路系統管理員使用者登入)
Time of Update: 2018-07-24
一、建立臨時空間 create temporary tablespace user_temp tempfile ‘E:\APP\SCOTT\ORADATA\ORCL\user_temp.dbf’ size 50m autoextend on next 50m maxsize 20480m extent management local; 二、建立資料資料表空間 create tablespace user_data logging
Time of Update: 2018-07-24
1、with admin option with admin option的意思是被授予該許可權的使用者有權將某個許可權(如create any table)授予其他使用者或角色,取消是不級聯的。 如授予A系統許可權create session with admin option,然後A又把create session許可權授予B,但管理員收回A的create session許可權時,B依然擁有create session的許可權。但管理員可以顯式收回B create
Time of Update: 2018-07-24
cmd->sqlplus “/as sysdba” 命令列登入oracle 此時可以看看預設有什麼賬戶,這步可省略。 cmd->select username from dba_users;//沒有分號會在下一行顯示個“2”,因為sqlplus每個命令應該以 分號結尾。 cmd->alter user sys identified by oracle;//可以把sys賬戶的密碼改一下,然後就可以用了。 https://localhost:5500/em/login
Time of Update: 2018-07-24
Please, note. This article is entirely based on a work done by me colleague developer, who hasn't got account on this webpage and also hasn't got time for writing this article. I'm writing it for him. I will try to forward him any comments that may
Time of Update: 2018-07-24
項目中有個功能需要從一台Oracle資料庫擷取資料,本以為是很簡單的事情,直接將原來的SqlClient換成OracleClient調用, 結果遠沒自己想的簡單。有很多需要安裝Oracle用戶端,正好項目非常急,公司也沒有Oracle環境,可把我急壞了。網上這方面搜尋後, 太多的文章,還要不停的去測試,選擇,都快煩透了。最後找了我一個哥們,他直接幫我寫了一個Demo,我改了一下連接字串,
Time of Update: 2018-07-24
public static bool DBBackup(string dmpFileName, string logFileName) { // 傳回值 bool result = false; // 備份命令,從xml檔案中擷取 "/c EXP 使用者名稱/密碼@資料庫服務名 FULL=Y INCTYPE=COMPLETE "
Time of Update: 2018-07-25
1、先前用occi操作oracle資料庫都是失敗,後來發現是我下載的庫版本和對應的dll版本不一致導致:如32庫, 卻下載了64位的dll,因此導致在初始化環境就失敗,百思不得其解。 2、在下載好對應的32位庫和32位dll,可以正常初始化環境,操作oracle資料庫。 3、只需下載2個檔案,其他版本的檔案根據自己需要下載。如我下載的是:instantclient-basic-nt-11.2.0.3.0.zip 和 instantclient-sdk-nt-11.2.0.4.0
Time of Update: 2018-07-26
解決方案一: ERROR: ORA-01034: ORACLE not available ORA-27101: shared memory realm does not exist 進程 ID: 0 會話 ID: 0 序號: 0 因為這個小小的錯誤,折騰了我好幾個小時,特記錄如下。 上網搜尋了下解決方案,如下: sqlplus "sys/password as sysdba" 串連成功,提示"已串連到空閑常式"
Time of Update: 2018-07-26
以前查oracle的版本資訊,只知道一種方法,就是用v$versions視圖,如下: SQL> select * from v$version; BANNER ---------------------------------------------------------------- Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production PL/SQL Release 9.2.0.1.0 -
Time of Update: 2018-07-26
Oracle資料庫採用那種主鍵建置原則 1、自動成長identity: 適用於MySQL、DB2、MS SQL Server,採用資料庫產生的主鍵,用於為long、short、int類型產生唯一標識 使用SQL Server 和 MySQL 的自增欄位,這個方法不能放到 Oracle 中,Oracle 不支援自增欄位,要設定sequence(MySQL 和 SQL Server 中很常用) 資料庫中的文法如下: view
Time of Update: 2018-07-26
工作以來,碰到的第一個oracle區別於sql server的地方,就是oracle的左右串連語句。 這東西,還是舉個栗子來形容比較形象。一個使用者表users(user_id,address),手機號碼錶msisdns(user_id,msisdn)。對於每一個使用者,使用者表都有對應的ID對應,但並不是每個使用者都有手機號,因此,在手機號碼錶並不一定有記錄。那我們先看下面的語句。 select u.address, m.msisdn from users u,
Time of Update: 2018-07-26
執行: select ENDDATE from tabletest 返回: ENDDATE 20140601020105 執行: select to_date(ENDDATE , 'yyyy-mm-dd hh:mi:ss') from tabletest 返回: to_date(ENDDATE , 'yyyy-mm-dd hh:mi:ss')01-JUN-14 執行: select
Time of Update: 2018-07-24
標籤:dde acl 第一個 red 問題: name 關鍵字 txt png 串連方式Oracle簡單使用Emp資料表1.sqlplus命令1)Scott使用者登入:Sqlplus