Shell script compare all parameters in two files and display results
Hi ,
I am not familiar with shell programming. I have a requirement like i have two files
.I need to compare the two files by comparing each parameter and i should produce 2 outputs.
1)i have around 35 parameters say i have one parameter name called db_name=dcap in one file and db_name=dcicr in another file.then i need to display the output stating the difference in db_name.
2)output2:There are some parameters say one parameter name memory_target= some value is only present in second file but not in first file.i need to check this parameter whether it is properly set or not if not ,produce the output stating parameter is not set.
3)output3:There are some deprecated parameters are there in my first file say there are 9 parameters.If these parameters are there in second file then i should generate a report stating these are deprecated no need to implement these items.
ex: i have a parameter called java_pool_size .if it is present in second file i should say that this parameter should not be implemented.
I would really appreciate your help in this script.Your inputs are always welcome.
I am trying from my end...Advance thanks to persons for their replies....
Here requirement is different.Here we need to do check some specific parameters.
1)First one say i have parameter name db_block_size should be present in two files and if any mismatch found
we shold generate a report stating db_block_size parameter is differnet of it's not present in second file.
like that i need to check 35 parameters.
2)Second one:
There are some specific parameters present in second file i need to check for that parameters in second file
if it is not found i should generate a report stating say diagnostic_dest parameter is not present in second file.
3) Third one:There are some parameters present in file1 should not present in second file.if that is the case then i should
generate the report stating the parameter in file1 is present in file2. like that i have around 12 parametes.
I will provide you sample list:
for First one:
PARAMETERS TO BE VERIFIED WITH 9i vs 11g
db_block_size
db_cache_size
db_file_multiblock_read_count
open_cursors
cursor_sharing
background_dump_dest
core_dump_dest
user_dump_dest
for second requirement:
diagnostic_dest
db_unique_name
memory_max_target
memory_target
for Third requirement:
pga_aggregate_target
java_pool_size
large_pool_size
shared_pool_size
Thank you verymuch for your reply.Please let me know anything needs to be clarified
My OS:Susilinux 10.3
Thank you very much for your reply..
Here we are giving two files as input one is oracle 9i and another one is oracle 11g right..Where are you giving that?
I did n't get it exactly what listparams file contains? I mean parameters list from both files shall we need to give in list params file?
once again thank you very much for your timely reply....
---------- Post updated at 05:14 AM ---------- Previous update was at 04:48 AM ----------
Hi after running the scripts,These are the outputs i got it.
Last edited by vbe; 11-17-2010 at 09:34 AM..
Reason: code tags please
Check that your listparam looks like mine (see my previous post, i have set some things in bold and red to bring your attention on those points)
in listparam,
<param> 1
means : <param> should match the requirement 1
<param> 2
means : <param> should match the requirement 2
<param> 3
means : <param> should match the requirement 3
What name did you choose for the script ?
What name did you choose for the files you want to be analyzed ?
What name did you choose for the file containing the list of the parameters to check against the requirements ?
---------- Post updated at 08:08 AM ---------- Previous update was at 06:00 AM ----------
Hi,
for first condition it is working properly.Now i have included parameters needs to check for second and third condition in listparam file but now it's not giving the second and third outputs.
These are the parameters i have included in my paramlist file:
diagnostic_dest 2
db_unique_name 2
memory_max_target 2
memory_target 2
pga_aggregate_target 3
java_pool_size 3
large_pool_size 3
shared_pool_size 3
shared_pool_reserved_size 3
db_keep_cache_size 3
db_recycle_cache_size 3
sga_target 3.
The output i got is:
it is only checking for first condition:
Param 9i 11g
Warning : cursor_sharing does not have the same values in 9i.ora and 11g.ora : missmatch !
cursor_sharing --- SIMILAR
Warning : background_dump_dest does not have the same values in 9i.ora and 11g.ora : missmatch !
background_dump_dest /usr/local/oracle/admin/dcap/bdump ---
Warning : core_dump_dest does not have the same values in 9i.ora and 11g.ora : missmatch !
core_dump_dest /usr/local/oracle/admin/dcap/cdump ---
Warning : user_dump_dest does not have the same values in 9i.ora and 11g.ora : missmatch !
user_dump_dest /usr/local/oracle/admin/dcap/udump ---
Warning : log_archive_dest does not have the same values in 9i.ora and 11g.ora : missmatch !
log_archive_dest /archive/dcap/arch/ use_db_recovery_file_dest'
Warning : log_archive_start does not have the same values in 9i.ora and 11g.ora : missmatch !
log_archive_start TRUE ---
Warning : log_archive_format does not have the same values in 9i.ora and 11g.ora : missmatch !
log_archive_format dcap%t_%s.arc ---
Warning : service_names does not have the same values in 9i.ora and 11g.ora : missmatch !
service_names dcap dcicr,dcicr.world
Warning : control_files does not have the same values in 9i.ora and 11g.ora : missmatch !
control_files ( "/u02/oradata/dcap/control01.ctl",
(+DCI/dcicr/controlfile/current.256.725043389,
Warning : compatible does not have the same values in 9i.ora and 11g.ora : missmatch !
compatible 9.2.0 11.1.0
Warning : db_name does not have the same values in 9i.ora and 11g.ora : missmatch !
db_name dcap dcicr
Warning : instance_name does not have the same values in 9i.ora and 11g.ora : missmatch !
instance_name dcap dcicr1
Warning : processes does not have the same values in 9i.ora and 11g.ora : missmatch !
processes 500 4
10 1000 2
Warning : job_queue_processes does not have the same values in 9i.ora and 11g.ora : missmatch !
job_queue_processes 4 2
Warning : log_buffer does not have the same values in 9i.ora and 11g.ora : missmatch !
log_buffer 524288 10485760
Warning : undo_tablespace does not have the same values in 9i.ora and 11g.ora : missmatch !
undo_tablespace undots undots1
Warning : undo_retention does not have the same values in 9i.ora and 11g.ora : missmatch !
undo_retention 6000 #
added 4/17 to
correct snapshot too
old - RG
3600
Warning : audit_trail does not have the same values in 9i.ora and 11g.ora : missmatch !
audit_trail DB OS
Warning : sql92_security does not have the same values in 9i.ora and 11g.ora : missmatch !
sql92_security TRUE TRUE
Warning : audit_file_dest does not have the same values in 9i.ora and 11g.ora : missmatch !
audit_file_dest --- /u01/app/oracle/admin/dcicr/audit
Warning : O7_dictionary_accessibility does not have the same values in 9i.ora and 11g.ora : missmatch !
O7_dictionary_accessibility --- FALS
Last edited by vbe; 11-17-2010 at 09:35 AM..
Reason: code tags!
Hi,
I have 2 files abc.txt and bdc.txt.
I am using
$diff -y abc.txt bcd.txt -- compared the files side by side
I would like to write a Shell Script to cmpare the files side by side and print the results( which are not matched) in a side by side format and save the results in another... (10 Replies)
Hi ,
I had a requirement to compare two files whether the two files are same or different .... like(files contaisn of two columns each)
file1.txt
121343432213 1234
64564564646 2345
343423424234 2456
file2.txt
121343432213 1234
64564564646 2345
31231313123 3455
how to... (2 Replies)
Hello,
I want to use shell script to generate network files (I tried with python but its taking too long).
I have a list of nodes:
node.txt
LOC_Os11g37970
LOC_Os01g07760
LOC_Os03g19480
LOC_Os11g45740
LOC_Os06g08290
LOC_Os07g02800
I have an edge-list as well: edge.txt
Source_node ... (2 Replies)
Basically, I have two files
dupestest.txt
152,153
192,193,194
215,216
290,291
2279,2280 2282,2283haftest.txt
152,ABBOTS ROAD
153,ABBOTS ROAD
154,ABBOTS ROAD
155,ABBOTS ROAD
156,ABBOTS ROAD
157,ABBOTS ROADI want to find the numbers in dupestest.txt in haftest.txt... (4 Replies)
Hi
i want to compare two files and i need the o/p of only difference
here the files
file1
achilles
aedxbepo
aedxbwdm01
aedxbwdm02
albedo
amarice
ambrister
anakin
anton
argon
artephius
asgard
avatar
aymara (10 Replies)
I have two files; file A and file B. I need all the entries of file A to be compared with file B line by line. If the entry exists on file B, then save those on file C; if no then save it on file D
Note :- all the columns of the lines of file A need to be compared, except the last two columns... (8 Replies)
Hello friends,
I am a script which dispalys a multiple files with their contents.
for exm:
suppose two file test1.txt and test2.txt.
when I run my script it have to display the below O/P.
test1.txt
-rw-r----- 1 sranga staff 91 Sep 23 02:18 calc.sh
-rw-r----- 1 sranga ... (2 Replies)
I have a directory with about 6 files that we receive regularly. these 6 files contain information for 3 different units, 2 for each unit. files related to a specific unit are named similarly with a change in number at the end of the file. the numbers should be sequential. for each grouping of... (3 Replies)
Hello,
I'm a newbie in shell script.
So, i would like to create a shell script which take 2 IN parameters (PARAM1 and PARAM2).
This script need to create 2 files as :
I need to create this file /etc/apache2/sites-available/PARAM2 :
<VirtualHost *:80>
DocumentRoot "/home/PARAM1/www"... (0 Replies)
hi experts
please help me to compare two files which are in different directory
file1<file will be master file>
(/home/rev/mas.txt}
ex x1
x2
file2 <will be in different folder>
(/home/rev/per/.....)
ex x3
x4
the filesinside per folder i need to compare with master file... (1 Reply)