OracleÖÐÈçºÎÓÃÒ»ÌõSQL¿ìËÙÉú³É10ÍòÌõ²âÊÔÊý¾Ý
OracleÖÐÈçºÎÓÃÒ»ÌõSQL¿ìËÙÉú³É10ÍòÌõ²âÊÔÊý¾Ý
×öÊý¾Ý¿â¿ª·¢»ò¹ÜÀíµÄÈ˾³£Òª´´½¨´óÁ¿µÄ²âÊÔÊý¾Ý£¬¶¯²»¶¯¾ÍÐèÒªÉÏÍòÌõ£¬Èç¹ûÒ»ÌõÒ»ÌõµÄ¼È룬
ÄÇ»áÀË·Ñ´óÁ¿µÄʱ¼ä£¬±¾ÎĽéÉÜÁËOracleÖÐÈçºÎͨ¹ýÒ»ÌõSQL¿ìËÙÉú³É´óÁ¿µÄ²âÊÔÊý¾ÝµÄ·½·¨¡£
²úÉú²âÊÔÊý¾ÝµÄSQLÈçÏ£º
SQL> select rownum as id,
2 to_char(sysdate + rownum / 24 / 3600, 'yyyy-mm-dd hh24:mi:ss') as inc_datetime,
3 trunc(dbms_random.value(0, 100)) as random_id,
4 dbms_random.string('x', 20) as random_string
5 from dual
6 connect by level <= 10;
ID INC_DATETIME RANDOM_ID RANDOM_STRING
---------- ------------------- ---------- --------------------------------------------------------------------------------
1 2009-12-08 19:43:14 76 GWMU280MIVBKKOCZV620
2 2009-12-08 19:43:15 34 GNV88O6TDHD3TWC5GWI5
3 2009-12-08 19:43:16 77 LI6H4O5IAHQIMO4B0WMH
4 2009-12-08 19:43:17 99 LP7XP49I0YOJIYSJDQZO
5 2009-12-08 19:43:18 55 V3284X9RXW4UZI8BQMO3
6 2009-12-08 19:43:19 16 T0OA52UAOGHL1TT46H25
7 2009-12-08 19:43:20 61 UY6RUOF7HWTO86942FLP
&nbs
Ïà¹ØÎĵµ£º
ËäȻѧϰJavaºÜ¾ÃÁË£¬×Ô¼ºÒ²Á¬½Ó¹ýһЩÊý¾Ý¿â£¬±ÈÈçmysqlÖ®ÀàµÄ£¬Èç½ñÄØ£¬Ò²Ñ§Ï°ÁËÒ»¶Îʱ¼äµÄOracle£¬È»¶øÄØ£¬½ñÌìÊÇÎÒµÚÒ»´ÎÁ¬½ÓOracle£¬ºÙºÙ£¬Ó¦¸Ã»¹²»ËãÌ«³Ù°É¡£
½ñÌìÄØ£¬Óе㱿׾£¬´ó¼ÒĪЦ£¡
ÎÒÕâÊÇÒ»¸ö²éѯÀý×Ó
Ê×ÏÈ£¬Ô ......
ϵͳ»·¾³£ºWindows 7
Èí¼þ»·¾³£ºVisual C++ 2008 SP1 +SQL Server 2005
±¾´ÎÄ¿µÄ£º±àдһ¸öº½¿Õ¹ÜÀíϵͳ
ÕâÊÇÊý¾Ý¿â¿Î³ÌÉè¼ÆµÄ³É¹û£¬ËäÈ»³É¼¨²»¼Ñ£¬µ«ÊÇ×÷ΪÎÒÓÃVC++ ÒÔÀ´±àдµÄ×î´ó³ÌÐò»¹ÊÇ´«µ½ÍøÉÏ£¬ÒÔ¹©²Î¿¼¡£ÓÃVC++ ×öÊý¾Ý¿âÉè¼Æ²¢²»ÈÝÒ×£¬µ«Ò²²»ÊDz»¿ÉÄÜ¡£ÒÔÏÂÊÇÎҵijÌÐò½çÃ棬ºóÃæ ......
ѧϰOracle DBAÒ²°ë¸ö¶àѧÆÚÁË£¬½ñÌìÃÍÈ»²Å·¢ÏÖ£¬ÔÀ´ÎÒµÄÊ黹ÊǺÜеģ¬ÉϿβÙ×÷ʱºòÒ²Ö»ÊÇÖªµÀ´ó¸ÅÔõô×ö£¬µ«ÊÇÒªÕæµÄÈ«²¿×Ô¼º×ö£¬¶ø²»È¥·Ê黹ÊÇÓÐÒ»¶¨µÄÄѶȵģ¬ËùÒÔÄØ£¬½ñÌ쿪ʼ½«DBA´ÓÍ·¸´Ï°Ò»±é£¬Í¬Ê±ÔÙ²Ù×÷Ò»±é¡£
µÚÒ»Õ£¬Ñ§µÄÊÇOracleµÄÌåϵ½á¹¹£ ......
1.ĬÈÏÔ¼Êø£º¶¨Òå¸ÃÁÐδÊäÈëֵʱӦ¸Ã¾ßÓеÄĬÈÏÖµ
SQL-------alter table ±íÃû add constraint dt_ÁÐÃû default ĬÈÏÖµ for ÁÐÃû
2.¿ÕÖµÔ¼Êø£º¶¨Òå¸ÃÁÐÊÇ·ñÔÊÐíΪ¿ÕÖµ
SQL-------¶¨Òå±íµÄʱºòÔÚ¶ÔÓ¦ÁÐÁÐÊý¾ÝÀàÐͺóÃæÌí¼Ónot null
3.¼ì²éÔ¼Êø£ºÓÖ½ÐcheckÔ¼Êø£¬ÓÃÀ´ÏÞÖÆÁеÄÈ¡Öµ£¬Ëü¸ù¾Ý¶¨ÒåµÄÂß¼±í´ïʽÀ´Ç¿ÖÆÓòµÄÍêÕûÐÔ ......
¡¡¡¡Êý¾Ý¿â¿ª·¢ÈËÔ±»òÊý¾Ý¿â¹ÜÀíÔ±(DBA)ΪÁË·¢²¼Êý¾Ý¿â»ò±¸·ÝÊý¾Ý¿â¶ÔÏ󣬳£ÐèÒªÉú³ÉT-SQL½Å±¾¡£±ÊÕßÔÚÕâÀï¶Ô³£Ó÷½·¨½øÐÐÁË×ܽᣬ¹©ÅóÓÑÃDzο¼¡£
¡¡¡¡·½·¨Ò»£ºÊ¹ÓÃÆóÒµ¹ÜÀíÆ÷
¡¡¡¡½øÈë“ÆóÒµ¹ÜÀíÆ÷”£¬ÓÒ»÷Êý¾Ý¿â£¬Ñ¡Ôñ“ËùÓÐÈÎÎñ→Éú³ÉSQL½Å±¾”¼´¿É¡£
¡¡¡¡·½·¨ÆÀ¼Û£ºÓŵãÊÇ·½±ã£¬ÇÒ²Ù×÷¼òµ¥¡ ......