Home | Mirror | Search

Netkiller Database 手札

PostgreSQL, MySQL, Oracle ...

Mr. Neo Chan, 陳景峰(BG7NYT)


中國廣東省深圳市龍華新區民之街道溪山美地
518109
+86 13113668890
+86 755 29812080

文檔初創于April 6, 2008

版權聲明

轉載請與作者聯繫,轉載時請務必標明文章原始出處和作者信息及本聲明。

文檔出處:
http://netkiller.sourceforge.net
http://netkiller.github.com

$Date: 2013-02-04 09:33:18 +0800 (Mon, 04 Feb 2013) $


您可以使用iBook閲讀當前文檔

目錄

自述
1. 系列文檔
2. 作者簡介
3. 寫給讀者
I. MySQL
1. MySQL Server
1. MySQL Installation
1.1. Installation by apt-get under debian/ubuntu
1.2. Installation by source code
1.3. MySQL binary distribution
1.4. mysql-5.5.21-debian6.0-i686.deb
1.5. CentOS 6.2 + MySQL 5.5.25 (RPM)
1.6. mysql-admin
2. my.cnf
2.1. bind-address
2.2. Configuring Database Character Encoding
2.3. max_connections
2.4. storage-engine
2.5. max_allowed_packet
2.6. skip-name-resolve
2.7. 禁用TCP/IP連結
2.8. timeout
2.9. Example for my.cnf
3. mysql log
4. Security
5. Replication
5.1. Master Slave
5.1.1. Master
5.1.2. Slave
5.1.3. Testing
5.1.4. 將現有資料庫遷移到主從結構資料庫
5.1.5. 主從複製安全問題
5.1.6. 主從不同步問題
5.2. Master Master(主主)
5.2.1. Master A
5.2.2. Master B
5.2.3. 將Master A 資料庫 同步到 Master B 兩端資料庫內容保持一致
5.2.4. Master A - B 同步兩端資料庫
5.2.5. Master A 資料庫解除只讀權限
5.2.6. 查看主主的工作狀態
5.3. 與複製有關的問題
5.3.1. expire-logs-days
5.3.2. Semisynchronous Replication
6. MySQL Custer
6.1. Management node (MGM node)
6.2. Data node
6.3. SQL node
6.4. Starting
6.5. Shutdown
6.6. Testing
7. Monitoring
7.1. Analysis and Optimization
7.1.1. mytop - top like query monitor for MySQL
7.1.2. mtop - MySQL terminal based query monitor
7.1.3. innotop
7.1.4. mysqlreport
7.2. Munin
7.3. Cacti
7.4. Monitoring MySQL with SNMP
8. Import / Export (Backup and Recovery)
8.1. Export(Backup)
8.2. Import(Recovery)
8.3. xml
8.4. 備份表數據
8.5. source
8.6. 使用 mysqlhotcopy 備份 MyISAM 引擎的資料庫
8.7. AutoMySQLBackup
8.8. xtrabackup - Open source backup tool for InnoDB and XtraDB.
8.8.1. Percona yum Repository
8.8.2. Creating an Incremental Backup
9. Snapshot Backup
3. Client and Utility Programs
1. mysql - the MySQL command-line tool
1.1. ~/.my.cnf
1.2. 屏幕輸出到檔案
1.3. 終端編碼
1.4. Unix Socket
1.5. 重定向巧用
2. mysqldump - a database backup program
2.1. 備份資料庫,無結構,只有數據
2.2. 備份資料庫結構(不備份數據)
2.3. 使用完整的insert插入數據
2.4. --extended-insert / --skip-extended-insert
2.5. --where
3. mysqladmin - client for administering a MySQL server
3.1. reload
3.2. 更改密碼
3.3. status
3.4. process list
4. myisamchk — MyISAM Table-Maintenance Utility
5. mysqlcheck — A Table Maintenance and Repair Program
6. mysqlslap - load emulation client
7. mysqldumpslow - Parse and summarize the MySQL slow query log.
8. mysql log
4. Database Administration
1. User Account Management
1.1. Create User
1.2. Drop User
1.3. Rename User
1.4. SET PASSWORD
1.5. Reset root password
2. Access Privilege System
2.1. SHOW GRANTS
2.2. show privileges
2.3. Grant privileges
2.4. Revoke privileges
2.5. Show Privileges
2.6. MAX_QUERIES_PER_HOUR/MAX_UPDATES_PER_HOUR
3. Maintenance 資料庫維護
3.1. CHECK 檢查表
3.2. ANALYZE 分析表
3.3. CHECKSUM
3.4. OPTIMIZE 優化表
3.5. REPAIR 修復
4. SHOW COMMAND
4.1. 查看版本
4.2. status
4.2.1. show status
4.2.2. show master status
4.2.3. show slave status
4.2.4. show plugins
4.3. variables
4.3.1. wait_timeout
4.3.2. table_lock_wait_timeout
4.3.3. low_priority_updates
4.3.4. character_set
4.3.5. datadir
4.3.6. storage_engine
4.4. binary
5. DDL - Data Definition Language
1. Database
1.1. create
1.2. drop
1.3. Alter
1.4. Rename
1.5. CHARACTER
1.6. show create database
2. Table
2.1. create table ... select
2.2. modifiy table
2.3. TEMPORARY Table
2.4. Collate
2.5. CHARACTER
2.6. DEFAULT
2.7. KEY
2.7.1. PRIMARY KEY
2.8. COMMENT
3. Index
3.1. SHOW INDEX
3.2. CREATE INDEX
3.3. DROP INDEX
3.4. rebuild
4. 外鍵(Foreign Key)
4.1. FOREIGN KEY (RESTRICT)
5. View
6. Trigger
6.1. create trigger
6.2. drop trigger
6.3. show triggers
6.4. EXAMPLE
7. Partitioning
7.1. EXPLAIN PARTITIONS
7.2. SHOW CREATE TABLE
7.3. range
7.4. list
7.5. HASH
7.5.1. LINEAR HASH
7.6. 添加分區
7.7. ERROR 1503 (HY000): A PRIMARY KEY must include all columns in the table's partitioning function
6. SQL Statement Syntax
1. DISTINCT
2. group by
3. replace
4. OUTFILE/LOAD DATA INFILE
4.1. Export data to CSV from MySQL
5. SQL 92
6. Functions and Operators
6.1. COUNT
6.2. UUID()
6.3. String
6.3.1. LEFT/RIGHT
6.3.2. RPAD/LPAD
6.3.3. CONCAT
6.3.4. GROUP_CONCAT
6.3.5. replace
6.4. Date and Time
6.4.1. year/month/day hour:minite:second
6.4.2. Unix time
6.4.3. DATE_FORMAT
6.4.4. DATE_SUB
6.4.5. datediff / timediff
7. 事務處理和鎖定語句
7.1. 排他鎖
7.2. 表的加鎖與解鎖
7.3. 事務所用到的表
8. MySQL 專有命令
8.1. SQL_NO_CACHE
7. Optimization
1. Buffering and Caching
1.1. Query Cache SELECT Options
2. SQL
8. MySQL Connectors
1. JDBC
2. ODBC
3. MySQL native driver for PHP - mysqlnd
4. python-mysqldb
9. MySQL GUI/Web Manager
1. HeidiSQL
2. Toad for MySQL Freeware
3. phpMyAdmin - MySQL web administration tool
4. Maatkit Essential command-line utilities for MySQL
10. FAQ
1. 資料庫內容替換
2. 查看錯誤代碼
2.1. ERROR 1153 (08S01) at line 3168: Got a packet bigger than 'max_allowed_packet' bytes
2.2. ERROR 1129 (00000): Host 'XXXXXX' is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts'
3. 臨時表是否需要建索引
4. Kill 腳本
11. HandlerSocket
12. MariaDB
13. Maatkit
II. PostgreSQL
14. PostgreSQL 安裝
1. Ubuntu 12.04.1 LTS 安裝
2. PostgreSQL 配置
2.1. postgresql.conf
2.2. pg_hba.conf
3. 創建dba用戶
15. Administration
1. User 用戶管理
1.1. SUPERUSER
1.2. 刪除用戶
2. Database
2.1. 刪除資料庫
3. Table
4. Backup / Restore
4.1. import
4.2. 大型資料庫
16. PostgreSQL GUI
1. pgAdmin III
2. phpPgAdmin
3. Monitoring
3.1. PgBadger
4. pgModeler - PostgreSQL Database Modeler
17. FAQ
III. Oracle
18. Installing Oracle Database
1. Installing Oracle Database 10g Release 2 on Linux x86
2. 11gR2
3. Installing Oracle Client
4. Silence Install - Database
4.1. Response File
4.2. OS 配置腳本
4.3. 運行 runInstaller
5. Silence Install - Client
19. Manager
1. listener.ora
1.1. TNS 配置
1.1.1. 11gR2
2. Account
2.1. show user
2.2. DEFAULT_TABLESPACE
2.3. unlock/lock
3. 顯示表
4. oracle 817 script
5. Script for automatic startup on boot
6. Run level shell script to start Oracle 10g services on RedHat Enterprise Linux (RHAS 4)
20. Oracle Gui
1. Create instance
2. Oracle Net Configuration Assistant
3. Oracle Enterprise Manager
4. Other GUI - phpOraAdmin
21. CLI
1. SQL*Plus
1.1. startup/shutdown
1.2. conn
1.3. parameter
1.3.1. db
1.3.2. instance_name
1.3.3. service_name
1.3.4. global_name
1.3.5. db_name
1.3.6. db_domain
1.3.7. sga
1.3.8. size
1.3.9. spfile
1.3.10. cache
1.4. $ORACLE_HOME/sqlplus/admin/glogin.sql
1.5. @運行SQL
2. lsnrctl
3. RMAN
3.1. 資料庫模式
3.2. 完全備份
3.3. 增量備份
3.4. 恢復資料庫
3.5. 是用tar打包rman檔案
IV. NoSQL
22. MongoDB
1. Quickstart
1.1. Starting Mongo
1.2. Ubuntu MongoDB
1.3. CentOS MongoDB
2. Security and Authentication
3. Replication
4. Drivers
4.1. Using MongoDB in PHP
5. mongo 命令行
5.1. help
5.2. show 查看命令
5.3. 索引管理
5.4. 記錄管理
5.4.1. save
5.4.2. update
5.4.3. remove
5.4.4. find
6. RockMongo
23. Redis
1. Redis 安裝
1.1. CentOS
1.2. Ubuntu
1.3. Test Redis
2. phpRedisAdmin
24. Cassandra
1. Getting Started
1.1. Downloading and Installation
1.2. Running Cassandra
1.3. cli tool
1.4. Testing Cassandra
2. Configure Cassandra
2.1. Envionment variables
2.2. log4j.properties
2.3. storage-conf.xml
3. Keyspace
3.1. Schema
3.1.1. Keyspace
3.1.2. Column family
3.2. Keyspace example
4. Cluster
4.1. Running a cluster
4.2. Running a single node
4.3. nodetool
25. Hypertable
1. Hypertable 安裝
1.1. Hypertable standalone 單機安裝
1.2. Hypertable on HDFS(hadoop) 安裝
1.3. MapR
1.4. ThriftBroker
1.5. 檢驗安裝
2. Code examples
2.1. PHP
3. HQL
3.1. namespace 命名空間管理
3.2. Table 表
26. Membase
27. TokyoCabinet/Tyrant
28. Flare
29. Voldemort
30. LevelDB
31. CouchDB
V. Database Relational
32. DB-Engines - DB-Engines Ranking
33. SysBench
34. SuperSmack
35. GreenSQL
36. ETL (Extract-Transform-Load)
37. Database design & E-R diagram
1. opensource database design tools
2. OpenSystemArchitect
3. SQL Power Architect

範例清單

1.1. my.cnf
5.1. BEFORE/AFTER
5.2. uuid()
7.1. SQL_CACHE 測試
21.1. full backup
22.1. MongoDB Test
22.2.
24.1. Twitter
24.2. Twissandra
comments powered by Disqus