I have on PRD server and DEV server.I need to copy files from one directory in PRD to DEV directory.Before copying files from PRD to DEV,it has to check any files existing in DEV directory,if existing need to delete that files and then copy files from PRD.
You haven't said how you want to copy the files. Using 'ftp', 'rcp', 'scp', or 'nfs'?
Files existing in the target (DEV) directory that have the same name as a file in the source (PRD) directory will be automatically replaced, so I don't see the need to delete them first.
here using SCP to copy files....and all the times,copying files are not same...thats why need to delete the existing files whatever it may be from DEV and copy fresh files...supppose in DEV directory it contains 15 files already and planning to copy 13 files from PRD...so need to delete all the files in DEV direcrtory first...
so after that need to take the highest seq number and some seq number :say 10 less than highest...these two values has to place in the below code during the process..while issuing the below command in script,it has to take these two values and execute ..so how its possible...
restore archivelog low sequence 55162 high sequence 55166;
Since the output of the grep command is fixed format, you don't need to do a numeric sort.
Use 'tail' to save only the last 10 lines of the sorted output, then the low sequence is the first entry of the output file, and the high sequence is the last.
select name from v$datafile;
select name from v$controlfile;
select name from v$tempfile;
select MEMBER from v$logfile;
These sqls has to run in the script and o/p of each sql has to write in seperate files.But the o/p is like if we issue
select name from v$datafile; o/p like
So need to change the o/p as
rm -rf /path/datafilename1
rm -rf /path/datafilename2
like that all sql o/p has to come like this and write in seperate files,so that i have to execute that files only
ok..i understand....this is the first time am posting in one blog..and moreover am not a shell programmer....only some basic ideas....thats why asked questions like this...excuse it...i will post a new thread for the same...