Time of Update: 2014-06-15
需求:統計WAIT_ORDER表中的工單總數、未處理工單總數、已完成工單總數、未完成工單總數。表結構 : 為了舉例子方便,WAIT_ORDER表只有兩個欄位,分別是ID、STATUS,其中STATUS為工單的狀態。1表示未處理,2表示已完成,3表示未完成總數。SQL: SELECT COUNT(B.ID) AS 工單總數, &
Time of Update: 2014-06-15
在Oracle 10g logical standby 的模式下,如果主庫出現了故障,備用庫也可以迅速切換成主庫使用。 參考oracle 官方文檔中7.3.2 Failovers Involving a Logical Standby Database 章節,切換過程介紹的很詳細。 這雷根據實際項目需要,總結成下列三步。 第一步,將邏輯備庫的應用模式關閉,近可能應用完所有的歸檔記錄檔,使資料丟失度盡量小。 使用該SQL 檢查日誌的應用情況。 SELECT APPLIED_SCN, LATEST_
Time of Update: 2014-06-15
Oracle spatial 空間資料SQL查詢操作相關執行個體--select dlbm,dlmc,trim(zldwdm) as zldwdm_1 from gzdt where nvl(zldwdm,'t')='t' or zldwdm='';update gzdt set ZLDWDM='510113106' where nvl(zldwdm,'t')='t' or zldwdm='';commit;delete from gzdt where ZLDWDM like '51
Time of Update: 2014-06-15
MSCA(Mobile Supply Chain Application)日誌的收集Reference Note:338291.1 - Howto Enable WMS / MSCA Logging1. Locate the mwa.cfg file:In 11i: $MWA_TOP/secure/In R12: $INST_TOP/admin/install/2. Ensure trace is enabled in the mwa.cfg file.You should see trace
Time of Update: 2014-06-15
Oracle 9i提供了dbms_redefinition包來實現資料庫的表的線上重定義功能。在實際的應用上,我們可以利用這個包來進行:(1)堆表與分區之間進行轉換。(2)重建表以減少HWM。10g能shrink,9i如果用move tablespace and rebuild index在move的時候會鎖表,如果想實現線上降低HWM,只能用這個了。(3)線上更改表結構,如更改列的前後順序,將column_a,column_b改成column_b,column_a1.建立測試表create
Time of Update: 2014-06-15
Oracle 行轉列 的寫法:/*DROP TABLE FOO;*//**建立一張示範的表**/CREATE TABLE FOO ( BBBID NUMBER(2), --主鍵 DEPID NUMBER(2), --單位編號 AAC006 VARCHAR2(1) --性別 1男 2女
Time of Update: 2014-06-15
Pg XLOG檔案(常說的REDOLOG)名字的命名方法是在XLogFileName宏裡定義的,分別由時間軸ID、日誌ID、段ID的八位16進位數依次構成。例如00000001000000010000008F。#define XLogFileName(fname,tli, log, seg) \snprintf(fname, MAXFNAMELEN, "%08X%08X%08X", tli, log,
Time of Update: 2014-06-15
背景:1) When we take a disk offline in case the disk is corrupted or database is not able to read or write from the disk. In case of Oracle database 10g, oracle engine use to balance the other disks with the content of offline disk. This process was a
Time of Update: 2014-06-15
HEXTORAW 文法: HEXTORAW(string) 功能: 將由string表示的位元值轉換為一個RAW數值. String應該包含一個十六進位的數值. String中的每兩個字元表示了結果RAW中的一個位元組..HEXTORAW和RAWTOHEX為相反的兩個函數. 使用位置: 過程性語言和SQL語句。 RAWTOHEX 文法: RAWTOHEX(rawvalue) 功能: 將RAW類數值rawvalue轉換為一個相應的十六進位表示的字串.
Time of Update: 2014-06-15
Oracle建立DB-LINK測試條件兩台伺服器遠程:IP:192.168.0.18,SID: usertest,使用者名稱:usertest,密碼:123456本地:IP: 192.168.8.90,SID: wjn,使用者名稱:userwjn,密碼:mosquito0參數設定1. 查看資料庫global_name執行select * from global_name;遠端資料庫18返回: USERTEST.US.ORACLE.COM本機資料庫9
Time of Update: 2014-06-15
1.建立一個表T2插入兩行資料,第一行資料寫如果歸檔日誌,第二行資料在聯機日誌中SQL> create table t2( a1 number(10), a2 char(10)) tablespace users; SQL> insert into t2 values (
Time of Update: 2014-06-15
虛擬機器裡的Linux安裝了Oracle,由於在Windows物理機要用到PL/SQL Developer串連到虛擬機器裡的Oracle,但是不想在物理機裡在重新安裝一下Oracle了(太大了,沒地了=。=)。於是用到了Oracle Instant Client。好了廢話不多說了。步驟如下:1、先在Linux裡配置好監聽。listener.ora 檔案內容如下# listener.ora Network Configuration File: /u01/app/oracle/product/10
Time of Update: 2014-06-15
在看代碼的過程中碰到了這一用法,不太理解,google了一下。它的意義其實是如果在insert語句末尾制定了“on duplicate key update”語句的話,則當插入行會導致一個unique索引或者primary key中出現重複值,則執行update中的語句,否則才插入新行。例如,如果列a被定義為unique,並且值為1,則下列語句有同樣的效果,也就是說一旦出入的記錄中存在a=1的情況,直接更新c = c + 1,而不執行c = 3的操作。insert into table(a,
Time of Update: 2014-06-15
查看Oracle資料庫版本·SQL> select * from v$version;BANNER--------------------------------------------------------------------------------Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - ProductionPL/SQL Release 11.2.0.1.0 - ProductionCORE11.2.0
Time of Update: 2014-06-15
如果插入Oracle的當前系統時間可以用 SYSDATEINSERT INTO FLOOR VALUES ( SYSDATE ) ;往Oracle資料庫中插入日期型資料(to_date的用法)今天碰到了需要往Oracle資料庫中插入日期型資料,要使用TO_DATE函數,在網上發現一篇寫的不錯的文章,摘來一起分享。 INSERT INTO FLOOR VALUES ( to_date ( '2007-12-20 18:31:34' , 'YYYY-MM-DD HH24:MI:SS' )
Time of Update: 2014-06-15
【Oracle故障】ORA-27054 NFS file system where the file is created or resides is not mounted with correct options 在資料備份過程中,由於目標是使用NFS檔案系統,因此在匯入的時候遇到了BUG,報錯如下: ORA-39001: invalid argument valueORA-39000: bad dump file specificationORA-31641:
Time of Update: 2014-06-15
詳見文檔:Oracle Database Release Notes11g Release 2 (11.2) for IBM AIX on POWER Systems (64-Bit)Part Number E23560-031、 Installation, Configuration, and Upgrade Issues for Release 11.2.0.3Review the following sections for information about issues that
Time of Update: 2014-06-15
今天在Ubuntu Linux下本來玩玩Android的源碼看下的。那小的怎看根目錄的空間已然不多。所以想把MySQL卸掉然後裝到自己想要裝的地方,所以又開始弄起MySQL來了(好像違背了我的初衷啊^_^),在加上我的導師是做資料庫的,下學期還要想跟著導師寫個小型資料庫呢,所以乾脆換了今天的目的。相關參考:Ubuntu 12.04 下安裝MySQL 5.5.25 見 1.
Time of Update: 2014-06-15
Oracle資料庫同步 在兩台oracle資料庫之間測試成功,下面就總結一下吧: 需求: 現有兩台oracle資料庫伺服器A和B(A,B可以是在同一內網,也可以是在互連網上的兩台獨立機器)。A和B裡有都有testable表,結構一樣,現需要當A庫中的testable表變化時,B庫裡的testable也相應變化資料 我的解決方案: 在A中建立到B庫的連結,然後對要同步的表做一個同義synonym,最後建一個觸發器,就可以完成了。當然,你所用的當前的使用者要有相應的許可權去執行這些操作。
Time of Update: 2014-06-15
主伺服器:172.16.15.20從伺服器:172.16.15.301、兩節點分別安裝mysql# pvcreate /dev/sda5 # vgcreate myvg /dev/sda5 # lvcreate -L 10G -n mydata myvg # mkdir -p /data/mydata