Oracle 10g ÒªµãÕûÀí Ö® ¹ÜÀí±í
¹ÜÀí±í
±íÊÇÕæÕý´æ´¢ÐÅÏ¢µÄ¶ÔÏó¡£
1 Êý¾ÝÀàÐÍ
£¨1£©ÊýÖµÀàÐÍ£ºÓÃÓÚ´æ´¢ÕûÊý¡¢¸¡µãÊý¡¢ÊµÊý¡£
number£¨¾«¶È£¬·¶Î§£©¾«¶ÈÊÇÖ¸Êý×Ö¸öÊý×ܺͣ¬·¶Î§ÊÇָСÊýµãÓұߵÄλÊý¡£
£¨2£©×Ö·ûÀàÐÍ£ºÉùÃ÷°üº¬ÁË×Öĸ¡¢Êý×ÖÊý¾ÝµÄÁС£
char£º´æ´¢¹Ì¶¨³¤¶È×Ö·û´®
nchar£º´æ´¢UnicodeÊý¾Ý
varchar2£º¿É±ä³¤¶È£¬ÉùÃ÷ʱ±ØÐëÖ¸¶¨´óС¡£
nvarchar2£º¿É±ä³¤¶È
£¨3£©ÈÕÆÚºÍʱ¼ä
date£º´æ´¢ÈÕÆÚºÍʱ¼ä£¬¿ÉÒÔʹÓÃto_date()ºÍsystdate()º¯ÊýÀ´½¨Á¢ÈÕÆÚÖµ£¬Ö»´æÕûÃë
timestamp£º¿ÉÒԹ涨¾«¶È
2 ´´½¨±íºÍÔ¼Êø
¶ÑÊÇ×î»ù±¾µÄ±íÀàÐÍ¡£
create table [Óû§Ãû.] table_name (ÁÐÃû Êý¾ÝÀàÐÍ (default value) not null£¬·····);
£¨1£©Ô¼Êø
Ô¼Êø¿ÉÒÔÔÚcreate tableÓï¾äÖд´½¨Ò²¿ÉÒÔÔÚalter tableÓï¾äÖÐÌí¼Ó¡£
¹Ø¼ü×Ö£ºconstraint
alter table table_name add constraint Ô¼ÊøÃû Ìõ¼þ;
¢Ù Ö÷¼üÔ¼Êø£ºÈ·±£Ò»¸ö±íÖÐûÓÐÖظ´ÐС£
alter table table_name add constraint Ö÷¼üÃû primary key(ÁÐÃû);
Ò»¸ö±í×îÓÐÖ»ÄÜÓÐÒ»¸öÖ÷¼üÔ¼Êø¡£
±íÖв»ÄÜÓÐÈκÎÁ½ÐÐÔÚÖ÷¼üÔ¼ÊøÁÐÉϾßÓÐÏàͬµÄÖµ¡£
Ö÷¼üÁв»ÄÜΪnull¡£
¢Ú Íâ¼üÔ¼Êø£º½¨Á¢±íºÍ±íÖ®¼äµÄ¸¸×Ó¹Øϵ
alter table ×Ó±íÃû add constraint Íâ¼üÃû foreign key(×Ó±íÁÐ) references ¸¸±íÃû(ÁÐÃû)
Èç¹û²åÈë×Ó±íµÄÐÐÔÚÍâ¼üÁÐÓзÇnullÖµ£¬ÄÇôÔÚ¸¸±íÐÐÖбØÐèÔÚÒýÓõÄÁÐÖÐÓÐÏàͬµÄÖµ¡£
ÔÚ¸¸±íÖб»²ÎÕÕµÄÁбØÐëÊÇΨһµÄ»òÖ÷¼ü¡£
ÔÚ×Ó±í²åÈë¼Ç¼ʱ£¬²»ÂÛ¸¸±íÔÚ¶ÔÓ¦µÄÁÐÊÇ·ñ¾ßÓÐnullÖµ£¬Íâ¼üÁж¼¿ÉÒÔ²åÈënull
¢Û ΨһÐÔÔ¼Êø£ºÈ·±£±íÖеĸ÷ÐУ¬¶ÔÓÚֵΪ·ÇnullµÄ¸øµãÁж¼¾ßÓÐΨһֵ¡£
ÔÚ±íÖУ¬¿ÉÒÔÓжà¸öÐÐÔÚÏàÓ¦µÄΨһÐÔÔ¼ÊøÁÐÖоßÓÐnullÖµ¡£
alter table ±íÃû add constrains Ô¼ÊøÃû unique(ÁÐÃû);
¢Ü ¼ì²éÔ¼Êø£ºÖ¸¶¨Ô¼ÊøÁеÄÈ¡Öµ·¶Î§
alter table ±íÃû add
Ïà¹ØÎĵµ£º
ÏîÄ¿ÀïÒ»¸ö¹¦ÄÜÒªÓõ½Ëæ»úÅÅÐò£¬µ«ÊǺóÀ´ÓÖÒòΪÊý¾ÝÁ¿´óµÄÔÒò£¬Òª·Öҳȥ²éѯÊý¾Ý£¬½á¹ûµ¼Ö²éѯ³öÀ´µÄÊý¾Ý³öÏÖÖظ´¡£
ÔsqlÈçÏÂselect * from ( select row_.*, rownum rownum_ from
(select * from tble order by dbms_random.random) row_ where rownum <= 12) where rownum_ > 10;
ºóÀ´½â¾ö°ì·¨£¬²åÈ ......
ºÜ¾Ã²»ÓõÄoralceÊý¾Ý¿â£¬Èç¹ûÍü¼ÇÁËÃÜÂ룬¿ÉÒÔÕâÑù½â¾ö£º
Èç¹ûûÓÐÉèÖû·¾³±äÁ¿£¬ ȥĿ¼C:\oracle\product\10.2.0\db_1\BIN Ö´ÐÐÒÔÏÂÃüÁ
C:\oracle\product\10.2.0\db_1\BIN>sqlplus /nolog
SQL*Plus: Release 10.2.0.1.0 - Production on Fri Jan 22 16:00:18
2010 Copyright (c) 1982, 2005, Oracle. All ri ......
Oracle Flashback ¼¼Êõ×ܽá
Flashback ¼¼ÊõÊÇÒÔUndo segmentÖеÄÄÚÈÝΪ»ù´¡µÄ£¬ Òò´ËÊÜÏÞÓÚUNDO_RETENTON²ÎÊý¡£ÒªÊ¹ÓÃflashback µÄÌØÐÔ£¬±ØÐëÆôÓÃ×Ô¶¯³·Ïú¹ÜÀí±í¿Õ¼ä¡£
ÔÚOracle 10gÖУ¬ Flash back¼Ò×å·ÖΪÒÔϳÉÔ±£º Flashback Database£¬ Flashback Drop£¬Flashback Query(·ÖFlashback Query,Flashback Version Query ......
ϵÁÐÖ®Î壺ORACLE EBS ϵͳÖ÷Êý¾Ý¹ÜÀí£¨A£©
ÎïÁÏÊÇÔÚINVÄ£¿éÖж¨ÒåµÄ£¬¹©Ó¦ÉÌÊÇÔÚAPÄ£¿éÖж¨ÒåµÄ£¬¿Í»§ÊÇÔÚARÄ£¿éÖж¨ÒåµÄ
Èý¸ö³£ÓÃÖ÷Êý¾Ý£ºÎïÁÏ¡¢¹©Ó¦ÉÌÓë¿Í»§¡£ÕâÈý¸öÖ÷Êý¾Ý¶¼ÓÐÒ»¸ö¹²Í¬µÄϵͳʹÓÃÌص㣺¿ç×éÖ¯µÄÈ«¾ÖÐÔ¡£
¶ø¶ÔÓÚBOMÊý¾Ý£¬¾¡¹ÜÔÚÆóҵʵ¼Ê¹ÜÀí¹¤×÷ÖУ¬¿ÉÄܾßÓÐÒ»¶¨µÄÈ«¾ÖÐÔÌص㣨ÀýÈ粻ͬ¹¤³§Éú²úͬÑù² ......
¹ÜÀíÎļþ
1 ¹ÜÀí¿ØÖÆÎļþ
£¨1£©¸ÅÊö
¢Ù ¿ØÖÆÎļþÊÇOracleÊý¾Ý¿â×îÖØÒªµÄÎïÀíÎļþ¡£
¢Ú ÿ¸öOracleÊý¾Ý¿â¶¼±ØÐëÓÐÒ»¸ö¿ØÖÆÎļþ¡£
¢Û ÔÚ×°ÔØ£¨mount£©Êý¾Ý¿âʱ£¬Oracle»á¸ù¾Ý³õʼ»¯²ÎÊý¶¨Î»¿ØÖÆÎļþ¡£
¢Ü ÔÚÆô¶¯Àý³Ìʱ£¬Oracle»á¸ù¾Ý¿ØÖÆÎļþÔÚÀý³ÌºÍÊý¾Ý¿âÖ®¼ä½¨Á¢¹ØÁª¡£
¢Ý ´ò¿ªÊý¾Ý¿âʱ£¬Oracle»á¸ù¾Ý¿ØÖÆÎļþËù¼ÇÔ ......