Pages: 4/10 First page Previous page 1 2 3 4 5 6 7 8 9 10 Next page Final page [ View by Articles | List ]
刚刚装好的库,简单测试没有问题后,放下,不到半个钟头,再次连接上去,发现数据库已经不可用了……

Quotation
oracle@staging:~$ sqlplus /nolog

SQL*Plus: Release 10.2.0.1.0 - Production on Mon May 18 16:13:29 2009

Copyright (c) 1982, 2005, Oracle.  All rights reserved.

SQL> conn  / as sysdba
Connected to an idle instance.

SQL> select * from scott.emp;
select * from scott.emp
*
ERROR at line 1:
ORA-01034: ORACLE not available


机器并没有重启,oracle莫名其妙的到了不可用状态!我开始以为是谁关闭了,下开启指令
Quotation
SQL> startup
ORACLE instance started.

Total System Global Area 1224736768 bytes
Fixed Size                  2020384 bytes
Variable Size             318770144 bytes
Database Buffers          889192448 bytes
Redo Buffers               14753792 bytes
ORA-01102: cannot mount database in EXCLUSIVE mode


这下遭遇ORA-01102: cannot mount database in EXCLUSIVE mode 错误了
Search On Google,then get the problem's anwser
大意是 “Oracle被异常关闭时,有资源没有被释放……”

检查警告日志,也证实了这一点,系统异常

马上查$ORACLE_HOME/dbs,发现一lk【SID】 文件,果然呆在这里
Quotation
staging:dbs# fuser -u lkCAPITALV
lkCAPITALV:            368(oracle)   370(oracle)   372(oracle)   374(oracle)   376(oracle)   378(oracle)   380(oracle)   382(oracle)   384(oracle)   386(oracle)   388(oracle)   397(oracle)  1472(oracle)  1557(oracle)  8852(oracle)


杀掉先:
Quotation
staging:dbs# fuser -k lkCAPITALV


再查,发现已经没有资源占用
Quotation
staging:dbs# fuser -u lkCAPITALV  

ok!
再次启动Oracle
Quotation
oracle@staging:~$ sqlplus /nolog

SQL*Plus: Release 10.2.0.1.0 - Production on Mon May 18 16:24:05 2009

Copyright (c) 1982, 2005, Oracle.  All rights reserved.
SQL> conn / as sysdba
Connected to an idle instance.
SQL> startup
ORACLE instance started.

Total System Global Area 1224736768 bytes
Fixed Size                  2020384 bytes
Variable Size             318770144 bytes
Database Buffers          889192448 bytes
Redo Buffers               14753792 bytes
Database mounted.
Database opened.
SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options

----------------------END----------------------------
Tags: ,
innodb到现在还是mysql下最主要的支持事务的存储引擎,那么好,现在我们又多了一种选择了,
一种新的事务存储引擎 PBXT Storage Engine

以后mysql的主要存储引擎架构趋势已成:
Open in new window

这是原作者对这种存储引擎的总结:
Quotation
PrimeBase XT (PBXT) is a transactional storage engine for MySQL which can be loaded dynamically by the pluggable storage engine API of MySQL 5.1. It has been designed for modern, web-based, high concurrency environments. Full MVCC (multi-version concurrency control) support and a unique "write-once" strategy make PBXT particularly effective under heavy update loads.


先来看一下PBXT的架构吧:
Open in new window
AICD特性完整支持! 众多特性:

Quotation
1. MVCC: Multi-version concurrency control, enables reading without locking.
2. Transactional: support for BEGIN, COMMIT and ROLLBACK and recovery on startup.
3. ACID compliant: Atomic, Consistent, Isolated, Durable (once committed changes cannot be lost).
4. Row-level locking: updates use row-level locking allowing for maximum concurrency.
5. Deadlock detection: immediate notification if client processes are deadlocked.
6. Referential Integrity: foreign key support.
7. Write-once: PBXT avoids double-writes by using a log-based architecture.
8. BLOB streaming: In combination with the BLOB Streaming engine.


06年就开始有这么个东西了,始生之物,其形必丑,没错,开始的时候不是很完善,不过经过作者这2,3年的不断改进,
更新,已经有了巨大进步了。

作者的这张和INNODB的测试的性能图可以看得出差别了
作者的测试环境:
MySQL 5.1.30
8 core, 64-bit, Linux machine
with an SSD drive and a 5 warehouse DBT2 database.
Open in new window

从这个图的表现看出,随着引擎的版本越高,这存储引擎表现越来越好,
例如1.0.08的表现似乎有超越innodb的趋势。
以后要慢慢深入研究一下这个东东了

引擎下载:http://www.primebase.org/download/
快速指南:http://www.primebase.org/download/index.php#qg_source
白皮书: http://www.primebase.org/download/pbxt_white_paper.pdf

参考资料:
http://dev.mysql.com/tech-resources/articles/pbxt-storage-engine.html
http://pbxt.blogspot.com/
         在以前的文章中《mysql同步复制M-M(master master)模式》 里,配置了这样一种双向同步机制,两台服务器都可以保持同步并且都可以读写,但是这种配置方案还不完善,生产上实际可能出现很多问题,最突出的一点就是库中某些表有自增长auto_increment字段的时候,容易产生键值冲突错误!

      熟读过mysql的replication的docs,我们发现mysql其实对这个主键冲突已经有相应的解决方案,只是互联网很多配置过程都没有加进去这点,直接拿来用,出问题的概率是比较大的。
      
      mysql的服务器变量auto_increment_increment【增长值】和auto_increment_offset【偏移量】可以协调多主服务器复制和AUTO_INCREMENT列。并且每个变量有一个默认的(并且是最小的)值1,有一个最大值65,535。把这些变量设置为非冲突的值,例如在同一个表插入新行时,多主服务器配置主的服务器就不会发生AUTO_INCREMENT值冲突,这里就可以解决这个问题,比如就这里的两台服务器A和B为例:
在A的[mysqld]字段下增加:

auto-increment-increment = 2
auto-increment-offset = 1


在B的[mysqld]字段下增加:

auto-increment-increment = 2
auto-increment-offset = 2


         这样,两台服务器同时有数据插入到有auto_increment的字段是,就不会发生冲突,一个简单的例子就是A下插入的ID为1,3,5,7……,以此类推,B下插入的ID就为2,4,6,8,……,以此类推,但即使这样,mysql建议也不要使用这种双向同步机制,主要的原因是目前的同步还不支持在多源服务器上同步更新锁协议,从而无法保证数据库数据操作的“原子性”问题。那么本文就算对上篇mysql复制文章的补充。

----------End-----------
    今天才知道,mysql从5.1.23后,安装innodb引擎,以前的--with-innodb编译参数已经无效了,需要用--with-plugins方式安装,这个选项可选参数很多,包括partition daemon_example ftexample archive blackhole csv example federated heap innobase myisam myisammrg ndbcluster这些东西,而--with-plugins默认的参数是none,也就是说不指定一些参数,上面很多新特性,都不会编译进去Mysql了,stupid

   现在新版本的innodb引擎已经出来了,现在的版本是“InnoDB Plugin, release 1.0.2 ”
这里下载: http://www.innodb.com/innodb_plugin/download/v102/
相关文档:http://www.innodb.com/doc/innodb_plugin-1.0/

要用最新的innodb,可以替换一下mysql源码里面的旧版本

简单写下过程:


tar -zxf mysql-5.1.30.tar.gz
cd mysql-5.1.30/storage
wget http://www.innodb.com/download/innodb_plugin/innodb_plugin-1.0.2.tar.gz
tar -zxf innodb-1.0.2.tar.gz
rm -fr innobase
mv innodb-1.0.2 innobase
cd ..
./configure --prefix=/usr/local/mysql/ --enable-assembler --with-extra-charsets=complex --enable-thread-safe-client --with-big-tables --with-readline --with-ssl --with-embedded-server --enable-local-infile --enable-profiling --with-mysqld-user=mysql --with-plugins=partition,heap,innobase,myisam
make
make install  

  
安装完后初始化表后就可以启动了

---------END---------
Pages: 4/10 First page Previous page 1 2 3 4 5 6 7 8 9 10 Next page Final page [ View by Articles | List ]