´¦ÀíoracleÊý¾Ý
/**
*
*/
package com.huawei.widget.util;
import java.math.BigDecimal;
/**
* @author tanjixuan
* @since 2008-12-20
*
*/
public final class DatabaseUtil
{
// oracleתÒå×Ö·û
public static final char ORACLE_ESCAPE_CHAR = '\\';
// oracleÌØÊâ×Ö·û¶¨Ò壬ÓÃÓÚתÒå¡£ÒÔ“|”×Ö·û·Ö¸î
public static final String ORACLE_SPACIAL_CHAR = "|%|_|" + ORACLE_ESCAPE_CHAR + "|";
// ²»ÔÊÐíʵÀý»¯
private DatabaseUtil()
{
}
static public String toEscape(String data)
{
if (null == data || "".equals(data.trim()))
{
return data;
}
int len = data.length();
StringBuilder escapeStrBuild = new StringBuilder();
char singleChar;
for (int index = 0; index < len; index++)
{
singleChar = data.charAt(index);
if (ORACLE_SPACIAL_CHAR.indexOf(singleChar) > -1)
{
escapeStrBuild.append(ORACLE_ESCAPE_CHAR).append(singleChar);
}
else
{
escapeStrBuild.append(singleChar);
}
}
// ´¦ÀíoracleµÄ×Ö·û´®ÌØÊâ×Ö·ûÁË¡£
String escapeStr = escapeStrBuild.toString().replace("'", "''");
return escapeStr;
}
static public String toOracleString(String data)
{
if (null == data || "".equals(data.trim()))
{
return data;
}
// ´¦ÀíoracleµÄ×Ö·û´®ÌØÊâ×Ö·ûÁË¡£
String escapeStr = data.replace("'", "''");
return escapeStr;
}
static public Long toLong(BigDecimal data)
{
Long resultLong = 0L;
if (null != data)
{
resultLong = data.longValue();
&
Ïà¹ØÎĵµ£º
¡¾Ê¾Àý1.1¡¿ ²éѯ¹ÍÔ±±àºÅΪ7788µÄ¹ÍÔ±ÐÕÃûºÍ¹¤×Ê¡£
²½Öè1£ºÓÃSCOTT/TIGERÕË»§µÇ¼SQL*Plus¡£
²½Öè2£ºÔÚÊäÈëÇøÊäÈëÒÔϳÌÐò£º
/*ÕâÊÇÒ»¸ö¼òµ¥µÄʾÀý³ÌÐò*/
SET SERVEROUTPUT ON
DECLARE--¶¨Ò岿·Ö±êʶ
v_name VARCHAR2 ......
¡¾ÑµÁ·6.1¡¿¡¡Ê¹ÓÃÒþʽÓαêµÄÊôÐÔ£¬Åж϶ԹÍÔ±¹¤×ʵÄÐÞ¸ÄÊÇ·ñ³É¹¦¡£
²½Öè1£ºÊäÈëºÍÔËÐÐÒÔϳÌÐò£º
BEGIN
UPDATE emp SET sal=sal+100 WHERE empno=1234;
IF SQL%FOUND THEN
DBMS_OUTPUT.PUT_LINE('³É¹¦Ð޸ĹÍÔ±¹¤×Ê£¡');
......
³£¼ûºǫ́½ø³Ì°üÀ¨:
• Êý¾Ý¿âд½ø³Ì (DBWn):½«Êý¾Ý¿â»º³åÇø¸ßËÙ»º´æÖеľ¹ýÐ޸ĵĻº³åÇø(»ÒÊý¾Ý»º ³åÇø)ÒÔÒì²½·½Ê½Ð´Èë´ÅÅÌ
• ÈÕ־д½ø³Ì (LGWR):½«ÈÕÖ¾»º³åÇøÖгÆΪÖØ×öÐÅÏ¢µÄ»Ö¸´ÐÅϢдÈë´ÅÅÌÉϵÄÖØ×öÈÕ Ö¾Îļþ
• ¼ì²éµã½ø³Ì (CKPT):ÔÚ¿ØÖÆÎļþºÍÿ¸öÊý¾ÝÎļþÍ·ÖмǼ¼ì²éµãÐÅÏ¢
• ϵͳ¼àÊÓÆ÷½ø³ ......
•ºÎΪÉó¼Æ
Êý¾Ý¿âÉó¼Æ£¬¾ÍÊǶÔÊý¾Ý¿âµÄ»î¶¯×ö¸ú×ټǼ£¬Ö÷Òª°üÀ¨Êý¾Ý¿âÁ¬½Ó£¬SQLÓï¾äÖ´ÐУ¬Êý¾Ý¿â¶ÔÏó·ÃÎÊÕâЩ·½ÃæµÄ¸ú×ټǼ¡£
•ÏÖʵ×÷ÓÃ
°²È«¿ØÖÆ¡¢¸ú×ÙÊý¾Ý±ä»¯¡¢³ÌÐòBUGµ÷ÊÔ¡¢×Ô¶¨ÒåµÄÊý¾Ý»ã×Ü·ÖÎö¡¢²Ù×÷ÈÕÖ¾
•´æ´¢·½Ê½
Ò»ÖÖÊÇ´æ´¢ÔÚ²Ù×÷ϵͳÎļþÖУ¬Ò»ÖÖÊÇ´æ´¢ÔÚsystem±í¿Õ¼äÖеÄSYS.AUD$±íÖÐ
......
•±í·ÖÇø¼¼ÊõÊÇÔÚ³¬´óÐÍÊý¾Ý¿â(VLDB)Öн«´ó±í¼°ÆäË÷Òýͨ¹ý·ÖÇø£¨patition£©µÄÐÎʽ·Ö¸îΪÈô¸É½ÏС¡¢¿É¹ÜÀíµÄС¿é£¬²¢ÇÒÿһ·ÖÇø¿É½øÒ»²½»®·ÖΪ¸üСµÄ×Ó·ÖÇø£¨sub partition£©
•Í¨¹ý¶Ô±í½øÐзÖÇø£¬¿ÉÒÔ»ñµÃÒÔϵĺô¦
–¼õÉÙÊý¾ÝË𻵵ĿÉÄÜÐÔ
–¸÷·ÖÇø¿ÉÒÔ¶ÀÁ¢±¸·ÝºÍ»Ö¸´£¬ÔöÇ¿ÁËÊý¾Ý¿âµÄ¿É¹ÜÀíÐÔ
......