Thursday, March 09, 2006

Block Corrupted on datafile

when you found some block corrupt, if you use 9i and 10G , you can use rman command for blockrecover


example you found this error from alert log

ORA-01578: ORACLE data block corrupted (file # 8, block # 13)
ORA-01110: data file 8: '/oracle/oradata/trgt/users01.dbf'
ORA-01578: ORACLE data block corrupted (file # 2, block # 19)
ORA-01110: data file 2: '/oracle/oradata/trgt/undotbs01.dbf'


you can resolve this problem by:

rman> BLOCKRECOVER DATAFILE 8 BLOCK 13 DATAFILE 2 BLOCK 19;


By don't need offline datafile .

How do I use UTL_SMTP send mail charset thai (TIS-620)

- - Set Message format--
/*
utl_smtp.data(c,'MIME-Version: 1.0' CHR(13) CHR(10)'Content-Type: text/html; charset=utf-8' CHR(13)CHR(10) 'Content-Transfer-Encoding: 8bit' CHR(13)CHR(10) msg);
*/


--Change to --

utl_smtp.open_data(c);
utl_smtp.write_raw_data(c, utl_raw.cast_to_raw('MIME-Version: 1.0' CHR(13) CHR(10)'Content-Type: text/html; charset=tis-620' CHR(13)CHR(10) 'Content-Transfer-Encoding: 8bit' CHR(13)CHR(10) msg));
utl_smtp.close_data(c);

utl_smtp.quit(c);

********************************************
Example use UTL_SMTP (char-set: TIS-620 thai) (subject + body = thai)

-----------------------------------------------------
CREATE OR REPLACE PROCEDURE test_mail
AS

connection UTL_SMTP.connection;
v_reply UTL_SMTP.reply;
sender VARCHAR2 (50);
recipient VARCHAR2 (50);
subj VARCHAR2 (100);
BODY VARCHAR2 (1000);
begin
sender := 'sen_mail@host';
recipient := 'rep_mail@host';

-- Subject mail--
subj := 'ดี'; -- Thai language---
-- Body mail--
BODY := 'สวัสดีครับ'; --Thai language--

connection := UTL_SMTP.open_connection ('mail.server.com', 25);
v_reply := UTL_SMTP.helo (connection, 'host.co.th');
v_reply := UTL_SMTP.mail (connection, sender);
v_reply := UTL_SMTP.rcpt (connection, recipient);

utl_smtp.open_data(connection);
UTL_SMTP.WRITE_DATA(connection, 'From: ' ||sender|| UTL_TCP.CRLF);
UTL_SMTP.WRITE_DATA(connection, 'To: ' ||recipient ||UTL_TCP.CRLF);
UTL_SMTP.WRITE_DATA(connection, 'MIME-Version: 1.0'|| UTL_TCP.CRLF);
UTL_SMTP.WRITE_DATA(connection, 'Content-Type: text/html;charset=tis-620'||UTL_TCP.CRLF);
UTL_SMTP.write_raw_data(connection,utl_raw.cast_to_raw('Subject:' ||subj));
UTL_SMTP.WRITE_DATA(connection, UTL_TCP.CRLF ||'' ||UTL_TCP.CRLF);
UTL_SMTP.write_raw_data(connection, utl_raw.cast_to_raw(BODY));
utl_smtp.close_data(connection);
UTL_SMTP.quit (connection);

end;
--------------------------------------------------------

Enjoy!

Mount disk for NFS file Type

let me show example for high performance for mount NFS


incq107ac:/vol/vol2 on /opt/oracle/oradata/disk2 type nfs (rw,sync,bg,hard,nointr,rsize=32768,wsize=32768,tcp,nfsvers=3,timeo=600,actimeo=0,addr=152.69.210.107)

The given interface(s), "eth0" is not public. Public interfaces should be used to configure virtual IPs.

When I install oracle 10G release 2

and i run root.sh, i found below error from some node.

During CRS install while running root.sh, The following messages are displayed
Oracle CRS stack installed and running under init(1M)Running vipca(silent) for configuring nodeappsThe given interface(s), "eth0" is not public. Public interfaces should be used to configure virtual IPs.Changes


You are running root.shCause
When verifying the IP addresses, VIP uses calls to determine if a IP address is valid or not. In this case, VIP finds that the IPs are non routable (For example IP addresses like 192.168.* and 10.10.*.)

Oracle is aware that the IP's can be made public but since mostly such IP's are used for Private, it display this error message.Solution
The workaround is to re-run vipca manually as root
#./vipca

or add the VIP using srvctl add nodeapps

-----------------------

Change HTMLDB port default

port defaults are 8080 for HTTP and 2100 for FTP. problem, it same with some application.

So
if the package dbms_xdb is granted to PUBLIC you need DBA privileges to change the ports.

-- change HTTP port from 8080 to 8083 call

SQL> dbms_xdb.cfg_update(updateXML(dbms_xdb.cfg_get(), '/xdbconfig/sysconfig/protocolconfig/httpconfig/http-port/text()', 8083));

-- change FTP port From 2100 to 2111 call

SQL> dbms_xdb.cfg_update(updateXML( dbms_xdb.cfg_get(), '/xdbconfig/sysconfig/protocolconfig/ftpconfig/ftp-port/text()' , 2111));

-- refresh settings

SQL> exec dbms_xdb.cfg_refresh;

-----------------