MYSQL数据库系统的设计架构
[
2008/08/27 09:04 | by askwan ]
2008/08/27 09:04 | by askwan ]
CentOs5上安装Oracle 10g R2
[
2008/07/13 22:14 | by askwan ]
2008/07/13 22:14 | by askwan ]
应网友要求,把我安装部署oracle的文档发出来,仅供参考!
一. 需要的必须的软件包:
默认安装情况下,可能有些已经安装了
二.建立oracle用户和组
一. 需要的必须的软件包:
默认安装情况下,可能有些已经安装了
Quotation
[root@server ~]# yum -y install binutils compat-db control-center gcc gcc-c++ glibc glibc-common gnome-libs
Quotation
[root@server ~]# yum -y install libstdc++ make libstdc++.so.5 libXp
二.建立oracle用户和组
Quotation
[root@server ~]# groupadd oinstall
[root@server ~]# groupadd dba
[root@server ~]# useradd -g oinstall -G dba oracle
[root@server ~]# passwd oracle
[root@server ~]# groupadd dba
[root@server ~]# useradd -g oinstall -G dba oracle
[root@server ~]# passwd oracle
用mysqlreport监控并输出mysql状态值
[
2008/04/29 23:41 | by askwan ]
2008/04/29 23:41 | by askwan ]
mysqlreport 以非常友好的方式显示MySQL状态变量值。和SHOW STATUS不同,mysqlreport以一种非常格式化的方式输出状态值,具有非常好的可读性。
官方站点是:http://hackmysql.com
安装mysqlreport非常简单
常用选项
官方站点是:http://hackmysql.com
安装mysqlreport非常简单
Quotation
#cd /usr/local/sbin
#wget hackmysql.com/scripts/mysqlreport
#chmod 755 mysqlreport
#wget hackmysql.com/scripts/mysqlreport
#chmod 755 mysqlreport
常用选项
Quotation
#mysqlreport --help
mysqlreport v3.5 Apr 16 2008
mysqlreport makes an easy-to-read report of important MySQL status values.
Command line options (abbreviations work):
--user USER Connect to MySQL as USER
--password PASS Use PASS or prompt for MySQL user's password
--host ADDRESS Connect to MySQL at ADDRESS
--port PORT Connect to MySQL at PORT
--socket SOCKET Connect to MySQL at SOCKET
--no-mycnf Don't read ~/.my.cnf
--infile FILE Read status values from FILE instead of MySQL
--outfile FILE Write report to FILE
--email ADDRESS Email report to ADDRESS (doesn't work on Windows)
--flush-status Issue FLUSH STATUS; after getting current values
--relative X Generate relative reports. If X is an integer,
reports are live from the MySQL server X seconds apart.
If X is a list of infiles (file1 file2 etc.),
reports are generated from the infiles in the order
that they are given.
--report-count N Collect N number of live relative reports (default 1)
--detach Fork and detach from terminal (run in background)
--help Prints this
--debug Print debugging information
Visit http://hackmysql.com/mysqlreport for more information.
mysqlreport v3.5 Apr 16 2008
mysqlreport makes an easy-to-read report of important MySQL status values.
Command line options (abbreviations work):
--user USER Connect to MySQL as USER
--password PASS Use PASS or prompt for MySQL user's password
--host ADDRESS Connect to MySQL at ADDRESS
--port PORT Connect to MySQL at PORT
--socket SOCKET Connect to MySQL at SOCKET
--no-mycnf Don't read ~/.my.cnf
--infile FILE Read status values from FILE instead of MySQL
--outfile FILE Write report to FILE
--email ADDRESS Email report to ADDRESS (doesn't work on Windows)
--flush-status Issue FLUSH STATUS; after getting current values
--relative X Generate relative reports. If X is an integer,
reports are live from the MySQL server X seconds apart.
If X is a list of infiles (file1 file2 etc.),
reports are generated from the infiles in the order
that they are given.
--report-count N Collect N number of live relative reports (default 1)
--detach Fork and detach from terminal (run in background)
--help Prints this
--debug Print debugging information
Visit http://hackmysql.com/mysqlreport for more information.
mysql同步复制M-S(master slave)模式
[
2008/04/22 22:47 | by askwan ]
2008/04/22 22:47 | by askwan ]
本文在上篇M-M后,实现Mysql的M-S同步复制
如下图:
mysql的安装过程比较简单,这里略过
1.在maste主机上,配置my.cnf
在[mysqld]配置段添加如下字段中增加
重启mysql
进入mysql中
增加同步帐号
此时不要关闭此终端!
记住上表前两个字段的信息 mysql-bin.000002 和 1448 。
另开一个终端:
如下图:
mysql的安装过程比较简单,这里略过
1.在maste主机上,配置my.cnf
在[mysqld]配置段添加如下字段中增加
Quotation
log-bin=mysql-bin.log
binlog-do-db=blog #要同步的数据库的名字
binlog-do-db=index #要同步的数据库的名字
server-id=1
binlog-do-db=blog #要同步的数据库的名字
binlog-do-db=index #要同步的数据库的名字
server-id=1
重启mysql
Quotation
#service mysqld restart
Quotation
#mysql -u root -ppassword
Quotation
mysql>grant replication slave on *.* to 'repication'@'%' identified by 'password';
mysql>use database;
mysql>flush tables with read lock;
mysql>show master status:
mysql>use database;
mysql>flush tables with read lock;
mysql>show master status:
Quotation
---------------------------------------------------------------------
| File | Position | Binlog_Do_DB | Binlog_Ignore_DB |
+------------------+----------+------------------+------------------+
| mysql-bin.000002 | 1448 | blog,index | |
+------------------+----------+------------------+------------------+
| File | Position | Binlog_Do_DB | Binlog_Ignore_DB |
+------------------+----------+------------------+------------------+
| mysql-bin.000002 | 1448 | blog,index | |
+------------------+----------+------------------+------------------+
此时不要关闭此终端!
记住上表前两个字段的信息 mysql-bin.000002 和 1448 。
另开一个终端:





