??xml version="1.0" encoding="utf-8" standalone="yes"?>国产在线高清精品,色就色 综合激情,日本一区二区中文字幕http://www.aygfsteel.com/wansong/category/32914.htmlwansongzh-cnThu, 21 Jun 2012 22:06:21 GMTThu, 21 Jun 2012 22:06:21 GMT60db2 import exporthttp://www.aygfsteel.com/wansong/articles/381152.htmlw@ns0ngw@ns0ngWed, 20 Jun 2012 02:57:00 GMThttp://www.aygfsteel.com/wansong/articles/381152.htmlhttp://www.aygfsteel.com/wansong/comments/381152.htmlhttp://www.aygfsteel.com/wansong/articles/381152.html#Feedback0http://www.aygfsteel.com/wansong/comments/commentRss/381152.htmlhttp://www.aygfsteel.com/wansong/services/trackbacks/381152.htmlcmd 输入 db2cw

db2 connect to DBNAME user DBUSER

db2 export to SAMPLE.ixf of ixf select * FROM SAMPLE
db2 import from SAMPLE.ixf of ixf insert_update into NAMESPACE.SAMPLE

w@ns0ng 2012-06-20 10:57 发表评论
]]>
orcal case when 的写?/title><link>http://www.aygfsteel.com/wansong/articles/364429.html</link><dc:creator>w@ns0ng</dc:creator><author>w@ns0ng</author><pubDate>Mon, 21 Nov 2011 06:08:00 GMT</pubDate><guid>http://www.aygfsteel.com/wansong/articles/364429.html</guid><wfw:comment>http://www.aygfsteel.com/wansong/comments/364429.html</wfw:comment><comments>http://www.aygfsteel.com/wansong/articles/364429.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/wansong/comments/commentRss/364429.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/wansong/services/trackbacks/364429.html</trackback:ping><description><![CDATA[case when c.claim_status='FIN' and c.CHECK_OUT_FLAG=0 then '1' else '0' end as isFinished,<br />上面q种相当于if else的语?br /><br />case c.claim_status when 'FIN' then '1' else '0' end as isFinished,<br />下面q种相当?swith 的语?img src ="http://www.aygfsteel.com/wansong/aggbug/364429.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/wansong/" target="_blank">w@ns0ng</a> 2011-11-21 14:08 <a href="http://www.aygfsteel.com/wansong/articles/364429.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>nosql hadoophttp://www.aygfsteel.com/wansong/articles/363528.htmlw@ns0ngw@ns0ngFri, 11 Nov 2011 07:08:00 GMThttp://www.aygfsteel.com/wansong/articles/363528.htmlhttp://www.aygfsteel.com/wansong/comments/363528.htmlhttp://www.aygfsteel.com/wansong/articles/363528.html#Feedback0http://www.aygfsteel.com/wansong/comments/commentRss/363528.htmlhttp://www.aygfsteel.com/wansong/services/trackbacks/363528.htmlhttp://www.infoq.com/cn/news/2011/01/nosql-why

http://www.infoq.com/cn/author/孙立;jsessionid=3E8C088BDE4FC6B8AEF843663EB5CD61


http://www.infoq.com/cn/articles/hadoop-process-develop

w@ns0ng 2011-11-11 15:08 发表评论
]]>
mysql 分区 分表http://www.aygfsteel.com/wansong/articles/360293.htmlw@ns0ngw@ns0ngSun, 09 Oct 2011 09:13:00 GMThttp://www.aygfsteel.com/wansong/articles/360293.htmlhttp://www.aygfsteel.com/wansong/comments/360293.htmlhttp://www.aygfsteel.com/wansong/articles/360293.html#Feedback0http://www.aygfsteel.com/wansong/comments/commentRss/360293.htmlhttp://www.aygfsteel.com/wansong/services/trackbacks/360293.htmlhttp://dev.mysql.com/doc/refman/5.1/zh/partitioning.html

http://cailin.iteye.com/blog/983394
http://www.iteye.com/topic/866142


w@ns0ng 2011-10-09 17:13 发表评论
]]>
数据?表字D?设计http://www.aygfsteel.com/wansong/articles/360222.htmlw@ns0ngw@ns0ngSat, 08 Oct 2011 13:11:00 GMThttp://www.aygfsteel.com/wansong/articles/360222.htmlhttp://www.aygfsteel.com/wansong/comments/360222.htmlhttp://www.aygfsteel.com/wansong/articles/360222.html#Feedback0http://www.aygfsteel.com/wansong/comments/commentRss/360222.htmlhttp://www.aygfsteel.com/wansong/services/trackbacks/360222.htmlhttp://office.microsoft.com/en-us/access-help/database-design-basics-HA001224247.aspx

w@ns0ng 2011-10-08 21:11 发表评论
]]>
sql server 排序函数 row_numberQrankQdense_rankQntile 和mysql中的写法http://www.aygfsteel.com/wansong/articles/354576.htmlw@ns0ngw@ns0ngTue, 19 Jul 2011 00:03:00 GMThttp://www.aygfsteel.com/wansong/articles/354576.htmlhttp://www.aygfsteel.com/wansong/comments/354576.htmlhttp://www.aygfsteel.com/wansong/articles/354576.html#Feedback0http://www.aygfsteel.com/wansong/comments/commentRss/354576.htmlhttp://www.aygfsteel.com/wansong/services/trackbacks/354576.htmlhttp://blog.csdn.net/halfcup/article/details/5488517

 

五大数据库常用SQL比较(?
http://www.aheiwang.com/article.asp?id=14



w@ns0ng 2011-07-19 08:03 发表评论
]]>
MySQL的经典用?/title><link>http://www.aygfsteel.com/wansong/articles/342910.html</link><dc:creator>w@ns0ng</dc:creator><author>w@ns0ng</author><pubDate>Thu, 13 Jan 2011 03:14:00 GMT</pubDate><guid>http://www.aygfsteel.com/wansong/articles/342910.html</guid><wfw:comment>http://www.aygfsteel.com/wansong/comments/342910.html</wfw:comment><comments>http://www.aygfsteel.com/wansong/articles/342910.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/wansong/comments/commentRss/342910.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/wansong/services/trackbacks/342910.html</trackback:ping><description><![CDATA[MySQL的经典用??----量数据l计处理,模拟物化视图  http://www.javaeye.com/topic/727676<br /> MySQL的经典用?十一)----临时表与内存?nbsp;  http://www.javaeye.com/topic/846638<br /> <br /> Mysql 复制讄 http://www.javaeye.com/topic/586239<br /> mysql性能优化的参数简?http://www.javaeye.com/topic/607589<br /> <br /> http://www.javaeye.com/forums/tag/mysql <img src ="http://www.aygfsteel.com/wansong/aggbug/342910.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/wansong/" target="_blank">w@ns0ng</a> 2011-01-13 11:14 <a href="http://www.aygfsteel.com/wansong/articles/342910.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>oracle referencehttp://www.aygfsteel.com/wansong/articles/337618.htmlw@ns0ngw@ns0ngTue, 09 Nov 2010 05:56:00 GMThttp://www.aygfsteel.com/wansong/articles/337618.htmlhttp://www.aygfsteel.com/wansong/comments/337618.htmlhttp://www.aygfsteel.com/wansong/articles/337618.html#Feedback0http://www.aygfsteel.com/wansong/comments/commentRss/337618.htmlhttp://www.aygfsteel.com/wansong/services/trackbacks/337618.html

w@ns0ng 2010-11-09 13:56 发表评论
]]>
oracle q接?配置http://www.aygfsteel.com/wansong/articles/336934.htmlw@ns0ngw@ns0ngWed, 03 Nov 2010 07:28:00 GMThttp://www.aygfsteel.com/wansong/articles/336934.htmlhttp://www.aygfsteel.com/wansong/comments/336934.htmlhttp://www.aygfsteel.com/wansong/articles/336934.html#Feedback0http://www.aygfsteel.com/wansong/comments/commentRss/336934.htmlhttp://www.aygfsteel.com/wansong/services/trackbacks/336934.html

一般是300
  不要过q个?br />
最?5
  最大可讑ֈ125
  然后具体q有一些其它的参数都在我的EMAIL里有说明
  所有的容器那几个参数Q无法是有的是写在PROPERTIES有的是写在XML有的是直接图形化讑֜界面里而己
  如果你的一个FOR循环里套?00个以上的PSTMT或者是STMT你想惻I那一定会抛错
  因此q个限制了你的设计
  你在设计一些大循环或者是BATCH JOB时就要考虑多线E啦Q还有分Ҏ啦,分页啦等
  因ؓ你可以放大这?00个连接的讄Q可是付出的代h是ORACLE服务器用内存数的上?br />   你可以放?000Q放?000Q如果是3万呢Q还不够?br />   对吧
  每开一个PSTMT或者是STMT是一个连接,每开一个CONNECTION也是一个连?br />   因此你的E序p及时且合理的d闭这个CONNECTION
  具体p看实际情况了


w@ns0ng 2010-11-03 15:28 发表评论
]]>
ORACLE DBAhttp://www.aygfsteel.com/wansong/articles/334242.htmlw@ns0ngw@ns0ngMon, 11 Oct 2010 01:24:00 GMThttp://www.aygfsteel.com/wansong/articles/334242.htmlhttp://www.aygfsteel.com/wansong/comments/334242.htmlhttp://www.aygfsteel.com/wansong/articles/334242.html#Feedback0http://www.aygfsteel.com/wansong/comments/commentRss/334242.htmlhttp://www.aygfsteel.com/wansong/services/trackbacks/334242.html*=========================================================================*/
/*            昄最q被改动?0个文?nbsp;              */
/*=========================================================================*/
ls -alt|head
/*=========================================================================*/
/*            把Oracle的SGA钉在内存?nbsp;              */
/*=========================================================================*/
HP-UX AND LINUX AS 3
LOCK_SGA = TURE
SUN Solaris
USE_ISM=TRUE

/*=========================================================================*/
/*         汇出数据库成文g                 */
/*=========================================================================*/
exp userid=arms/arms@arms owner=arms file=(arms_1123-1.dmp,arms_1123-2.dmp,
arms_1123-3.dmp,arms_1123-4.dmp,arms_1123-5.dmp,arms_1123-6.dmp,arms_1123-7.dmp)
 filesize=2GB log=arms_1123.log

imp armsetl/armsetl fromuser=armsetl touser=armsetl rows=y indexes=n
commit=y buffer=65536 feedback=100000 ignore=n volsize=0
file=exp_icd.dmp
--oracle10g中汇入需要system用户做汇入动?br /> imp userid=sys/sys@ARMS fromuser=ARMS  touser=ARMSETL file=(arms_1123-1.dmp,arms_1123-2.dmp,
arms_1123-3.dmp,arms_1123-4.dmp,arms_1123-5.dmp) filesize=2GB  COMMIT=Y log=ARMSETL.log

E:\export>imp userid=system/arms@arms fromuser=arms touser=armsetl tables=VW_PAY
MNTRESP indexes=n ignore=y file=VW_PAYMNTRESP.dmp filesize=2GB log=VW_PAYMNTRESP
_imp.log

D:\ARMS_EXP>exp userid=arms/arms@arms tables=VW_PAYMNTRESP direct=y file=VW_PAYM
NTRESP.dmp filesize=2GB log=VW_PAYMNTRESP.log

/*=========================================================================*/
/*         查看消耗CPU的百分比                 */
/*=========================================================================*/
RHORA*ORA-/etc>ps auxgw|sort +2 |tail
oracle   14482  0.0  3.9 303796 20068 ?      S    17:09   0:01 oracleORA (LOCAL=NO)
oracle   14184  0.0  5.1 303132 26188 ?      S    11:58   0:01 ora_smon_ORA
oracle   14305  0.0  5.9 303280 30208 ?      S    15:08   0:04 oracleORA (LOCAL=NO)
oracle   14216  0.0  6.3 305588 32440 ?      S    12:04   0:10 oracleORA (LOCAL=NO)
oracle   14180  0.1  0.8 308684 4248 ?       S    11:58   0:29 ora_lgwr_ORA
oracle   14178  0.2  7.5 305536 38748 ?      S    11:58   0:50 ora_dbw0_ORA
oracle   14512 14.1 11.2 309252 57364 ?      S    18:05   3:25 oracleORA (LOCAL=NO)
oracle   14289  2.0 12.9 305088 65976 ?      S    13:51   5:44 oracleORA (LOCAL=NO)
oracle   14226  2.3  3.1 305868 16116 ?      S    12:09   8:47 oracleORA (LOCAL=NO)
USER       PID %CPU %MEM   VSZ  RSS TTY      STAT START   TIME COMMAND

/*=========================================================================*/
/*         查看消耗CPU最长时间的q程                 */
/*=========================================================================*/
RHORA*ORA-/etc>ps -ef |grep oracle|sort +6|tail
sort 按第六排排序....
tail昄输出后的多少?默认为前10?br /> /*=========================================================================*/
/*          更改字符集问题解册l请见本人BLOG                    */
/*=========================================================================*/
select userenv('language') from dual;
SIMPLIFIED CHINESE_CHINA.ZHT16BIG5
SIMPLIFIED CHINESE_CHINA.WE8ISO8859P1
SQL> ALTER DATABASE CHARACTER SET ZHT16BIG5;
ALTER DATABASE CHARACTER SET ZHT16BIG5
*
ERROR at line 1:
ORA-12712: new character set must be a superset of old character set
使用q_的这U方式是不可以更Ҏ据库字符集的.
改了字符集后
SQL> conn / as sysdba;
ERROR:
ORA-12705: invalid or unknown NLS parameter value specified
解决办法:
export NLS_LANG=CHINESE_CHINA.ZHT16BIG5
当服务器客户机无法登?
/*=========================================================================*/
/*          表空间文件丢失问题解?nbsp;                   */
/*=========================================================================*/
SQL> startup
ORACLE instance started.

Total System Global Area  236000356 bytes
Fixed Size                   451684 bytes
Variable Size             201326592 bytes
Database Buffers           33554432 bytes
Redo Buffers                 667648 bytes
Database mounted.
ORA-01122: database file 18 failed verification check
ORA-01110: data file 18: '/opt/oracle/product/9.2.0/dbs/LHB.DAT'
ORA-01251: Unknown File Header Version read for file number 18
问题如上所C?没有办法扑ֈLHB.DAT
1.SQL> startup mount
ORACLE instance started.
Total System Global Area  236000356 bytes
Fixed Size                   451684 bytes
Variable Size             201326592 bytes
Database Buffers           33554432 bytes
Redo Buffers                 667648 bytes
Database mounted.
SQL> alter database datafile '/opt/oracle/product/9.2.0/dbs/LHB.DAT' offline drop;
Database altered.
SQL> alter database open;
Database altered.
SQL>

/*=========================================================================*/
/*          修改global_name                     */
/*=========================================================================*/
conn / as sysdba
update props$ set value$ = 'oradb' where name = 'GLOBAL_DB_NAME';
commit;
shutdown immediate
startup
之后再创建dblink即不带域名?/p>


grant connect to arms
/*=========================================================================*/
/*          TO_DATE函数问题解决.                     */
/*=========================================================================*/
select OHDUEDATE,to_date(lhb.OHDUEDATE,'dd/mm/yy') from lhb --写错了这L一个格?宛_我花了半天的旉
最lȝ,要看清格式这点很重要:to_date/'dd/?yy')...q种方式.'dd/mon/yy'q样解决问题;

/*=========================================================================*/
/*              不断昄输出新的?nbsp;                      */
/*=========================================================================*/
tail -f logfile.log


/*=========================================================================*/
/*              讄ORACLE下的ksh命o提示W?nbsp;                      */
/*=========================================================================*/
export PS1="`hostname`*\${ORACLE_SID}-\${PWD}>"

/*=========================================================================*/
/*               强制在UNIX下关闭ORACLEq程                       */
/*=========================================================================*/
 ps -ef |grep "ora_"|grep -v grep|awk '{print $2}' |xargs kill -9
 shutdown abort

/*=========================================================================*/
/*               db_block_size                       */
/*=========================================================================*/
show parameter db_block_size     (高速缓存区(Database Buffer Cache))
每个表空间可以徏立不同的DB_BLOCK_SIZE     说明:8k的高速缓存通过DB_8K_CACHE_SIZE
参数来设定的.
share pool 存储数据字典高速缓?br /> 当share pool装满?最q最用的执行路径和分析树从库高速缓存中删除,以便为新?br /> 腾出空?

 

/*=========================================================================*/
/*                oracle 9.2.4+linux启动与关闭相?nbsp;                        */
/*=========================================================================*/
linux+oracle 9.2.4 的启动方法与原来oracle 8.1.7的启动方式有些不?br /> 方式?
[oracle@RHORA oracle]$ sqlplus /nolog
SQL*Plus: Release 9.2.0.4.0 - Production on Wed Nov 8 17:24:47 2006
Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.
SQL> conn / as sysdba
Connected.
SQL> startup
关闭改为shutdown immediate;

LRM-00109: could not open parameter file '/opt/oracle/product/9.2.0/dbs/initORCL.ora'
把initORA.ora拯q去可以用了.

ORA-01990: error opening password file '/opt/oracle/product/9.2.0/dbs/orapw'
把密码文件拷贝过d可以启动?
ORA-27037: unable to obtain file status
Linux Error: 2: No such file or directory
Additional information: 3

/*=========================================================================*/
/*                    utl_file的相关问?nbsp;                       */
/*=========================================================================*/
查找导出路径:show parameter utl_file_dir     -oracle 8i 可以直接更改初始参数?br /> 件而后重新启动数据库就可以保存;
alter system set utl_file_dir='\home\oracle' scope=spfile;   更改9i的版本可以这h?br /> 注上面只能更改到spfile(也是所说的内存).要更改到pfile 请从pfile------spfile
呵呵.

startup mount;
recover database until cancel;
alter database open resetlogs;
/*=========================================================================*/
/*                     查剩余表I间                        */
/*=========================================================================*/
SELECT tablespace_name, sum ( blocks ) as free_blk , 
 
trunc ( sum ( bytes ) /(1024*1024) ) as free_m, 
 
max ( bytes ) / (1024) as big_chunk_k, count (*) as num_chunks 
 
FROM dba_free_space GROUP BY tablespace_name;

/*=========================================================================*/
/*                      JOB按时间去执行存储q程                            */
/*=========================================================================*/
DECLARE
  X NUMBER;
BEGIN
  SYS.DBMS_JOB.SUBMIT
    ( job       => X
     ,what      => 'ARMS1.SP_OUTPUT_COL_CUST_PAY;'
     ,next_date => to_date('26-10-2006 20:09:06','dd/mm/yyyy hh24:mi:ss')
     ,interval  => 'TRUNC(LAST_DAY(SYSDATE)) + 1 + 1/24 + 30/1440'
     ,no_parse  => TRUE
    );
  SYS.DBMS_OUTPUT.PUT_LINE('Job Number is: ' || to_char(x));
END;
/
commit;
午夜12?...TRUNC(SYSDATE+1)  
W二天凌晨一Ҏ ...TRUNC(LAST_DAY(SYSDATE)) + 1 + 1/24
如还要在后面加分?可以l箋

/*=========================================================================*/
/*                      建立常用输出?nbsp;                                 */
/*=========================================================================*/
CREATE OR REPLACE Package PKG_APBT  As

    type Type_Ret_Curs is ref Cursor;

    msg_0 CONSTANT VARCHAR2(100) := '埯成功!';
    msg_1 CONSTANT VARCHAR2(100) := '埯失敗!';
    msg_2 CONSTANT VARCHAR2(100) := '沒有該紀?';
    msg_3 CONSTANT VARCHAR2(100) := '主鍵已經存在!';
    msg_4 CONSTANT VARCHAR2(100) := '長度太長!';
    msg_5 CONSTANT VARCHAR2(100) := '輸入參數不能為空!';
    msg_6 CONSTANT VARCHAR2(100) := '沒有數據!';
    msg_7 CONSTANT VARCHAR2(100) := '用戶不存?';
    msg_9 CONSTANT VARCHAR2(100) := '輸入參數不正?';
End;
/

/*=========================================================================*/
/*                      建日志表                                  */
/*=========================================================================*/
CREATE TABLE LOGDATA
(
  LOG_DATE    VARCHAR2(20)     DEFAULT to_char(sysdate,'YYYY-MM-DD HH24:MI:SS') NOT NULL,
  OPERATOR    VARCHAR2(50),
  LOG_TYPE    CHAR(1),
  USER_TABLE  VARCHAR2(50),
  INFO        VARCHAR2(4000),
  SYS_TYPE    NUMBER(1)   DEFAULT 0     NOT NULL
)
/*=========================================================================*/
/*                      建立同义词ƈ使用                                   */
/*=========================================================================*/
我们先看如下的一pd执行Q?/p>

SQL> create or replace view v_bmw_pay_online_new as
  2  select *
  3  from taobao.bmw_pay_online_new@lnk_db215;
 
SQL> create or replace procedure sp_v_test is
  2  v_id number;
  3  begin
  4     select id into v_id from v_bmw_pay_online_new where id=1;
  5  end;
  6  /

Procedure created

SQL> create or replace synonym s_bmw_pay_online_new
  2        for taobao.bmw_pay_online_new@lnk_db215;

Synonym created

SQL> create or replace procedure sp_s_test is
  2  v_id number;
  3  begin
  4     select id into v_id from s_bmw_pay_online_new where id=1;
  5  end;
  6  /

Warning: Procedure created with compilation errors

SQL> show error
Errors for PROCEDURE TAOBAO.SP_S_TEST:

LINE/COL ERROR
-------- ------------------------------------------------------------------------------------
4/29     PL/SQL: ORA-00600: 内部错误代码Q参? [17069], [0x57E77854], [], [], [], [], [], []
4/4      PL/SQL: SQL Statement ignored


可以看到Q在同样一个远E对象上面,我可以通过创徏视图Q然后在该视图上创徏存储q程Q是没有M问题的,
但是如果我对该远E操作做一个同义词Q再在同义词上创建存储过E,则报ZOra-00600。跟t也无果Q?br /> 看生的日志文g也不能看出来什么,上metalinkQ搜?ora-00600 17069"Q发现查出现的东西一大堆Q?br /> 大致是library cache错误Q但是到底怎么会生这个错误呢Qonline联系上一个oracle在线技术支持,聊了一会儿Q?br /> 问题是解决了Q但是他是不承认是bugQ呵c?/p>

以下是聊天的ȝQ?br /> ORA-00600 [17069] reorted on compiling a procedure.

Invalid lock in library cache.
Unable to pin the object and hence the Error.

<Note:39616.1> "Failed to pin a library cache object after 50 attempts"

Clearing the shared memory will help to get rid of inconsistant information
in memory which is causing the error.

The inconsistency was suspected to be in the remote site. But flushing the
shared pool in remote location didnt help.Tried recreation of the procedure
after dropping and recreating the synonym in the local database. But the
same failed.Flushed the shared pool in local database abd successfully
created the procedure.

alter system flush share_pool;

/*=========================================================================*/
/*                      建立同义词ƈ使用                                   */
/*=========================================================================*/
create synonym synonym_name for table_name@db_link;
select * from table_name;

/*=========================================================================*/
/*                      建立DB-LINKq接q?nbsp;                             */
/*=========================================================================*/
讄之前误|alter system set global_names = false
create public database link db_link
connect to user identified by pwd
using 'connect string';
select sysdate from dual@db_link;

/*=========================================================================*/
/*                               插入旉?nbsp;                               */
/*=========================================================================*/
insert into test(IMPORT_DATE) values
(to_date('2002-10-20 15:30:00','yyyy-mm-dd hh24:mi:ss'));
insert into test(testtime) values(sysdate);
取得时候可以to_char(sysdateQ?yyyy-mm-dd   hh24:mi:ss')

/*=========================================================================*/
/*                      更改表时记录其变化的TRIGGER                        */
/*=========================================================================*/
CREATE OR REPLACE TRIGGER T_APBT_CONTRACT_ALL_AIUDR
after insert or update or delete on APBT_CONTRACT_ALL
for each row   
/*无论一条语句改变了多少条记?ORACLE对于每条记录触发一ơ触发器*/
/*before和after的区?事g发生前还是事件发生后*/
begin
    if inserting then
        insert into A_APBT_CONTRACT_ALL(ID,CONTRACT_SERIAL_NUM,flag)
        values (Seq_APBT_ARMS.NEXTVAL,:new.CONTRACT_SERIAL_NUM,1);/* :new*/
    elsif updating then
        insert into A_APBT_CONTRACT_ALL(ID,CONTRACT_SERIAL_NUM,flag)
        values (Seq_APBT_ARMS.NEXTVAL,:old.CONTRACT_SERIAL_NUM,2);
        /*此句存在问题*/
    elsif deleting then
        insert into A_APBT_CONTRACT_ALL(ID,CONTRACT_SERIAL_NUM,flag)
        values (Seq_APBT_ARMS.NEXTVAL,:old.CONTRACT_SERIAL_NUM,3);
    end if;
end;
/

/*=========================================================================*/
/*                      你能够创如下语句所触发:                        */
/*=========================================================================*/
DML语句( DELETE,INSERT,UPDATE)
DDL语句( CREATE,ALTER,DROP)
数据库操? SERVERERROR, LOGON, LOGOFF, STARTUP, SHUTDOWN)

/*=========================================================================*/
/*                                  建立sequence序列:                        */
/*=========================================================================*/
DROP SEQUENCE ARMS.SEQ_APBT_ARMS;
CREATE SEQUENCE ARMS.SEQ_APBT_ARMS
  START WITH 30
  MAXVALUE 999999999999999999999999999
  MINVALUE 1
  NOCYCLE
  CACHE 20
  NOORDER;



w@ns0ng 2010-10-11 09:24 发表评论
]]>
oracle 字符节问?/title><link>http://www.aygfsteel.com/wansong/articles/333962.html</link><dc:creator>w@ns0ng</dc:creator><author>w@ns0ng</author><pubDate>Fri, 08 Oct 2010 05:20:00 GMT</pubDate><guid>http://www.aygfsteel.com/wansong/articles/333962.html</guid><wfw:comment>http://www.aygfsteel.com/wansong/comments/333962.html</wfw:comment><comments>http://www.aygfsteel.com/wansong/articles/333962.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/wansong/comments/commentRss/333962.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/wansong/services/trackbacks/333962.html</trackback:ping><description><![CDATA[<span style="font-size: 10.5pt; font-family: 'Calibri','sans-serif'; mso-fareast-font-family: 宋体; mso-bidi-font-family: 宋体; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA"><v:shapetype id="_x0000_t75" stroked="f" filled="f" path="m@4@5l@4@11@9@11@9@5xe" o:preferrelative="t" o:spt="75" coordsize="21600,21600"> <span style="font-size: 10.5pt; font-family: 'Calibri','sans-serif'; mso-fareast-font-family: 宋体; mso-bidi-font-family: 宋体; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA"><v:shapetype id="_x0000_t75" stroked="f" filled="f" path="m@4@5l@4@11@9@11@9@5xe" o:preferrelative="t" o:spt="75" coordsize="21600,21600"> <v:stroke joinstyle="miter"></v:stroke><v:formulas><v:f eqn="if lineDrawn pixelLineWidth 0"></v:f><v:f eqn="sum @0 1 0"></v:f><v:f eqn="sum 0 0 @1"></v:f><v:f eqn="prod @2 1 2"></v:f><v:f eqn="prod @3 21600 pixelWidth"></v:f><v:f eqn="prod @3 21600 pixelHeight"></v:f><v:f eqn="sum @0 0 1"></v:f><v:f eqn="prod @6 1 2"></v:f><v:f eqn="prod @7 21600 pixelWidth"></v:f><v:f eqn="sum @8 21600 0"></v:f><v:f eqn="prod @7 21600 pixelHeight"></v:f><v:f eqn="sum @10 21600 0"></v:f></v:formulas><v:path o:connecttype="rect" gradientshapeok="t" o:extrusionok="f"></v:path><o:lock aspectratio="t" v:ext="edit"></o:lock></v:shapetype><span style="font-size: 10.5pt; font-family: 'Calibri','sans-serif'; mso-fareast-font-family: 宋体; mso-bidi-font-family: 宋体; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA"><v:shapetype id="_x0000_t75" stroked="f" filled="f" path="m@4@5l@4@11@9@11@9@5xe" o:preferrelative="t" o:spt="75" coordsize="21600,21600"> <v:stroke joinstyle="miter"></v:stroke><v:formulas><v:f eqn="if lineDrawn pixelLineWidth 0"></v:f><v:f eqn="sum @0 1 0"></v:f><v:f eqn="sum 0 0 @1"></v:f><v:f eqn="prod @2 1 2"></v:f><v:f eqn="prod @3 21600 pixelWidth"></v:f><v:f eqn="prod @3 21600 pixelHeight"></v:f><v:f eqn="sum @0 0 1"></v:f><v:f eqn="prod @6 1 2"></v:f><v:f eqn="prod @7 21600 pixelWidth"></v:f><v:f eqn="sum @8 21600 0"></v:f><v:f eqn="prod @7 21600 pixelHeight"></v:f><v:f eqn="sum @10 21600 0"></v:f></v:formulas><v:path o:connecttype="rect" gradientshapeok="t" o:extrusionok="f"></v:path><o:lock aspectratio="t" v:ext="edit"></o:lock></v:shapetype><span style="font-size: 10.5pt; font-family: 'Calibri','sans-serif'; mso-fareast-font-family: 宋体; mso-bidi-font-family: 宋体; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA"><v:shapetype id="_x0000_t75" stroked="f" filled="f" path="m@4@5l@4@11@9@11@9@5xe" o:preferrelative="t" o:spt="75" coordsize="21600,21600"> <v:stroke joinstyle="miter"></v:stroke><v:formulas><v:f eqn="if lineDrawn pixelLineWidth 0"></v:f><v:f eqn="sum @0 1 0"></v:f><v:f eqn="sum 0 0 @1"></v:f><v:f eqn="prod @2 1 2"></v:f><v:f eqn="prod @3 21600 pixelWidth"></v:f><v:f eqn="prod @3 21600 pixelHeight"></v:f><v:f eqn="sum @0 0 1"></v:f><v:f eqn="prod @6 1 2"></v:f><v:f eqn="prod @7 21600 pixelWidth"></v:f><v:f eqn="sum @8 21600 0"></v:f><v:f eqn="prod @7 21600 pixelHeight"></v:f><v:f eqn="sum @10 21600 0"></v:f></v:formulas><v:path o:connecttype="rect" gradientshapeok="t" o:extrusionok="f"></v:path><o:lock aspectratio="t" v:ext="edit"></o:lock></v:shapetype><v:shape id="Picture_x0020_13" style="width: 7.985in; height: 309.75pt" alt="Snap1.bmp" type="#_x0000_t75" o:spid="_x0000_i1025"><v:imagedata o:href="cid:image005.jpg@01CB5BF5.5FC80410" src="file:///C:\DOCUME~1\246788\LOCALS~1\Temp\msohtmlclip1\01\clip_image001.jpg">见邮?/v:imagedata></v:shape></span></span></span><v:stroke joinstyle="miter"></v:stroke><v:formulas><v:f eqn="if lineDrawn pixelLineWidth 0"></v:f><v:f eqn="sum @0 1 0"></v:f><v:f eqn="sum 0 0 @1"></v:f><v:f eqn="prod @2 1 2"></v:f><v:f eqn="prod @3 21600 pixelWidth"></v:f><v:f eqn="prod @3 21600 pixelHeight"></v:f><v:f eqn="sum @0 0 1"></v:f><v:f eqn="prod @6 1 2"></v:f><v:f eqn="prod @7 21600 pixelWidth"></v:f><v:f eqn="sum @8 21600 0"></v:f><v:f eqn="prod @7 21600 pixelHeight"></v:f><v:f eqn="sum @10 21600 0"></v:f></v:formulas><v:path o:connecttype="rect" gradientshapeok="t" o:extrusionok="f"></v:path><o:lock aspectratio="t" v:ext="edit"></o:lock></v:shapetype></span> <img src ="http://www.aygfsteel.com/wansong/aggbug/333962.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/wansong/" target="_blank">w@ns0ng</a> 2010-10-08 13:20 <a href="http://www.aygfsteel.com/wansong/articles/333962.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>oracle 查看安装的字W集http://www.aygfsteel.com/wansong/articles/332758.htmlw@ns0ngw@ns0ngFri, 24 Sep 2010 07:36:00 GMThttp://www.aygfsteel.com/wansong/articles/332758.htmlhttp://www.aygfsteel.com/wansong/comments/332758.htmlhttp://www.aygfsteel.com/wansong/articles/332758.html#Feedback0http://www.aygfsteel.com/wansong/comments/commentRss/332758.htmlhttp://www.aygfsteel.com/wansong/services/trackbacks/332758.htmlHKEY_LOCAL_MACHINE/SOFTWARE/ORACLE/KEY_OracleClient10g_home/NLS_LANG



w@ns0ng 2010-09-24 15:36 发表评论
]]>
oracle sequence ibatishttp://www.aygfsteel.com/wansong/articles/332477.htmlw@ns0ngw@ns0ngSun, 19 Sep 2010 13:46:00 GMThttp://www.aygfsteel.com/wansong/articles/332477.htmlhttp://www.aygfsteel.com/wansong/comments/332477.htmlhttp://www.aygfsteel.com/wansong/articles/332477.html#Feedback0http://www.aygfsteel.com/wansong/comments/commentRss/332477.htmlhttp://www.aygfsteel.com/wansong/services/trackbacks/332477.html <!-- Oracle SEQUENCE -->
<insert id="insertProduct-ORACLE" parameterClass="com.domain.Product">
    <selectKey resultClass="int" keyProperty="id" type="pre">
        <![CDATA[SELECT STOCKIDSEQUENCE.NEXTVAL AS ID FROM DUAL]]>
    </selectKey>
    <![CDATA[insert into PRODUCT (PRD_ID,PRD_DESCRIPTION) values(#id#,#description#)]]>
</insert>


http://www.dnbcw.com/biancheng/oracle/BVBZ11361.html

create table example(
id number(4) not null primary key,
name varchar(25),
phone varchar(10),
address varchar(50));
然后Q你需要一个自定义的sequence
create sequence emp_sequence
increment by 1 -- 每次加几?br /> start with 1 -- ?开始计?br /> nomaxvalue -- 不设|最大?br /> nocycle -- 一直篏加,不@?br /> nocache -- 不徏~冲?/div>
以上代码完成了一个序?sequence)的徏立过E?名称为emp_sequence,范围是从1开始到无限?无限大的E度是由你机器决定的),nocycle 是决定不循环,如果你设|了最大值那么你可以用cycle 会seq到最大之后@?对于nocacheZ说一下如果你l出了cache值那么系l将自动d你的cache值大个seq

create or replace trigger "触发器名U? before
insert on example for each row when (new.id is null)
begin
select emp_sequence.nextval into: new.id from dual;
end;





w@ns0ng 2010-09-19 21:46 发表评论
]]>oracle pagination stored procedure.http://www.aygfsteel.com/wansong/articles/331932.htmlw@ns0ngw@ns0ngMon, 13 Sep 2010 13:42:00 GMThttp://www.aygfsteel.com/wansong/articles/331932.htmlhttp://www.aygfsteel.com/wansong/comments/331932.htmlhttp://www.aygfsteel.com/wansong/articles/331932.html#Feedback0http://www.aygfsteel.com/wansong/comments/commentRss/331932.htmlhttp://www.aygfsteel.com/wansong/services/trackbacks/331932.html
Oracle 分页Q?

create or replace procedure P_QuerySplit(

sqlscript varchar2, 表名/SQL语句

pageSize integer, 每页记录?/p>

pageIndex integer, 当前?/p>

totalCount out number, 总记录数

totalPage out number, 总页?/p>

v_cur out sys_refcursor q回游标

 

  1. ) is  
  2. /**  
  3. * by chenjianxin 2008-5-3  
  4. *  
  5. */  
  6. v_PageSize number;  
  7. v_PageIndex number;  
  8. v_SQL_Count varchar2(4000);  
  9. v_SQL varchar2(4000);  
  10. v_StartIndex number;  
  11. v_EndIndex number;  
  12. begin  
  13. v_PageSize:=pageSize;  
  14. if v_PageSize=0 then  
  15. v_PageSize:=1;  
  16. end if;  

 

ibatis调用Oracle分页存储q程中需要统计记录数?/p>

 

  1. v_SQL_Count :'select count(*) from (' ? ? sqlscript ? ?') a ';  
  2. execute immediate v_SQL_Count into totalCount;  

 

计算总页?/p>

 

  1. totalPage:=CEIL(totalCount/v_PageSize); 

验证号 如果号大余了最大页敎ͼq回最后一?/p>

 

  1. v_PageIndex:=pageIndex;  
  2. if v_PageIndex>totalPage then  
  3. v_PageIndex:=totalPage;  
  4. end if;  

 

计算开始的Index和结束的Index

 

  1. v_StartIndex:=(v_PageIndex-1)*v_PageSize 1;  
  2. v_EndIndex:=v_PageIndex*v_PageSize;  
  3. v_SQL:='SELECT /* FIRST_ROWS */* FROM (';  
  4. v_SQLv_SQL:=v_SQL ? ?' SELECT A.*, ROWNUM RN ';  
  5. v_SQLv_SQL:=v_SQL ? ?' FROM (' ? ?sqlscript ? ?') A ';  
  6. v_SQLv_SQL:=v_SQL ? ?' WHERE ROWNUM <= ' ? ?v_EndIndex;  
  7. v_SQLv_SQL:=v_SQL ? ?')WHERE RN >= ' ? ?v_StartIndex;  
  8. open v_cur for v_SQL;  
  9. end P_QuerySplit;   



  • create or replace procedure PageInation(   
  • p_CURSOR out TESTPACKAGE.Test_CURSOR,   
  • tableName in varchar2,   
  • tableResult in varchar2,   
  • lowerNum in numeric,   
  • higherNum in numeric   
  • ) is    
  • sqls varchar2(2000);   
  • begin   
  • sqls :='select * from ( select rownum rownum_,'||tableResult||' from ('||tableName||') row_ where rownum <=' ||higherNum||') where rownum_ >'||lowerNum;    
  • OPEN p_CURSOR FOR sqls;   
  • end PageInation;    


  • w@ns0ng 2010-09-13 21:42 发表评论
    ]]>
    oracle exp/imphttp://www.aygfsteel.com/wansong/articles/331906.htmlw@ns0ngw@ns0ngMon, 13 Sep 2010 08:25:00 GMThttp://www.aygfsteel.com/wansong/articles/331906.htmlhttp://www.aygfsteel.com/wansong/comments/331906.htmlhttp://www.aygfsteel.com/wansong/articles/331906.html#Feedback0http://www.aygfsteel.com/wansong/comments/commentRss/331906.htmlhttp://www.aygfsteel.com/wansong/services/trackbacks/331906.htmloracle客户端cmdQ?br /> imp InquiryApp/InquiryApp@InquiryApp_10.225.109.178 full=y file=d:/DLY ignore=y
    exp InquiryApp/InquiryApp@InquiryApp_10.225.109.178 full=y file=d:\exp.dmp
    exp InquiryApp/InquiryApp@InquiryApp_10.225.109.178 tables=(testCreate1) file=d:\expTables.dmp

    oracle服务器端cmdQ?br /> exp InquiryApp/InquiryApp full=y file=d:\exp.dmp



    w@ns0ng 2010-09-13 16:25 发表评论
    ]]>
    Oracle, DB2 ?MySQL 分页查询写法http://www.aygfsteel.com/wansong/articles/331788.htmlw@ns0ngw@ns0ngSun, 12 Sep 2010 02:45:00 GMThttp://www.aygfsteel.com/wansong/articles/331788.htmlhttp://www.aygfsteel.com/wansong/comments/331788.htmlhttp://www.aygfsteel.com/wansong/articles/331788.html#Feedback0http://www.aygfsteel.com/wansong/comments/commentRss/331788.htmlhttp://www.aygfsteel.com/wansong/services/trackbacks/331788.html

    w@ns0ng 2010-09-12 10:45 发表评论
    ]]>
    mysql 同时q回查询L及分|?/title><link>http://www.aygfsteel.com/wansong/articles/331785.html</link><dc:creator>w@ns0ng</dc:creator><author>w@ns0ng</author><pubDate>Sun, 12 Sep 2010 02:36:00 GMT</pubDate><guid>http://www.aygfsteel.com/wansong/articles/331785.html</guid><wfw:comment>http://www.aygfsteel.com/wansong/comments/331785.html</wfw:comment><comments>http://www.aygfsteel.com/wansong/articles/331785.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/wansong/comments/commentRss/331785.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/wansong/services/trackbacks/331785.html</trackback:ping><description><![CDATA[<p>select * from auth_user</p> <p>SELECT FOUND_ROWS() //q回查询记录的L</p> <p>select sql_calc_found_rows col_name from table_name limit 5,3;<br /> select found_rows()<br /> </p> SELECT语句中加上修饰SQL_CALC_FOUND_ROWS <br /> <br /> 加上SQL_CALC_FOUND_ROWS之后Q即使你用了limit n,m QSELECT FOUND_ROWS() 仍会q回满条g记录的L。这P你执行完 select SQL_CALC_FOUND_ROWS 之后Q再取一下记录Lp了?br /> <img src ="http://www.aygfsteel.com/wansong/aggbug/331785.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/wansong/" target="_blank">w@ns0ng</a> 2010-09-12 10:36 <a href="http://www.aygfsteel.com/wansong/articles/331785.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>主题QMySQL的经典用??----量数据l计处理,模拟物化视图http://www.aygfsteel.com/wansong/articles/331762.htmlw@ns0ngw@ns0ngSat, 11 Sep 2010 12:16:00 GMThttp://www.aygfsteel.com/wansong/articles/331762.htmlhttp://www.aygfsteel.com/wansong/comments/331762.htmlhttp://www.aygfsteel.com/wansong/articles/331762.html#Feedback0http://www.aygfsteel.com/wansong/comments/commentRss/331762.htmlhttp://www.aygfsteel.com/wansong/services/trackbacks/331762.html

    w@ns0ng 2010-09-11 20:16 发表评论
    ]]>
    MySQL 用户权限分配 Grant 语法详解http://www.aygfsteel.com/wansong/articles/331732.htmlw@ns0ngw@ns0ngSat, 11 Sep 2010 04:35:00 GMThttp://www.aygfsteel.com/wansong/articles/331732.htmlhttp://www.aygfsteel.com/wansong/comments/331732.htmlhttp://www.aygfsteel.com/wansong/articles/331732.html#Feedback0http://www.aygfsteel.com/wansong/comments/commentRss/331732.htmlhttp://www.aygfsteel.com/wansong/services/trackbacks/331732.htmlhttp://www.dgpower.net/index.php/home/showonews/162

    http://dev.firnow.com/course/7_databases/mysql/Mysqljs/20090824/171265.html

    注意Q?mysql的数据库名称不能?-"Ҏ字符Q?br />

    grant create routine on procedure rbaccms.prc_page_result to root@localhost;
    grant alter routine on procedure rbaccms.prc_page_result to root@localhost;
    grant execute on procedure rbaccms.prc_page_result to root@localhost;

    show grants for root@localhost;




    MySQL 用户权限分配 Grant 语法详解

    2010-02-25    文章来源Q?nbsp;   览ơ数Q?18

    本文实例Q运行于 MySQL 5.0 及以上版本?/p>

    MySQL 赋予用户权限命o的简单格式可概括为:

    grant 权限 on 数据库对?to 用户

    一、grant 普通数据用P查询、插入、更新、删?数据库中所有表数据的权利?/h2>
    grant select on testdb.* to common_user@'%'
    grant insert on testdb.* to common_user@'%'
    grant update on testdb.* to common_user@'%'
    grant delete on testdb.* to common_user@'%'

    或者,用一?MySQL 命o来替代:

    grant select, insert, update, delete on testdb.* to common_user@'%'

    二、grant 数据库开发h员,创徏表、烦引、视图、存储过E、函数。。。等权限?/h2>

    grant 创徏、修攏V删?MySQL 数据表结构权限?/p>

    grant create on testdb.* to developer@'192.168.0.%';
    grant alter  on testdb.* to developer@'192.168.0.%';
    grant drop   on testdb.* to developer@'192.168.0.%';

    grant 操作 MySQL 外键权限?/p>

    grant references on testdb.* to developer@'192.168.0.%';

    grant 操作 MySQL 临时表权限?/p>

    grant create temporary tables on testdb.* to developer@'192.168.0.%';

    grant 操作 MySQL 索引权限?/p>

    grant index on  testdb.* to developer@'192.168.0.%';

    grant 操作 MySQL 视图、查看视图源代码 权限?/p>

    grant create view on testdb.* to developer@'192.168.0.%';
    grant show   view on testdb.* to developer@'192.168.0.%';

    grant 操作 MySQL 存储q程、函?权限?/p>

    grant create routine on testdb.* to developer@'192.168.0.%';  -- now, can show procedure status
    grant alter  routine on testdb.* to developer@'192.168.0.%';  -- now, you can drop a procedure
    grant execute        on testdb.* to developer@'192.168.0.%';

    三、grant 普?DBA 理某个 MySQL 数据库的权限?/h2>
    grant all privileges on testdb to dba@'localhost'

    其中Q关键字 “privileges” 可以省略?/p>

    四、grant 高 DBA 理 MySQL 中所有数据库的权限?/h2>
    grant all on *.* to dba@'localhost'

    五、MySQL grant 权限Q分别可以作用在多个层次上?/h2>

    1. grant 作用在整?MySQL 服务器上Q?/p>

    grant select on *.* to dba@localhost; -- dba 可以查询 MySQL 中所有数据库中的表?
    grant all    on *.* to dba@localhost; -- dba 可以理 MySQL 中的所有数据库

    2. grant 作用在单个数据库上:

    grant select on testdb.* to dba@localhost; -- dba 可以查询 testdb 中的表?/pre>
    

    3. grant 作用在单个数据表上:

    grant select, insert, update, delete on testdb.orders to dba@localhost;

    4. grant 作用在表中的列上Q?/p>

    grant select(id, se, rank) on testdb.apache_log to dba@localhost;

    5. grant 作用在存储过E、函CQ?/p>

    grant execute on procedure testdb.pr_add to 'dba'@'localhost'
    grant execute on function  testdb.fn_add to 'dba'@'localhost'

    六、查?MySQL 用户权限

    查看当前用户Q自己)权限Q?/p>

    show grants;

    查看其他 MySQL 用户权限Q?/p>

    show grants for dba@localhost;

    七、撤销已经赋予l?MySQL 用户权限的权限?/h2>

    revoke ?grant 的语法差不多Q只需要把关键?“to” 换成 “from” 卛_Q?/p>

    grant  all on *.* to   dba@localhost;
    revoke all on *.* from dba@localhost;

    八、MySQL grant、revoke 用户权限注意事项

    1. grant, revoke 用户权限后,该用户只有重新连?MySQL 数据库,权限才能生效?/p>

    2. 如果惌授权的用P也可以将q些权限 grant l其他用P需要选项 “grant option“

    grant select on testdb.* to dba@localhost with grant option;

    q个Ҏ一般用不到。实际中Q数据库权限最好由 DBA 来统一理?/p>

    九、应用实?新徏用户q只付给指定数据库操作权?

    //下面为创建lamfire用户,q程d密码?23456,q分配其对lamfireDB数据库完全操作权?/p>

    CREATE USER 'lamfire'@'%' IDENTIFIED BY '123456';

    GRANT USAGE ON * . * TO 'lamfire'@'%' IDENTIFIED BY '123456'  ;

    CREATE DATABASE IF NOT EXISTS lamfireDB ;

    GRANT ALL PRIVILEGES ON `lamfireDB` . * TO 'lamfire'@'%';

     FLUSH PRIVILEGES;



    w@ns0ng 2010-09-11 12:35 发表评论
    ]]>
    优化数据?/title><link>http://www.aygfsteel.com/wansong/articles/329475.html</link><dc:creator>w@ns0ng</dc:creator><author>w@ns0ng</author><pubDate>Fri, 20 Aug 2010 07:45:00 GMT</pubDate><guid>http://www.aygfsteel.com/wansong/articles/329475.html</guid><wfw:comment>http://www.aygfsteel.com/wansong/comments/329475.html</wfw:comment><comments>http://www.aygfsteel.com/wansong/articles/329475.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/wansong/comments/commentRss/329475.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/wansong/services/trackbacks/329475.html</trackback:ping><description><![CDATA[1. 表的索引。场景:一个大量记录的表,索引name字段Q然后根据name查询?Q如果另一个表兌q个表,索引q个的主键,然后做关联查询,是否提高效率Q问题:如果q个的主键是longQ记录一般做递增Q做主键索引是否Ҏ能有所帮助? <img src ="http://www.aygfsteel.com/wansong/aggbug/329475.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/wansong/" target="_blank">w@ns0ng</a> 2010-08-20 15:45 <a href="http://www.aygfsteel.com/wansong/articles/329475.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>SQL重复记录查询http://www.aygfsteel.com/wansong/articles/321630.htmlw@ns0ngw@ns0ngSat, 22 May 2010 13:44:00 GMThttp://www.aygfsteel.com/wansong/articles/321630.htmlhttp://www.aygfsteel.com/wansong/comments/321630.htmlhttp://www.aygfsteel.com/wansong/articles/321630.html#Feedback0http://www.aygfsteel.com/wansong/comments/commentRss/321630.htmlhttp://www.aygfsteel.com/wansong/services/trackbacks/321630.html where name in (select name  from RbacUser  group  by name  having  count(name) > 1)


    select * from rbacUser
    where (name,groupId) in (select name,groupId  from RbacUser  group  by name,groupId  having  count(*) > 1)

    w@ns0ng 2010-05-22 21:44 发表评论
    ]]>
    վ֩ģ壺 | | Ž| Ӧ| | | | ̫| | ʷ| ľ| ͩ| | | | | | | | | ֶ| | ̨| ̨| ²| ĵ| ҵ| ²| ˶| ƽ| ƽ| Ӣɽ| ٽ| | | | | | ԣ| ֶ| |