||------- Êý¾Ý¿â¹ÜÀí -------||
//ÏÔʾ³õʼ»¯²ÎÊý
show parameter;
//Êý¾Ý¿â±íµÄÂß¼±¸·ÝÓë»Ö¸´
//µ¼³ö
1.µ¼³ö±í
exp userid=scott/tiger@ORCL tables=(emp) file=d:\e1.dmp
2.µ¼³öÆäËû·½°¸µÄ±í£¬Ê×ÏÈҪȷÈÏ×Ô¼ºÊÇsysdbaÉí·Ý
exp userid=system@919959ORCL tables=(scott.emp) file=d:\e1.dmp
3.µ¼³ö±í½á¹¹
exp userid=scott/tiger@ORCL tables=(emp) file=d:\e3.dmp rows=n
4.ʹÓÃÖ±½Óµ¼³ö·½Ê½(ЧÂÊ±ÈÆÕͨµ¼³ö·½Ê½¿ì)
exp userid=scott/tiger@ORCL tables=(emp,dept) file=d:\e4.dmp direct=y
5.µ¼³ö·½°¸
exp userid=scott/tiger@ORCL owner=scott file=d:\e5.dmp
6.µ¼³öÊý¾Ý¿â£¬¸ÃÓû§±ØÐëÊÇdba
exp userid=system/919959@ORCL full=y inctype=complete file=d:\e6.dmp
//µ¼Èë
1.µ¼Èë×Ô¼º±í
imp userid=scott/tiger@ORCL tables=(emp) file=d:\e1.dmp
2.µ¼Èë±íµ½ÆäËûÓû§
ÒªÇó¸ÃÓû§¾ßÓÐdbaȨÏÞ£¬»òÊÇimp_full_database
imp userid=system/919959@ORCL tables(emp) file=d:\e2.dmp touser=scott
3.µ¼Èë±íµÄ½á¹¹
imp userid=scott/tiger@ORCL tables=(emp) file=d:\e3.dmp rows=n
4.µ¼ÈëÊý¾Ý
imp userid=scott/tiger@ORCL ......
||------- ά»¤Êý¾ÝÍêÕûÐÔ -------||
¡¾Ô¼Êø¡¿
//Ô¼Êø
not null //·Ç¿Õ
unique //Ψһ ²»ÄÜÖØ¸´£¬µ«¿ÉÒÔΪ¿Õ
primary key //Ö÷¼ü
foreign key //Íâ¼ü
check //Âú×ãÌõ¼þ
//É̵êÊÛ»õϵͳ±íÉè¼Æ°¸Àý£¨1£©
//goods ÉÌÆ·±í
goodsid //ÉÌÆ·ºÅ
goodsname //ÉÌÆ·Ãû
unitprice //µ¥¼Û
category //ÉÌÆ·Àà±ð
provider //¹©Ó¦ÉÌ
SQL> create table goods(
2 goodsid char(8) primary key,--Ö÷¼ü
3 goodsname varchar2(30) ,
4 unitprice number(10,2) check (unitprice>0),--µ¥¼Û±ØÐë>0
5 category varchar2(8),
6 provider varchar2(30));
//customer ¿Í»§±í
customerid //¿Í»§ºÅ
name //ÐÕÃû
address //סַ
email //µçÓÊ
sex //ÐÔ±ð
cardid //Éí·ÝÖ¤
SQL> create table sustomer(
2 customerid char(8) primary key,--Ö÷¼ü
3 name varchar2(30) not null,--²»Îª¿Õ
  ......
||------- pl/sql »ù´¡ -------||
pl/procedural language ¹ý³ÌÓïÑÔ
//´´½¨±í
SQL> create table mytest(
2 name varchar2(30),
3 pwd varchar2(30));
//´´½¨¹ý³Ì
create procedure sp_pro1 is
create or replace procedure sp_pro1 is --Èç¹û´æÔÚ¼´Ìæ»»
begin
--Ö´Ðв¿·Ö
insert into mytest values('valen','123');
--½áÊø²¿·Ö
end;
SQL> create or replace procedure sp_pro2 is
2 begin
3 --Ö´Ðв¿·Ö
4 delete from mytest where name='valen';
5 --½áÊø²¿·Ö
6 end;
7 /
//²é¿´¹ý³ÌµÄ´íÎóÐÅÏ¢
show error;
//ÈçºÎµ÷Óô洢¹ý³Ì
1.exec ¹ý³ÌÃû£¨²ÎÊýÖµ1£¬²ÎÊýÖµ2£©£»
2.call ¹ý³ÌÃû£¨²ÎÊýÖµ1£¬²ÎÊýÖµ2£©£»
//pl/sql±à³Ì¹æ·¶
1.µ¥ÐÐ×¢ÊÍ --
2.¶àÐÐ×¢ÊÍ/*...*/
3.¶¨Òå±äÁ¿£¬v_×÷Ϊǰ׺
4.¶¨Òå³£Á¿£¬c_×÷Ϊǰ׺
5.¶¨ÒåÓα꣬_cursor×÷Ϊºó׺
6.¶¨ÒåÀýÍ⣬e_×÷Ϊǰ׺
//¿é½á¹¹ÊÂÒËͼ
declear
/* ¶¨Ò岿·Ö--³£Á¿£¬±äÁ¿£¬Óα꣬ÀýÍ⣬¸´ÔÓÊý¾ÝÀàÐÍ */
begin
/* Ö´Ðв¿·Ö- ......
ÔÚoracleÖд洢¹ý³Ì»òÕßÊÓͼµÈ¶ÔÏó´´½¨Ê±£¬Èç¹ûÉæ¼°µ½ÁíÍâÒ»¸öÓû§µÄ±í£¬¼´Ê¹ÄãÒѾgrant dbaÁË£¬Ò²²»ÐУ¬±ØÐëÏÔʽµØ¸³Óè²éѯȨÏÞ¡£·ñÔò£¬Äã»á·¢ÏÖÔÚpl/sqlÖпÉÒÔÖ´ÐÐÓï¾ä£¬µ«ÊÇÒ»µ©·Åµ½create Öо͸æËßÄãȨÏÞ²»×ã¡£
grant select any table to user ......
DBAÃǾ³£»áÓöµ½Ò»¸öÕâÑùÁîÈËÍ·ÌÛµÄÎÊÌ⣺²»ÖªµÀËÔÚOracleÉÏ´´½¨ÁËÒ»¸öÓû§£¬´´½¨Ê±£¬Ã»ÓиøÕâ¸öÓû§Ö¸¶¨Ä¬Èϱí¿Õ¼ä£¬ËùÒÔÕâ¸öÓû§¾Í»á²ÉÓÃĬÈϵıí¿Õ¼ä——system±í¿Õ¼ä¡£µ¼ÖÂϵͳ±í¿Õ¼äѸËÙ±»Óû§Êý¾ÝÕ¼Âú£¬Ö±ÖÁå´»ú¡£
ÔÚ10GÖУ¬DBAÓа취±ÜÃâÕâÖÖÎÊÌâÁË——ÔÚÏßÖ¸¶¨ÏµÍ³Ä¬Èϱí¿Õ¼ä£º
ALTER DATABASE DEFAULT TABLESPACE <tsname>;
ͨ¹ýÖ´ÐÐÒÔÉÏÃüÁ¿ÉÒÔÉ趨ϵͳµÄĬÈϱí¿Õ¼ä¡£ÕâÑùµÄ»°£¬ÔÚ´´½¨ÐÂÓû§Ê±£¬Èç¹û²»Ö¸¶¨ËûµÄĬÈϱí¿Õ¼ä£¬¾Í»á²ÉÓÃÉÏÃæÖ¸¶¨µÄϵͳĬÈϱí¿Õ¼ä×÷ΪÕâ¸öÓõÄĬÈϱí¿Õ¼ä¡£
SQL>conn /as sysdba
SQL> create user test1 identified by test1 default tablespace ringidx;
Óû§ÒÑ´´½¨¡£
SQL> alter database default tablespace ring;
Êý¾Ý¿âÒѸü¸Ä¡£
SQL> create user test identified by test;
Óû§ÒÑ´´½¨¡£
SQL> select username, default_tablespace defspace from dba_users where
username=’TEST’;
USERNAME DEFSPACE
————– —————-
TEST RING
µ«ÊÇҪעÒâµÄÊÇ£¬Ò»µ©½«ÏµÍ³Ä¬Èϱí¿Õ¼äÐÞ¸ÄÁËÒ ......
function Ajax(url)
{
var m_xmlReq=null;
if(window.ActiveXObject)
{
try
{
m_xmlReq = new ActiveXObject('Msxml2.XMLHTTP');
}
catch(e)
{
try{m_xmlReq = new ActiveXObject('Microsoft.XMLHTTP');}catch(e){}
}
}
else if(window.XMLHttpRequest)
{
m_xmlReq = new XMLHttpRequest();
}
this.post=function(d)
{
if(!m_xmlReq) return;
m_xmlReq.open('POST',url,false);
m_xmlReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded;charset=utf-8');
m_xmlReq.send(d);
return eval(m_xmlReq.responseText);
}
} ......