¡¾×ª¡¿oracle ȨÏÞ¹ÜÀíÏà¹ØÃüÁî
Ò»¡¢ÏµÍ³µÄĬÈÏÓû§
Java´úÂë
sys;//ϵͳ¹ÜÀíÔ±£¬ÓµÓÐ×î¸ßȨÏÞ
system;//±¾µØ¹ÜÀíÔ±£¬´Î¸ßȨÏÞ
scott;//ÆÕͨÓû§£¬ÃÜÂëĬÈÏΪtiger,ĬÈÏδ½âËø
¶þ¡¢µÇ½
Java´úÂë
sqlplus conn / as sysdba;//µÇ½sysÕÊ»§
sqlplus sys as sysdba;//ͬÉÏ
sqlplus scott/tiger;//µÇ½ÆÕͨÓû§scott
Èý¡¢¹ÜÀíÓû§
Java´úÂë
create user zhangsan;//ÔÚ¹ÜÀíÔ±ÕÊ»§Ï£¬´´½¨Óû§zhangsan
alert user scott identified by tiger;//ÐÞ¸ÄÃÜÂë
ËÄ£¬ÊÚÓèȨÏÞ
1¡¢Ä¬ÈϵÄÆÕͨÓû§scottĬÈÏδ½âËø£¬²»ÄܽøÐÐÄǸöʹÓã¬Ð½¨µÄÓû§Ò²Ã»ÓÐÈκÎȨÏÞ£¬±ØÐëÊÚÓèȨÏÞ
Java´úÂë
/*¹ÜÀíÔ±ÊÚȨ*/
grant create session to zhangsan;//ÊÚÓèzhangsanÓû§´´½¨sessionµÄȨÏÞ£¬¼´µÇ½ȨÏÞ
grant unlimited session to zhangsan;//ÊÚÓèzhangsanÓû§Ê¹Óñí¿Õ¼äµÄȨÏÞ
grant create table to zhangsan;//ÊÚÓè´´½¨±íµÄȨÏÞ
grant drop table to zhangsan;//ÊÚÓèɾ³ý±íµÄȨÏÞ
grant insert table to zhangsan;//²åÈë±íµÄȨÏÞ
grant update table to zhangsan;//Ð޸ıíµÄȨÏÞ
grant all to public;//ÕâÌõ±È½ÏÖØÒª£¬ÊÚÓèËùÓÐȨÏÞ(all)¸øËùÓÐÓû§(public)
2¡¢oralce¶ÔȨÏÞ¹ÜÀí±È½ÏÑϽ÷£¬ÆÕͨÓû§Ö®¼äÒ²ÊÇĬÈϲ»ÄÜ»¥Ïà·ÃÎʵģ¬ÐèÒª»¥ÏàÊÚȨ
Java´úÂë
/*oralce¶ÔȨÏÞ¹ÜÀí±È½ÏÑϽ÷£¬ÆÕͨÓû§Ö®¼äÒ²ÊÇĬÈϲ»ÄÜ»¥Ïà·ÃÎʵÄ*/
grant select on tablename to zhangsan;//ÊÚÓèzhangsanÓû§²é¿´Ö¸¶¨±íµÄȨÏÞ
grant drop on tablename to zhangsan;//ÊÚÓèɾ³ý±íµÄȨÏÞ
grant insert on tablename to zhangsan;//ÊÚÓè²åÈëµÄȨÏÞ
grant update on tablename to zhangsan;//ÊÚÓèÐ޸ıíµÄȨÏÞ
grant insert(id) on tablename to zhangsan;
g
Ïà¹ØÎĵµ£º
oracle10g´´½¨Óû§
Oracle10g µÄ´´½¨Óû§Ãû
1¡¢ linux Ï oracle µÄÆô¶¯
ÒÔ oracle Éí·ÝµÇ¼
Æô¶¯ lsnrctl start
怬 sqplus /nolog
Á¬½ÓÊý¾Ý¿â connect /as sysdba
Æô¶¯Êý¾Ý¿â startup
¹Ø±ÕÊý¾Ý¿â s ......
Oracle ´¥·¢Æ÷ÓÐÓï¾ä¼¶´¥·¢Æ÷ºÍÐм¶´¥·¢Æ÷
Óï¾ä¼¶´¥·¢Æ÷ µ±É¾³ý²¿ÃűíÖеIJ¿ÃźÅʱ£¬Í¬Ê±É¾³ýµôÔ±¹¤±íÖв¿ÃźÅΪ£ºold.deptnoµÄ¼Ç¼
create or replace trigger del_dept_id
after delete on dept
for each row
begin
delete from emp where deptno=:old.deptno;
end;
µ±Íù²¿Ãűí²åÈëʱ£¬Í¬Ê±ÔÚÔ±¹¤±íÖ ......
Ò»¡¢Ð½¨databack.shÎļþ£¬´æ·ÅĿ¼/opt/databack/
#Êý¾Ý¿âÓû§×ÊÁÏ
USERNAME=Êý¾Ý¿âÓû§Ãû(ÐÅÏ¢Òþ²Ø)
PASSWORD=Êý¾Ý¿âÃÜÂë(ÐÅÏ¢Òþ²Ø)
#FTP·þÎñÆ÷ÐÅÏ¢
FTP_SERV=FTP·þÎñÆ÷(ÐÅÏ¢Òþ²Ø)
FTP_USER=FTPÓû§Ãû(ÐÅÏ¢Òþ²Ø)
FTP_PASS=FTPÃÜÂë(ÐÅÏ¢Òþ²Ø)
FTP_DIR=FTPĿ¼(ÐÅÏ¢Òþ²Ø)
#±¸·ÝĿ¼
BACKUP_DIR=/opt/databack
#¸ ......
ORACLEÀïËøÓÐÒÔϼ¸ÖÖģʽ:
0£ºnone
1£ºnull ¿Õ
2£ºRow-S Ðй²Ïí(RS)£º¹²Ïí±íËø£¬sub share
3£ºRow-X ÐжÀÕ¼(RX)£ºÓÃÓÚÐеÄÐ޸ģ¬sub exclusive
4£ºShare ¹²ÏíËø(S)£º×èÖ¹ÆäËûDML²Ù×÷£¬share
5£ºS/Row-X ¹²ÏíÐжÀÕ¼(SRX)£º×èÖ¹ÆäËûÊÂÎñ²Ù×÷£¬share/sub exclusive
6£ºexclusive ¶ÀÕ¼(X)£º¶ÀÁ¢·ÃÎÊʹÓã¬exclusive
......