Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

oracle±Ê¼Ç2


µÚÒ»¿Î£º¿Í»§¶Ë
1. Sql Plus(¿Í»§¶Ë£©£¬ÃüÁîÐÐÖ±½ÓÊäÈ룺sqlplus£¬È»ºó°´ÌáʾÊäÈëÓû§Ãû£¬ÃÜÂë¡£
2. ´Ó¿ªÊ¼³ÌÐòÔËÐÐ:sqlplus£¬ÊÇͼÐΰæµÄsqlplus.
3. http://localhost:5560/isqlplus
Toad£º¹ÜÀí£¬ PlSql Developer:
µÚ¶þ¿Î£º¸ü¸ÄÓû§
1. sqlplus sys/bjsxt as sysdba
2. alter user scott account unlock;(½âËø)
µÚÈý¿Î£ºtable structure
1. ÃèÊöijһÕÅ±í£ºdesc ±íÃû
2. select * from ±íÃû
µÚËĿΣºselect Óï¾ä£º
1.¼ÆËãÊý¾Ý¿ÉÒÔÓÃ¿Õ±í£º±ÈÈ磺.select 2*3 from dual
2.select ename,sal*12 annual_sal from emp;Óëselect ename,sal*12 "annual sal" from emp;Çø±ð£¬¼ÓË«ÒýºÅ±£³ÖÔ­´óСд¡£²»¼ÓÈ«±ä´óд¡£
3. select ename || "abcd" Èç¹ûÁ¬½Ó×Ö·û´®Öк¬Óе¥ÒýºÅ£¬ÓÃÁ½¸öµ¥ÒýºÅ´úÌæÒ»¸öµ¥ÒýºÅ¡£
µÚÎå¿Î£ºdistinct
select deptno from emp;
select distinct deptno from emp;
select distinct deptno from emp;
select distinct deptno ,job from emp
È¥µôdeptno,jobÁ½Õß×éºÏµÄÖØ¸´¡£¸ü¶àµÄÏ¾ÍÊÇÕâô¶àÏîµÄ×éºÏµÄ²»Öظ´×éºÏ¡£
µÚÁù¿Î£ºWhere
select * from emp where deptno =10;
select * from emp where deptno <>10;²»µÈÓÚ10
select * from emp where ename ='bike';
select ename,sal from emp where sal between 800 and 1500 (>=800 and <=1500)
¿ÕÖµ´¦Àí:
select ename,sal,comm from emp where comm is (not) null;
select ename,sal,comm from emp where ename ( not)in ('smith','king','abc');
select ename from emp where ename like '_A%';_´ú±íÒ»¸ö×Öĸ,%´ú±í0¸ö»ò¶à¸ö×Öĸ. Èç¹û²éѯ%
¿ÉÓÃתÒå×Ö·û.\%. »¹¿ÉÒÔÓÃescape '$'±ÈÈç:select ename from emp where ename like '%$a%' escape '$';
µÚÆß¿Î: orderby
select * from dept;
select * from dept order by dept desc;(ĬÈÏ:asc)
select ename,sal,deptno from emp order by deptno asc,ename desc;
µÚ°Ë¿Î: sql function1:
select ename,sal*12 annual_sal from emp
where ename not like '_A%' and sal>800
order by sal desc;
select lower(ename) from emp;
select ename from emp
where lower(ename) like '_a%';µÈͬÓÚ
select ename from emp where ename like '_a%' or ename like '_A%';
select substr(ename,2,3) from emp;´ÓµÚ¶þ×Ö·û½Ø,Ò»¹²½ØÈý¸ö×Ö·û.
select chr(65) from dual ½á¹ûΪ:A
select


Ïà¹ØÎĵµ£º

Oracle ÖеÄUnion¡¢Union All¡¢Intersect¡¢Minus

ÖÚËùÖÜÖªµÄ¼¸¸ö½á¹û¼¯¼¯ºÏ²Ù×÷ÃüÁ½ñÌìÏêϸµØ²âÊÔÁËһϣ¬·¢ÏÖһЩÎÊÌ⣬¼Ç¼±¸¿¼¡£ ¼ÙÉèÎÒÃÇÓÐÒ»¸ö±íStudent£¬°üÀ¨ÒÔÏÂ×Ö¶ÎÓëÊý¾Ý£º drop table student;
create table student
(
id int primary key,
name nvarchar2(50) not null,
score number not null
);
insert into student values(1,'Aaron',78);
inse ......

ÓÃperl²éѯoracleÊý¾Ý¿âÖдæÔÚµÄlock

Ô­ÎĵØÖ·oracle lock
1ÓÃPerl TKÄ£¿é ²éѯDBÖеÄLOCK
use DBI;
use Tkx;
use DBD::Oracle qw(:ora_session_modes);
$mw = Tkx::widget->new(”.”);
$mw->g_wm_title(”Oracle Lock”);
$content = $mw->new_ttk__frame(-padding => “5 5 12 0″);
$content->g_grid ......

oracleµÇ¼ÈÏ֤֪ʶ

ÀûÓÃosÉóºË
µÇ¼oracleʱÔÚWinÖÐʵÏÖ¶ÔosµÄÉóºËÓÐÈçϼ¸²½£º
1¡¢  create  os user id
2¡¢  create  os group   ora_dba(Õâ¸ö×éÖÐÓû§¾ßÓйÜÀíËùÓÐoracle database µÄȨÏÞ),
             ora_sid_dba£¨Ö»ÄܶÔÓ¦µ½ÏàÓ¦sidµ ......

OracleµÄÊý¾Ý·ÖÇø

Êý¾Ý·ÖÇøÊÇÕë¶Ô±íµÄ¡£
ΪʲôҪ½«±í·ÖÇø£¿
·ÖÇø±íͨ³£´æ´¢ÔÚ½ÏСµÄÎļþ£¨<2GB£©ÖУ¬Ò×ÓÚ±¸·Ý¡£
Ó²¼þ¹ÊÕÏʱ£¬Ö»ÓÐÊý¾Ý¿âµÄһС²¿·Ö»áÊܵ½Ó°Ïì¡£
Ò×ÓÚÊý¾Ý·ÖÎö¡£
¿ÉÒÔÔÚÆäËû·ÖÇø¼ÌÐøÌṩ·þÎñµÄͬʱά»¤ÐèÒª½øÐÐά»¤µÄ±íµÄ·ÖÇø¡£alter table sale drop partition q1_1999;
»ùÓÚÁ¿³ÌµÄ·ÖÇø
¹Ø¼üÊÇÑ¡Ôñ·ÖÇø¼ü£¬ËüÓ¦¸Ã¿ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ