oracle 10g ÊÖ¶¯´´½¨scott(tiger) schema
ת×Ô£ºhttp://cnhtm.itpub.net/post/39970/496967
oracle 9i/10gÖУ¬Èç¹ûÊý¾Ý¿âʵÀýÖÐûÓÐscottģʽ£¬¿ÉÒÔÊÖ¹¤´´½¨£¬·½·¨ÈçÏ£º
µÇ¼Êý¾Ý¿â
ora_test@oracle[/home/oracle]> sqlplus / as sysdba
SQL*Plus: Release 10.2.0.1.0 - Production on Wed Feb 24 09:21:26 2010
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
´´½¨scottÓû§
sys@CNHTM> create user scott identified by tiger;
User created.
ΪscottÓû§·ÖÅäȨÏÞ
sys@CNHTM> grant connect,resource to scott;
Grant succeeded.
ÓÃscottÓû§µÇ¼
sys@CNHTM> conn scott/tiger
Connected.
Ö´ÐÐdemobld.sql½Å±¾
ÔÚoracle 9iÖУ¬demobld.sql½Å±¾Î»ÓÚ <ORACLE_HOME>/sqlplus/demo Ŀ¼ÖÐ
ÔÚoracle10gÖУ¬Õâ¸ö½Å±¾ÔÚµ¥¶ÀµÄ¹âÅÌ"Oracle Database 10g Companion CD Release 2"ÖУ¬¿ÉÒÔ´ÓotnÏÂÔØ°²×°¡£»òÕßÊÖ¹¤´´½¨Õâ¸öÎļþ£¬±¾ÎÄ×îºóÓÐÕâ¸öÎļþµÄÄÚÈÝ
scott@CNHTM> @?/sqlplus/demo/demobld.sql
Building demonstration tables. Please wait.
Demonstration table build is complete.
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
¸½¼þ£ºdemobld.sql ½Å±¾ÄÚÈÝ
----------------------demobld.sql begin-----------------------
--
-- Copyright (c) Oracle Corporation 1988, 2000. All Rights Reserved.
--
-- NAME
-- demobld.sql
--
-- DESCRIPTION
-- This script. creates the SQL*Plus demonstration tables in the
-- current schema. It should be STARTed by each user wishing to
-- access the tables. To remove the tables use the demodrop.sql
-- script.
--
-- USAGE
-- from within SQL*Plus, enter:
-- START demobld.sql
SET TERMOUT ON
PROMPT Building demonstration tables. Please wait.
SET TERMOUT OFF
DROP TABLE EMP;
DROP TABLE DEPT;
DROP TABLE BONUS;
DROP TABLE SALGRADE;
DROP TABLE DUMMY;
CREATE TABLE EMP
(EMPNO NUMBER(4) NOT NULL,
ENAME VARCHAR2(10),
JOB VARCHAR2(9),
MGR NUMBER(4),
HIREDAT
Ïà¹ØÎĵµ£º
¾¹ý³¤Ê±¼äѧϰOracle£¬Äã¿ÉÄÜ»áÓöµ½Oracle tnsÅäÖÃÎÊÌ⣬ÕâÀォ½éÉÜOracle tnsÅäÖÃÎÊÌâµÄ½â¾ö·½·¨¡£×î½üæ×Ű²×°OracleÊý¾Ý¿â£¬±¾À´Í¦¼òµ¥µÄ£¬¿ÉÀÏÊdzöÏÖÎÊÌ⣬×îºó×Ô¼ºÔÚÍøÉÏÕûÀíÁËһЩtns´íÎó½â¾ö·½·¨£¬Ï£Íû¶Ô³õѧÕßÓÐÒæ¡£
³£¼ûÎÊÌâ:
1¡¢ORA-12541:tns:ûÓмàÌýÆ÷£º
ÏÔ¶øÒ×¼û£¬·þÎñÆ÷¶ËµÄ¼àÌýÆ÷ûÓÐÆô¶¯£¬ÁíÍâ¼ì²é¿Í» ......
truncate,delete,dropµÄÒìͬµã
×¢Òâ:ÕâÀï˵µÄdeleteÊÇÖ¸²»´øwhere×Ó¾äµÄdeleteÓï¾ä
Ïàͬµã:truncateºÍ²»´øwhere×Ó¾äµÄdelete, ÒÔ¼°drop¶¼»áɾ³ý±íÄÚµÄÊý¾Ý
²»Í¬µã:
1. truncateºÍ deleteֻɾ³ýÊý¾Ý²»É¾³ý±íµÄ½á¹¹(¶¨Òå)
dropÓï¾ä½«É¾³ý±íµÄ½á¹¹±»ÒÀÀµµÄÔ¼Êø(constrain),´¥·¢Æ÷(trigger),Ë÷Òý(index); ÒÀÀµÓÚ¸Ã±íµ ......
ͨ¹ý select * from table whereid=16701 for update Ëø×¡Ò»Õűí
ͨ¹ýÒÔÏÂÓï¾ä¿É²éѯ³ö±»Ëø×¡µÄ¶ÔÏó
SELECT OBJECT_ID,
SESSION_ID,
SERIAL#,
ORACLE_USERNAME,
&nb ......
£¨ºìÉ«²¿·ÖΪÐÞ¸ÄÄÚÈÝ£©
µÚÒ»²½£¬ÔÚ´ÅÅÌϽ¨Ò»¸öÎļþ¼Ð£¬×¢Òâ²»ÒªÓпոñ£¬·ñÔòoracle°²×°Ê±»á³öÏÖ¾¯¸æ¡£
µÚ¶þ²½£¬ÓÃÓÚ½øÈë°²×°½çÃæºó£¬¼ì²â»·¾³ÔÚ°²×°Îļþ¼ÐÀïËÑË÷ "refhost.xml"£¬¹²2¸öÎļþ¡£
ÓüÇʱ¾´ò¿ª£¬¿´µ½
<!--Microsoft Windows vista-->
<OPERATING_SYSTEM>
&l ......
Á¬½ÓOracleÊý¾Ý¿âµÄHibernateÅäÖÃÎļþ
Á¬½ÓOracleµÄHibernateÅäÖÃÎļþÓÐÁ½ÖÖ¸ñʽ£¬Ò»ÖÖÊÇxml¸ñʽµÄ£¬ÁíÒ»ÖÖÊÇJavaÊôÐÔÎļþ¸ñʽµÄ¡£ÏÂÃæ·Ö±ð¸ø³öÕâÁ½ÖÖ¸ñʽÅäÖÃÎļþµÄ´úÂë¡£
1£®xml¸ñʽµÄÅäÖÃÎļþ
ÏÂÃæ½«¸ø³öÁ¬½Ó±¾µØOracle·þÎñÆ÷ÉϵÄdb_database02Êý¾Ý¿âʱHibernateÅäÖÃÎļþhibernate.cfg.xmlµÄ´úÂë¡£
Àý³Ì2-5£º¹âÅÌ\mr ......