¹ØÓÚSQLÓï¾ä
½ñÌìдÍøÕ¾µÄʱºòºÜ囧°¡£¬·¢ÏÖ²éÕÒÓû§È¨ÏÞµÄʱºòÎÞÔµÎ޹ʵÄͬһ¸öȨÏÞÖظ´³öÏֺܶà´Î
Ð޸ĺóµÄSQLÓï¾äÈçÏÂ
SELECT
node
.
id
,
node
.
name
,
access
.
role_id
from
think_role_user
AS
user
,
think_access
AS
access
,
think_node
AS
node
WHERE
user
.
user_id
=
5
AND
access
.
role_id
=
user
.
role_id
AND
access
.
level
=
3
AND
access
.
node_id
=
node
.
id
LIMIT
0
,
30
ÆäÖÐNODEÊÇȨÏ޽ڵ㣬ACCESSÊÇȨÏÞºÍÓû§ËùÔÚ×é¶ÔÓ¦µÄ½Úµã£¬USERÊÇÓû§ÓëÆäËùÔÚ×éÖ®¼äµÄ±í£¬ÕâÑùд³öÀ´µÄSQLÓï¾ä¾ÍÄܹ»ÕýÈ·²éѯÁË
ÎÒ·¢ÏÖÎÒ´íÎóµÄµØ·½ÊǶàÒýÈëÁËÁíÒ»¸öÎÞ¹ØµÄ±í£¬¾ÍÊÇ˵fromÀïÃæ¶à³öÀ´ÁíÒ»¸ö±í£¬Ò»¿ªÊ¼ÎÒÒÔΪûÓвî±ð£¬ºóÀ´²Å·¢ÏÖ¶àÒ»¸öÄÇÑùµÄ±í£¬Í¬Ò»¸ö²éѯ½á¹û¾Í»á¶à³öÄǸö±íµÄ½Úµã¸öÊý±¶¡£¡£¡£
¶÷£¬ºÜ¾ÃûÓÐд¹ýSQL£¬½ñÌìËãÊǸ´Ï°ÁËһϡ£ºÜ²»´í~~~~
Ïà¹ØÎĵµ£º
--¼à¿ØË÷ÒýÊÇ·ñʹÓà alter index &index_name monitoring usage; alter index &index_name nomonitoring usage; select * from v$object_usage where index_name = &index_name;
--ÇóÊý¾ÝÎļþµÄI/O·Ö²¼ select df.name,phyrds,phywrts,phyblkrd,phyblkwrt,singleblkrds,readtim,writetim from v$filestat fs,v ......
µÚÒ»µã£º
ʹÓÃÊÓͼ£¬¿ÉÒÔ¶¨ÖÆÓû§Êý¾Ý£¬¾Û½¹Ìض¨µÄÊý¾Ý¡£
½âÊÍ£º
ÔÚʵ¼Ê¹ý³ÌÖУ¬¹«Ë¾Óв»Í¬½ÇÉ«µÄ¹¤×÷ÈËÔ±£¬ÎÒÃÇÒÔÏúÊÛ¹«Ë¾ÎªÀýµÄ»°£¬
²É¹ºÈËÔ±£¬¿ÉÒÔÐèҪһЩÓëÆäÓйصÄÊý¾Ý£¬¶øÓëËûÎ޹صÄÊý¾Ý£¬¶ÔËûû
ÓÐÈκÎÒâÒ壬ÎÒÃÇ¿ÉÒÔ¸ù¾ÝÕâһʵ¼ÊÇé¿ö£¬×¨ÃÅΪ²É¹ºÈËÔ±´´½¨Ò»¸öÊÓ
ͼ£¬ÒÔºóËûÔÚ²éѯÊý¾Ýʱ£¬Ö»Ðèse ......
ÊÓͼ¿ÉÒÔ±»¿´³ÉÊÇÐéÄâ±í»ò´æ´¢²éѯ¡£¿Éͨ¹ýÊÓͼ·ÃÎʵÄÊý¾Ý²»×÷Ϊ¶ÀÌصĶÔÏó´æ´¢ÔÚÊý¾Ý¿âÄÚ¡£Êý¾Ý¿âÄÚ´æ´¢µÄÊÇ SELECT Óï¾ä¡£SELECT Óï¾äµÄ½á¹û¼¯¹¹³ÉÊÓͼËù·µ»ØµÄÐéÄâ±í¡£Óû§¿ÉÒÔÓÃÒýÓñíʱËùʹÓõķ½·¨£¬ÔÚ Transact-SQL Óï¾äÖÐͨ¹ýÒýÓÃÊÓͼÃû³ÆÀ´Ê¹ÓÃÐéÄâ±í¡£Ê¹ÓÃÊÓͼ¿ÉÒÔʵÏÖÏÂÁÐÈÎÒ»»òËùÓй¦ÄÜ£º
½«Óû§ÏÞ¶¨ÔÚ± ......
·½·¨Ò»£º
DB1 tb1
DB2 tb2
Ñ¡ÔñDB1 µ½±íµÄÁбíÄÇÀï
Ñ¡Ôñtb1±í ÓÒ¼ü ËùÓÐÈÎÎñ Êý¾Ýµ¼³ö
ÏÂÒ»²½ Ñ¡ÔñÄãÒªµ¼³öµÄÊý¾Ý¿âDB1 ÏÂÒ»²½ Ñ¡ÔñÄãÒªµ¼ÈëµÄÊý¾Ý¿âDB2
ÏÂÒ»²½ Ñ¡ÔñÄãÒªµ¼µÄ±í£¨Ç°Ã滹´£©tb1£¬ ºóÃæ¶ÔÓ¦µÄÊÇÐÂÊý¾Ý¿âµÄ±íÃûtb2£¨Ä¬ÈÏÊÇÏàͬ±íÃû£¬¿ÉÐ޸ģ© ÏÂÒ»²½ ÍêÁË ......
CREATE FUNCTION dbo.UF_GetInvoiceSerials( @bizCode VARCHAR(10))
RETURNS VARCHAR(100)
AS
BEGIN
DECLARE @ret AS VARCHAR(1000)
SELECT @ret=Coalesce(@ret + ', ','') +
CASE e.ID
  ......