Oracle»ù´¡
1¡¢Ä¬ÈÏÊÂÀý£º
Óû§Ãû£ºscottÃÜÂ룺tiger Ö÷»ú×Ö·û´®£º±¾»ú¿ÉÒÔΪ¿Õ
2¡¢Æô¶¯·½·¨£º
ÔËÐУºsqlplus scott/tiger@lhd
3¡¢SQLPLUS»ù±¾ÃüÁ
Desc£ºÏÔʾ±í¡¢ÊÓͼ½á¹¹ desc ±íÃû£¬ÊÓͼ
List£ºÁгöSQL»º³åÇøÇøÖеÄÒ»Ðлò¶àÐÐÃüÁîÓï¾ä
Exit£ºÍ˳ö
4¡¢³£ÓõÄÊý¾Ý×Öµä(ÈýÖÖǰ׺£ºUSER£¬ALL£¬DBA)
USER_TABLES£ºÓû§ËùÓбíÐÅÏ¢
USER_VIEWS£ºÓû§ËùÓÐÊÓͼ
USER_CONSTRAINTS£º¼Ç¼´´½¨±í½á¹¹µÄÔ¼Êø
USER_DEPENDENCIES£º¼Ç¼Óû§±íÖ®¼äµÄ¹Øϵ¼°×Ô¶¨ÒåÀàÐÍÖ®¼äµÄ¹Øϵ
USER_TAB_COLUMNS£ºÓйظ÷±íµÄÁÐÐÅÏ¢
USER_TRIGGERS£ºÓû§´¥·¢Æ÷µÄÐÅÏ¢
5¡¢ÏÔʾ¿ØÖÆ£º
set linesize 500
set pagesize 100
"/"Óë"run"Ö´ÐиղÅÖ´ÐеÄÓï¾ä¡¢Ò²¿ÉÒÔÓÓr”
"·ÖºÅ"´ú±íÓï¾ä½áÊøÌá½»µ½ºǫִ́ÐÐ
6¡¢ÉèÖÃʱ¼äÊä³ö¸ñʽ£º
alter session set NLS_date_format='YYYY-MM-DD'
7¡¢ÇåÆÁ:clear screen
8¡¢²éѯijÓû§ÏµıíÃû£º
SELECT * from dba_tables WHERE owner='HSA6'
9¡¢²éѯÓм¸¸öÓû§
select * from dba_users
10¡¢µ¼ÈëDMP¸ñʽÊý¾Ý£º
1).н¨³É±í¿Õ¼äºÍÓû§Ãû
2).imp system/123456@orcl file='d:\data\test.dmp' log='d:\data\test.log' fromuser='hsa6' touser='hsa7'
fromuserÊÇÖ¸dmp¸ñʽ°üÖеÄij±í¿Õ¼äµÄÓû§£¬TOUSER ÊÇÖ¸Òªµ¼ÈëµÄ±í¿Õ¼äµÄÓû§
11¡¢¸ü¸Äijֵ£º
sqlserver:
update ca_company set dwmc=substring(dwmc,1,2)+'B'+substring(dwmc,4,10)
oracle:
UPDATE ca_company SET c4='b'|| substr(c4,2,LENGTH(c4)) WHERE c4 LIKE 'a%'
²éѯϵͳËùÓÐÓû§£ºselect distince owner from dba_segments;
²é¿´Óë¶àÉÙ¸ö±í¿Õ¼ä£ºselect tablespace_name from dba_tablespaces;
²é¿´±í¿Õ¼äÓжàÉÙ¸ö±í£ºselect tablespace_name,bytes/1024/1024 file_size_mb file_name from dba_data_files;
1.Á¬½Ó£ºsqlplus scott/tiger@oracle »òÕß sqlplus / as sysdba;
2.Í˳ö£ºquit»òexit;
3.²é¿´µ±Ç°Óû§£ºshow user;
4.ÖØÐÂÁ¬½Ó£º/ as sysdba;
5.´´½¨±í¿Õ¼ä£ºcreate tablespace sales datafile 'd:/hello.dbf' size 4m;
6.²é¿´µ±Ç°Ê±¼ä£ºselect sysdata from daul(ÓÐselect ±ØÓÐfrom)£»
7.²é¿´±í½á¹¹£ºdesc dual (Ðé±í)£»
8.´´½¨Óû§ÃûºÍÃÜÂ룺create user rose identified by rose;
9.ÊÚȨ( ʹÓÃoracleµÄ×ÊÔ´): grant dba,connect,resource to rose;
10.Óû§µÇÂ
Ïà¹ØÎĵµ£º
Ç°ÑÔ:ÍøÉÏÓкܶà½â¾ö°ì·¨£¬É¾listener.oraÒ²ºÃ£¬»¹ÊÇʲôҲºÃ£¬¶¼½â¾ö²»ÁËÎÒÕâ¸öÎÊÌ⣬ÒÀÈ»±¨12514´íÎó£¬ÒÔÏÂÊÇÎÒÖð¸ö³¢ÊÔºó³É¹¦µÄ¼àÌý×Ö·û´®¡£¡£
listener.oraÎļþ£º
# listener.ora Network Configuration File: d:\app\john\product\11.1.0\db_1\network\admin\listener.ora
# Generated by Oracle configuration too ......
OracleÊý¾Ý¿â·þÎñÆ÷ÓÉÁ½²¿·Ö×é³É£¬Ò»²¿·ÖÊÇORACLEÊý¾Ý¿â£¬Ò»²¿·ÖÊÇORACLEʵÀý¡£ORACLEÊý¾Ý¿â¾ÍÊÇ´æ´¢ÔÚ´ÅÅÌÉϵÄORACLEÊý¾ÝÎļþ¡¢ÈÕÖ¾ÎļþºÍ¿ØÖÆÎļþ¡£ÊµÀýÊÇÓÃÀ´¶ÔÊý¾Ý¿â½øÐвÙ×÷¡¢¹ÜÀíµÄ¡£ÊµÀýÓÉһϵÁнø³ÌºÍÄÚ´æ×é³É¡£
Æô¶¯Êý¾Ý¿âµÄʱºòÏÈÔÚÄÚ´æ·ÖÅäÒ»¿éºÜ´óµÄ´æ´¢¿Õ¼ä£¬È»ºóÆô¶¯ORACLEÊý¾Ý¿âÔËÐÐʱÐèÒªµÄһϵÁнø³Ì£¬¼´ ......
Ò» ¸ÅÄî
ÓαêÊÇSQLµÄÒ»¸öÄڴ湤×÷Çø£¬ÓÉϵͳ»òÓû§ÒÔ±äÁ¿µÄÐÎʽ¶¨Òå¡£ÓαêµÄ×÷ÓþÍÊÇÓÃÓÚÁÙʱ´æ´¢´ÓÊý¾Ý¿âÖÐÌáÈ¡µÄÊý¾Ý¿é¡£ÔÚijЩÇé¿öÏ£¬ÐèÒª°ÑÊý¾Ý´Ó´æ·ÅÔÚ´ÅÅ̵ıíÖе÷µ½¼ÆËã»úÄÚ´æÖнøÐд¦Àí£¬×îºó½«´¦Àí½á¹ûÏÔʾ³öÀ´»ò×îÖÕд»ØÊý¾Ý¿â¡£ÕâÑùÊý¾Ý´¦ÀíµÄËٶȲŻáÌá¸ß£¬·ñÔòƵ·±µÄ´ÅÅÌÊý¾Ý½»»»»á½µµÍЧÂÊ¡£
¶þ&n ......
ͨ¹ýJDBC£¬ÎÒÃÇ¿ÉÒÔÏòoracle²åÈë´ó¶ÔÏó£¬ÈçͼƬ£¬ÒôƵ£¬³¤Îı¾µÈ£¬Æä²åÈë·½·¨Óкܶ࣬ÕâÀïÑÝʾһÏÂͨ¹ýÁ÷¸üиüеÄÐÎʽ²åÈëCLOB´ó¶ÔÏó¡£
ÕâÊÇÒ»¸ö´æ´¢Îı¾µÄÀý×Ó£¬½âÊÍÎÒ»áÔÚ³ÌÐòÖÐÒÔ×¢Ê͵ÄÐÎʽд³ö
/**
* ½«Éú³ÉµÄ±íÑù´æ´¢µ½Êý¾Ý¿â
*
* @param htmlParam
* @return
*/
  ......
1.´ò¿ªcmd£¬ÊäÈësqlplus£¬»Ø³µ
2.ÊäÈëÓû§Ãû£ºsystem/manager@orcl as sysdba£¬»Ø³µ
3.create user muzai identified by muzai; //´´½¨muzaiÓû§£¬ÃÜÂëΪmuzai
4.grant dba to muzai; //°ÑdbaµÄȨÏÞ¸³¸ømuzaiÕâ¸öÓû§ ......