Howto conjoin information from two hash tables?

Howto conjoin information from two hash tables?

am 05.06.2011 11:30:07 von Scottie

Hi!
I'm stuck. Can you help me?

After the backup by Oracle RMAN tool I parse the log file and create
two hash tables:

%channel = #It collects information specific to channels
{ch1}
->[0] allocated channel: ch1
->[1] channel ch1: SID=596 device type=DISK
->[2] channel ch1: starting compressed full datafile backup set
->[3] channel ch1: specifying datafile(s) in backup set
{ch2}
->[0] allocated channel: ch2
->[1] channel ch2: SID=15 device type=DISK
->[2] channel ch2: starting compressed full datafile backup set
->[3] channel ch2: specifying datafile(s) in backup set

%channel_files = #It collects information about files that are
processed by the channel
{ch1}
->[0] input datafile file number=00014 name=/foo/oradata/foo/foo-
data04.dbf
->[1] input datafile file number=00019 name=/foo/oradata/foo/foo-
data05.dbf
{ch2}
->[0] input datafile file number=00013 name=/foo/oradata/foo/foo-
index03.dbf
->[1] input datafile file number=00012 name=/foo/oradata/foo/foo-
data03.dbf

I would like to concatenate information from the above two hash tables
into one line. Example result that I would get:
============================

Files for channel 'ch1':
Channel name Channel type File Number File Name
--------------- -------------- ----------------
---------------------------
ch1 DISK 00014 /foo/oradata/foo/foo-
data04.dbf
ch1 DISK 00019 /foo/oradata/foo/foo-
data05.dbf

Files for channel 'ch2':
Channel name Channel type File Number File Name
--------------- -------------- ----------------
---------------------------
ch2 DISK 00013 /foo/oradata/foo/foo-
index03.dbf
ch2 DISK 00012 /foo/oradata/foo/foo-
data03.dbf

============================

I will be grateful for your help.

Regards,
--
Scottie


--
To unsubscribe, e-mail: beginners-unsubscribe@perl.org
For additional commands, e-mail: beginners-help@perl.org
http://learn.perl.org/

Re: Howto conjoin information from two hash tables?

am 06.06.2011 00:39:13 von derykus

On Jun 5, 2:30=A0am, scottie...@gmail.com (Scottie) wrote:
> Hi!
> I'm stuck. Can you help me?
>
> After the backup by Oracle RMAN tool I parse the log file and create
> two hash tables:
>
> %channel =3D =A0#It collects information specific to channels
> =A0{ch1}
> =A0 =A0 ->[0] =A0 allocated channel: ch1
> =A0 =A0 =A0 =A0 ->[1] =A0 channel ch1: SID=3D596 device type=3DDISK
> =A0 =A0 =A0 =A0 ->[2] =A0 channel ch1: starting compressed full datafile =
backup set
> =A0 =A0 =A0 =A0 ->[3] =A0 channel ch1: specifying datafile(s) in backup s=
et
> =A0{ch2}
> =A0 =A0 ->[0] =A0 allocated channel: ch2
> =A0 =A0 =A0 =A0 ->[1] =A0 channel ch2: SID=3D15 device type=3DDISK
> =A0 =A0 =A0 =A0 ->[2] =A0 channel ch2: starting compressed full datafile =
backup set
> =A0 =A0 =A0 =A0 ->[3] =A0 channel ch2: specifying datafile(s) in backup s=
et
>
> %channel_files =3D #It collects information about files that are
> processed by the channel
> =A0{ch1}
> =A0 =A0 ->[0] =A0 input datafile file number=3D00014 name=3D/foo/oradata/=
foo/foo-
> data04.dbf
> =A0 =A0 ->[1] =A0 input datafile file number=3D00019 name=3D/foo/oradata/=
foo/foo-
> data05.dbf
> =A0{ch2}
> =A0 =A0 ->[0] =A0 input datafile file number=3D00013 name=3D/foo/oradata/=
foo/foo-
> index03.dbf
> =A0 =A0 ->[1] =A0 input datafile file number=3D00012 name=3D/foo/oradata/=
foo/foo-
> data03.dbf
>
> I would like to concatenate information from the above two hash tables
> into one line. Example result that I would get:
> ==================== =====
====
>
> Files for channel 'ch1':
> =A0 Channel name =A0 =A0Channel type =A0 File Number =A0 =A0 =A0File Name
> =A0 --------------- -------------- ----------------
> ---------------------------
> =A0 ch1 =A0 =A0 =A0 =A0 =A0 =A0 DISK =A0 =A0 =A0 =A0 =A0 00014 =A0 =A0 =
=A0 =A0 =A0 =A0/foo/oradata/foo/foo-
> data04.dbf
> =A0 ch1 =A0 =A0 =A0 =A0 =A0 =A0 DISK =A0 =A0 =A0 =A0 =A0 00019 =A0 =A0 =
=A0 =A0 =A0 =A0/foo/oradata/foo/foo-
> data05.dbf
>
> Files for channel 'ch2':
> =A0 Channel name =A0 =A0Channel type =A0 File Number =A0 =A0 =A0File Name
> =A0 --------------- -------------- ----------------
> ---------------------------
> =A0 ch2 =A0 =A0 =A0 =A0 =A0 =A0 DISK =A0 =A0 =A0 =A0 =A0 00013 =A0 =A0 =
=A0 =A0 =A0 =A0/foo/oradata/foo/foo-
> index03.dbf
> =A0 ch2 =A0 =A0 =A0 =A0 =A0 =A0 DISK =A0 =A0 =A0 =A0 =A0 00012 =A0 =A0 =
=A0 =A0 =A0 =A0/foo/oradata/foo/foo-
> data03.dbf
>
> ==================== =====
====
>

This shouldn't be too hard but what have you tried...
and what specific problems are you having with the
trial solution? Seeing what's been done will make
it easier to suggest remedies or maybe provide a
doc reference that'll help.


--
Charles DeRykus



--
To unsubscribe, e-mail: beginners-unsubscribe@perl.org
For additional commands, e-mail: beginners-help@perl.org
http://learn.perl.org/