oracle»ù´¡ÖªÊ¶1
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.Óû§µÇ½
Ïà¹ØÎĵµ£º
oracle±í¿Õ¼ä²Ù×÷Ïê½â
1
2
3×÷Õߣº À´Ô´£º ¸üÐÂÈÕÆÚ£º2006-01-04
5
6
7½¨Á¢±í¿Õ¼ä
8
9CREATE TABLESPACE data01
10DATAFILE '/ora ......
create table emp2_log(
uname varchar2(20),
action varchar(10),
atime date
);
create or replace trigger trig
after insert or delete or update on emp2 for each row //°óÔÚÒ»ÕűíÉÏ,before after ¶¼¿É
ÒÔ,beforeÊÇ ²åÊý¾Ý֮ǰ£¬afterÊÇÖ®ºó
begin
&nb ......
ÔÚPL/SQLÖÐʹÓÃÕóÁд¦ÀíÊÇÒ»¸öºÜºÃµÄ×ö·¨(È磬ʹÓÃbulk collectºÍforall)¡£ÅúÁ¿´¦ÀíÄܹ»´ó´ó¼õÉÙPL/SQLÓï¾äÖ´ÐÐÒýÇæµÄ»·¾³Çл»´ÎÊý£¬´Ó¶øÌá¸ßÆäÐÔÄÜ¡£
¡¡¡¡ÁíÒ»¸öÓÅÐãʾÀýÊÇ°Ñ´æ´¢¹ý³ÌÖеÄËùÓдúÂë·ÅÈëËø¶¨µÄÈí¼þ°üÖУ¬ÕâÑù¿ÉÒÔÉú³ÉÄ£¿éµ¥Ôª¡£°Ñ´æ´¢¹ý³Ì·ÅÈëÈí¼þ°üÀï¿ÉÒÔʵÏÖÏà¹Ø³ÌÐòºÍ¹¦ÄܵķÖ×é¡£µ±
µ¥¸ö°ü±»Ê¹Óà ......
When queried, virtual columns appear to be normal table columns, but
their values are derived rather than being stored on disc. The syntax
for defining a virtual column is listed below.
column_name [datatype] [GENERATED ALWAYS] AS (expression) [VIRTUAL]
If the datatype is omitted, it is determin ......
Ç°¶Îʱ¼ä×öÁËÒ»¸öÐéÄâ×éÖ¯µÄ´´½¨¡£Õâ¸öÐéÄâ×éÖ¯µÄ´´½¨ÊÇ´ÓÏÖÓеÄ×éÖ¯ÖжÁÈ¡Êý¾ÝÈ»ºó½øÐзÖÎö±£´æµ½ÐéÄâ×éÖ¯±íÖС£±£´æÖ®ºóдÈÕÖ¾·½±ãͬ²½µ½ÆäËüϵͳÖС£¹«Ë¾Ê¹ÓõÄÖ÷Òª¼¼ÊõÊÇSSH¡£ÓÉÓÚÊÇÐÂÈËûÓÐʲô¾Ñ飬¼Ó֮ʱ¼ä±È½Ï½ôÆÈ£¬×îºóʹÓÃÒ»°ãµÄÂ߼˼Ïëͨ¹ýµÝ¹éÔÚhibernateÏÂ˳Àû´´½¨ÁË¡£¿ÉÊÇ´ÓÏÖÓеÄ×éÖ¯Ö ......