Monday, August 23, 2010

How to get all the table names in oracle database

*) To get the Current User table names and the Details,

SELECT * FROM USER_TABLES;

*) To get All user Table names and the Details,

SELECT * FROM ALL_TABLES;

Monday, August 2, 2010

ORA-02097 and ORA-16018

1) Issues ARCHIVE LOG LIST to see destination.



SQL> archive log list

Database log mode Archive Mode
Automatic archival Enabled
Archive destination USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence 215
Next log sequence to archive 217
Current log sequence 217



2)Check your current archival location by issuing, show parameter DB_RECOVERY_FILE_DEST


SQL> show parameter DB_RECOVERY_FILE_DEST


NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
db_recovery_file_dest string /oradata2

db_recovery_file_dest_size big integer 30G



3) Now you want to set log_archive_dest.



SQL> alter system set log_archive_dest='/oradata1';

alter system set log_archive_dest='/oradata1'

*
ERROR at line 1:
ORA-02097: parameter cannot be modified because specified value is invalid
ORA-16018: cannot use LOG_ARCHIVE_DEST with LOG_ARCHIVE_DEST_n or
DB_RECOVERY_FILE_DEST



4)If you want to set log_archive_dest first reset DB_RECOVERY_FILE_DEST and then set .


SQL> alter system set DB_RECOVERY_FILE_DEST='';

System altered.


SQL> alter system set log_archive_dest='/oradata1';

System altered.


SQL> archive log list

Database log mode Archive Mode
Automatic archival Enabled
Archive destination /oradata1
Oldest online log sequence 215
Next log sequence to archive 217
Current log sequence 217



5)Also if you now want to set DB_RECOVERY_FILE_DEST ORA-16019: will occur.



SQL> alter system set DB_RECOVERY_FILE_DEST='/oradata2';



alter system set DB_RECOVERY_FILE_DEST='/oradata2'

*

ERROR at line 1:
ORA-02097: parameter cannot be modified because specified value is invalid
ORA-16019: cannot use db_recovery_file_dest with LOG_ARCHIVE_DEST or
LOG_ARCHIVE_DUPLEX_DEST



6)To set DB_RECOVERY_FILE_DEST first reset LOG_ARCHIVE_DEST.

SQL> alter system set log_archive_dest='';

System altered.


SQL> alter system set DB_RECOVERY_FILE_DEST='/oradata2';

System altered.


SQL> archive log list

Database log mode Archive Mode
Automatic archival Enabled
Archive destination USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence 215
Next log sequence to archive 217
Current log sequence 217



7)To set multiple location of archival destination set another log_archive_dest_n parameter like,



SQL> alter system set log_archive_dest_3='LOCATION=/oradata2';

System altered.

Monday, April 26, 2010

Change Admin password or Recover Admin Password in Sun Java Application Server 8.2

1)   To Change the admin password .......

In admin web login,

Go to,
Configurations -----> Server-config (Admin Config) ----> Security --->  Realms -----> admin-realms

Then click the Manage Users button.Then click the admin in USER ID column.
From there , you can change the admin password.


2) To recover lost admin password.........


Assume that the admin user name is "admin" and domain name is "domain1" for the domain whose admin password is forgotten.


*  Step 1- create a dummy domain


asadmin create-domain --adminport 7070 --adminuser admin --instanceport 7071 testdomain   
Please enter the admin password>password 
Please enter the admin password again>password 
Please enter the master password>password 
Please enter the master password again>password   
Domain testdomain created.


* Step 2 - Copy testdomain’s “admin-keyfile” to domain1’s “admin-keyfile”


now the password for domain1 is “password that you enter to testdomain admin”



Thursday, January 7, 2010

Solaris Root File System Getting filled

I Had this problem in one of my Live server.

I checked in different major common areas that can be happend.

I checked /opt/SUNWexplo/output to check weather there are explora and also check for coredumps...Messages files... But i couldn't find.

Then i used
                   root@ser1# du -ah / |sort -n |more command.

This command gave me the size of individual file in that file system. This command shows files in subfolders as well.

Then i found some unusual file growing in /var/spool/mqueue

I think those files generated by SEND mail service. Those mails are not delevering and requeue again and again and growing the size.

What i did was, I deleted all those files and disable the SEND mail service. This can do only if you are not using SEND mail for your mailing.

If there is any other options that we can over come from these option please share......

Thanks and Best Regards.

Monday, December 7, 2009

Sun Java Systems Messaging Server 6.3

Try to put some difficulties that i faced during sun java Messaging server 6.3 installation and configuration and the Solution that i found with the help of My friends and sun forums.


1) How to create a custom User Service package and custom Group Service pkage.


Most likely you will want to create your own service packages based on customized Class-of-Service templates with attribute values appropriate for the users and groups in your installation.

To create your own service packages, use the Class-of-Service templates stored in the da.cos.skeleton.ldif file, located in the following directory:

da-base/lib/config-templates

This file was created specifically for use as a template for writing customized Class-of-Service templates. It is not installed in the LDAP directory when Delegated Administrator is configured.

The da.cos.skeleton.ldif file contains a parameterized template for each Class-of-Service definition provided by Delegated Administrator:

standardUserMail

standardUserCalendar

standardUserMailCalendar

standardGroupMail

standardGroupCalendar

standardGroupMailCalendar

You can create your own Class-of-Service templates by using one or more of the parameterized templates in the da.cos.skeleton.ldif file.


http://docs.sun.com/app/docs/doc/819-4438/acfdj?a=view

2) Could not send mails Via Internet using Microsoft Outlook.

This happens because we have to add MAIL AUTHENTICATION to MS OUTLOOK. In sun java messaging server mail relaying is strictly prohibited by mapping files.
"
ORIG_SEND_ACCESS

tcp_local*tcp_local* $N$D30Relaying$ not$ allowed "


3) Again i had a problem of viewing the Mail queues,top addresses in the mail queue etc.
There is a command ,

" mail-srv-base/sbin/imsimta qm " This will direct you to a qm.maint> prompt

In help you can find many options. I'll put some usefull options.

*)qm.maint>sum
This will summarize the mail server queue processes

EX:

" qm.maint> sum
Messages
Channel Queued Size (Kb) Oldest
--------- -------- ----------- -----------------
tcp_local 0 0.00
tcp_intranet 0 0.00
tcp_auth 0 0.00
reprocess 0 0.00
process 0 0.00
ims-ms 0 0.00
---------- -------- ----------- -----------------
Totals 0 0.00
qm.maint>
"



*)qm.maint> top -to
This will give you the top recipient addresses if that recicient
address appear more than two times

*)qm.maint>top -from

This will give you the top senders addresses if that recicient
address appear more than two times
*)qm.maint>directory
This will list all the mails , mail IDs and the relevent channels.This
command will help to get tha mail ID

*) qm.maint>delete -channel= <-ALL / MSG ID>
From the directory command you can find the channel
names,number of mails, size of total mails in queue and Message ID.If
you put the Messade ID with delete command it will delete the relevent
message.If you put -all option,it will delete all the meessages in the
peticular channel.

*)qm.maint>read -channel=
This will help to read the Basic mail details.


4) We wanted to block mails receiving from out side domains to paticular addresses.

I did it with the help of sun forums by editing mapping files.Here i have put the entries that i edited


EX:
My Domain name is dodanwala.com. My email address is viraj@dodanwala.com
i want to Block all the Incomming mail from gmail,yahoo,hot mail etc. But need to get mail from dodanwala.com domain. We have to edit D#mailsrv-base/config/mappings file

"
ORIG_SEND_ACCESS

! src-channelfrom-addressdst-channelto-address
tcp_**@dodanwala.com*viraj@dodanwala.com $Y
tcp_local**viraj@dodanwala.com $N$D30Access$ denied$ to$ viraj@dodanwala.com


"
5)Our mail server got relayied by some SPAMMER and our mail queue got increased rapidly.
when i write this to http://forums.sun.com/ they tald to send the mail.log file.But i coulnt find any mail.log file in my log folder.
Then i found that we have to add some entry to D#mailsrv-base/config/imta.cnf file.
We have to add "logging " key word to the end of the following line.
EX:
-------------------------------------------------------------------------------------------------
!
! part II : channel blocks
!
defaults notices 1 2 4 7 copywarnpost copysendpost postheadonly noswitchchannel immnonurgent maxjobs 7 defaulthost echannelli
ng.com echannelling.com logging
-------------------------------------------------------------------------------------------------
After restarting the mail server i could fing the mail.log file. In the mail.log file we foung that some mails are using AUTHENTICATION to send mails.But those mails are not sending by our mail clients. The log loks like follows.
EX:

07-Dec-2009 16:16:45.57 tcp_auth tcp_local EEA 3 admin@telephase.com.au rfc822;heard@insaneofferz1.info heard@insaneofferz1.info
07-Dec-2009 16:16:45.57 tcp_auth tcp_local EEA 3 admin@telephase.com.au rfc822;heard16677@kinki-kids.com heard16677@kinki-kids.com
07-Dec-2009 16:16:45.57 tcp_auth tcp_local EEA 3 admin@telephase.com.au rfc822;heather.h.taylor@lowes.com heather.h.taylor@lowes.com
07-Dec-2009 16:16:45.57 tcp_auth tcp_local EEA 3 admin@telephase.com.au rfc822;heath01@mweb.co.za heath01@mweb.co.za
07-Dec-2009 16:16:45.57 tcp_auth tcp_local EEA 3 admin@telephase.com.au rfc822;heartlandvending@pixius.net heartlandvending@pixius.net
07-Dec-2009 16:16:45.57 tcp_auth tcp_local EEA 3 admin@telephase.com.au rfc822;heather.clark@railroadbazaar.com heather.clark@railroadbazaar.com
07-Dec-2009 16:16:45.58 tcp_auth tcp_local EEA 3 admin@telephase.com.au

we found EEA entry in the log.
E=successfully enqueued A=SASL Authentication used
To use SASL Authentication these SPAMERS mut know atleast on of our user ID and a Password.
To find the user name that they are using to use the mails i had to add some entry to option.dat file. that found in the config folder


To find out which account,add the following to your msg_base/config/option.dat file:

LOG_USERNAME=1

Then run:

./imsimta cnbuild;./imsimta restart

This will add the user id (prefixed with an asterisk character) which authenticated to the mail.log line. You can then track down any future deliveries to work out which account needs have their password changed
Then the output of the mail.log will be like follows.

------------------------------------------------------------------------------------------------------------
"
07-Dec-2009 20:16:06.12 tcp_auth tcp_local EEA 3 petrockt@live.com rfc822;cornishay07@yahoo.com cornishay07@yahoo.com *admin@domainname.com
07-Dec-2009 20:16:06.12 tcp_auth tcp_local EEA 3 petrockt@live.com rfc822;coronado_della@yahoo.com coronado_della@yahoo.com
*admin@domailname.com

"
-------------------------------------------------------------------------------------------------------------
Then easily we can track the user id that they are using and we can change the password of it.
6) Latest problem i faced was ,just after i change the store admin password our useres could not connect using HTTP web mail.
Finaly we managed to solve the problem with the help of http://forum.sun.com/ . Here i have posted the forum threads i used to solve that proble.
http://forums.sun.com/thread.jspa?threadID=5419202




Thanks goes to SHANE in the sun forums. and Aruna Premasiri in MIT