Oracle³£ÓõÄһЩÓï·¨¡¢ÃüÁîºÍº¯Êý
Ò»¡¢³£ÓÃÓï·¨ --1. ɾ³ý±íʱ¼¶ÁªÉ¾³ýÔ¼Êø
drop table ±íÃû cascade constraint
--2. µ±¸¸±íÖеÄÄÚÈݱ»É¾³ýºó£¬×Ó±íÖеÄÄÚÈÝÒ²±»É¾³ý
on delete casecade
--3. ÏÔʾ±íµÄ½á¹¹
desc ±íÃû
--4. ´´½¨ÐµÄÓû§
create user [username] identified by [password]
--5. ¸øÓû§·ÖÅäȨÏÞ
grant ȨÏÞ1¡¢È¨ÏÞ2...to Óû§
ex:grant create session to [username] --´ËʱֻÄÜÁ¬½Óµ½Êý¾Ý¿â
grant connect,resource to [username] --´ËʱȨÏÞÄÜÂú×ãÒªÇó
grant select,delete on scott.emp to [username]
--6. »ØÊÕȨÏÞ
revoke select ,delete on scott.emo from [username]
--7. ÐÞ¸ÄÓû§ÃÜÂë
alter user [username] identified by [password]
--8. Ï´εǼʱÌáʾÐÞ¸ÄÃÜÂë
alter user [username] password expired
--9. Ëø¶¨Óû§
alter user [username] account lock
--10. ½âËø±»Ëø¶¨µÄÓû§
alter user [username] account unlock
¶þ¡¢³£ÓÃÃüÁî
--1. ÉèÖÃÏÔʾ¿í¶È
set linesize 100;
--2. ÉèÖÃÿҳÏÔʾÌõÊý
set pagesize 30;
3. ÓüÇʱ¾´ò¿ª
em a.sql
--4. Ö´ÐÐÎļþaÖеĴúÂ룬¿ÉÖ¸¶¨ÎļþµÄ·¾¶ @d:a.txt
@ a
--5. ¸ù¾ÝÓû§ÃûºÍÃÜÂëÁ¬½ÓÊý¾Ý¿â Èç¹ûÁ¬½Ó³¬¼¶¹ÜÀíÔ±(sys) ÔòÓ¦¼ÓÉÏas sysdba;
conn Óû§Ãû/ÃÜÂë
--6. ÏÔʾµ±Ç°Á¬½ÓµÄÓû§
show user;
--7. µÃµ½µ±Ç°Óû§ÏµÄËùÓбí
select * from tab;
--8. ²é¿´±í½á¹¹
desc temp;
--9. ¼ÌÐøÖ´ÐÐÉÏÒ»¸ö²éѯÓï¾ä
/
--10. ÇåÆÁ
clear scr;
Èý¡¢³£Óú¯Êý
·×Ö·ûº¯Êý
--1. ½«Ð¡Ð´×Öĸת»»³É´óд£¬dual ΪһÐé±í
select upper('coolszy') from dual;
--2. ½«´óд×Öĸת»»³ÉСд
select lower('KUKA') from dual;
--3. ½«Ã¿¸öµ¥´ÊµÄÊ××Öĸ´óд£¬ÆäËûλÖõÄ×ÖĸСд
select initcap('kuKA aBc') from dual;
--4. Á¬½Ó×Ö·û´®£¬µ«Ã»ÓÐ||ºÃÓÃ
select concat('Hello',' world') from dual;
--5. ½ØÈ¡×Ö·û´®£¬µÚ¶þ¸ö²ÎÊýÊÇ´ÓµÚ¼¸¸ö×Öĸ¿ªÊ¼½ØÈ¡(´Ó1¿ªÊ¼,Èç¹ûÊÇÒ»¸ö¸ºÊý£¬Ôò´Ó½áβÊýÆð)£¬µÚÈý¸ö²ÎÊýÊÇÐèÒª½ØÈ¡µÄ×ÖĸµÄ¸öÊý
select substr('hello',2,3) from dual;
--6. Çó×Ö·û´®³¤¶È
select length('hello') from dual;
--7. Ìæ»»×Ö·û´®
select replace('HELLO','L','x') from dual;
·ÊýÖµº¯Êý
--1. ËÄÉáÎåÈë
select round(789.536) from dual;
select round(789.536,2) from dual;
select round(789.536,-1) from dual;
Ïà¹ØÎĵµ£º
oracleÖÐsqlÓï¾äÖÐselect * from t_Test t where t.Id in(1,2,3......)/*ÊýÁ¿²»ÄÜ´óÓÚ1000¸ö*/
½â¾ö·½·¨ ·Ö¸î³É¶à´Îin È»ºóÔÙ»òÉÏ Èç select * from t_Test t where t.Id in(1,2,3......800) or t.Id in(801,802,803......1300)
ÔÚʹÓÃÖÐ×îºÃÄܲ»Ê¹ÓÃÆäËûÌõ¼þÀ´´úÌæin
......
<!--
@Name£º·ÖÀàͳ¼ÆÃ÷ϸ
@Time£º2010.01.05
@author JZP
--->
<%@ page language="java" import="java.util.*" pageEncoding="GBK"%>
<%@ page language="java" import="wfc.service.database.DB"%>
<%@ page import="java.sql.Connection"%>
<%@ page import="java.sql.Resul ......
For win:
1¡¢Ð½¨Ò»¸öÅú´¦ÀíÎļþb.bat£¬¸ÃÎļþĿ¼ÏÂÒªÓÐexp.exeÎļþ
Åú´¦ÀíÎļþÄÚÈÝ£º
exp userid=user/passfile=i:\db%date:~0,10%.dmp log=i:\db%date:~0,10%.log
2¡¢Ð½¨ÈÎÎñ¹ØÁªb.batÎļþ¼´¿É¡£
For linux:
1¡¢Çе½oracleÓû§ÏÂн¨Ò»¸öÎļþ£¬Èçb.sh £¬²¢¸³ÓÚ¿ÉÖ´ÐÐȨÏÞ c ......
ÔÚÇ°ÃæѧϰOracleÊý¾Ý¿â»ù´¡¼Ü¹¹Ê±£¬ÒѾÁ˽âÁËOracleµÄ´æ´¢½á¹¹£¬Âß¼ÉÏ£¬OracleµÄÊý¾Ý´æ·ÅÔÚtablespacesÖУ¬ÎïÀíÉÏ´æ·ÅÔÚdatafilesÖС£Ò»¸ötablespaceÖ»ÄÜÊôÓÚÒ»¸öÊý¾Ý¿â(Ò»¸öÊý¾Ý¿â¿É°üÀ¨¶à¸ötablespace)£¬°üÀ¨ÁË1¸ö»ò¶à¸öÊý¾ÝÎļþ¡£Tablespace¿É½øÒ»²½·ÖΪsegments¡¢extentsºÍblocks¡£Ò»¸ödatafileÖ»ÊôÓÚÒ»¸öÊý¾Ý¿âµÄÒ» ......
OracleÓ¦ÓÃϵͳµÄÓÅ»¯Ëĸö·½Ãæ
1.¡¡¡¡¡¡ Ó¦ÓóÌÐòSQLÓï¾äÓÅ»¯;
2.¡¡¡¡¡¡ ORACLEÊý¾Ý¿â²ÎÊýµ÷Õû;
3.¡¡¡¡¡¡ ²Ù×÷ϵͳ²ÎÊýµ÷Õû;
4.¡¡¡¡¡¡ ÍøÂçÐÔÄܵ÷Õû.
oracleÓ¦ÓÃϵͳµÄÐÔÄÜÖ¸±ê
1.¡¡¡¡¡¡ Êý¾Ý¿âÍÌÍÂÁ¿;
2.¡¡¡¡¡¡ Êý¾Ý¿âÓû§ÏìӦʱ¼ä.
ORACLEÊý¾Ý¿âÐÔÄÜÓÅ»¯µÄ¼¸¸ö²¿·Ö
Êý¾Ý¿âÐÔÄÜÓÅ»¯°üÀ¨Èçϼ¸¸ö²¿·Ö£º
1¡¢1¡¢µ÷Õ ......