锘??xml version="1.0" encoding="utf-8" standalone="yes"?>另类图片亚洲校园小说区,国产99久久亚洲综合精品,亚洲不卡影院午夜在线观看http://www.tkk7.com/himalayas/category/50231.htmlzh-cnSun, 10 Feb 2013 01:59:05 GMTSun, 10 Feb 2013 01:59:05 GMT60mysql 5.5.19 涓諱粠閰嶇疆+璇誨啓鍒嗙http://www.tkk7.com/himalayas/archive/2012/01/10/368205.htmlhimalayashimalayasTue, 10 Jan 2012 06:00:00 GMThttp://www.tkk7.com/himalayas/archive/2012/01/10/368205.htmlhttp://www.tkk7.com/himalayas/comments/368205.htmlhttp://www.tkk7.com/himalayas/archive/2012/01/10/368205.html#Feedback0http://www.tkk7.com/himalayas/comments/commentRss/368205.htmlhttp://www.tkk7.com/himalayas/services/trackbacks/368205.html
master:10.13.120.236
slave:10.13.120.233
姝ラ涓錛氬畨瑁卪aster
涓嬭澆mysql-5.1.60-linux-x86_64-glibc23.tar.gz 鏀懼埌/home/a/soft/涓?/div>
shell>sudo groupadd mysql 
shell>sudo useradd -r -g mysql mysql 
shell>cd /home/a/soft/ 
shell>tar zxvf mysql-5.1.60-linux-x86_64-glibc23.tar.gz
shell>cd /usr/local/ 
shell>sudo ln -s /home/a/soft/mysql-5.1.60-linux-x86_64-glibc23 mysql 
shell> cd mysql 
shell>sudo chown -R mysql . 
shell>sudo chgrp -R mysql . 
shell>sudo scripts/mysql_install_db --user=mysql 
shell>sudo chown -R root . 
shell>sudo chown -R mysql data 
# Next command is optional 
shell>sudo cp support-files/my-medium.cnf /etc/my.cnf 
shell>sudo bin/mysqld_safe --user=mysql & 
# Next command is optional 
shell>sudo cp support-files/mysql.server /etc/init.d/mysql.server
#閰嶇疆my.cnf
####################################
binlog-do-db=phpdb
binlog-ignore-db=mysql
log-bin=/usr/local/mysql/log/updatelog
log-slave-updates
slave-skip-errors=all
#####################################
$sudo service mysql.server start
$mysql -uroot -p
鏀瑰彉褰撳墠鏁版嵁搴撲負(fù)mysql錛?/div>
mysql>use mysql
璁劇疆浠庢湰鍦頒富鏈虹櫥褰曠殑root甯愬彿瀵嗙爜錛?/div>
mysql>set password for root@localhost=password('root');
鍒犻櫎鍖垮悕甯愬彿錛?nbsp;
mysql>delete from user where user='';
鍒犻櫎瀵嗙爜涓虹┖鐨勫笎鍙鳳細(xì)
mysql>delete from user where password='';
鍒犻櫎鍏佽闈瀕ocalhost涓繪満鐧誨綍鐨勫笎鍙鳳細(xì)
mysql>delete from user where host<>'localhost';
鎵ц涓嬮潰鐨勫懡浠や嬌鏇存敼鐢熸晥錛?/div>
mysql>flush privileges; 
mysql>update user set host = '%' where user = 'root';
mysql>create database phpdb;
mysql>use phpdb;
mysql>create table person(id int(10) primary key auto_increment,name varchar(100) not null);
#dump涓誨簱鏁版嵁
mysql>flush tables with read lock;
$mysqldump -h127.0.0.1 -p3306 -uroot -p phpdb > /mnt/phpdb.sql 
錛?mnt鐩綍鏄垜鑷繁鍋氱殑NFS錛屽氨鏄柟渚夸笉鍚屾満鍣ㄩ棿浣跨敤鏂囦歡錛屼笉鐢╪fs涔熷彲浠ワ級(jí)
mysql> unlock tables;
mysql>use mysql
mysql>GRANT REPLICATION SLAVE ON *.* TO 'slave1_user'@'10.13.120.233' IDENTIFIED BY 'root';
$sudo service mysql.server restart
mysql> show master status;
+------------------+----------+--------------+------------------+
| File             | Position | Binlog_Do_DB | Binlog_Ignore_DB |
+------------------+----------+--------------+------------------+
| mysql-bin.000006 |     2366 | phpdb        | mysql            |
+------------------+----------+--------------+------------------+
1 row in set (0.00 sec)

姝ラ浜岋細(xì)瀹夎slave
涓嬭澆mysql-5.1.60-linux-x86_64-glibc23.tar.gz 鏀懼埌/home/a/soft/涓?/div>
shell>sudo groupadd mysql 
shell>sudo useradd -r -g mysql mysql 
shell>cd /home/a/soft/ 
shell>tar zxvf mysql-5.1.60-linux-x86_64-glibc23.tar.gz
shell>cd /usr/local/ 
shell>sudo ln -s /home/a/soft/mysql-5.1.60-linux-x86_64-glibc23 mysql 
shell> cd mysql 
shell>sudo chown -R mysql . 
shell>sudo chgrp -R mysql . 
shell>sudo scripts/mysql_install_db --user=mysql 
shell>sudo chown -R root . 
shell>sudo chown -R mysql data 
# Next command is optional 
shell>sudo cp support-files/my-medium.cnf /etc/my.cnf 
shell>sudo bin/mysqld_safe --user=mysql & 
# Next command is optional 
shell>sudo cp support-files/mysql.server /etc/init.d/mysql.server
#閰嶇疆my.cnf
#####################################################
server-id       = 2
#master-host     =   mysql_master
#master-user     =   slave1_user
#master-password =   root
#master-port     = 3306
#master-connect-retry=60
replicate-ignore-db=mysql
replicate-do-db=phpdb
log-slave-update
slave-skip-errors=all
#####################################################
$sudo service mysql.server start
$mysql -uroot -p
鏀瑰彉褰撳墠鏁版嵁搴撲負(fù)mysql錛?/div>
mysql>use mysql
璁劇疆浠庢湰鍦頒富鏈虹櫥褰曠殑root甯愬彿瀵嗙爜錛?/div>
mysql>set password for root@localhost=password('root');
鍒犻櫎鍖垮悕甯愬彿錛?nbsp;
mysql>delete from user where user='';
鍒犻櫎瀵嗙爜涓虹┖鐨勫笎鍙鳳細(xì)
mysql>delete from user where password='';
鍒犻櫎鍏佽闈瀕ocalhost涓繪満鐧誨綍鐨勫笎鍙鳳細(xì)
mysql>delete from user where host<>'localhost';
鎵ц涓嬮潰鐨勫懡浠や嬌鏇存敼鐢熸晥錛?/div>
mysql>flush privileges; 
mysql>update user set host = '%' where user = 'root';
mysql>create database phpdb;
mysql>use phpdb;
$mysqldump -h127.0.0.1 -p3306 -uroot -p phpdb < /mnt/phpdb.sql  
錛坢ysql>source /mnt/phpdb.sql錛?/div>
mysql>change master to master_host='10.13.120.236', 
mysql>master_user='slave1_user', 
mysql>master_password='root',
mysql>master_port=3306,
mysql>master_connect_retry=60,
mysql>MASTER_LOG_FILE='mysql-bin.000006',
mysql>MASTER_LOG_POS=107;
mysql>slave start;
mysql> show slave status\G;
*************************** 1. row ***************************
Slave_IO_State: Waiting for master to send event
Master_Host: 10.13.120.236
Master_User: slave1_user
Master_Port: 3306
Connect_Retry: 60
Master_Log_File: mysql-bin.000006
Read_Master_Log_Pos: 2366
Relay_Log_File: canggu-OptiPlex-760-relay-bin.000002
Relay_Log_Pos: 2512
Relay_Master_Log_File: mysql-bin.000006
Slave_IO_Running: Yes
Slave_SQL_Running: Yes
Replicate_Do_DB: phpdb
Replicate_Ignore_DB: mysql
Replicate_Do_Table: 
Replicate_Ignore_Table: 
Replicate_Wild_Do_Table: 
Replicate_Wild_Ignore_Table: 
Last_Errno: 0
Last_Error: 
Skip_Counter: 0
Exec_Master_Log_Pos: 2366
Relay_Log_Space: 2682
Until_Condition: None
Until_Log_File: 
Until_Log_Pos: 0
Master_SSL_Allowed: No
Master_SSL_CA_File: 
Master_SSL_CA_Path: 
Master_SSL_Cert: 
Master_SSL_Cipher: 
Master_SSL_Key: 
Seconds_Behind_Master: 0
Master_SSL_Verify_Server_Cert: No
Last_IO_Errno: 0
Last_IO_Error: 
Last_SQL_Errno: 0
Last_SQL_Error: 
Replicate_Ignore_Server_Ids: 
Master_Server_Id: 1
1 row in set (0.00 sec)
ERROR: 
No query specified

mysql>slave stop;
mysql>change master to master_host='10.13.120.236', 
master_user='slave1_user', 
master_password='root',
master_port=3306,
master_connect_retry=60,
MASTER_LOG_FILE='mysql-bin.000006',
MASTER_LOG_POS=107;


閰嶇疆璇誨啓鍒嗙

涓嬭澆
mysql-proxy-0.8.2-linux-glibc2.3-x86-32bit.tar.gz
瑙e帇騫禼p鍒?usr/local/mysql-proxy
鍦?/span>/usr/local/mysql-proxy/bin涓嬪垱寤烘枃浠秏ysql-proxy.cnf娣誨姞濡備笅鍐呭錛?br />[mysql-proxy]
daemon=true
admin-address=127.0.0.1:4041
proxy-address=:3306
admin-username=admin
admin-password=admin
admin-lua-script=/usr/local/mysql-proxy/share/doc/mysql-proxy/admin-sql.lua
proxy-read-only-backend-addresses=10.13.120.233:3306
proxy-backend-addresses=10.13.120.236:3306
proxy-lua-script=/usr/local/mysql-proxy/share/doc/mysql-proxy/rw-splitting.lua
log-file=/usr/local/mysql-proxy/logs/log-debug.log
log-level=debug


鍚姩浠g悊錛?br />/usr/local/mysql-proxy/bin/mysql-proxy  --daemon --defaults-file=mysql-proxy.cnf






himalayas 2012-01-10 14:00 鍙戣〃璇勮
]]>mysql-5.1.60-linux-x86_64-glibc23 瀹夎http://www.tkk7.com/himalayas/archive/2012/01/01/367700.htmlhimalayashimalayasSun, 01 Jan 2012 08:02:00 GMThttp://www.tkk7.com/himalayas/archive/2012/01/01/367700.htmlhttp://www.tkk7.com/himalayas/comments/367700.htmlhttp://www.tkk7.com/himalayas/archive/2012/01/01/367700.html#Feedback0http://www.tkk7.com/himalayas/comments/commentRss/367700.htmlhttp://www.tkk7.com/himalayas/services/trackbacks/367700.html
涓嬭澆
mysql-5.1.60-linux-x86_64-glibc23
.tar.gz鏀懼埌/home/a/soft/涓?/code>
shell>sudo groupadd mysql
shell>sudo useradd -r -g mysql mysql
shell>cd /home/a/soft/
shell>tar zxvf
mysql-5.1.60-linux-x86_64-glibc23
.tar.gz
shell>cd /usr/local/

shell>sudo ln -s /home/a/soft/
mysql-5.1.60-linux-x86_64-glibc23
mysql
shell> cd mysql
shell>sudo chown -R mysql .
shell>sudo chgrp -R mysql .
shell>sudo scripts/mysql_install_db --user=mysql
shell>sudo chown -R root .
shell>sudo chown -R mysql data
shell>sudo cp support-files/my-medium.cnf /etc/my.cnf
#閰嶇疆/etc/my.cnf
......
shell>sudo ./scripts/mysql_install_db --user=mysql
shell>sudo cp support-files/mysql.server /etc/init.d/mysql.server
$sudo service mysql.server start
$mysql -uroot -p
鏀瑰彉褰撳墠鏁版嵁搴撲負(fù)mysql錛?/div>
mysql>use mysql
璁劇疆浠庢湰鍦頒富鏈虹櫥褰曠殑root甯愬彿瀵嗙爜錛?/div>
mysql>set password for root@localhost=password('root');
鍒犻櫎鍖垮悕甯愬彿錛?nbsp;
mysql>delete from user where user='';
鍒犻櫎瀵嗙爜涓虹┖鐨勫笎鍙鳳細(xì)
mysql>delete from user where password='';
鍒犻櫎鍏佽闈瀕ocalhost涓繪満鐧誨綍鐨勫笎鍙鳳細(xì)
mysql>delete from user where host<>'localhost';
鎵ц涓嬮潰鐨勫懡浠や嬌鏇存敼鐢熸晥錛?/div>
mysql>flush privileges; 
mysql>update user set host = '%' where user = 'root';


himalayas 2012-01-01 16:02 鍙戣〃璇勮
]]>MYSQL瀛楁int/bigint綾誨瀷鏌ヨ榪斿洖鐨勭粨鏋滀笉鍚岋紙bug錛?/title><link>http://www.tkk7.com/himalayas/archive/2011/11/30/365162.html</link><dc:creator>himalayas</dc:creator><author>himalayas</author><pubDate>Wed, 30 Nov 2011 01:49:00 GMT</pubDate><guid>http://www.tkk7.com/himalayas/archive/2011/11/30/365162.html</guid><wfw:comment>http://www.tkk7.com/himalayas/comments/365162.html</wfw:comment><comments>http://www.tkk7.com/himalayas/archive/2011/11/30/365162.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.tkk7.com/himalayas/comments/commentRss/365162.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/himalayas/services/trackbacks/365162.html</trackback:ping><description><![CDATA[<div><div>欏圭洰緇勭殑鍚屽榪涙潵鍦ㄤ嬌鐢╩ysql鐨勬椂鍊欏彂鐜頒簡涓涓棶棰橈紝鍏蜂綋鍐呭濡備笅錛?br />MYSQL 鐗堟湰 錛?Server version: 5.1.48-log Source distribution<br /><img src="http://www.tkk7.com/images/blogjava_net/himalayas/mysql_bug.jpg" width="387" height="599" alt="" /><br /><br /><div><p style="margin-left:15.75pt"><strong><span style="font-size:14.0pt; font-family:瀹嬩綋">鍜ㄨ浜?/span></strong><strong><span style="font-size:14.0pt">DBA</span></strong><strong><span style="font-size:14.0pt;font-family:瀹嬩綋">錛屾垜浠彂鐜板湪</span></strong><strong><span style="font-size:14.0pt">mysql</span></strong><strong><span style="font-size:14.0pt; font-family:瀹嬩綋">榪涜鍊兼瘮杈冪殑鏃跺?/span></strong></p> <p style="margin-left:15.75pt"><strong><span style="font-size:14.0pt;color:red">int</span></strong><strong><span style="font-size: 14.0pt;font-family:瀹嬩綋;color:red">錛氫嬌鐢?/span></strong><strong><span style="font-size:14.0pt;color:red">decimal</span></strong><strong><span style="font-size: 14.0pt;font-family:瀹嬩綋;color:red">綾誨瀷姣旇緝錛堟敮鎸佹誕鐐規(guī)暟鐨勬瘮杈冿級(jí)</span></strong></p> <table border="0" cellspacing="0" cellpadding="0" style="margin-left:15.75pt;border-collapse:collapse;"> <tbody><tr> <td width="590" valign="top" style="width:442.8pt;border:solid black 1.0pt; padding:0cm 5.4pt 0cm 5.4pt"> <p><strong>Arg_comparator::compare_decimal </strong></p> <p><strong>Arg_comparator::compare_decimal (this=0x121cc2b8) at item_cmpfunc.cc:1378</strong></p> <p><strong>1378    int Arg_comparator::compare_decimal()</strong></p> </td> </tr> </tbody></table> <p style="margin-left:15.75pt"><strong><span style="font-size:14.0pt"> </span></strong></p> <p style="margin-left:15.75pt"><strong><span style="font-size:14.0pt;color:red">bigint</span></strong><strong><span style="font-size: 14.0pt;font-family:瀹嬩綋;color:red">錛氫嬌鐢?/span></strong><strong><span style="font-size:14.0pt;color:red">int</span></strong><strong><span style="font-size: 14.0pt;font-family:瀹嬩綋;color:red">綾誨瀷姣旇緝</span></strong></p> <table border="0" cellspacing="0" cellpadding="0" style="margin-left:15.75pt;border-collapse:collapse;"> <tbody><tr> <td width="590" valign="top" style="width:442.8pt;border:solid black 1.0pt; padding:0cm 5.4pt 0cm 5.4pt"> <p><strong>Arg_comparator::compare_int_signed </strong></p> <p><strong>Arg_comparator::compare_int_signed (this=0x121cc2b8) at item_cmpfunc.cc:1457</strong></p> <p><strong>1457  int Arg_comparator::compare_int_signed()</strong></p> </td> </tr> </tbody></table></div></div></div><img src ="http://www.tkk7.com/himalayas/aggbug/365162.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/himalayas/" target="_blank">himalayas</a> 2011-11-30 09:49 <a href="http://www.tkk7.com/himalayas/archive/2011/11/30/365162.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>Oracle鍒嗛〉 瀵艱嚧鏁版嵁鎬繪潯鏁頒笉鍙? 鑰?鍑虹幇閲嶅璁板綍鐨勯棶棰樼殑瑙e喅鍔炴硶http://www.tkk7.com/himalayas/archive/2011/01/18/343168.htmlhimalayashimalayasTue, 18 Jan 2011 11:04:00 GMThttp://www.tkk7.com/himalayas/archive/2011/01/18/343168.htmlhttp://www.tkk7.com/himalayas/comments/343168.htmlhttp://www.tkk7.com/himalayas/archive/2011/01/18/343168.html#Feedback0http://www.tkk7.com/himalayas/comments/commentRss/343168.htmlhttp://www.tkk7.com/himalayas/services/trackbacks/343168.html
        SELECT *
        FROM (SELECT t1.*,rownum as linenum
        FROM (SELECT
        A.MEMBERID memberID,
        A.LOGNAME logName,
        A.STATUS status,
        A.UPDATETIME updateTime,
        A.OPERATORNAME operatorName
        FROM BD_BAOYANG_LIST A
        WHERE
        <![CDATA[
                A.TYPE='BUY'
              ]]>
        <dynamic>
            <isEqual property="status" compareValue="1" prepend="and">
                A.STATUS=1
            </isEqual>
            <isEqual property="status" compareValue="-1" prepend="and">
                <![CDATA[
                A.STATUS<>1
              ]]>
            </isEqual>
            <isNotEmpty property="memberID" prepend="and">
                A.MEMBERID = #memberID#
            </isNotEmpty>
            <isNotEmpty property="logName" prepend="and">
                A.LOGNAME = #logName#
            </isNotEmpty>
            <isNotEmpty property="startTime" prepend="and">
                <![CDATA[
                   A.UPDATETIME >= cast(#startTime# as DATE)
                ]]>
            </isNotEmpty>
            <isNotEmpty property="endTime" prepend="and">
                <![CDATA[
                   A.UPDATETIME < cast(#endTime# as DATE)+1
                ]]>
            </isNotEmpty>
        </dynamic>
        <![CDATA[
                          ORDER BY A.UPDATETIME DESC) t1
WHERE ROWNUM <= #endRow#) t2
 WHERE linenum >= #startRow#
]]>
鍦ㄨ繍琛屽悗鍙戠幇鏌ヨ鍑烘潵鐨勭粨鏋滄繪潯鏁板拰鏁版嵁搴撻噷鐨勮褰曟暟閲忔槸涓鑷寸殑錛屼絾鏄嚭鐜頒簡鏁版嵁閲嶅鐜拌薄錛屼篃灝辨槸璇存湁浜涙暟鎹閲嶅鐨勮褰曟浛鎹簡銆?/div>
涓寮濮嬩互涓烘槸Java紼嬪簭閫昏緫闂錛岀粡榪囪鐪熺殑鎺掓煡錛屾帓闄や簡紼嬪簭鐨勯棶棰樸?/div>
浠旂粏鐪嬩簡涓涓嬫暟鎹簱閲岀殑鏁版嵁錛屽彂鐜癠PDATETIME榪欎竴鍒楃殑鏁版嵁鏍煎紡鏄痽yyy-MM-dd娌℃湁灝忔椂-鍒?縐掔殑銆傝繖鏍瘋鍒楃殑鏁版嵁灝卞嚭鐜頒簡閲嶅鐜拌薄錛岃繖鏃舵垜浜х敓浜嗙枒闂細(xì)闅鵑亾oracle鍦ㄥ鏁版嵁榪涜鎺掑簭鐨勬椂鍊欏閲嶅鐨勬帓搴忔潯浠舵槸涓嶈兘淇濊瘉欏哄簭鐨勪笉鍙樻э紵
甯︾潃榪欎釜闂鎴戞煡璇簡oarcle鐨勭浉鍏寵祫鏂欍?/div>
緇忚繃鏌ヨ璧勬枡鍙戠幇錛宱racle鍦ㄥ灝忛噺鏁版嵁鏌ヨ鐨勬椂鍊欎細(xì)灝嗘暟鎹斁鍒扮紦瀛樺唴榪涜鎺掑簭錛屽綋鏁版嵁閲忚揪鍒頒竴瀹氱▼搴︽椂浼?xì)灏嗘暟鎹湪纾佺洏鎺掑簭锛岃岀鐩樻帓搴忔椂褰撻亣鍒版帓搴忔潯浠剁浉鍚岀殑鎯呭喌涓嬶紝浼?xì)鏍规嵁璇ユ潯璁板綍鐨勬洿鏂版棄櫁礃q涜鎺掑簭錛堟垜鎯沖彲鑳芥槸ROWID錛夛紝浣嗘槸濡傛灉鏀懼埌鍐呭瓨鎺掑簭鐨勮瘽濡傛灉涓嶆寚瀹氭帓搴忔潯浠跺氨涓嶄細(xì)璧版洿鏂版椂闂達(dá)紝鍥犳鎴戝湪涓婇潰鐨勭▼搴廜RDER BY A.UPDATETIME DESC 淇敼鎴怬RDER BY A.UPDATETIME DESC錛孉.ROWID DESC榪欐牱灝辮В鍐充簡闂錛屼絾鏄繖鏍瘋В鍐崇殑鏂瑰紡鍗佸垎鐨勪笉浼橀泤錛岀涓錛氳繖鏍稶PDATETIME涓婂緩绔嬬殑绱㈠紩灝變笉鍐嶈搗浣滅敤錛岀浜岋細(xì)褰撹琛ㄦ暟鎹噺寰堝ぇ鐨勬椂鍊欙紝灝變細(xì)瀵艱嚧鏌ヨ闈炲父鑰楁椂錛屼絾鏄笟鍔¤姹傚張蹇呴』鎸夌収UPDATETIME鏉ヨ繘琛屾帓搴忥紝鍥犳寤鴻濡傛灉琛ㄧ殑鏁版嵁閲忓緢澶у氨搴旇灝嗚鏃墮棿瀛楁 鎻愪緵 灝忔椂/鍒嗛挓/縐掗挓
OVER!!!!!!!!!!!!


himalayas 2011-01-18 19:04 鍙戣〃璇勮
]]>ORACLE 鐗╃悊鍒嗛〉http://www.tkk7.com/himalayas/archive/2011/01/11/342770.htmlhimalayashimalayasTue, 11 Jan 2011 06:54:00 GMThttp://www.tkk7.com/himalayas/archive/2011/01/11/342770.htmlhttp://www.tkk7.com/himalayas/comments/342770.htmlhttp://www.tkk7.com/himalayas/archive/2011/01/11/342770.html#Feedback0http://www.tkk7.com/himalayas/comments/commentRss/342770.htmlhttp://www.tkk7.com/himalayas/services/trackbacks/342770.html<select id="FREEZE-SELECT" parameterClass="TA-FreezeAccountDO" resultClass="TA-FreezeAccountDO">
        SELECT
        A.MEMBERID memberID,
        A.LOGNAME logName,
        A.STATUS status,
        A.UPDATETIME updateTime
        FROM (SELECT RID
        FROM (SELECT RID, ROWNUM AS RN
        FROM (SELECT
        A.ROWID RID
        FROM BD_BAOYANG_LIST A
        WHERE
        <![CDATA[
            A.STATUS=#status#
        ]]>
        <dynamic>
            <isNotEmpty property="memberID" prepend="and">
                A.MEMBERID = #memberID#
            </isNotEmpty>
            <isNotEmpty property="logName" prepend="and">
                A.LOGNAME = #logName#
            </isNotEmpty>
            <isNotEmpty property="startTime" prepend="and">
                <![CDATA[
                   A.UPDATETIME >= cast(#startTime# as DATE)
                ]]>
            </isNotEmpty>
             <isNotEmpty property="endTime" prepend="and">
                <![CDATA[
                   A.UPDATETIME < cast(#endTime# as DATE)+1
                ]]>
            </isNotEmpty>
        </dynamic>
        <![CDATA[
                          ORDER BY A.MEMBERID)
WHERE ROWNUM <= #endRow#)
 WHERE RN >= #startRow#) T1,BD_BAOYANG_LIST A
 WHERE T1.RID = A.ROWID
ORDER BY A.MEMBERID
]]>
    </select>


himalayas 2011-01-11 14:54 鍙戣〃璇勮
]]>ORACLE 鍒嗛〉榪囩▼http://www.tkk7.com/himalayas/archive/2011/01/11/342769.htmlhimalayashimalayasTue, 11 Jan 2011 06:41:00 GMThttp://www.tkk7.com/himalayas/archive/2011/01/11/342769.htmlhttp://www.tkk7.com/himalayas/comments/342769.htmlhttp://www.tkk7.com/himalayas/archive/2011/01/11/342769.html#Feedback0http://www.tkk7.com/himalayas/comments/commentRss/342769.htmlhttp://www.tkk7.com/himalayas/services/trackbacks/342769.html--鍒涘緩淇濆瓨鏌ヨ緇撴灉闆嗙殑 cursor
create or replace package pkg_query as type cur_query is ref cursor; end pkg_query;
--鎻掍歡瀛樺偍榪囩▼
create or replace procedure Pagers(
v_cur out pkg_query.cur_query,--鏌ヨ緇撴灉
numCount out number,--鎬昏褰曟暟
page in number,--鏁版嵁欏墊暟錛屼粠1寮濮?/div>
pageSize in number,--姣忛〉澶у皬
tableName varchar2,--琛ㄥ悕
strWhere varchar2,--where鏉′歡
Orderby varchar2
) is

strSql varchar2(2000);--鑾峰彇鏁版嵁鐨剆ql璇彞
pageCount number;--璇ユ潯浠朵笅璁板綍欏墊暟
startIndex number;--寮濮嬭褰?/div>
endIndex number;--緇撴潫璁板綍

begin

  strSql:='select count(*) from '||tableName;
  if strWhere is not null or strWhere<>'' then 
     strSql:=strSql||' where '||strWhere;
  end if; 
  
  EXECUTE IMMEDIATE strSql INTO numCount;
  --璁$畻鏁版嵁璁板綍寮濮嬪拰緇撴潫
  pageCount:=numCount/pageSize+1;
  startIndex:=(page-1)*pageSize+1;
  endIndex:=page*pageSize;
  
  strSql:='select rownum ro, t.* from '||tableName||' t';  
  strSql:=strSql||' where rownum<='||endIndex;
  
  if strWhere is not null or strWhere<>'' then 
     strSql:=strSql||' and '||strWhere;
  end if;
  
  if  Orderby is not null or Orderby<>''  then 
     strSql:=strSql||' order by '||Orderby;
  end if;
  
  strSql:='select * from ('||strSql||') where ro >='||startIndex;  
  DBMS_OUTPUT.put_line(strSql);

  OPEN v_cur FOR strSql; 
end Pagers;



himalayas 2011-01-11 14:41 鍙戣〃璇勮
]]> 主站蜘蛛池模板: 插B内射18免费视频| 亚洲国产成人精品青青草原| 成人浮力影院免费看| 一级**爱片免费视频| 亚洲熟妇AV一区二区三区浪潮 | 亚洲色成人四虎在线观看| 国产成人精品日本亚洲| 亚洲国产精品13p| 女人与禽交视频免费看| 免费看片在线观看| 免费无码黄网站在线看| 免费视频精品一区二区| 亚洲第一街区偷拍街拍| 亚洲伦理一二三四| 久久亚洲精品国产精品| 亚洲av永久无码精品古装片 | 免费国产污网站在线观看不要卡| 久久久久亚洲国产| 亚洲在成人网在线看| 亚洲精品免费观看| 日韩在线视频免费| 亚洲中文字幕一二三四区| 91亚洲精品自在在线观看| 亚洲激情在线观看| 亚洲av色福利天堂| 亚洲国产成人一区二区三区| 中文字幕亚洲日韩无线码| 亚洲国产成人VA在线观看| 亚洲&#228;v永久无码精品天堂久久 | 亚洲成年人免费网站| 1a级毛片免费观看| 中文字幕免费在线| 亚洲综合免费视频| 国产乱子精品免费视观看片| 国产91免费视频| 国产精品成人观看视频免费| 国产精品久久久久久久久免费| 国产成人精品免费视频网页大全| 中文字幕在线免费| 国产免费久久精品99re丫y| 无码人妻精品一二三区免费|