Oracle CommitÓ÷¨
µÚÒ»¸öbug fix Óõ½ OracleµÄUpdateÓï¾ä
update Table1 set Web=-1 where ProgID=N‘123’
CodeReview ʱ
Do we need a COMMIT; in the Oracle version?
ÉÏÍø²éÁËÒ»ÏÂOracle COMMITÓ÷¨
COMMIT
Purpose
Use the COMMIT statement to end your current transaction and make permanent all changes performed in the transaction. A transaction is a sequence of SQL statements that Oracle Database treats as a single unit. This statement also erases all savepoints in the transaction and releases transaction locks.
Until you commit a transaction:
You can see any changes you have made during the transaction by querying the modified tables, but other users cannot see the changes. After you commit the transaction, the changes are visible to other users' statements that execute after the commit.
You can roll back (undo) any changes made during the transaction with the ROLLBACK statement (see ROLLBACK.
Oracle Database issues an implicit COMMIT before and after any data definition language (DDL) statement.
You can also use this statement to
Commit an in-doubt distributed transaction manually
Terminate a read-only transaction begun by a SET TRANSACTION statement
Oracle recommends that you explicitly end every transaction in your application programs with a COMMIT or ROLLBACK statement, including the last transaction, before disconnecting from Oracle Database. If you do not explicitly commit the transaction and the program terminates abnormally, then the last uncommitted transaction is automatically rolled back.
A normal exit from most Oracle utilities and tools causes the current transaction to be committed. A normal exit from an Oracle precompiler program does not commit the transaction and relies on Oracle Database to roll back the current transaction.
Ïà¹ØÎĵµ£º
°²×°ÍêOracle 10g£¬sql*plusµÇ½
"Óû§Ãû³Æ£¨U£©:"ÖÐÊäÈë'system'
"¿ÚÁP£©:"ÖÐÊäÈë'manager'
"Ö÷»ú×Ö·û´®£¨H£©:" tnsname.oraÖÐÅäÖõķþÎñÃû(Èç¹ûÊÇϵͳĬÈÏÊý¾Ý¿â¿ÉÒÔ²»ÊäÈë)
(×¢1£ºÕâ¸öÓû§Ãû/ÃÜÂëÊÇÔÚ°²×°¹ý³ÌÖÐ×Ô¼ºÉ趨µÄ)
(×¢2: Èç¹ûÉÏÊö²Ù×÷Å׳öûÓмàÌýÆ÷£¬ÔòÐè¿ ......
OracleÊý¾Ýµ¼Èëµ¼³öimp/exp¾ÍÏ൱ÓÚoracleÊý¾Ý»¹ÔÓ뱸·Ý¡£expÃüÁî¿ÉÒÔ°ÑÊý¾Ý´ÓÔ¶³ÌÊý¾Ý¿â·þÎñÆ÷µ¼³öµ½±¾µØµÄdmpÎļþ£¬impÃüÁî¿ÉÒÔ°ÑdmpÎļþ´Ó±¾µØµ¼Èëµ½Ô¶´¦µÄÊý¾Ý¿â·þÎñÆ÷ÖС£ ÀûÓÃÕâ¸ö¹¦ÄÜ¿ÉÒÔ¹¹½¨Á½¸öÏàͬµÄÊý¾Ý¿â£¬Ò»¸öÓÃÀ´²âÊÔ£¬Ò»¸öÓÃÀ´ÕýʽʹÓá£
Ö´Ðл·¾³£º¿ÉÒÔÔÚSQLPLUS.EXE»òÕßDOS£¨ÃüÁîÐУ©ÖÐÖ´ÐУ¬
DOSÖпÉÒ ......
Çø±ð£º
¡¡¡¡1£®CHARµÄ³¤¶ÈÊǹ̶¨µÄ£¬¶øVARCHAR2µÄ³¤¶ÈÊÇ¿ÉÒԱ仯µÄ£¬ ±ÈÈ磬´æ´¢×Ö·û´®“abc"£¬¶ÔÓÚCHAR
(20)£¬±íʾÄã´æ´¢µÄ×Ö·û½«Õ¼20¸ö×Ö½Ú(°üÀ¨17¸ö¿Õ×Ö·û)£¬¶øÍ¬ÑùµÄVARCHAR2
(20)ÔòÖ»Õ¼ÓÃ3¸ö×ֽڵij¤¶È£¬20Ö»ÊÇ×î´óÖµ£¬µ±Äã´æ´¢µÄ×Ö·ûСÓÚ20ʱ£¬°´Êµ¼Ê³¤¶È´æ´¢¡£
¡¡¡¡2£®CHARµÄЧÂʱÈVARCHAR2µÄЧÂÊ ......
ÐÞ¸ÄÁÐÊôÐÔ
alter table tablename modify(name ,varchar2(10)) Áпí¶È²»µÃСÓÚÐÞ¸ÄǰµÄ¿í¶È
ÈÕÖ¾¹ÜÀí
ÊÓͼ v$logfile
alter database add logfile 'd:\orcl01.log' size 10m;//Ìí¼Ó×é
alter database add logfile member 'd:\orcl02.log' to group 4;//Ïò4×éÖÐÌí¼Ó³ÉÔ±
alter database drop logfile member 'd: ......