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