oracleÐÞ¸ÄÓû§Ãû
--sqlplus
sqlplus;
sys /password as sysdba;
--²éÕÒÓû§ID£¨user#£©,Êý¾Ý¿âÀïÃæ´æ·ÅµÄÓû§¶¼ÊÇ´óд!
select user#,name,password from user$ where name ='FACT';
USER# NAME PASSWORD
91 FACT 7A0F2B316C212D67
-¸ù¾ÝÓû§ID ¸üÐÂÓû§Ãû¡£
update user$ set name= FACT where user#=91;
--Ìá½»¡£
commit;
--È·ÈÏÓû§ÃûÊÇ·ñ¸üгɹ¦¡£
select user#,name,password from user$ where USER# = 91;
USER# NAME PASSWORD
91 FACT 7A0F2B316C212D673
--ÐÞ¸ÄÓû§ÃÜÂë¡£
alter user fact identified by fact;
--ÊÖ¹¤Ö´Ðмì²éµã²Ù×÷£¬½«Database Buffer CacheÖеÄÊý¾ÝÇ¿ÖÆд³öµ½Íâ´æ¡£
alter system checkpoint;
--Ç¿ÖÆË¢ÐÂShared Pool£¡ÒòΪOracleµÄÊý¾Ý×ÖµäÐÅÏ¢ÊÇ»º´æÔÚShared PoolµÄDictionary CacheÖеġ£
alter system flush shared_pool;
--È·ÈÏÃÜÂëÊÇ·ñÐ޸ijɹ¦¡£
select user#,name,password from user$ where USER# = 91;
USER# NAME PASSWORD
91 FACT 7A0F2B316C212D67
--²âÊÔÓû§ÊÇ·ñ¿ÉÓá£
conn fact/fact
Connected.
show user
USER is "FACT"
--ÖØÆôORACLE·þÎñ
Ïà¹ØÎĵµ£º
PL/SQL
¿é½á¹¹
DECLARE
ÉùÃ÷²¿·Ö
BEGIN
¿ÉÖ´Ðв¿·Ö
EXCEPTION
Òì³£´¦Àí²¿·Ö
END;
Àý£º
Ê×ÏÈÎÒÃÇ¿´Ò»¸ö¼òµ¥Ö®Àý×Ó,ÏÂÃæÕâ¸öÀý×ÓÊÇͳ¼Æ´Ó1 ......
oracle Óαê
¹Ø¼ü×Ö: oracle Óαê
1. Óαê: ÈÝÆ÷£¬´æ´¢SQLÓï¾äÓ°ÏìÐÐÊý¡£
2. ÓαêÀàÐÍ: ÒþʽÓα꣬ÏÔʾÓα꣬REFÓαꡣÆäÖУ¬ÒþʽÓαêºÍÏÔʾÓαêÊôÓÚ¾²Ì¬Óα꣨ÔËÐÐÇ°½«ÓαêÓëSQLÓï¾ä¹ØÁª£©,REFÓαêÊôÓÚ¶¯Ì¬Óαê(ÔËÐÐʱ½«ÓαêÓëSQLÓï¾ä¹ØÁª)¡ ......
Êý¾ÝÀàÐÍʹÓÃ
1.ÉùÃ÷£º
a.¸ñʽ£ºVariable_name [constant] databyte [not null] [:=default expression]
b.±äÁ¿Óë³£Á¿ÉùÃ÷»ù±¾Ò»Ö£¬Ê¹ÓÃconstantÉùÃ÷µÄΪ³£Á¿£¬²»Ê¹ÓÃΪ±äÁ¿£¬²¢ÇÒ¸³ÖµÖ»ÄÜÔÚDECLAREÇøÓò¸³Öµ£»
c.ʹÓÃ%TYPEºÍ%ROWTYPEÉùÃ÷¿ÉÒÔʹ±äÁ¿µÄÀàÐÍÓë±íÖÐ×Ö¶ÎÀàÐÍ»òÕû¸ö¼Ç¼ÀàÐͱ ......
Òì³£
Ô¤¶¨ÒåÒì³£
oracleΪ³£¼û´íÎóÔ¤¶¨Òå
ÔÚDBMS_STANDARD³ÌÐò°üÖÐÌṩÁËÕâЩ¶¨Òå
²»ÐèÒªÏÔʾÉùÃ÷
declare
sex student.stu_sex%type;
begin
select stu_sex into sex from student;
dbms_output.put_line('sex:'||sex);
exception
&nbs ......
1. ASCII
·µ»ØÓëÖ¸¶¨µÄ×Ö·û¶ÔÓ¦µÄÊ®½øÖÆÊý;
SQL> select ascii(A) A,ascii(a) a,ascii(0) zero,ascii( ) space from dual;
A A ZERO SPACE
--------- --------- --------- ---------
65 97 48 32
2. CHR
¸ø³öÕûÊý,·µ»Ø¶ÔÓ¦µÄ×Ö·û;
SQL> select chr(54740) zhao,chr(65) chr65 from dual;
ZH C
-- ......