³£ÓõÄORACLE PL/SQL¹ÜÀíÃüÁîÒ»
ÔÎÄ£ºÁõÎä| ³£ÓõÄORACLE PL/SQL¹ÜÀíÃüÁîÒ»
ÊìϤORACLE¹ÜÀíµÄÒ»¶¨¶ÔÕâЩÃüÁî²»»áÄ°Éú£¬²»¹ý¶ÔÓÚÎÒÕâ¸ö¸Õ½Ó´¥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,ͬÉÏÒ»Ñù£¬¿ÉÒÔ½«ÃÜÂë·Ö¿ªÊäÈë¡£
¶þ Í˳öSQLPLUS
quit£»
Èý ´´½¨Óû§
create user Óû§Ãû identified by ÃÜÂë;
È磺´´½¨Óû§CKSP£¬ÃÜÂëΪ123: create user cksp identified by 123;
ËÄ ¸øÓû§·ÖÅä½ÇÉ«»òȨÏÞ
grant *** to ***;
È磺¸ø¸Õ²ÅµÄÓû§·ÖÅä½ÇÉ«DBA:grant dba to cksp;
·ÖÅäcreate table ȨÏÞ£ºgrant
Îå ɾ³ýÓû§
drop user Óû§ [cascade];
ÆäÖÐcascadeÊÇ¿ÉÑ¡µÄ£¬Èç¹ûÊäÈëÁË£¬Ôò±íʾɾ³ý¸ÃÓû§¼°ËùÓÐÊý¾Ý¡£
È磺ɾ³ýÉÏÃæ´´½¨µÄÓû§CKSP¼°ËûµÄËùÓÐÊý¾Ý£ºdrop user cksp cascade;
Ïà¹ØÎĵµ£º
¼ò½é
ÔÚÕâƪÎÄÕÂÖУ¬ÎÒÁоÙһЩsqlÓï¾äÀ´½éÉÜÊý¾Ý¿â£¬Êý¾Ý±í£¬ÊÓͼµÈµÈ¡£µ±ÎÒÃÇÔÚʹÓòéѯ²éѯ²Ù×÷ʱÕâЩsqlÓï¾ä¶¼ÊǷdz£ÓÐÓõġ£ËäÈ»ÔÚsql server¶ÔÏóä¯ÀÀÆ÷ÖÐÎÒÃÇÒ²¿ÉÒÔ»ñµÃÕâЩÓï¾ä£¬µ«ÊÇÈç¹ûÎÒÃÇдÕâЩÓï¾äʱÎÒÃÇ¿ÉÒÔ½«Ëü×Ô¶¨Òå¡£Õâ¾ÍÒâζ×ÅÎÒÃÇ¿ÉÒÔ¸øÓè×Ô¼ºµÄÐèÇóÀ´¹ýÂ˽á¹û¡£
sqlÓï¾äÁбí
ÈçºÎÁоÙsql serverµ±Ç°Á ......
Ò».ORACLE³£Óñí
1.dual ORACLEÓÃÀ´¸øûÓбíµÄÔËËã·û.Èç:select sysdate from dual;
¶þ.×Ö·û´®²Ù×÷
1.|| ×Ö·û´®¼Ó·¨ select 'a'||'bc' from dual; --'abc'
Èý.ʱ¼äºÍÈÕÆÚ
1.sysdate ϵͳµ±Ç°µÄÈÕÆÚ
&n ......
¹Ø¼ü×Ö: oracle & sql server
Êý¾ÝÀàÐͱȽÏ
ÀàÐÍÃû³Æ
Oracle
SQLServer
±È½Ï
×Ö·ûÊý¾ÝÀàÐÍ CHAR CHAR ¶¼Êǹ̶¨³¤¶È×Ö·û×ÊÁϵ«oracleÀïÃæ×î´ó¶ÈΪ2kb£¬SQLServerÀïÃæ×î´ó³¤¶ÈΪ8kb
±ä³¤×Ö·ûÊý¾ÝÀàÐÍ VARCHAR2 VARCHAR OracleÀïÃæ×î´ó³¤¶ÈΪ4kb£¬SQLServerÀïÃæ×î´ó³¤¶ÈΪ8kb
¸ù¾Ý×Ö·û¼¯¶ø¶¨µÄ¹Ì¶¨³¤¶È×Ö· ......