Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

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


Ïà¹ØÎĵµ£º

sql server Óë oracle µÄÇø±ð

ÎÒÏÈÅ×שÒýÓñ:      
     
  1.     ¿ª·¢ÐÔ:     SQLSERVER²»ÄÜ,ORACLEÄÜ×°ÔÚUNIXÉÏ      
  2.     ·ÖÇø±í:     SQLSERVER²»Ä ......

oracle ʱ¼ä ´¦Àí ´óÈ«

sysdate+(5/24/60/60) ÔÚϵͳʱ¼ä»ù´¡ÉÏÑÓ³Ù5Ãë
sysdate+5/24/60 ÔÚϵͳʱ¼ä»ù´¡ÉÏÑÓ³Ù5·ÖÖÓ
sysdate+5/24 ÔÚϵͳʱ¼ä»ù´¡ÉÏÑÓ³Ù5Сʱ
sysdate+5 ÔÚϵͳʱ¼ä»ù´¡ÉÏÑÓ³Ù5Ìì
add_months(sysdate,-5) ÔÚϵͳʱ¼ä»ù´¡ÉÏÑÓ³Ù5ÔÂ
add_months(sysdate,-5*12) ÔÚϵͳʱ¼ä»ù´¡ÉÏÑÓ³Ù5Äê
ÉÏÔÂÄ©µÄÈÕÆÚ£ºselect last_day(add_mon ......

OracleÈ«ÎÄË÷ÒýÉèÖò½Öè

ÒÑÓм¸¸öÏîÄ¿×鿪ʼʹÓÃoracleµÄÈ«ÎÄË÷Òý¡£OracleµÄ´Ê·¨·ÖÎöÆ÷Õë¶ÔZHS16GBK×Ö·û¼¯µÄ´Ê·¨·ÖÎöÉв»¹»ÖÇÄÜ£¬Ö»ÄÜ»úеµØÒÔ×ÖΪµ¥Ôª
½øÐÐÆ¥Åä¡£¶ÔÓÚutf8×Ö·û¼¯µÄÊý¾Ý¿âÓÐÒ»¸öеĺºÓï·ÖÎöÆ÷chinese_lexer£¬Ð§ÂÊÓÐÁ˺ܴó¸ÄÉÆ¡£ÏÖ½«ÑéÖ¤²¢ÕûÀí¹ýµÄÈçºÎ½øÐÐoracleÈ«ÎÄ
Ë÷ÒýÉèÖõÄÎĵµ·¢¸ø´ó¼Ò£¬ÊÊÓÃÓÚ8i¡¢9i¸÷ƽ̨°æ±¾¡£
¡¡¡¡¶ÔÓ ......

oracle ÈÕÆÚº¯Êý

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; ......

Oracle RAC ÈÕ³£»ù±¾Î¬»¤ÃüÁî

ÁгöÅäÖõÄËùÓÐÊý¾Ý¿â
[root@node1 ~]# srvctl config database
NOVADB
ËùÓÐʵÀýºÍ·þÎñµÄ״̬
[root@node1 ~]# srvctl status database -d NOVADB
Instance NOVADB1 is running on node node1
Instance NOVADB2 is running on node node2
µ¥¸öʵÀýµÄ״̬
[root@node1 ~]# srvctl status instance -d NOVADB -i NOVA ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ