ORACLE directory Ŀ¼
Create directoryÈÃÎÒÃÇ¿ÉÒÔÔÚOracleÊý¾Ý¿âÖÐÁé»îµÄ¶ÔÎļþ½øÐжÁд²Ù×÷£¬¼«´óµÄÌá¸ßÁËOracleµÄÒ×ÓÃÐԺͿÉÀ©Õ¹ÐÔ¡£
ÆäÓ﷨Ϊ:
CREATE [OR REPLACE] DIRECTORY directory AS 'pathname';
±¾°¸Àý¾ßÌå´´½¨ÈçÏÂ:
create or replace directory exp_dir as '/tmp';
Ŀ¼´´½¨ÒԺ󣬾ͿÉÒ԰ѶÁдȨÏÞÊÚÓèÌØ¶¨Óû§£¬¾ßÌåÓï·¨ÈçÏÂ:
GRANT READ[,WRITE] ON DIRECTORY directory TO username;
ÀýÈç:
grant read, write on directory exp_dir to eygle;
´ËʱÓû§eygle¾ÍÓµÓÐÁ˶ԸÃĿ¼µÄ¶ÁдȨÏÞ¡£
ÈÃÎÒÃÇ¿´Ò»¸ö¼òµ¥µÄ²âÊÔ:
SQL> create or replace directory UTL_FILE_DIR as '/opt/oracle/utl_file';
Directory created.
SQL> declare
2 fhandle utl_file.file_type;
3 begin
4 fhandle := utl_file.fopen('UTL_FILE_DIR', 'example.txt', 'w');
5 utl_file.put_line(fhandle , 'eygle test write one');
6 utl_file.put_line(fhandle , 'eygle test write two');
7 utl_file.fclose(fhandle);
8 end;
9 /
PL/SQL procedure successfully completed.
SQL> !
[oracle@jumper 9.2.0]$ more /opt/oracle/utl_file/example.txt
eygle test write one
eygle test write two
[oracle@jumper 9.2.0]$
ÀàËÆµÄÎÒÃÇ¿ÉÒÔͨ¹ýutl_fileÀ´¶ÁÈ¡Îļþ:
SQL> declare
2 fhandle utl_file.file_type;
3 fp_buffer varchar2(4000);
4 begin
5 fhandle := utl_file.fopen ('UTL_FILE_DIR','example.txt', 'R');
6
7 utl_file.get_line (fhandle , fp_buffer );
8 dbms_output.put_line(fp_buffer );
9 utl_file.get_line (fhandle , fp_buffer );
10 dbms_output.put_line(fp_buffer );
11 utl_file.fclose(fhandle);
12 end;
13 /
eygle test write one
eygle test write two
PL/SQL procedure successfully completed.
¿ÉÒÔ²éѯdba_directories²é¿´ËùÓÐdirectory.
SQL> select * from dba_directories;
OWNER DIRECTORY_NAME DIRECTORY_PATH
------------------------------ ------------------------------ ------------------------------
SYS UTL_FILE_DIR /opt/oracle/utl_file
SYS BDUMP_DIR
Ïà¹ØÎĵµ£º
ÔÚJAVAÖеÄSQL Óï¾äµÄ±àд·½Ã棬ûÓÐʹÓÃORACLE °ó¶¨±äÁ¿£¬ºÜ´ó³Ì¶ÈÉϽµµÍÁËÊý¾Ý¿âµÄÐÔÄÜ£¬±íÏÖÔÚÁ½¸ö·½Ã棺
1¡¢SQLÓï¾äÓ²·ÖÎö(Hard Parse)Ì«¶à£¬ÑÏÖØÏûºÄCPU×ÊÔ´£¬ÑÓ³¤ÁËSQLÓï¾ä×ܵÄÖ´ÐÐʱ¼ä
SQLÓï¾äµÄÖ´Ðйý³Ì·Ö¼¸¸ö²½Ö裺Óï·¨¼ì²é¡¢·ÖÎö¡¢Ö´ÐС¢·µ»Ø½á¹û¡£ÆäÖзÖÎöÓÖ·ÖΪӲ·ÖÎö(Hard Parse)ºÍÈí·ÖÎö(Soft Pars ......
http://www.haoxiai.net/shujuku/Oracle/111145.html
Ò»¡¢Êý¾Ý¿âÃû
ʲôÊÇÊý¾Ý¿âÃû
Êý¾Ý¿âÃû¾ÍÊÇÒ»¸öÊý¾Ý¿âµÄ±êʶ£¬¾ÍÏñÈ˵ÄÉí·ÝÖ¤ºÅÒ»Ñù¡£ËûÓòÎÊýDB_NAME±íʾ£¬Èç¹ûһ̨»úÆ÷ÉÏ×°Á˶àÈ«Êý¾Ý¿â£¬ÄÇôÿһ¸öÊý¾Ý¿â¶¼ÓÐÒ»¸öÊý¾Ý¿âÃû¡£ÔÚÊý¾Ý¿â°²×°»ò´´½¨Íê³ÉÖ®ºó£¬²ÎÊýDB_NAME±»Ð´Èë²ÎÊýÎļþÖ®ÖС£¸ñʽÈçÏ£º
DB_NAME=m ......
1¡¢ÓÃpl/sql developerÖ»µ¼³ö±í½á¹¹£¬²»µ¼³öÊý¾ÝµÄsqlÎļþ
´ð£º TOOLS-> Export Tables È»ºóÑ¡ÔñÖмäµÄ sqlInserts
ËüÓÐÒ»¸ö where clause ¿ÉÒÔÉèÖõÄ, ¿´µ½Ã»ÓÐ. ÌîÈë rownum < 0 ¾ÍOKÁË.
»ò ......
sqlÓï¾äÈçÏÂ:
select * from userdb40.numservice where ServiceNumber =88880068
and applytime <= to_date('2009-12-26 10:41:44','yyyy-MM-dd HH24:mi:ss')
select to_date('2007-06-28 19:51:20.0','yyyy-MM-dd HH24:mi:ss') from dual; ......
Ò»¡¢Ê¹ÓÃsrvctl¹ÜÀíRACÊý¾Ý¿â
[root@NODE01 bin]# pwd
/orac/crs/bin # srvctlÔÚ$CRS_HOME/binĿ¼Ï£¬Ëü¿ÉÒÔÔÚÈκνڵãÉÏά»¤¡£
[root@NODE01 bin]# ./srvctl
Usage: srvctl <command> <object> [<options>]
command: enable|disable|start|stop|relocate|status| ......