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
As far as I know, the only to edit is manually.
Have a look at "prostrct" utility
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?
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
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.
Thanks Team.
It seems like manual edit is the best option for me now as this is going to be one time setup only.
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 .
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 .