OracleÊý×éÈëÃÅ
OracleÊý×éÒ»°ã¿ÉÒÔ·ÖΪ¹Ì¶¨Êý×éºÍ¿É±äÊý×é
¹Ì¶¨Êý×é
Sql´úÂë
declare
type v_ar is varray(10) of varchar2(30);
my_ar v_ar:=v_ar('g','m','d','¹¨','˧');
begin
for i in 1..my_ar.count
loop
dbms_output.put_line(my_ar(i));
end loop;
end;
declare
type v_ar is varray(10) of varchar2(30);
my_ar v_ar:=v_ar('g','m','d','¹¨','˧');
begin
for i in 1..my_ar.count
loop
dbms_output.put_line(my_ar(i));
end loop;
end;
¿É±äÊý×é
һάÊý×é
Sql´úÂë
declare
type v_table is table of varchar2(30) index by binary_integer;
--ÀàÐÍ¿ÉÒÔÊÇÇ°ÃæµÄÀàÐͶ¨Ò壬index by binary_integer×Ó¾ä´ú±íÒÔ·ûºÅÕûÊýΪË÷Òý£¬
--ÕâÑù·ÃÎʱíÀàÐͱäÁ¿ÖеÄÊý¾Ý·½·¨¾ÍÊÇ“±í±äÁ¿Ãû(Ë÷Òý·ûºÅÕûÊý)”¡£
my_table v_table;
begin
for i in 1..20
loop
my_table(i):=i;
dbms_output.put_line(my_table(i));
end loop;
end;
declare
type v_table is table of varchar2(30) index by binary_integer;
--ÀàÐÍ¿ÉÒÔÊÇÇ°ÃæµÄÀàÐͶ¨Ò壬index by binary_integer×Ó¾ä´ú±íÒÔ·ûºÅÕûÊýΪË÷Òý£¬
--
Ïà¹ØÎĵµ£º
-----------------------------------------------------------------------------------
DOS:
1. sqlplus
2.
Óû§Ãû:sqlplus ¡¢conn
ÃÜÂë:as sysdba ¡¢as sysdba
½âËø£º
3. ALTER USER DBSNMP ACCOUNT UNLOCK£»
½âËø£ºsystem
4. alter user system identified by manage ......
³£Ó÷½·¨ÓÐÒÔϼ¸ÖÖ£º
Ò»¡¢Í¨¹ýPL/SQL Dev¹¤¾ß
1¡¢Ö±½ÓFile->New->Explain Plan Window£¬ÔÚ´°¿ÚÖÐÖ´ÐÐsql¿ÉÒԲ鿴¼Æ»®½á¹û¡£ÆäÖУ¬Cost±íʾcpuµÄÏûºÄ£¬µ¥Î»Îªn%£¬Cardinality±íʾִÐеÄÐÐÊý£¬µÈ¼ÛRows¡£
2¡¢ÏÈÖ´ÐÐ EXPLAIN PLAN FOR select * from tableA ......
ÓÉÓÚÊý¾Ý¿âÔʼ°²×°µÄÔÒòÔì³ÉÊý¾Ý¿â»òÕû¸ö²Ù×÷ϵͳµÄ²»°²È«»òÕßÓÉÓÚ´ÅÅ̿ռä±ä»¯ÔÙ»òÕßÓÉÓÚÒµÎñ±ä»¯Ôì³ÉµÄI/OÐÔÄÜÐèÒªµ÷ÕûµÈµÈÔÒòÐèÒªÊý¾Ý¿â¹ÜÀíÔ±½øÐÐÊý¾Ý¿âÎļþλÖõĵ÷Õû.ÏÂÃæÍ¨¹ýÒ»¸öWINDOWSƽ̨µÄORACLEÊý¾ÝÎļþÒÆ¶¯ÎªÀý×ÓÌÖÂÛÒ»ÏÂÊý¾Ý¿âÎļþÒÆ¶¯µÄ·½·¨,Çë´ó¼ÒÖ¸Õý.
Ò».ÒÆ¶¯Êý¾ÝÎļþ
ÒÆ¶¯Êý¾ÝÎļþ±ÊÕßĿǰʹÓõÄÓÐ ......
ÒÔϵÄÎÄÕÂÖ÷Òª½²ÊöµÄÊÇOracleɾ³ýÓû§±íµÄʵ¼Ê²Ù×÷·½°¸£¬±¾ÎÄÖ÷ÒªÊÇÒÔÏà¹ØÊµ¼ÊÓ¦ÓôúÂëµÄ·½Ê½À´Òý³öÆäʵ¼ÊµÄ²Ù×÷²½Ö裬ÒÔϾÍÊÇÎÄÕµľßÌåÄÚÈÝÃèÊö£¬ÍûÄãÔÚä¯ÀÀÖ®ºó»áÓÐËùÊÕ»ñ¡£
1.
select 'Drop table '||table_name||';' from all_tables where owner='Ҫɾ³ýµÄÓû§Ãû£¨×¢ÒâÒª´óд£©';
2.Oracleɾ³ýÓû§±í ÒÔÓ ......