DB分類文章 顯示方式:簡文 | 列表

2007年11月20日

logminer應用(查尋所操作過的sql語法)

主要目地:查尋所操作過的sql語法

前言:
在操作logmnr之前先提一下redo log file的作用,redo log file 主要是用來存放執行中、執行後的sql指令,所以在redo log裏可查到
1、資料改變的記錄 (insert / update / delete / ddl的動作)
2、scn值
3、commit_scn
4、owner、table name
5、redo、undo的sql語法等等

重要的view有
V$LOGMNR_CONTENTS : 存放我們解譯後的sql  (注意,當我們離開這個session後,裏面的資料將會自動清除)
V$LOGMNR_DICTIONARY :如是使用字典檔時,這裏會有一筆資料;字典檔的用處主要是用於反解譯oracle的語言成我們所明了的文字,存放oracle內部的資料都是編碼過的, 如 insert into Object#2581(col#1, col#2) values (hextoraw('4a6f686e20446f65'),hextoraw('c306'));",這種東西對我們來說是很難了解的,所以我們如要 看到類似INSERT INTO emp(name, salary) VALUES ('John Doe', 50000); 這種描述的話,就需要字典檔來幫忙了
V$LOGMNR_LOGFILE:記錄被分析的檔案明細
V$LOGMNR_LOGS                  Synonym for V_$LOGMNR_LOGS
...繼續閱讀

Posted by my_work at 樂多Roodo!22:16回應(0)引用(0)

2007年11月6日

General Space Management Enhancements

1、SYSAUX tablespace:OverView
  • 角色是補助system tablespace,
  • 存在指令、函式庫的地方
  • 當新建database時,會順便產生
  • 跟system tablespace一樣具有一些特別的保護機治
    無法reamanent、read write、extent management local、segment space management auto、drop
  • 不支援 transportable tablespace
  • 如sysaux tablespace遺失、損壞將會讓一些oracle的功能失效
...繼續閱讀

Posted by my_work at 樂多Roodo!23:20回應(1)引用(0)

10g備份跟還原相關(3/3)

Setting Duration and Throttling Option
1、copy database in 10 hours with minimum impact
RMAN>backup as copy duration 10:00 minimized load database;
2、back up tablespace in 4 hours
RMAN>backup duration 4:00 filesperset 1 tablespace users;
3、back up as  many files as possible in 4 hours
RMAN>backup duration 4:00 partial filesperset 1 database;

duration <hrs>:<mins> [partial] [minimize {time|load}]
partial:假如在指定時間內沒有完成備份將不會發生錯誤訊習。如沒有指定的話,將會停止rman執行跟顯示錯誤訊習
minimize time:儘可能的在指定的時間內完成備份的動作
minimize load:儘可能的不影響正常的運作之下完成備份的動作



summary
  • use the flash recovery area to simplify file managemenet for all recovery-related files
  • apply incremental backups to data file image copies to speed up recovery time
  • iuse the block change tracking file to create faster incremental backups
  • use incremental backups to refresh a clone database
  • use compressed backup sets to save storage space

overview
  • setting up a flash recvoery area and managing space
  • enabling block change tracking
  • using the Oracle-suggested strategy for backups
  • using optimized incremental backups
  • recovering with incrementally updated backups
  • performing RMAN channel failover

Posted by my_work at 樂多Roodo!23:19回應(0)引用(0)

2007年10月9日

10g備份跟還原相關(2/3)

 10g rman提供的優點
1、單一介面處理全部的備份跟還原流程。

2、加強增量備份特性以縮短份、還原時間

3、提供image 備份的方式縮短restore的時間

4、提供增量備份去clone出db

5、提供壓縮備份檔的選項
...繼續閱讀

Posted by my_work at 樂多Roodo!9:04回應(0)引用(0)

2007年09月8日

9i RAC 筆記(2)


4、有關Shared Disk
 rac看來,每一個node的組成都跟標準的oracle一樣,都是由conrtrolfiledatafileredo logfile(不一定一定要使用)所組成的,只有在存放這些實体檔案地方要特別的處理。而oracle官方是建議使用ocfsraw來解決,但只要是符合cluster file system的第三方軟体都可以替代ocfsraw
   ...繼續閱讀

Posted by my_work at 樂多Roodo!10:37回應(0)引用(0)

2007年08月28日

9i RAC 筆記(1)

Oracle RAC 檔案系統簡介

raw:9i/10g/11g支援
在一般檔案系統中存在著所謂 buffer cache 來提高 IO 處理效率,當使用者存取硬碟資料時,會先將資料放入此暫存空間,再提供 user process 進行讀取 / 寫入。這樣的 IO 過程對一般資料存取時或許是不錯的方式,但是在資料庫的存取應用下,反而會成為一個 IO 瓶頸。
因為 Oracle 本身已經提供了 SGA 負責資料暫存管理,因此這樣的架構下會產生所謂的 double buffering 。況且針對資料存取處理上, Oracle 記憶體中提供的資料暫存演算法肯定比 OS 所提供的資料暫存處理方式來的有效率。
簡單來說,如果我們要讀取一個表格中的某個 block ,他必須先從 disk 讀取後存放在檔案系統中 buffer cache 後,再複製到屬於 Oracle 的 DB buffer cache 內進行屬於真正資料庫所需的資料操作。寫入資料的時候,也必須要先從 Oracle data buffer 寫入檔案系統 cache buffer ,然後再批次寫入 disk 。在大量處理資料時,整個系統的資源可能因為多餘的資料搬移而因此消耗殆盡。
因此,在 IO 效能考慮下,在建置資料庫系統時,可選擇使用 raw device 來 bypass file system cache buffer ,但在 raw device 上進行管理是相對的不方便,因為os無法直接操作到 raw 裏面的資料,而是要由 oracle 的操作介面來處理,為加管理上面的難度。

asm:10g/11g支援
簡 單的說可視為raw的加強版,之前的raw裏的檔案操作都要經過SQL語法來能才能操作。所以asm就提供了像os的操作指令,可讓os人員進行簡單的操作、查看檔案大小。並且也提供了像  raid 的功能,可用多棵分割區來加強資料的安全性,online增加空間,加入新的分割區後會自動把空間平均打散到每個分割區上;dba管理者也可不必指定 datafile放那裏,設定什名字,刪除tablespace時要注意實体檔案是否真忘了刪除等等這些好處。

ocfs1/2:9iR2/10g/11g支援
是一個clusteraware 的文件架構,在每個RAC node上都有 instance運行,並通過網絡通信+lock的機制,確保不同的node對同一個存儲區域的讀寫是在控制下進行並且所有的node通過 ocfs2 instance知道誰寫了/誰讀了。
ps:9i並不是全部的版本都有支援,也可使用協力廠商的cluster file system來取代



lvm1/2: (Logical Volume Mamager)
以前linux單一分割區給於初始大小後,將無法再調整,只有刪除再進行分割,這對於24x7的企業環境來說停止運作就是金錢的損失,所以在kernel 2.4之後就支援lvm的格式,可動態的調整每個partition的大小。

而1跟2代的差別(完整內容請看 http://www.tldp.org/HOWTO/LVM-HOWTO/lvm2faq.html#AEN338)
* For 2.4 based kernels, the maximum LV size is 2TB. For some older kernels, however, the limit was 1TB due to signedness problems in the block layer. Red Hat Enterprise Linux 3 Update 5 has fixes to allow the full 2TB LVs. Consult your distribution for more information in this regard.
* For 32-bit CPUs on 2.6 kernels, the maximum LV size is 16TB.
* For 64-bit CPUs on 2.6 kernels, the maximum LV size is 8EB. (Yes, that is a very large number.)

redhat gfs :
redhat 推出的cluster file system 的文件架構
http://www.redhat.com/magazine/008jun05/features/gfs_nfs/ (GFS VS NFS)
https://www.redhat.com/mailman/listinfo/linux-cluster (GFS maillist)

cluster file system簡介:
主要需求是要做到檔案共享給多台機器使用,而能正確的處理同時間對檔案的讀寫不會發生損壞的架構。在這個原理之下你是採用那種檔案格式為何就不重要了,只要廠商能設計出符合這個原理的廠品就可了。我查到的廠品有(更多的資訊就請自行上google尋找了)
Oracle Cluster file system, OCFS
IBM General Parallel File System (GPFS).
Veritas cluster file system. VxCFS
OSCP-Certified NAS Network File System (NFS)
Red Hat Global File System (GFS)
HP  Unified Cluster Portfolio
Microsoft Cluster Service (MSCS)




...繼續閱讀

Posted by my_work at 樂多Roodo!0:32回應(0)引用(0)

2007年08月8日

RMAN auxiliary 的應用

簡介: 9i rman 除了備份的功能之外,也附加了一些額外的應用,這次是介照如何用rman 的auxiliary 產生一個副本的db

環境簡介:
os:Red Hat Enterprise Linux AS release 4 (Nahant Update 1)
oracle: 9.2.0.4.0 (32位元)
RAM:1G ...繼續閱讀

Posted by my_work at 樂多Roodo!9:12回應(8)引用(1)

2007年08月2日

Oracle 9iR2 online create dataguard

os: rhce 4.0
oracle: 9iR2

目標: 大多數的資料都是需要停止db的運作才建置起data guard的,但真實情況中,大多數的企業中是不太能忍受長時間的停止運作
           為了符合現實情況,這次需要二個pc來完成所需要的環境

作用: 做異地備援、縮短移轉機器的停止運作時間 ...繼續閱讀

Posted by my_work at 樂多Roodo!21:15回應(4)引用(0)

2007年07月26日

9i使用logmnr的簡介

os:redhat 4.0

oracle 9iR2

...繼續閱讀

Posted by my_work at 樂多Roodo!13:12回應(17)引用(0)
 [第一頁]  [3]  [4]  [5]  [6]  [7]  [8]  [9]  [10]  [11]  [12]  [最終頁]