Wednesday, October 27, 2010

Automate the FTP in Solaris , Linux environment

Here i am writing a sample script which was very helpful for me.

There was a requirment to FTP some files Daily which were generated Daily in our live server to Billing servers in Maldives.

I used following small script to automate this process.

======================================================================
root@oracle-R-D # vi ftp-automate (Use your own name)

HOST=(Remote Server IP address)
FTPUSER=(FTP User id in remote server)
FTPPASSWORD=(FTP User Password)
ftp -n $HOST << -EOF
user $FTPUSER $FTPPASSWORD
lcd /(File location path in local server)
cd /(Directory path where you want to put th file in remote server)
bin
prompt off
mput (Or mget)
bye
EOF



Make sure thet you give the Execution permission to script file.

PowerDesk Pro 6.0
Using Ftp (User Friendly Reference)
The TCP/IP Guide: A Comprehensive, Illustrated Internet Protocols Reference

Wednesday, October 20, 2010

ORA-29280 , ORA-06512

I got following Error when i try to run a SQL script in Oracle 10g in Solaris 10 x86.
This runs in Oracle 9i which installed in Solaris 10 SPARC perfectly.

ERROR at line 1:
ORA-29280: invalid directory path
ORA-06512: at "SYS.UTL_FILE", line 33
ORA-06512: at "SYS.UTL_FILE", line 436
ORA-06512: at line 16


I did the following to overcome from this problem.


SQL> show parameter utl_file_dir;

NAME                                 TYPE                         VALUE
------------------------------
------------------------------------ --------------------------------
utl_file_dir                         string                          *


SQL> ALTER SYSTEM SET UTL_FILE_DIR='' scope=spfile;

Then i restarted the database. Then i issued the following command.

SQL> show parameter utl_file_dir;

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
 
utl_file_dir                         string      /ora10g/ora10g/



After these changes, the script worked perfectly.

http://download.oracle.com/docs/cd/B28359_01/server.111/b28320/initparams255.htm
http://forums.oracle.com/forums/thread.jspa?threadID=590335

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.