Informix

Informix

Connect with Db2, Informix, Netezza, open source, and other data experts to gain value from your data, share insights, and solve problems.

 View Only
  • 1.  logical, physical & temp chunks location

    Posted 11/05/24 12:19 PM

    Hi DBAs,

    We have legacy Informix database and I am unable to figure out dbspaces & their respective chunk names along with full pathname.

    Please help me with a query to find the above or any onstat command.

    Thanks in advance.

    Syed



    ------------------------------
    Syed Hussaini
    ------------------------------


  • 2.  RE: logical, physical & temp chunks location

    Posted 11/05/24 12:37 PM

    Hi Syed,

    You can use onstat -d to get the list of dbspaces and chunks associated with each dbspace (the chunk/dbs column shows the chunk number and its corresponding dbspace, the pathname show the name of the chunk, the flags column shows the flags of the chunk (Primary,  Mirror, Online or Down chunk, etc), etc).

    Check the documentation for all of the flags and other information you might need.

    You can also query the tables sysdbspaces and syschunks in the sysmaster database and perform a join between them to get what you want.

         

    Cordialement, Regards,    Khaled Bentebal  Email: khaled.bentebal@consult-ix.fr Site Web:  www.consult-ix.fr
    Le 05/11/2024 à 18:18, Syed Hussaini via IBM TechXchange Community a écrit :
    01000192fd55d3b6-f44112fb-681b-46ea-a316-4e6c3a8e2302-000000@email.amazonses.com">
    Hi DBAs, We have legacy Informix database and I am unable to figure out dbspaces & their respective chunk names along with full pathname. ... -posted to the "Informix" group





  • 3.  RE: logical, physical & temp chunks location

    Posted 11/05/24 02:03 PM

    Syed:

    You can use:

    onstat -d

    That will show you your dbspaces as well as the chunk paths. Each chunk entry in the report will include the dbsnum (dbspace number) to which it belongs as well and the chunk number of the next chunk in the dbspace if any. The dbspace report line will contain the number of chunks belonging to each dbspace as well as the chunk number of the first chunk in that dbspace's list.

    If you want to use queries against the sysmaster database, look at the sysdbspaces table and the syschunks table in that database. They are linked by dbsnum.

    Art



    ------------------------------
    Art S. Kagel, President and Principal Consultant
    ASK Database Management Corp.
    www.askdbmgt.com
    ------------------------------



  • 4.  RE: logical, physical & temp chunks location

    Posted 11/06/24 05:37 AM

    Thanks Art & Khaled. After your reply I checked onstat -d & ran through both sys tables and can figure out rootdbs and logical log dbspaces/files. But still dont know where physical log dbspace/file reside. Is there a way to figure out this. Thanks again.

    IBM Informix Dynamic Server Version 12.10.FC10 -- On-Line -- Up 22 days 04:03:54 -- 1648880 Kbytes
     
    Dbspaces
    address          number   flags      fchunk   nchunks  pgsize   flags    owner    name
    80619028         1        0x40001    1        2        4096     N  BA    informix rootdbs
    818db260         2        0x40001    2        1        4096     N  BA    informix tmslogdb
    818db4a0         3        0x40001    3        2        4096     N  BA    informix tmtabdb1
    818db6e0         4        0x40001    4        1        4096     N  BA    informix tmtabdb2
    818db920         5        0x40001    5        6        4096     N  BA    informix tmtabdb3
    818dbb60         6        0x40001    6        5        4096     N  BA    informix tmtabdb4
    818dbda0         7        0x40001    7        4        4096     N  BA    informix tmtabdb5
    818de028         8        0x40001    8        1        4096     N  BA    informix tmtabdb6


    ------------------------------
    Syed Hussaini
    ------------------------------



  • 5.  RE: logical, physical & temp chunks location

    Posted 11/06/24 06:36 AM

    Sayed:

    Yes. If you did not create a PLOG type dbspace specifically for it (a v14.10 feature, so that's a no), then it MAY be in the rootdbs or somewhere else. If you run onstat -l and look at the address of the physical log in the top section of the report, you will see the dbspace number:


    Physical Logging
    Buffer bufused  bufsize  numpages   numwrits   pages/io
     P-2  0        2048     25840      351        73.62
         phybegin         physize    phypos     phyused    %used    
         2:53             32715      7588       0          0.00     

    Logical Logging

    See the "phybegin" entry. That is showing that the physical log starts on page 53 or dbspace #2 on my system.

    Art



    ------------------------------
    Art S. Kagel, President and Principal Consultant
    ASK Database Management Corp.
    www.askdbmgt.com
    ------------------------------



  • 6.  RE: logical, physical & temp chunks location

    Posted 11/06/24 07:04 PM

    Syed,

    Quite some years ago I posted a shell archive containing the Perl module DBspaces.pm and a few utilities to go with it.  Separately I posted the Perl utility chunk-path.pl. (Why didn't I include that in the .shar? <face-palm>)  And it requires another Perl module, UNLreport.pm, which produces nice column output.

    It would be silly for me to suggest you download & install all of this just for a nice listing, unless you are a fellow Perl hack [wannabe].  However, using onstat -d as a starting point (as Art and Khaled have suggested), you might take the last column of the output of the chunks section and, in a shell loop, run ls -L on each path to get where the symlink is pointing to.  This is essentially what chunk-path does.

    Good luck!



    ------------------------------
    Jacob Salomon
    ---
    Nobody goes there anymore, it's too crowded.  --Attr: Yogi Berra
    ------------------------------



  • 7.  RE: logical, physical & temp chunks location

    Posted 11/07/24 02:05 AM

    Thanks Jacob for reply. Let me check if I can work on that. For now I am asked to spin up new instance based on this instance and needed this info quickly



    ------------------------------
    Syed Hussaini
    ------------------------------