ORACLE ÖÐROWNUMÓ÷¨×ܽá
¶ÔÓÚ Oracle µÄ rownum ÎÊÌ⣬ºÜ¶à×ÊÁ϶¼Ëµ²»Ö§³Ö>,>=,=,between...and£¬Ö»ÄÜÓÃÒÔÉÏ·ûºÅ(<¡¢<=¡¢!=)£¬²¢·Ç˵ÓÃ>,>=,=,between..and ʱ»áÌáʾSQLÓï·¨´íÎ󣬶øÊǾ³£ÊDz鲻³öÒ»Ìõ¼Ç¼À´£¬»¹»á³öÏÖËƺõÊÇĪÃûÆäÃîµÄ½á¹ûÀ´£¬ÆäʵÄúÖ»ÒªÀí½âºÃÁËÕâ¸ö rownum αÁеÄÒâÒå¾Í²»Ó¦¸Ã¸Ðµ½¾ªÆ棬ͬÑùÊÇαÁУ¬rownum Óë rowid ¿ÉÓÐЩ²»Ò»Ñù£¬ÏÂÃæÒÔÀý×Ó˵Ã÷¡£
¼ÙÉèij¸ö±í t1(c1) ÓÐ 20 Ìõ¼Ç¼,Èç¹ûÓà select rownum,c1 from t1 where rownum < 10, Ö»ÒªÊÇÓÃСÓںţ¬²é³öÀ´µÄ½á¹ûºÜÈÝÒ×µØÓëÒ»°ãÀí½âÔÚ¸ÅÄîÉÏÄÜ´ï³ÉÒ»Ö£¬Ó¦¸Ã²»»áÓÐÈκÎÒÉÎʵġ£
¿ÉÈç¹ûÓà select rownum,c1 from t1 where rownum > 10 (Èç¹ûдÏÂÕâÑùµÄ²éѯÓï¾ä£¬ÕâʱºòÔÚÄúµÄÍ·ÄÔÖÐÓ¦¸ÃÊÇÏëµÃµ½±íÖкóÃæ10Ìõ¼Ç¼)£¬Äã¾Í»á·¢ÏÖ£¬ÏÔʾ³öÀ´µÄ½á¹ûÒªÈÃÄãʧÍûÁË£¬Ò²ÐíÄú»¹»á»³ÒÉÊDz»ËɾÁËһЩ¼Ç¼£¬È»ºó²é¿´¼Ç¼Êý£¬ÈÔÈ»ÊÇ 20 Ìõ°¡£¿ÄÇÎÊÌâÊdzöÔÚÄÄÄØ£¿
ÏȺúÃÀí½â rownum µÄÒâÒå°É¡£ÒòΪROWNUMÊǶԽá¹û¼¯¼ÓµÄÒ»¸öαÁУ¬¼´ÏȲ鵽½á¹û¼¯Ö®ºóÔÙ¼ÓÉÏÈ¥µÄÒ»¸öÁÐ (Ç¿µ÷£ºÏÈÒªÓнá¹û¼¯)¡£¼òµ¥µÄ˵ rownum ÊǶԷûºÏÌõ¼þ½á¹û
µÄÐòÁкš£Ëü×ÜÊÇ´Ó1¿ªÊ¼ÅÅÆðµÄ¡£ËùÒÔÄãÑ¡³öµÄ½á¹û²»¿ÉÄÜûÓÐ1£¬¶øÓÐÆäËû´óÓÚ1µÄÖµ¡£ËùÒÔÄúû°ì·¨ÆÚÍûµÃµ½ÏÂÃæµÄ½á¹û¼¯£º
11 aaaaaaaa
12 bbbbbbb
13 ccccccc
.................
rownum >10 ûÓмǼ£¬ÒòΪµÚÒ»Ìõ²»Âú×ãÈ¥µôµÄ»°£¬µÚ¶þÌõµÄROWNUMÓÖ³ÉÁË1£¬ËùÒÔÓÀԶûÓÐÂú×ãÌõ¼þµÄ¼Ç¼¡£»òÕß¿ÉÒÔÕâÑùÀí½â£ºROWNUMÊÇÒ»¸öÐòÁУ¬ÊÇoracleÊý¾Ý¿â´ÓÊý¾ÝÎļþ»ò»º³åÇøÖжÁÈ¡Êý¾ÝµÄ˳Ðò¡£ËüÈ¡µÃµÚÒ»Ìõ¼Ç¼ÔòrownumֵΪ1£¬µÚ¶þÌõΪ2£¬ÒÀ´ÎÀàÍÆ¡£Èç¹ûÄãÓÃ>,>=,=,between...andÕâЩ
Ìõ¼þ£¬ÒòΪ´Ó»º³åÇø»òÊý¾ÝÎļþÖеõ½µÄµÚÒ»Ìõ¼Ç¼µÄrownumΪ1£¬Ôò±»É¾³ý£¬½Ó×ÅÈ¡ÏÂÌõ£¬¿ÉÊÇËüµÄrownum»¹ÊÇ1£¬ÓÖ±»É¾³ý£¬ÒÀ´ÎÀàÍÆ£¬±ãûÓÐÁËÊý¾Ý¡£
ÓÐÁËÒÔÉÏ´Ó²»Í¬·½Ã潨Á¢ÆðÀ´µÄ¶Ô rownum µÄ¸ÅÄÄÇÎÒÃÇ¿ÉÒÔÀ´ÈÏʶʹÓà rownum µÄ¼¸ÖÖÏÖÏñ
1. select rownum,c1 from t1 where rownum != 10 ΪºÎÊÇ·µ»ØÇ°9ÌõÊý¾ÝÄØ£¿ËüÓë select rownum,c1 from tablename where rownum < 10 ·µ»ØµÄ½á¹û¼¯ÊÇÒ»ÑùµÄÄØ£¿
ÒòΪÊÇÔÚ²éѯµ½½á¹û¼¯ºó£¬ÏÔʾÍêµÚ 9 Ìõ¼Ç¼ºó£¬Ö®ºóµÄ¼Ç¼Ҳ¶¼ÊÇ != 10,»òÕß >=10,ËùÒÔÖ»ÏÔʾǰÃæ9Ìõ¼Ç¼¡£Ò²¿ÉÒÔÕâÑùÀí½â£¬rownum Ϊ9ºóµÄ¼ÇÂ
Ïà¹ØÎĵµ£º
1.²é¿´±í¿Õ¼ä:
SELECT A.TABLESPACE_NAME,A.BYTES TOTAL,B.BYTES USED, C.BYTES FREE,
(B.BYTES*100)/A.BYTES "% USED",(C.BYTES*100)/A.BYTES "% FREE"
from SYS.SM$TS_AVAIL A,SYS.SM$TS_USED B,SYS.SM$TS_FREE C
WHERE A.TABLESPACE_NAME=B.TABLESPACE_NAME AND A.T ......
http://space.itpub.net/9134/viewspace-166486
¾³£ÓÐÈË»áÐèÒªOracleÊý¾Ý¿âËæ×ŲÙ×÷ϵͳһÆðÆô¶¯ºÍ¹Ø±Õ£¬¶øÐÞ¸Ä/etc/oratab,ÉèÖÃÁËoracle SIDÐÐÆô¶¯ÎªYʱʵ¼ÊÉÏÊDz»ºÃÓõġ£±¾ÎÄÒÔÒ»¸öÀý×ÓÀ´Ê¾·¶ÈçºÎÈ¥×ö¡£
ÈçϸøµÄÊÇÒ»¸öexample£¬×¢Òⲿ·ÖÄÚÈÝ¿ÉÄÜÒª¸Ä£¬±ÈÈçoracleµÄÓû§Ãû¡£
1¡¢ÔÚ/sbin/init.d/Ŀ¼Ï½¨Á¢Ò»¸öÎļþ£¬ ......
OS :RHEL AS 4 oracle 10g
0±¸·Ý½Å±¾
#!/bin/bash
# incremental level 0 backup script
source /home/oracle/.bash_profile
current_day=`date +%Y%m%d`
mkdir /home/ora ......
package com.svse.dao;
import java.sql.CallableStatement;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
public class UserDAO {
/*
* javaµ÷Óô洢¹ý³Ì
*/
public int addUser(String username,int userage)
{
Connection conn = null;
int useri ......
½ñÌìÔÚһ̨2003serverÉÏ°²×° 9i¿Í»§¶Ë¡£
ÅäÖÃÁËtnsÖ®ºóÁ¬½Ó£¬±¨´í "ORA-06413 Á¬½Óδ´ò¿ª´íÎó".
°ÑÆäËü·þÎñÆ÷µÄtnsname.oraÖ±½Ó¿½±´¹ýÀ´Ò²²»ÐС£
ºóÀ´²éÁËÒ»ÏÂ×ÊÁÏ£¬ËµÓ¦ÓóÌÐò·¾¶Àï±ßÓÐÌØÊâ×Ö·û¡£
Õâ²Å»ÐÈ»´óÎò£¬Á½ÄêÇ°Õâ¸öÎÊÌâÒѾÕÛÄ¥¹ýÎÒÒ»´ÎÁË£¬ÄÔ×Ó²»ºÃ£¬¾¹È»¸øÍüÁË¡£
ÔÒò¾ÍÊÇ64λϵͳ»·¾³Ï°²×°oracle£¬oralc ......