原创 one sql to calculate the schema's table capacity
SELECT owner, table_name, TRUNC(SUM(bytes)/(1024*1024)) MB FROM (SELECT segment_name table_name, owner, b
原创 oracle top n sentences
Oracle has some sentences for top n version oracle 10g 11g TOP-N SELECT * FROM ( SELECT name, id FROM test ORDE
原创 not exists 事例
今天一個開發問到一個not exists問題,小小做個實驗 實驗1 SQL> select * from emp e1 where not exists (select 1 from emp e2 where e1.mgr = e2.em
原创 ORA-01110 ORA-01111: name for data file 69 is unknown - rename to correct file
Today, I has added a datafile of an tablespace with 'alter tablespace tbs_name add datafile '+DATA' 8g'. I received a
原创 歸檔模式下恢復沒有備份的數據文件
測試環境 SQL> select * from v$version; BANNER -----------------------------------------------------------------------------
原创 function base index
create table t1(id number, idd varchar2(10)); insert into t1 values( 1, '11'); insert into t1 values(2, '22'); commit
原创 ORA-00600: internal error code, arguments: [4194], [53], [41], [], [], [], [], []
真心不動了,研發的同事關測試IBM 3650服務器是直接關插排電源??? 第二天加點重啓之後oracle 打開報錯ORA-00600: internal error code, arguments: [4194], [53], [41],
原创 in exists 使用
兩個寫法可以達到相同的結果 1 SQL> select * from emp where empno in (select mgr from emp); EMPNO ENAME JOB MGR
原创 oracle 11gr2 開啓memery_target 之後內存震盪
公司測試數據庫測試memery_target參數功能,利用crm系統進行測試,在加壓減壓之間徘徊,發現shared_pool、db_buffer、pga變化 很到,影響sql執行的性能,自己維護的線上數據庫一直沒有使用memery_tar
原创 There will be decreasing performance of oracle by delete whole table and then insert ...
There is a project that need collecting periodically (2 months) data into one table and then exporting it as excel fi
原创 mysql數據庫密碼破解
公司mysql dba把數據庫root密碼丟失需要破解,方法如下,適合linux、unix機器 service mysqld stop /opt/mysql/bin/mysqld_safe --skip-grant-tables &
原创 追蹤sql會話 dbms_monitor
經常會遇到一個會話中存在sql性能問題,但無法定位哪一個sql導致DB性能問題較高,這是我們需要對這個session進行監控可以通過dbms_monitor包來實現。 首先確定要監控的會話sid及serial#,可以通過v$sessio
原创 ASM相關視圖
oracle asm對於我們並不是一個黑盒子 ,我們可以通過相應視圖查看asm instance信息,和oracle系統視圖一樣。 v$asm_diskgroup x$kfgrp 記錄diskgroup內容信息 v$asm_disk x
原创 oracle nologging operation
我們都知道redo日誌是oracle恢復的基礎,但是有時候我們爲了增加數據庫運行的速度常常會通過減少redo log的產生來加快數據庫的運行速度。 一般常規的dml語句insert、update、delete是不能制止redo log 的
原创 How to understand pare(soft/hard) in AWR report
我們經常關注AWR report中pase cpu to pase elapsd % 參數,它表示sql在解析過程中使用cpu的時間佔用總時間的百分比,我們希望它接近100,這樣sql在解析的過程中沒有其它事件在等待。 當我們發現此參數值