How to add a new area inside struct file?

Posted by fiservarvind on 26-Aug-2019 10:29

Is there any tool or way to add a new area inside database struct file (.st). It seems like we can just manually edit the .st file to add new area with required params but do we also have any other way of doing it?

# Before image area
b ./testdb.b1

# Schema Area
d "Schema Area":6,32;1 .\testdb.d1

# NEWDATAAREA
d "NEWDATAAREA":7,32;1 .\testdb_7.d1

All Replies

Posted by Patrick Tingen on 26-Aug-2019 12:15

As far as I know, the only to edit is manually.

Posted by fredrik.richtner on 26-Aug-2019 12:18

Have a look at "prostrct" utility

Posted by fiservarvind on 26-Aug-2019 12:27

Thanks Fredrik.

The PROSTRCT ADD option is there but that too need a struct file. Without struct file is there any way to add area into db and if it also update my struct file automatically?

Posted by Rob Fitzpatrick on 26-Aug-2019 12:53

Create a file with the area(s) you want to add, e.g.:

d "NEWDATAAREA":7,32;1 .\testdb_7.d1

(Don't make it a Type I area like in this example.)

Give it a name, say add.st.

Add it to the database structure, e.g. prostrct add testdb add.st

Update the testdb.st structure file: prostrct list testdb

Posted by egarcia on 26-Aug-2019 13:42

Hello,

Some suggestions.

On Linux you can write something like the following:

echo 'd "Test":13,32;1 ./sports2000_13.d1 f 320' | prostrct add sports2000 /dev/stdin

You can write a wrapper script to write the new area to a file and then add it.

I hope this helps.

Posted by fiservarvind on 26-Aug-2019 14:08

Thanks Team.

It seems like manual edit is the best option for me now as this is going to be one time setup only.

Posted by fiservarvind on 27-Aug-2019 06:40

Can we add "Encryption Policy Area" inside our main struct file like below. It seems like it is not working, do I need to define "Encryption Policy Area" in separate file?

# Before image area

b ./teller.b1

# Schema Area

d "Schema Area":6,32;1      .\db1.d1

# TableArea

d "TableArea":7,8;64   .\db1_7.d1

e "Encryption Policy Area":13,32;64 .

Posted by Ruanne Cluer on 27-Aug-2019 10:33

That structure file isn't going to work because your bi extent is for a db called "teller" and the remaining are for a db called db1

Try this:  prostrct create db1 new.st

# new.st

# Before image area

b .

# Schema Area

d "Schema Area":6,32;1 .

# TableArea - 8 records per block are you sure?

d "TableArea":7,8;64   .

e "Encryption Policy Area":13,64;64

If you're adding more storage areas or extents to existing storage areas, you only need the 'additions' in the .st file (not any of the existing area/extents).

eg:

# IndexArea

"IndexArea":8,1;64   .

This thread is closed