Sunday, November 28, 2010

Resolving tempdb log file is full in SQL2000

In SQL 2000, if you have the error,

"The log file for database 'tempdb' is full. Back up the transaction log for the database to free up some log space."

To resolve this you need to truncate the log file by using

dump log tempdb with truncate_only

the normal backup log command won't work in this case

Thursday, October 28, 2010

sendmail, Solving ‘host name lookup failure’ at name server

To solve the problem of 'host name lookup failure’ on sendmail, first you need to determine if it's really this problem.

check the /var/log/maillog , there should be entry such as below

xxxxxx sendmail[30685]: o9T3l3Pe030683: to=, ctladdr= (0/0), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=120354, relay=xxx.xxxxxx.com, dsn=4.0.0, stat=Deferred: Name server: xx.xxxx.com: host name lookup failure

Then we try to nslookup the mail server, by dig xxx.xxxxx.com. It should show that the connection is time out.

; <<>> DiG 9.3.4-P1 <<>> xxx.xxxx.com
;; global options: printcmd
;; connection timed out; no servers could be reached

Next, we can resolved this by setting up name server or put the mail server into the /etc/mail/mailertable .

First by checking the /etc/nsswitch.conf to see if we are using hosts file.
#hosts: files dns

Then do the following to create the entry in the mailertable.
xxxx.xxxx.com smtp:[xxxx.xxxx.com]

then we hash the file to the mailertable.db
makemap hash /etc/mail/mailertable < /etc/mail/mailertable

after that, restart the sendmail by running service sendmail restart

Reference link
http://davespicks.com/writing/programming/sendmailhostlookupfailure.html

Wednesday, September 29, 2010

Logical Standby with Apply Process Fails With ORA-308

Recently, we encounter the Logical Standby Apply Process Fails With ORA-308 while testing the logical standby. Due to the archive log in Logical is automatically delete after a while.

To solve it, we first stop the automatically delete archivelog
exec dbms_logstdby.apply_set('LOG_AUTO_DELETE', 'FALSE');


Then, We check the ASM diskspace for the archivelog that is needed by standby.
Then we copy the archive log to the local folder for transfering it to standby by issuing below . The FLASH_DIR and EXPORT_DUMP_DIR is oracle directory, FLASH_DIR is the ASM disk space like +FLASHGRP/TESTDB/archivelog/

dbms_file_Transfer.copy_file('FLASH_DIR','1_3470_694714878.dbf','EXPORT_DUMP_DIR','1_3470_694714878.dbf');


After copying the file to standby, then we need to register the archivelog using below method.

Register the log file in standby

SQL> alter database register logfile '/TESTDB/archive/1_3470_694714878.dbf';

alter database register logfile '/TESTDB/archive/1_3470_694714878.dbf'

*

ERROR at line 1:

ORA-01289: cannot add duplicate logfile



If failed , then we have to update the logmnr table manually,

Stopped the logical standby.


SQL> alter database stop logical standby apply;

SQL> select file_name from system.logmnr_log$ where sequence#=3470;

FILE_NAME

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

+FLASHGRP/testdb/archivelog/2010_09_22/thread_1_seq_3470.3572.730402825

SQL> UPDATE SYSTEM.LOGMNR_LOG$ SET

FILE_NAME= 2 '/TESTDB/archive/1_3470_694714878.dbf' where sequence#=3470;

1 row updated.

SQL> commit;

Commit complete.


SQL> alter database start logical standby apply;

Database altered.




References:-
Logical Standby Apply Process Fails With ORA-308 [ID 274676.1]

Thursday, September 16, 2010

Oracle Error : ORA-21779 duration not active

Recently we encounter the error ORA-21779 duration not active, in the alert log. This error keeps repeating.

ORA-21779: duration not active
Cause: User is trying to use a duration that has been terminated.
Action: User should avoid performing such operation.


In the trace file , you will notice the below.

Errors in file ora_smon_610346.trc:
ORA-21779: duration not active
Fri Sep 17 14:25:54 2010


There are few problem that cause this, in below url show other issues. In our case this error keep repeating after few seconds. To solve this we do this.

After flushing the share pool , the error is no longer appeared

alter system flush shared_pool;

References:-

http://oraclequirks.blogspot.com/2006/07/ora-21779-brain-teaser.html

Friday, August 27, 2010

Oracle Listener on windows failed with faulting module oran110.dll

Recently we encounter the failing of listener, in our oracle XE , the error is due to a bug in the oracle. which is fixed in •9.2.0.8 Patch 1 ,•10.2.0.2 Patch 6 onwards , •10.2.0.3 Patch 2 onwards .

To workaround this issue,

in the Services, set the oracle listener to auto restart after few minutes if it encounter the failing of this services.

Metalink note:-
Windows TNS Listener Crash with Faulting Module ORANL10.DLL / ORANL9.DLL [ID 388017.1]



Event Viewer,
Faulting application TNSLSNR.EXE, version 0.0.0.0, faulting module oranl10.dll, version 10.2.0.1, fault address 0x000227ed.

For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.

Monday, August 16, 2010

Oracle IAS 10.1.3 how to change oc4jadmin password

If you encounter the below error, please follow the link below to solve the problem.
javascript:void(0)
Unable to make a connection to OC4J instance instance_name on Application
Server application_server_name. A common cause for this failure is an
authentication error. The administrator password for each OC4J instance in the
Cluster must be the same as the administrator password for the OC4J instance on
which Application Server Control is running.



http://oraclefunda.wordpress.com/2008/05/16/how-to-change-oc4jadmin-password-for-application-server-10gr3/

Tuesday, July 13, 2010

Unwrapping Oracle PLSQL

To unwrap the oracle 10g and 11g source code , you can see the blog below with the source code to do that.

http://blog.teusink.net/2010/04/unwrapping-oracle-plsql-with-unwrappy.html
=== Oracle 10g/11g PL/SQL unwrapper - by Niels Teusink - blog.teusink.net ===

If you dont' have the perl then can use this website that provide the unwrap

http://hz.codecheck.ch/UnwrapIt/Unwrapped.jsp



Requirement: -
Python 2.6 from http://www.python.org/

Friday, May 21, 2010

SAP - brbackup BR0301E logon denied

If you encounter SAP error while trying to use SAP brbackup as below

./brbackup -t online -p initERD_online.sap

BR0055I Start of database backup: bedgvjjf.and 2010-05-21 14.48.27
BR0484I BRBACKUP log file: /oracle/ERD/sapbackup/bedgvjjf.and
BR0280I BRBACKUP time stamp: 2010-05-21 14.48.27
BR0301E SQL error -1017 at location BrDbConnect-2, SQL statement:
'CONNECT system/*******'
ORA-01017: invalid username/password; logon denied
BR0310E Connect to database instance ERD failed
BR0280I BRBACKUP time stamp: 2010-05-21 14.48.27

The error is due to the you need to put this "-u /" login as local user

./brbackup -u / -t online -p initERD_online.sap

Thursday, April 22, 2010

SQL Server 2000 - Implement Password Policy

Password composition & Minimum password length
No SQL Server 2000 policy/settings can be set to enable this minimum password length for sql server login,
Workaround :- Set a new sp_password_neww to implement the feature or replace the existing sp_password procedure. (If Upgrading the SQL Server 2000, the original sp_password have to be put back) .

For creating a new sp_password_new and sp_addlogin_new
To make sure that the old procedures are not used, revoke execute permissions for both the SP_ADDLOGIN stored procedure and for the SP_PASSWORD stored procedure.Important :- The sa must not use Enterprise Manager, or use any other application that uses menu-driven methods for adding logins.

e.g.
add the below for the sp_addlogin
if @passwd is NULL
begin
Raiserror 20010 'The new password can not be blank/NULL.'
return (1)
end

if len(@passwd) < 6
begin
Raiserror 20020 'The new password can not be less than 6 characters.'
return (1)
end

if not (@passwd like '%[0-9]%' and @passwd like '%[a-z]%')
begin
Raiserror 20020 'The new password must be alphanumeric.'
return (1)
end



Number of unsuccessful logons before lockout & Lockout duration
Unable to implement this on SQL 2000, since we're using sql server login and this feature are not availaible in Microsoft SQL 2000 it is only if we used Windows integrated login that it can be implemented. SQL 2000 don't have the "Alter Login ...." command
Info :http://www.sqlservercentral.com/Forums/Topic767023-146-1.aspx



How to implement password expiration dates for SQL Server 2000 or SQL Server 7.0 login IDs.
http://support.microsoft.com/kb/80397

Sunday, April 11, 2010

Oracle Forms Report Crash while generating Excel output, REP-56049

If you have encounter the error REP-56048: Engine rwENG-1 Crashed , job id: 39021, then you need to increase the memory settings of the reports.

to do this, in the $ORACLE_HOME/reports/config ,find your report config file
and change the engine id,

engine id="rwEng" class="oracle.reports.engine.EngineImpl" initengine="1" maxengine="1" minengine="0" englife="1" maxidle="30" callbacktimeout="90000" jvmoptions="-Xms64m -Xmx32m -Xss8192k -Xoss8192k"

with jvmOptions to a higher value e.g.

engine id="rwEng" class="oracle.reports.engine.EngineImpl" initengine="1" maxengine="1" minengine="0" englife="1" maxidle="30" callbacktimeout="90000" jvmoptions="-Xms512m -Xmx1024m -Xss8192k -Xoss8192k"


Restart the forms services after this.

If you still encounter this problem after increasing the memory and you oracle forms version is 10.1.2.0.2. Do the below,

1. Apply the latest patch set 10.1.2.3 and then apply the 6835690 patch 6835690 to run the report with enhancedspreadsheet. Download and apply the Patch:5983622 for 10.1.2.3.

Note: The one-off patch:6835690 to get EnhancedSpreadsheet can be applied on release 10.1.2.2 too, but it is always recommended to upgrade to the latest patchset available. Right now the latest one is patchset 3.

3. To make sure the middle tier was successfully upgraded to patchset 3 (10.1.2.3), execute the following url and command:
http://host:port/reports/rwservlet/getserverinfo?

$ORACLE_HOME/Apache/Apache/bin/httpd -version

Both versions, Oracle HTTP Server (OHS) and Oracle Reports should be 10.1.2.3

4. Apply one-off patch 6835690 needed to work with EnhancedSpreadsheet desformat.


After that , change the format to DESFORMAT=ENHANCEDSPREADSHEET has been introduced to generate large data sets (up to 75,000 rows) to spreadsheets as indicated patch:6835690

Friday, March 26, 2010

Upgrading Oracle 10gR2 to Oracle 11gR2

Recently we upgrade our linux oracle 10gr2, 10.2.0.4 to the Oracle 11Gr2.
Using the DBUA , below are the errors we encounter :-

1) Error ignored: ORA-00044: timed_statistics must be TRUE when statistics_level
is not BASIC. ORA-01078: failure in processing system parameters

When we check our oracle 10gr2 parameter , we set the timed_statistics=false. To resolve this we turn it back to TRUE


2) Another error, oracle 11g unable to access our audit file dest, audit_file_dest. This is due to we're using another different id and group to install the oracle 11g. To resolve this we change the folder permission to world writable.


3) ORA-04023: Object SYS.STANDARD could not be validated or authorized.

To resolve this we try ,
1) Starts back the oracle 10gr2 , then run the below but still not working.
@?/rdbms/admin/catalog
@?/rdbms/admin/catproc
@?/rdbms/admin/utlrp

2) Follow metalink note, Upgrading to 11.1.0 and DBUA reports ORA-4023 On SYS.STANDARD [ID 729909.1] but still doesn't work.

3) In the end , we do the manually upgrading process. Complete Checklist for Manual Upgrades to 11gR2 [ID 837570.1]
which seems don't have any problem.


References: -
Upgrade 11g, ORA-04023: Object SYS.STANDARD errors
http://www.oracle-base.com/forums/viewtopic.php?f=1&t=9888
Upgrading 11g
http://avdeo.com/2007/09/07/upgrading-to-oracle-database-11g/