PostgreSQL/Oracle Table
ͨ³£ÎÒ們ÔÚ½¨Á¢ PostgreSQL/Oracle 資ÁÏ庫µÄ時ºò, Èç¹ûҪʹÓà MySQL/MS-SQL identity À×ͬµÄ¹¦ÄÜ, ¾ÍÊÇÒª採Óà Sequence 來½¨Á¢, ¶ø為ÁËÿһ個 Table ¶¼ÓÐ獨Á¢µÄÐò號產ÉúÆ÷, ÎÒ們會½¨Á¢個別µÄ sequence.
ÀýÈç (PostgreSQL sample):
CREATE SEQUENCE "student_seq" start 1 increment 1 maxvalue 2147483647 minvalue 1 cache 1;
create table student (
id bigint PRIMARY KEY DEFAULT NEXTVAL('student_seq'),
name character varying(50),
studentno character varying(50)
)
當ÎÒ們ʹÓûù±¾µÄ SQL command ¾ÍÊÇ
Insert into student ( name, studentno ) values ( 'jini', '890099' )
進ÐÐ Insert µÄ動×÷, Ëû×ÔÈ»會幫ÎÒÈ¡µÃ nextval of student_seq 進ÐÐ Insert.
ÄÇ麼, ÔÚ Hibernate annotation 標準µÄ×÷·¨, ¾ÍÊÇ
@Entity
@SequenceGeneratorr(name = "TheSEQ", allocationSize = 1, initialValue = 0, sequenceName = "student_seq")
public class Student implements Serializable {
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE
, generator = "TheSEQ")
private Long id;
// other attributes, getters and setters
}
這樣, ÎÒÿһ個 @Id ¶¼µÃ»¨時間寫Ö¸¶¨µÄ sequence name,
雖È»沒ÓÐʲ麼²»ºÃ, µ«ÊÇÎÒ們¿ÉÒÔÀûÓà [tablename]_seq µÄÔ則¶¨義 seq, ¾Í應該¿ÉÒÔ͸過 Dialect 來決¶¨ÎÒµÄ IdGenerator µÄ·½Ê½
ËùÒÔÎÒÏ£Íûδ來µÄ³Ìʽ碼Ö»ÓÐÒÔÏÂËùÁÐ, ÀûÓà AUTO ¶ø·Ç SEQUENCE generated type.
@Entity
public class Student implements Serializable {
@Id
@GeneratedValue(strategy=GenerationType.AUTO)
private
Ïà¹ØÎĵµ£º
ÏÂÃæÊÇCMDÃüÁî´°¿ÚϵIJÙ×÷£¬¿´¿´ÊÇÔõôµ¼ÈëµÄ¡£
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
C:\Documents and Settings\oeg2006>imp
Import: Release 9.2.0.1.0 - Production on ÐÇÆÚÈý 11ÔÂ 25 19:24:12 2009
Copyright (c) 1982, 2002, Oracle Corporation. A ......
Oracle 9i¶¯Ì¬SGA¹ÜÀí
ÔÚOracle 9iÖУ¬¿ÉÒÔÉèÖÃSGA_MAX_SIZE£¬¸Ã²ÎÊýÓÃÒÔ¿ØÖƸ÷»º³å³ØʹÓõÄÄÚ´æ×ܺͣ¬±¾ÖÊÉÏÊÇÔÚ½ø³ÌÖÐÔ¤ÏÈ·ÖÅäÒ»¶ÎÐéÄâµØÖ·±¸Óöø²»·ÖÅäÎïÀíÄڴ棬ĿµÄÊÇ·ÀÖ¹ºÍ½ø³Ç˽ÓеØÖ·¶ÎµÄ³åÍ»¡£
Ö»Òª×ܵÄSGAÄÚ´æÉèÖò»³¬¹ýSGA_MAX_SIZEµÄÉèÖ㬸ü¸Ä¶¼¿ÉÒÔÁ¢¼´ÉúЧ¡£ÐèҪעÒâµÄÊÇ£¬ÔÚOracle 9iR1ÖУ¬¶¯Ì¬¼õСÄÚ´ ......
Parsing command line arguments:
Parameter "silent" = true
java.lang.ArrayIndexOutOfBoundsException: 2
at oracle.net.ca.CmdlineArgs.parseArgs(Unknown Source)
at oracle.net.ca.I ......
1.GSD global services daemon
oracle¹Ù·½ÎĵµµÄÃèÊö
The Global Services Daemon (GSD) runs on each node with one GSD process per node. The GSD coordinates with the cluster manager to receive requests from clients such as the DBCA, EM, and the SRVCTL utility to execute administrative ......
Èç¹ûÊÇÖÐÎÄ×Ö·û¼¯£º
[TEST@ora10gr1#2009-11-25/08:39:38]
SQL>create table t1(t timestamp);
Table created.
[TEST@ora10gr1#2009-11-25/08:39:56]
SQL>insert into t1 values(to_timestamp('21NOV09 10:04:12.032','DDMONYY HH24:MI:SS.FF'));
* ERROR at li ......