Ó²ÅÌÊý¾Ý»Ö¸´µ¼º½
RAIDÊý¾Ý»Ö¸´µ¼º½
 | ÍøÕ¾Ê×Ò³ | Êý¾Ý»Ö¸´×ÊÁÏ | Êý¾Ý»Ö¸´Èí¼þ | ×ÉѯÁôÑÔ | Êý¾Ý»Ö¸´²©¿Í | Êý¾Ý»Ö¸´ÂÛ̳ | 
Êý¾Ý»Ö¸´Èí¼þÏÂÔØ
¹«Ë¾¼ò½é Êý¾Ý»Ö¸´³É¹¦°¸Àý Êý¾Ý»Ö¸´±¨¼Û Êý¾Ý»Ö¸´Åàѵ Êý¾Ý»Ö¸´¼¼ÊõÎÄÕ Êý¾Ý»Ö¸´¿Í·þÖÐÐÄ Êý¾Ý»Ö¸´·þÎñÁªÏµ·½Ê½
ÄúÏÖÔÚµÄλÖ㺠±±ÑÇÊý¾Ý»Ö¸´¼¼ÊõÕ¾ >> Êý¾Ý»Ö¸´×ÊÁÏ >> ·þÎñÆ÷Óë´æ´¢¼¼Êõ >> ÎÄÕÂÕýÎÄ
°Ë¸öѧϰµã°ïÖúÄãÈ«ÃæÈÏʶOracleÊý¾Ý¿â    ÈÈ      ¡¾×ÖÌ壺С ´ó¡¿
°Ë¸öѧϰµã°ïÖúÄãÈ«ÃæÈÏʶOracleÊý¾Ý¿â
×÷ÕߣºØýÃû    ÎÄÕÂÀ´Ô´£º±¾Õ¾ÕûÀí    µã»÷Êý£º    ¸üÐÂʱ¼ä£º2007-6-21

TableSpace

     ±í¿Õ¼ä£º Ò»¸ö±í¿Õ¼ä¶ÔÓ¦¶à¸öÊý¾ÝÎļþ(ÎïÀíµÄdbfÎļþ) ÓÃÓï·¨·½Ê½´´½¨tablespace£¬ÓÃsysdbaµÇ½£º --´´½¨±í¿Õ¼ämytabs£¬´óСΪ10MB:


create tablespace mytabs datafile
'C:\oracle\oradata\mydb\mytabs1.dbf' size 10M;
alter user zgl default tablespace mytabs;
--°Ñtabs×öΪzglµÄĬÈϱí¿Õ¼ä¡£
grant unlimited tablespace to zgl;
                              --½«²Ù×÷±í¿Õ¼äµÄȨÏÞ¸øzgl¡£

Exception ʾÀý£º
create or replace procedure
pro_test_exception(vid in varchar2) is
userName varchar2(30);
begin
select name into userName from t_user where id=vid;
dbms_output.put_line(userName);
exception
when no_data_found then
dbms_output.put_line('ûÓв鵽Êý¾Ý£¡');
when too_many_rows then
dbms_output.put_line('·µ»ØÁ˶àÐÐÊý¾Ý£¡');
                              end pro_test_exception;

°²È«¹ÜÀí

    ÒÔÏÂÓï¾äÒÔsysdbaµÇ½£º Óû§ÊÚȨ£º alter user zgl account lock;--Ëø¶¨Õʺš£ alter user zgl identified by zgl11;--ÐÞ¸ÄÓû§ÃÜÂë¡£ alter user zgl account unlock;--½â³ýÕʺÅËø¶¨¡£ alter user zgl default tablespace tt;--ÐÞ¸ÄÓû§zglµÄĬÈϱí¿Õ¼äΪtt¡£ create user qqq identified by qqq123 default tablespace tt;--´´½¨Óû§¡£

 grant connect to qqq;--¸øqqqÊÚÓèconnectȨÏÞ¡£ grant execute on zgl.proc01 to test;--½«¹ý³Ìzgl.proc01ÊÚÓèÓû§test¡£ grant create user to zgl;--¸øzglÊÚÓè´´½¨Óû§µÄȨÏÞ¡£ revoke create user from zgl;--½â³ýzgl´´½¨Óû§µÄȨÏÞ¡£

½ÇÉ«ÊÚȨ£º create role myrole;--´´½¨½ÇÉ«myrole grant connect to myrole;--¸ømyroleÊÚÓèconnectȨÏÞ grant select on zgl.t_user to myrole;--°Ñ²éѯzgl.t_userµÄȨÏÞÊÚÓèmyrole grant myrole to test;--°Ñ½ÇÉ«myroleÊÚÓètestÓû§

 ¸ÅÒªÎļþ(ÅäÖÃÎļþ)£º È«¾ÖÉèÖ㬿ÉÒÔÔÚ¸ÅÒªÎļþÖÐÉèÖõǽ´ÎÊý£¬È糬¹ýÕâ´ÎÊý¾ÍËø¶¨Óû§¡£

Synonym

´´½¨Í¬Òå´ÊʾÀý£º


create public synonym xxx for myuser.t_user
create synonym t_user for myuser.t_user
                              select * from dba_synonyms where table_name='T_USER'

¿çÊý¾Ý¿â²éѯ
create database link dblinkzgl
connect to myuser identified by a using 'mydb'
                              Select * From t_user@dblinkzgl

courseʾÀý ʾÀý1£º
create or replace procedure pro_test_cursor is
userRow t_user%rowtype;
cursor userRows is
select * from t_user;
begin
for userRow in userRows loop
dbms_output.put_line
(userRow.Id||','||userRow.Name||','||userRows%rowcount);
end loop;
                              end pro_test_cursor;

ʾÀý2£º
create or replace procedure
pro_test_cursor_oneRow(vid in number) is
userRow t_user%rowtype;
cursor userCur is
select * from t_user where id=vid;
begin
open userCur;
fetch userCur into userRow;
if userCur%FOUND then
dbms_output.put_line
(userRow.id||','||userRow.Name);
end if;
close userCur;
                              end pro_test_cursor_oneRow;

recordʾÀý
create or replace
procedure pro_test_record(vid in varchar2) is
type userRow is record(
id t_user.id%type,
name t_user.name%type
);
realRow userRow;
begin
select id,name into
realRow from t_user where id=vid;
dbms_output.put_line
(realRow.id||','||realRow.name);
                              end pro_test_record;

rowtypeʾÀý
create or replace procedure
pro_test_rowType(vid in varchar2) is
userRow t_user%Rowtype;
begin
select * into userRow from t_user where id=vid;
dbms_output.put_line
(userRow.id||','||userRow.name);
                              end pro_test_rowType;

ÎÄÕ¼È룺²Ëµ¶    ÔðÈα༭£º²Ëµ¶ 
  • ÉÏһƪÎÄÕ£º

  • ÏÂһƪÎÄÕ£º
  • ¡¾·¢±íÆÀÂÛ¡¿¡¾¼ÓÈëÊղء¿¡¾¸æËߺÃÓÑ¡¿¡¾´òÓ¡´ËÎÄ¡¿¡¾¹Ø±Õ´°¿Ú¡¿
    ÍøÓÑÆÀÂÛ£º£¨Ö»ÏÔʾ×îÐÂ10Ìõ¡£ÆÀÂÛÄÚÈÝÖ»´ú±íÍøÓѹ۵㣬Óë±¾Õ¾Á¢³¡Î޹أ¡£©
    ¹ØÓÚÎÒÃÇ | RAIDÊý¾Ý»Ö¸´ | ÓÑÇéÁ´½Ó | RSSÉú³É | XMLÉú³É | ÎÄÕÂHTMLµØͼ | ÏÂÔØHTMLµØͼ

    °æȨËùÓÐ ±±ÑÇÊý¾Ý»Ö¸´ÖÐÐÄ
    È«¹úͳһ¿Í·þµç»°:4006-505-808
    ±±¾©Êк£µíÇøÓÀ·á»ùµØ·á»ÛÖз7ºÅвÄÁÏ´´Òµ´óÏÃB×ù205ÊÒ
    ±±¾©Êк£µíÇøÓÀ·á»ùµØ·á»ÛÖз7ºÅвÄÁÏ´´Òµ´óÏÃB×ù205ÊÒ
    ¾©ICP±¸05011939
    iü.