oracle10g SQL ¸ú×Ù
1.¼¤»îSQL¸ú×Ù
´Óoracle10gÒÔºóÌṩÁËÐµķ½·¨¼¤»îSQLµÄ¸ú×Ù£¬¼´ÊÇʹÓÃdbms_monitor°üÀ´¿ªÆô»ò¹Ø±ÕSQL¸ú×Ù¡£
֮ǰ¾É·½·¨ÊÇʹÓà alter session set events .. »òÕßʹÓÃdbms_system.set_ev·½Ê½
ʹÓÃdbms_monitor°ü¿ÉÒÔÔڻỰ£¬¿Í»§¶Ë£¬×é¼þÒÔ¼°Êý¾Ý¿âËĸö²ã¼¶¿ªÆôSQLµÄ¸ú×Ù¡£
Ö»ÓÐÓµÓÐdba½ÇÉ«µÄÓû§²ÅÄÜÔÊÐíÖ´ÐÐdbms_monitor°ü
4¸ö²ã´Î¼¶±ðµÄ¼¤»îµ÷Ó÷½·¨£º
»á »° ¼¶:exec dbms_monitor.session_trace_enable(session_id =>1574,
serial_num=>36749,waits=>true,binds=>false);
×¢Òâ:ʹÓÃselect * from v$session where sid=sys_context('userenv','sid');
»ñµÃsession_idºÍserial
¹Ø±ÕÓÃ:
exec dbms_monitor.session_trace_disable(session_id=>1574,serial_num=>36749)
¿Í»§¶Ë¼¶:exec dbms_monitor.cliend_id_trace_enable(
client_id=''JXXXT:Administrator',
waits =>true,binds=>false)
×¢Òâ:client_id¼´v$session±íÀïÃæµÄclient_identifier×ֶΣ¬Ä¬ÈÏ´Ë×Ö¶ÎΪ¿Õ,
ͨ¹ýdba_enabled_traces±í²é¿´ÄÇЩ¿Í»§¶ËÆôÓÃÁËSQL¸ú×Ù
&nb
Ïà¹ØÎĵµ£º
create table tree_table
(
id number,
pId number,
orderNumber number,
name varchar2(255)
)
select tt.*
from tree_table tt
start with tt.pId = 0
connect by prior tt.id = ttd.pId
order siblings by orderNumber ......
1.½«¿Í»§¶Ë³ÌÐò½âѹµ½µçÄÔÖÐ
2.ÅäÖû·¾³±äÁ¿£º
ORACLE_HOME=F:\instantclient_10_2\client
Path¼ÓÉÏ%ORACLE_HOME%\bin£»
NLS_LANG=SIMPLIFIED CHINESE_CHINA.ZHS16GBK
3.ÐÞ¸Ä
%ORACLE_HOME%\network\adminϵÄtnsnames.oraÎļþ
dev = &nbs ......
OracleÖÐÌṩһϵÁÐÀàÐÍ£¬Ã¿¸öÀàÐ͵ÄÌØµãÈçÏ£º
char£º´æ´¢¹Ì¶¨³¤¶ÈµÄ×Ö·û£¬Èç¹û×Ö·û³¤¶È²»¹»»áÔÚÓұ߲¹¿Õ¸ñ¡£±ÈÈ磺name char£¨10£©£¬µ±¸øname¸³ÖµÎª'zhangsan'ʱ»áÔÚÓұ߲¹³ä2¸ö¿Õ¸ñ¡£charÀàÐ͵ÄÈÝÁ¿Îª1¡«2000B£¬Ã»ÓÐÖ¸¶¨ÔòĬÈϳ¤¶ÈΪ1¡£
varchar2£º´æ´¢³¤¶È¿É±äµÄ×Ö·û£¬ºÍcharÀàÐ͵IJ»Í¬£¬Ëü²»»á×Ô¶¯²¹³ä¿Õ¸ñ£¬ÇÒ¶¨ÒåÊ ......
1.oracle
sql = "SELECT column_name, data_type, data_length, nullable";
sql += " from user_tab_columns ";
sql += " where table_name='";
sql += $tableName;
sql += "'";
select * from user_tab_comments & ......
using System;
using System.Collections.Generic;
using System.Text;
using System.Data.SqlClient;
using System.Xml;
using System.Data;
namespace MyDbTest
{
class Program
{
static void Main(string[] args)
{
SqlConnection thisConnection = new SqlConnection(
@ ......