Oracle objectѧϰ±Ê¼Ç 1
1 ¾Û¼¯(cluster)
1.1 ¸ÅÄ
ÓÃÓÚ½«²»Í¬±íÖеÄÊý¾Ý´æ´¢µ½ÏàͬµÄÎïÀíÊý¾Ý¿éÖУ¬ÓÃÓÚ¶à±íÊý¾ÝÐèҪƵ·±½øÐÐÁªºÏ²éѯµÄÇé¿öÏ¡£¶à±íÊý¾Ý´æ´¢ÔÚÏàͬÊý¾Ý¿éºó£¬ÔÚ¶Ô¶Ô±í½øÐÐÁªºÏ²éѯʱ£¬ËùÐè¶ÁÈ¡µÄÎïÀí¿éÊý¼õÉÙ£¬´Ó¶øÌá¸ß²éѯÐÔÄÜ¡£
ÐèҪעÒâµÄÊǶԾۼ¯Öе¥±íµÄ²éѯºÍ¶Ô¾Û¼¯ÖбíÊý¾Ý½øÐÐÐ޸Ļò²åÈëµÈÊÂÎñ²Ù×÷ʱ£¬ÐÔÄܽ«Êܵ½Ó°Ïì¡£
ÿһ¸ö¾Û¼¯´æ´¢ÆäÖи÷¾Û¼¯±íµÄÊý¾Ý²¢Î¬»¤¸Ã¾Û¼¯Ë÷Òý£¬ÒÔ±ã¶ÔÊý¾Ý½øÐÐÅÅÐò¡£¾Û¼¯Ë÷ÒýÖеÄË÷ÒýÁУ¬³ÆΪ¾Û¼¯¼ü£¨cluster key£©£¬Æä¾ö¶¨ÁËÊý¾ÝÔÚÎïÀíÉϵĴ洢λÖã¬ÕâЩÁв»Ó¦Ê±³£¸üС£¾Û¼¯¼üͨ³£ÊÇÆä¾Û¼¯±íÖÐͬij¸ö±íµÄÖ÷¼üÏà¹ØÁªµÄij±íµÄÍâ¼ü¡£
¾Û¼¯·ÖΪÆÕͨ¾Û¼¯ºÍ¹þÏ£¾Û¼¯Á½ÖÖ£¬Æä²Ù×÷·½·¨²»Ì«Ïàͬ¡£
1.2 ½¨Á¢£º
1.2.1 ½¨Á¢ÆÕͨ¾Û¼¯
--½¨Á¢¾Û¼¯personnel£º
CREATE CLUSTER personnel
( department_number NUMBER(2) )
SIZE 512
STORAGE (INITIAL 100K NEXT 50K);
--½¨Á¢¾Û¼¯±íemp:
CREATE TABLE emp
(empno NUMBER PRIMARY KEY,
ename VARCHAR2(10) NOT NULL
CHECK (ename = UPPER(ename)),
job VARCHAR2(9),
mgr NUMBER REFERENCES scott.emp(empno),
hiredate DATE
CHECK (hiredate < TO_DATE ('08-14-1998', 'MM-DD-YYYY')),
sal NUMBER(10,2) CHECK&nb
Ïà¹ØÎĵµ£º
ÎÊÌâ
£¨1£©±íemployeesºÍdepartment´æÔÚ²ÎÕÕÍêÕûÐÔÔ¼Êø£¬ÔÚ±íemployeesÖвåÈë¼Ç¼£¨‘70’£¬‘999’£©department_idΪ‘999’ʱ£¬department±íÖл¹²»´æÔÚdepartment_idΪ‘999’µÄ¼Ç¼£¬ËùÒÔÎ¥±³Á˲ÎÕÕÍêÕûÐÔÔ¼Êø,³öÏÖ“Integrity constraint violation error”ÌáʾÐÅÏ ......
Oracle job ¹ÜÀí
SVRMGR> select * from dba_jobs;
³õʼ»¯Ïà¹Ø²ÎÊýjob_queue_processes
alter system set job_queue_processes=39 scope=spfile;//×î´óÖµ²»Äܳ¬¹ý1000 ;job_queue_interval = 10 //µ÷¶È×÷ҵˢÐÂƵÂÊÃëΪµ¥Î»
DBA_JOBS describes all jobs in the database.
USER_JO ......
·½°¸1 ÊÊÓÃÓÚoracle9iÒÔÉÏ£¡
select * from
(select row_number() over(order by sendid desc) rn,m.* from xxt_msgreceive m )
where rn <1010 and rn>=1000
·½°¸2
SELECT * from (SELECT A.*, ROWNUM RN from (SELECT * from xxt_msg where sendstatus=1 order by msgid desc) A WHERE ROWNUM < ......
--°ü
create or replace package pkg_query as
type cur_query is ref cursor;
end pkg_query;
--¹ý³Ì
CREATE OR REPLACE PROCEDURE "PRC_QUERY" (p_tableName
in varchar2, --±íÃû
& ......
Êý¾Ý¿âϵͳºÍ²Ù×÷ϵͳһÑù£¬ÔÚ¼ÆËã»úÉÏ°²×°³É¹¦ºó£¬»¹ÐèÒª½øÒ»²½ÅäÖúÍÓÅ»¯£¬´Ó¶øʹÆä¾ßÓиüÇ¿´óµÄ¹¦ÄܺÍÔËÐÐÔÚ×î¼Ñ״̬¡£Èç¹ûÔÚÉè¼Æ½×¶ÎÒòΪ¸÷ÖÖÒòËØûÓнøÐнÏΪºÏÀíµÄÅäÖúͼƻ®£¬ÄÇô¾ÍÐèÒªÔÚºóÆÚ¶ÔÊý¾Ý¿âϵͳ½øÐÐÓÅ»¯¡£
Êý¾Ý¿âϵͳÐÔÄܵÄÓÅ»¯£¬³ýÁËÔÚÉè¼Æ½×¶Î¶ÔÆäÂß¼´æ´¢½á¹¹ºÍÎïÀí´æ´¢½á¹¹Éè¼Æ½øÐÐÓÅ»¯£¬Ê¹Ö®ÔÚÂú×ã ......