MySQL 4.1+对多字符的支持
MySQL 4.1的字符集支持(Character Set Support)有两个方面:字符集(Character set)和排序方式(Collation)。对于字符集的支持细化到四个层次:服务器(server),数据库(database),数据表(table)和连接(connection)。 实际操作中, 就算设置了表的默认字符集为UTF-8并且通过UTF-8编码发送查询,你会发现存入数据库的仍然是乱码。问题就出在这个connection连接层上。解决方法是在发送查询前执行一下下面这句:SET NAMES 'utf8';在 PHP 中一般是在connect/pconnect 后 select_db完执行.[@more@]SET NAMES 'x' 语句等效为3条语句:SET charact
sqlplus的命令行回调
借助 http://sourceforge.net/projects/uniread/ 可以实现 sqlplus 的命令好回调: shell$ uniread sqlplus /nolog依赖三个包:GNU readline http://cnswww.cns.cwru.edu/php/chet/readline/rltop.html Term::ReadLine::Gnu http://search.cpan.org/dist/Term-ReadLine-Gnu/ IO::Tty http://search.cpan.org/dist/IO-Tty/[@more@]
分区只读的错误
Message from syslogd@m32.cax.inter at Tue Jul 31 16:07:25 2007 ...m32.cax.inter kernel: journal commit I/O error [@more@]Disabled Privacy Extensions on device c0344160(lo) IPv6 over IPv4 tunneling driver divert: not allocating divert_blk for non-ethernet device sit0 eth0: no IPv6 routers present cciss: cmd f71c0000 timedout Buffer I/O error on device cciss/c0d3p3, logical block 4839571 lost page write due to I/O error on cciss/c0d3p3 Aborting journal on device cciss/c0d3p3. __journal_rem
查看和监控ORACLE的SQL
1. 查看本用户下的各种对象的SQL脚本 SQL语句:[@more@]表: select * from cat; select * from tab; select table_name from user_tables;视图: select text from user_views where view_name=upper('&view_name');索引: select index_name,table_owner,table_name,tablespace_name,status from user_indexes order by table_name; 触发器: select trigger_name,trigger_type,table_owner,table_name,status from user_triggers;快照: select owner,name,master,table_name,last_refresh,next from user
删除100W行数据的方法
找到了两种方法删除100W行的数据[@more@]1, ------------------ declare v_n number :=0; begin if v_n < 100万 then delete from datta where csid=41 and rownum<2001; v_n := v_n+2000; commit; end if; delete from datta where csid=41; commit; end; /2, ------------- 1.根据用户所提需求过滤需要删除的源数据,create 临时表 as select rowid rid from 需要删除的表 where 删除条件。 2.使用pl/sql block来删除数据,这样能保证及时递交,防止lock过多的行导致系统负载增加。这里需要注
ORA-30036 的错误解决
There is not enough space left either due to the datafiles being full, autoextend which is not set at datafile level or due to a disk which's full. You'll have to check the size of the datafiles attached to the undo tablespace and check whether they can autoextend or not..[@more@]SQL> delete from data where sid=41;delete from data where sid=41 *ERROR at line 1:ORA-30036: unable to extend segment by 128 in undo tablespace 'UNDOTBS1'SQL> select file_name, bytes, autoextensibl
tom 关于oracle 开发原则
1.我们应该尽量使用单个SQL语句来实现应用需求2.如果单个SQL无法实现,考虑使用PL/SQL来实现3.如果PL/SQL无法实现,接下来可以尝试使用Java存储过程来实现4.如果Java过程也不行,尝试使用C的外部存储过程来解决5.如果以上都不能实现,那么你应该认真考虑你为什么要实现这个需求...[@more@]