Pular para o conteúdo principal

Postagens

Mostrando postagens de janeiro, 2010

Recreate EM Repository

Drop manualy: Step 1: Drop AQ related objects in the SYSMAN schema Logon SQLPLUS as user SYSMAN SQL> exec DBMS_AQADM.DROP_QUEUE_TABLE(queue_table=>'MGMT_NOTIFY_QTABLE',force =>TRUE); Step 2: Drop the DB Control Repository Objects Logon SQLPLUS as user SYS or SYSTEM, and drop the sysman account and management objects: SQL> SHUTDOWN IMMEDIATE; SQL> STARTUP RESTRICT; SQL> EXEC sysman.emd_maintenance.remove_em_dbms_jobs; SQL> EXEC sysman.setEMUserContext('',5); SQL> REVOKE dba FROM sysman; SQL> DECLARE CURSOR c1 IS SELECT owner, synonym_name name FROM dba_synonyms WHERE table_owner = 'SYSMAN'; BEGIN FOR r1 IN c1 LOOP IF r1.owner = 'PUBLIC' THEN EXECUTE IMMEDIATE 'DROP PUBLIC SYNONYM '||r1.name; ELSE EXECUTE IMMEDIATE 'DROP SYNONYM '||r1.owner||'.'||r1.name; END IF; END LOOP; END; / SQL> DROP USER mgmt_view CASCADE; SQL> DROP ROLE mgmt_user; SQL> DROP USER sysman CASCADE; SQL> ALTER SYSTEM DISABLE...

Send e-mail using UTL_SMTP

Sample code to send e-mail: DECLARE c utl_smtp.connection; PROCEDURE send_header(name VARCHAR2, header VARCHAR2) AS BEGIN utl_smtp.write_data(c,name ||':'|| header || UTL_TCP.CRLF); END; BEGIN c := utl_smtp.open_connection('mail.denilson.com.br'); utl_smtp.helo(c, 'Teste'); utl_smtp.mail(c, 'denilson@denilson.com.br'); utl_smtp.rcpt(c, 'denilson@denilson.com.br'); utl_smtp.open_data(c); send_header('From', 'denilson@denilson.com.br'); send_header('To', 'denilson@denilson.com.br'); send_header('Cc', 'denilson@denilson.com.br'); send_header('Subject', 'Teste'); utl_smtp.write_data(c, UTL_TCP.CRLF || 'Teste!'); -- Body message utl_smtp.close_data(c); utl_smtp.quit(c); EXCEPTION WHEN utl_smtp.transient_error OR utl_smtp.permanent_error THEN BEGIN utl_smtp.quit(c); EXCEPTION WHEN utl_smtp.transient_error OR utl_smtp.permanent_...

Broken pipe in Application log due to Timeout in HTTP

edit httpd.conf file in $ORACLE_HOME/Apache/Apache/conf change TimeOut parameter (default value is 300 seconds -5 minutes) The broken pipe reproduces each time the servlet is run with the following errors registered in Apache: sample error in error_log: oc4j_socket_recvfull timed out [ecid: 1126535220:144.23.227.233:11851:0:14,0] (4)Interrupted system call: MOD_OC4J_0038: Receiving data from oc4j exceeded the configured "Timeout" value and the error code is 4. [ecid: 1126535220:144.23.227.233:11851:0:14,0] MOD_OC4J_0054: Failed to call network routine to receive an ajp13 message from oc4j.

GET HOST ADDRESS FROM SERVER AND CLIENT

To Get server HOST NAME and HOST ADDRESS: SET serveroutput on BEGIN DBMS_OUTPUT.PUT_LINE(UTL_INADDR.GET_HOST_NAME); -- get local host name DBMS_OUTPUT.PUT_LINE(UTL_INADDR.GET_HOST_ADDRESS); -- get local IP addr END; / Using SYS_CONTEXT to get client host address: select SYS_CONTEXT('USERENV', 'IP_ADDRESS', 15) ipaddr from dual;