OracleÄÚÖýÇÉ«connectÓëresourceµÄȨÏÞ
Ê×ÏÈÓÃÒ»¸öÃüÁÓèuserÓû§connect½ÇÉ«ºÍresource½ÇÉ«£º
grant connect,resource to user;
ÔËÐгɹ¦ºóÓû§°üÀ¨µÄȨÏÞ:
CONNECT½ÇÉ«£º --ÊÇÊÚÓè×îÖÕÓû§µÄµäÐÍȨÀû£¬×î»ù±¾µÄ
ALTER SESSION --Ð޸ĻỰ
CREATE CLUSTER --½¨Á¢¾Û´Ø
CREATE DATABASE LINK --½¨Á¢Êý¾Ý¿âÁ´½Ó
CREATE SEQUENCE --½¨Á¢ÐòÁÐ
CREATE SESSION --½¨Á¢»á»°
CREATE SYNONYM --½¨Á¢Í¬Òå´Ê
CREATE VIEW --½¨Á¢ÊÓͼ
RESOURCE ½ÇÉ«£º --ÊÇÊÚÓ迪·¢ÈËÔ±µÄ
CREATE CLUSTER --½¨Á¢¾Û´Ø
CREATE PROCEDURE --½¨Á¢¹ý³Ì
CREATE SEQUENCE --½¨Á¢ÐòÁÐ
CREATE TABLE --½¨±í
CREATE TRIGGER --½¨Á¢´¥·¢Æ÷
CREATE TYPE --½¨Á¢ÀàÐÍ
´Ódba_sys_privsÀï¿ÉÒԲ鵽£¨×¢ÒâÕâÀï±ØÐëÒÔDBA½ÇÉ«µÇ¼£©:
select grantee,privilege from dba_sys_privs
where grantee='RESOURCE' order by privilege;
GRANTEE PRIVILEGE
------------ ----------------------
RESOURCE CREATE CLUSTER
RESOURCE CREATE INDEXTYPE
RESOURCE CREATE OPERATOR
RESOURCE CREATE PROCEDURE
RESOURCE CREATE SEQUENCE
RESOURCE CREATE TABLE
RESOURCE CREATE TRIGGER
RESOURCE CREATE TYPE
=================================================
Ò»¡¢ºÎΪ½ÇÉ«£¿
¡¡¡¡ÎÒÔÚÇ°ÃæµÄƪ·ùÖÐ˵Ã÷ȨÏÞºÍÓû§¡£ÂýÂýµÄÔÚʹÓÃÖÐÄã»á·¢ÏÖÒ»¸öÎÊÌ⣺Èç¹ûÓÐÒ»×éÈË£¬ËûÃǵÄËùÐèµÄȨÏÞÊÇÒ»ÑùµÄ£¬µ±¶ÔËûÃǵÄȨÏÞ½øÐйÜÀíµÄʱºò»áºÜ²»·½±ã¡£ÒòΪÄãÒª¶ÔÕâ×éÖеÄÿ¸öÓû§µÄȨÏÞ¶¼½øÐйÜÀí¡£
¡¡¡¡ÓÐÒ»¸öºÜºÃµÄ½â¾ö°ì·¨¾ÍÊÇ£º½ÇÉ«¡£½ÇÉ«ÊÇÒ»×éȨÏ޵ļ¯ºÏ£¬½«½ÇÉ«¸³¸øÒ»¸öÓû§£¬Õâ¸öÓû§¾ÍÓµÓÐÁËÕâ¸ö½ÇÉ«ÖеÄËùÓÐȨÏÞ¡£ÄÇôÉÏÊöÎÊÌâ¾ÍºÜºÃ´¦ÀíÁË£¬Ö»ÒªµÚÒ»´Î½«½ÇÉ«¸³¸øÕâÒ»×éÓû§£¬½ÓÏÂÀ´¾ÍÖ»ÒªÕë¶Ô½ÇÉ«½øÐйÜÀí¾Í¿ÉÒÔÁË¡£
¡¡¡¡ÒÔÉÏÊǽÇÉ«µÄÒ»¸öµäÐÍÓÃ;¡£Æäʵ£¬Ö»ÒªÃ÷°×£º½ÇÉ«¾ÍÊÇÒ»×éȨÏ޵ļ¯ºÏ¡£ÏÂÃæ·ÖÁ½¸ö²¿ÃÅÀ´¶Ôoracle½ÇÉ«½øÐÐ˵Ã÷¡£
¶þ¡¢ÏµÍ³Ô¤¶¨Òå½ÇÉ«
¡¡¡¡Ô¤¶¨Òå½ÇÉ«ÊÇÔÚÊý¾Ý¿â°²×°ºó£¬ÏµÍ³×Ô¶¯´´½¨µÄһЩ³£ÓõĽÇÉ«¡£Ï½é¼òµ¥µÄ½éÉÜÒ»ÏÂÕâЩԤ¶¨½ÇÉ«¡£½ÇÉ«Ëù°üº¬µÄȨÏÞ¿ÉÒÔÓÃÒÔÏÂÓï¾ä²éѯ£º
sql>select * from role_sys_privs where role='½ÇÉ«Ãû';
£±£®CONNECT, RESOURCE, DBA
ÕâЩԤ¶¨Òå½ÇÉ«Ö÷ÒªÊÇΪÁËÏòºó¼æÈÝ¡£ÆäÖ÷ÒªÊÇÓÃÓÚÊý¾Ý¿â¹ÜÀí¡£oracle½¨ÒéÓû§×Ô¼ºÉè¼ÆÊý¾Ý¿â¹ÜÀíºÍ°²È«µÄȨÏ޹滮£¬¶ø²»Òª¼òµ¥µÄʹÓÃÕâЩԤ¶¨½ÇÉ«¡£½«À´µÄ°æ±¾ÖÐÕâЩ½ÇÉ«¿ÉÄܲ»»á×÷ΪÔ
Ïà¹ØÎĵµ£º
ºÎΪLOB£¿
lobΪoracleÊý¾Ý¿âµÄÒ»¸ö´ó¶ÔÏóÊý¾ÝÀàÐÍ,¿ÉÒÔ´æ´¢³¬¹ý4000bytesµÄ×Ö·û´®£¬¶þ½øÖÆÊý¾Ý£¬OSÎļþµÈ´ó¶ÔÏóÐÅÏ¢.×î´ó¿É´æ´¢µÄÈÝÁ¿¸ùoracleµÄ°æ±¾ºÍoracle ¿é´óСÓйØ.
ÓÐÄǼ¸Öֿɹ©Ñ¡ÔñµÄLOBÀàÐÍ?
Ä¿Ç°ORACLEÌṩÁËCLOB£¬NCLOB£¬BLOB£¬BFILE¹²ËÄÖÖLOBÀàÐÍ,CLOB,NLOBΪ´ó×Ö·û´®ÀàÐÍ,NLOBΪ¶àÓïÑÔ¼¯×Ö·ûÀàÐÍ,ÀàËÆÓÚNV ......
1.ORACLE²ÉÓÃ×Ô϶øÉϵÄ˳Ðò½âÎöWHERE×Ó¾ä,¸ù¾ÝÕâ¸öÔÀí,±íÖ®¼äµÄÁ¬½Ó±ØÐëдÔÚÆäËûWHEREÌõ¼þ֮ǰ, ÄÇЩ¿ÉÒÔ¹ýÂ˵ô×î´óÊýÁ¿¼Ç¼µÄÌõ¼þ±ØÐëдÔÚWHERE×Ó¾äµÄĩβ.
¡¡¡¡ÀýÈç:
¡¡¡¡(µÍЧ)
¡¡¡¡SELECT … from EMP E WHERE SAL > 50000 AND JOB = ‘MANAGER’ AND 25 < (SELECT COUNT(*) from EMP WH ......
empÔ±¹¤±í
(empnoÔ±¹¤ºÅ/enameÔ±¹¤ÐÕÃû/job¹¤×÷/mgrÉϼ¶±àºÅ/hiredateÊܹÍÈÕÆÚ/salн½ð/commÓ¶½ð/deptno²¿ÃűàºÅ)
------1.Ñ¡Ôñ²¿ÃÅ30ÖеÄËùÓÐÔ±¹¤.
select ename
from emp
where deptno = 30;
------2.ÁгöËùÓаìÊÂÔ±(CLERK)µÄÐÕÃû£¬±àºÅºÍ²¿ÃűàºÅ.
select ename,empno,deptno
from emp
where job='CLERK';
--- ......
×ÛºÏÁ·Ï°
ѧÉúÔ˶¯»á±ÈÈüÐÅÏ¢Êý¾Ý¿â
1£¬Ô˶¯Ô±sporter£¨Ô˶¯Ô±±àºÅsporterid£¬Ô˶¯Ô±ÐÕÃûname£¬Ô˶¯Ô±ÐÔ±ðsex£¬ËùÊôϵºÅdepartment£©
2£¬ÏîÄ¿item£¨ÏîÄ¿±àºÅitemid£¬ÏîÄ¿Ãû³Æitemname£¬ÏîÄ¿±ÈÈüµØµãlocation£©
3£¬³É¼¨grade£¨Ô˶¯Ô±±àºÅsporterid£¬ÏîÄ¿±àºÅitemid£¬»ý·Ömark£©
½¨±í
1£¬¶¨Òå¸÷¸ö±íµÄÖ÷ÂëÍâÂëÔ¼Êø
2£¬ ......