![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Database-Based Authentication for PHP Apps | iBot | Oracle Updates (RSS) | 0 | 04-06-2008 05:10 AM |
| ccall database and collect data from one table | rinku | Shell Programming and Scripting | 0 | 05-28-2007 01:16 AM |
| Upload of the images from the folder to the Database table | shashisaini24 | UNIX for Advanced & Expert Users | 0 | 11-29-2006 06:03 AM |
| how to insert data in database based on text file? | forevercalz | Shell Programming and Scripting | 9 | 12-20-2005 11:40 PM |
| export table from oracle database | inquirer | Shell Programming and Scripting | 1 | 06-24-2003 09:48 AM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Delete database table based on months using script.
HI All,
Newbie here. I have a script which generates the tables in teradata database with time stamp like below.I want to add some more code to delete the archive tables which are 2months old. . $HOME/.profile t_name=$1 procdate=`date +%y%m%d` log_dir=$Folder/log tab=`echo $t_name"_"$procdate` tab_create=$log_dir/$t_name.txt param_dir=$Folder/parameter echo ".run file=$param_dir/logon.txt;" > $tab_create echo "DATABASE XYZ;" >> $tab_create echo ".echoreq off;" >>$tab_create echo ".SET FOLDLINE off; " >>$tab_create echo "rename table $t_name to $tab;" >> $tab_create echo ".if errorcode =3803 then .goto prob38;" >> $tab_create echo "create table $t_name as $tab with no data;" >> $tab_create echo ".quit;" >> $tab_create echo ".LABEL prob38" >> $tab_create echo "drop table $tab;" >> $tab_create echo "rename table $t_name to $tab;" >> $tab_create echo "create table $t_name as $tab with no data;" >> $tab_create echo ".quit;" >> $tab_create echo "EOF" >> $tab_create bteq < $tab_create> $log_dir/$tab_create_$tab.log Can someone help me on this.. Thanks. Regards, Mav. |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|