Oracle ѧϰ֪ʶµã£¨Ò»£©
Ò» µÇ¼SQLPLUS
sqlplusÓû§Ãû/ÃÜÂë@Êý¾Ý¿âʵÀýasµÇ¼½ÇÉ«;
Èç:Óû§sys(ÃÜÂëΪ123)ÒÔsysdbaµÄ½ÇÉ«µÇ¼Êý¾Ý¿âORACL£¬ÎÒÃÇ¿ÉÒÔÊäÈ룺sqlplus sys/123@oracl as sysdba;
ÕâÖֵǼ·½Ê½»áÖ±½Ó±©Â¶ÃÜÂ룬Èç¹ûÏëÒþ²ØÃÜÂ룬¿ÉÒÔÔÚ´ËÊ¡ÂÔÃÜÂëµÄÊäÈ룬È磺sqlplus sys@oracl as sysdba;»Ø³µÒÔºóORACLE»á¸ø³öÊäÈëÃÜÂëµÄÌáʾ·û¡£
µÇ¼ÒÔºóÈç¹ûÏëÇл»ÆäËûµÄÓû§£¬¿ÉÒÔÖ±½ÓʹÓÃconnect ÃüÁî,È磺connect user2/password@oracl as sysdba,ͬÉÏÒ»Ñù£¬¿ÉÒÔ½«ÃÜÂë·Ö¿ªÊäÈë¡£
Oracle ·ÖÒ³ºÍÅÅÐò³£ÓõÄ4Ìõ²éѯÓï¾ä
1. ²éѯǰ10Ìõ¼Ç¼
¡¡¡¡SELECT * from TestTable WHERE ROWNUM <= 10
¡¡¡¡2. ²éѯµÚ11µ½µÚ20Ìõ¼Ç¼
¡¡¡¡SELECT * from (SELECT TestTable.*, ROWNUM ro from TestTable WHERE ROWNUM <=20) WHERE ro > 10
¡¡¡¡3. °´ÕÕname×Ö¶ÎÉýÐòÅÅÁкóµÄÇ°10Ìõ¼Ç¼
¡¡¡¡SELECT * from (SELECT * from TestTable ORDERY BY name ASC) WHERE ROWNUM <= 10
¡¡¡¡4. °´ÕÕname×Ö¶ÎÉýÐòÅÅÁкóµÄµÚ11µ½µÚ20Ìõ¼Ç¼
¡¡¡¡SELECT * from (SELECT tt.*, ROWNUM ro from (SELECT * from TestTable ORDER BY name ASC) tt WHERE ROWNUM <=20) WHERE ro > 10
¶þ¡¢±íµÄ²Ù×÷
1¡¢ÐÞ¸ÄÁеÄÊý¾ÝÀàÐÍ»òÁÐÃû£¨²»ÄÜÓÐÊý¾Ý£©
SQL>alter table±íÃûmodify(ÁÐÃû ÁÐÊý¾ÝÀàÐÍ);
2¡¢Ìí¼ÓÒ»¸ö×Ö¶Î
SQL>alter table±íÃûadd(ÁÐÃû ÁÐÊý¾ÝÀàÐÍ);
3¡¢É¾³ýÒ»¸ö×Ö¶Î
SQL>alter table ±íÃûdrop column ÁÐÃû;
4¡¢Ð޸ıíÃû
SQL>rename ¾É±íÃûto бíÃû;
5¡¢²åÈëÈÕÆÚ×Ö¶Î
OracleÖÐĬÈϵĸñʽΪ"dd-mm-yy"Èç‘20-5ÔÂ-87’ÆäÖÐÔÂÒ»¶¨ÒªÎªºº×Ö£»
¸ü¸ÄÈÕÆÚµÄĬÈϸñʽ:alter session nls_date_format='yyyy-mm-dd';
6¡¢²åÈë¿ÕÖµ
insert into student(xh,xm,sex,birthday)values('1001','СÃ÷',null)
²éѯµÄʱºòselect * from student where birthday is (not)null;
7¡¢Ð޸ĺ¬ÓÐnullµÄÊý¾Ý
update student set sex='Å®' where birthday is null;
8¡¢É¾³ýÊý¾Ý
delete from ±íÃû ɾ³ýËùÓеļǼ£¬±í½á¹¹»¹ÔÚ£¬Ð´ÈÕÖ¾£¬¿ÉÒÔ»Ö¸´£¬É¾³ýËÙ¶ÈÂý£»
drop table±íÃû;ɾ³ý±íµÄ½á¹¹ºÍÊý¾Ý£»
truncate table±íÃû£ºÉ¾³ýËùÓеļǼ£¬±í½á¹¹»¹ÔÚ£¬²»Ð´ÈÕÖ¾£¬ÎÞ·¨ÕÒ»Øɾ³ýµÄ¼Ç¼£¬É¾³ýËٶȿì
Èý¡¢±íµÄ¸´ÔÓ²éѯ
1¡¢·Ö×é²éѯµÄ×ܽá
A¡¢·Ö×麯ÊýÖ»ÄܳöÏÖÔÚÑ¡ÔñÁÐ±í¡¢Having¡¢Order by×Ó¾äÖÐ
B¡
Ïà¹ØÎĵµ£º
ORACLE±¸·Ý²ßÂÔ(ORACLE BACKUP STRATEGY)
2007Äê11ÔÂ02ÈÕ ÐÇÆÚÎå 16:03
¸ÅÒª
1¡¢Á˽âʲôÊDZ¸·Ý
2¡¢Á˽ⱸ·ÝµÄÖØÒªÐÔ
3¡¢Àí½âÊý¾Ý¿âµÄÁ½ÖÖÔËÐз½Ê½
4¡¢Àí½â²»Í¬µÄ±¸·Ý·½Ê½¼°ÆäÇø±ð
5¡¢Á˽âÕýÈ·µÄ±¸·Ý²ßÂÔ¼°ÆäºÃ´¦
Ò»¡¢Á˽ⱸ·ÝµÄÖØÒªÐÔ
¿ÉÒÔ˵£¬´Ó¼ÆËã»úϵͳ³öÊÀµÄÄÇÌìÆ𣬾ÍÓÐÁ˱¸·ÝÕâ¸ö¸ÅÄ ......
extent--×îС¿Õ¼ä·ÖÅ䵥λ --tablespace management
block --×îСi/oµ¥Î» --segment management
create tablespace james
datafile '/export/home/oracle/oradata/james.dbf'
size 100M ¡¡¡¡¡¡¡¡¡¡¡¡--³õʼµÄÎļþ´óС¡¡
autoextend On¡¡¡¡¡¡¡¡ --×Ô¶¯Ôö³¤
next 10M¡ ......
OracleµÄÈ«ÎÄË÷Òý³ýÁËÖ§³ÖÎÄ×ÖÆ¥Åä²éѯ£¬»¹Ö§³Ö¶ÔÎÄÕºÒåµÄ²éѯ¡£ÕâÊÇͨ¹ýABOUT²Ù×÷ʵÏֵġ£
OracleĬÈÏÇé¿öÏÂÖ§³ÖÓ¢Îĺͷ¨ÎĵÄÎÄÕºÒåÖ§³Ö¡£ÆäËûÓïÑÔ¿ÉÒÔÌí¼Óͨ¹ýÓû§×Ô¶¨ÒåµÄÓïÑÔ¿âÀ´ÊµÏÖÏàÓ¦µÄ¹¦ÄÜ¡£
ÔÚ
Õâ֮ǰÐèÒªÏÈ°²×°Companion CD µÄOracle Database 10g Products Installation
Type,ÆäÖаüÀ¨ÁËOracle Text Su ......
ORA-00704: bootstrap process failure
ORA-1092 signalled during: alter database open...
½øÐÐÈçϲÙ×÷ºóOK.
SQL>startup upgrade
For Windows
SQL>@d:\oracle\product\10.2.0\db_1/rdbms/admin/catupgrd.sql
For Linux
SQL>@/u01/app/oracle/product/10.2.0/db_1/rdbms/admin/catupgrd.sql
´ýcatupgrd ......
Êý¾Ý×Öµädict×ÜÊÇÊôÓÚOracleÓû§sysµÄ¡£
¡¡¡¡1¡¢Óû§£º
¡¡¡¡¡¡select username from dba_users;
¡¡¡¡¸Ä¿ÚÁî
¡¡¡¡¡¡alter user spgroup identified by spgtest;
¡¡¡¡2¡¢±í¿Õ¼ä£º
¡¡¡¡¡¡select * from dba_data_files;
¡¡¡¡¡¡select * from dba_tablespaces;//±í¿Õ¼ä
¡¡¡¡¡¡select tablespace_name,sum(bytes), sum(b ......