原创 shell 中統計字符串出現的次數
下面三個方法都可以完成這個需求1.第一種方法:使用grep命令進行統計 grep -o '字符串' file |wc -l2.第二種方法:使用awk命令進行統計 awk -v RS="@#$j" '{print gsub(/字符串/,"&
原创 myqldump 相關命令及效率
下面附上mysqldump導出的常用參數及說明: 1. –compatible = name 它告訴 mysqldump,導出的數據將和哪種數據庫或哪個舊版本的 MySQL 服務器相兼容。值可以爲ansi、mysql323、mysq
原创 WWN、WWNN和WWPN
WWN是HBA卡用的編號,每一個光纖通道設備都有一個唯一的標識,稱爲WWN(world wide name),由IEEE負責分配。在有多臺主機使用磁盤陣列時,通過WWN號來確定哪臺主機正在使用指定的LUN(或者說是邏輯驅動器),被使用的
原创 Logminer 數據庫恢復及恢復歸檔文件
1.從源庫生成spfile文件,並拷貝到目標庫 sqlplus '/as sysdba' create pfile='/oracle/tmp/pfile_dbname1_20130319.ora' from spfile; 2.目標庫使用
原创 How to zone a Brocade SAN switch in command line base?
Here are the basics to add a new device to a Brocade SAN fabric. I’m working with a Brocade DCX switch. In this scenar
原创 MySQL中ONDUPLICATEKEYUPDATE 介紹
如果你想做到數據庫中沒有數據的話插入數據、有數據的話更新數據,那麼你可以選擇ON DUPLICATE KEY UPDATE ON DUPLICATE KEY UPDATE能夠在UNIQUE索引或PRIMARY KEY存在的情況下對舊行執
原创 MySQL 主從複製的相關命令
CHANGE MASTER TO option [, option] ... option: MASTER_BIND = 'interface_name' | MASTER_HOST = 'host_name'
原创 MySQL的create table as 與 like區別
對於mysql的複製相同表結構方法,有create table as 和create table like 兩種,區別是什麼呢? create table t2 as select * from t1 where 1=2 ;
原创 如何在select into outfile 的文件中顯示column name
正常情況先select into outfile 生產的文件是不包含column name,比如如下sql(root@localhost) [test]>SELECT EVENT_NAME ,COUNT_STAR from events
原创 優化鎖操作 Optimizing Locking Operations
8.10.1 Internal Locking Methods 8.10.2 Table Locking Issues 8.10.3 Concurrent Inserts 8.10.4 Metadata Locking 8.10
原创 MySQL query cache 文檔
The MySQL Query Cache 8.9.3.1 How the Query Cache Operates 8.9.3.2 Query Cache SELECT Options 8.9.3.3 Query Cache
原创 Table Maintenance Statements
ANALYZE TABLE Syntax ANALYZE [NO_WRITE_TO_BINLOG | LOCAL] TABLE tbl_name [, tbl_name] ... ANALYZE TABLE analyze
原创 InnoDB 的相關優化
Optimizing Storage Layout for InnoDB Tables Once your data reaches a stable size, or a growing table has increased by
原创 mysqldump Tips
This section surveys techniques that enable you to use mysqldump to solve specific problems: How to make a copy a
原创 MySQL 權限名稱彙總
Table 13.1 Permissible Privileges for GRANT and REVOKE Privilege Meaning and Grantable Levels ALL [PRIVILEGES] G