Script to Generate Onspaces Commands
Posted in 2011
Dan asked for a way to generate the onspaces commands needed to recreate an instance's dbspace/chunk layout (structure only, no data) on IDS 11.50/AIX. Answers: dbschema -d <db> -c (or -c -ns for onspaces/onparams output) does this, but only from version 11.70; for 11.50 alternatives were offered — Art Kagel's myschema in utils2_ak with the --infrastructure option (noting the makefile needs print_infrastructure added), a SQL query against sysdbspaces/syschunks unloading onspaces -c/-a lines (dbspaces only, not blob/sbspaces), plus ksh/awk and perl scripts from other posters. Dan said he had enough options.
Auto-generated by DrWatson from the posts below — may be imperfect; read the full thread.
Topics: Storage & Space Management, Server Administration, Platform-Specific Issues
Good Morning
IDS 11.50.FC5
O/S AIX 5.3
Does anyone out there have a script that will generate all of the onspaces
commands it would take to clone the dbspace/chunk part of an online instance?
Not interested in the data at this point, only the structure.
TIA,
Dan
how about "dbschema -c" od "dbschema -c -ns"
HTH
Hrvoje
On 13.07.2011. 13:48, DAN MUELLER wrote:
> Good Morning
>
> IDS 11.50.FC5
> O/S AIX 5.3
>
> Does anyone out there have a script that will generate all of the onspaces
> commands it would take to clone the dbspace/chunk part of an online instance?
> Not interested in the data at this point, only the structure.
>
> TIA,
> Dan
>
>
>
*******************************************************************************
> Forum Note: Use "Reply" to post a response in the discussion forum.
>
>
Dan:
If you download the latest utils2_ak, myschema now supports the new dbschema
feature that does this for you. The dbschema v11.70 option is -c for SQL
API output or "-c -ns" for onspaces/onparams commandline output. The option
in myschema is --infrastructure which generates onspaces and onparams
commands by default. If you want SQL API function calls instead use
--infrastructure=sql.
Note that the makefile in myschema.d doesn't build the new file
print_infrastructure.ec so the make will fail and I haven't had a change to
upload an updated version. If you can modify the makefile yourself (just
add print_infrastructure.o to the list of object files and
print_infrastructure.ec to the list of source files), fine, otherwise send
me an email and I'll reply with the update attached. That goes for anyone
else also.
I'm testing another new feature and I will upload a new version once that's
shaken out.
Art
Art S. Kagel
Advanced DataTools (www.advancedatatools.com)
Blog: http://informix-myview.blogspot.com/
Disclaimer: Please keep in mind that my own opinions are my own opinions and
do not reflect on my employer, Advanced DataTools, the IIUG, nor any other
organization with which I am associated either explicitly, implicitly, or by
inference. Neither do those opinions reflect those of other individuals
affiliated with any entity with which I am affiliated nor those of the
entities themselves.
On Wed, Jul 13, 2011 at 7:48 AM, DAN MUELLER <dan.mueller@trnswrks.com>wrote:
> Good Morning
>
> IDS 11.50.FC5
> O/S AIX 5.3
>
> Does anyone out there have a script that will generate all of the onspaces
> commands it would take to clone the dbspace/chunk part of an online
> instance?
> Not interested in the data at this point, only the structure.
>
> TIA,
> Dan
>
>
>
>
*******************************************************************************
> Forum Note: Use "Reply" to post a response in the discussion forum.
>
>
--bcaec53f918508e57c04a7f2641f
Oh, it is 11.50 so this dbscema is not working.
H
On 13.07.2011. 14:12, Hrvoje Zokovic wrote:
> how about "dbschema -c" od "dbschema -c -ns"
> HTH
> Hrvoje
>
> On 13.07.2011. 13:48, DAN MUELLER wrote:
>> Good Morning
>>
>> IDS 11.50.FC5
>> O/S AIX 5.3
>>
>> Does anyone out there have a script that will generate all of the onspaces
>> commands it would take to clone the dbspace/chunk part of an online
> instance?
>> Not interested in the data at this point, only the structure.
>>
>> TIA,
>> Dan
>>
>>
>>
>
*******************************************************************************
>> Forum Note: Use "Reply" to post a response in the discussion forum.
>>
>>
>
>
*******************************************************************************
> Forum Note: Use "Reply" to post a response in the discussion forum.
>
>
A starting point follows. This was done some years ago and may not
include all the nuances from 11.50 or 11.70. It gets the base dbspaces
but not sbspaces or blobspaces, although each of those is just another
union to be added.
unload to "/tmp/mkspaces.sh" delimiter ";"
select "onspaces -c -d " || trim(d.name)
|| case when is_temp = 1 then " -t " else " " end
|| " -p " || trim(c.fname)
|| " -o " || c.offset * 2 || " -s " || c.chksize * 2
from sysdbspaces d, syschunks c
where d.fchunk = c.chknum
and d.is_blobspace = 0
and d.is_sbspace = 0
and d.dbsnum > 1
union all
select "onspaces -a " || trim(d.name)
|| " -p " || trim(c.fname)
|| " -o " || c.offset * 2 || " -s " || c.chksize * 2
from sysdbspaces d, syschunks c
where d.dbsnum = c.dbsnum
and d.nchunks > 1
and d.fchunk <> c.chknum
and d.is_blobspace = 0
and d.is_sbspace = 0;
Cheers,
Dick Snoke
IBM ChannelWorks
dsnoke@us.ibm.com
(404) 487-1595
From: "DAN MUELLER" <dan.mueller@trnswrks.com>
To: ids@iiug.org
Date: 07/13/11 07:51 AM
Subject: Script to Generate Onspaces Commands [24337]
Sent by: ids-bounces@iiug.org
Good Morning
IDS 11.50.FC5
O/S AIX 5.3
Does anyone out there have a script that will generate all of the onspaces
commands it would take to clone the dbspace/chunk part of an online
instance?
Not interested in the data at this point, only the structure.
TIA,
Dan
*******************************************************************************
Forum Note: Use "Reply" to post a response in the discussion forum.
Thanx Guys, I have more than one option to get what I need. I appreciate the help. Dan
Hi Dan,
Hope you are doing fine .. :-)
I had written a script to create the onspaces command for exactly what you
are trying to do .. but as you can imagine it was written for version 7 and
9 .. so it may require some tweaks. Its essentially a ksh + awk script.
Hope this helps.
(See attached file: create_onspaces.ksh)
Thanx much,
Rajib Sarkar
Sr. Technical Analyst
DB2 UDB APD Team
IBM Data Management Group
Ph : (602)-217-2100
Fax: (602)-217-2100
T/L : 667-2100
http://www.ibm.com/software/data/db2/udb/support/
From his neck down a man is worth a couple of dollars a day, from his neck
up he is worth anything that his brain can produce. -- T. Edison
From: "DAN MUELLER" <dan.mueller@trnswrks.com>
To: ids@iiug.org
Date: 07/13/2011 04:48 AM
Subject: Script to Generate Onspaces Commands [24337]
Sent by: ids-bounces@iiug.org
Good Morning
IDS 11.50.FC5
O/S AIX 5.3
Does anyone out there have a script that will generate all of the onspaces
commands it would take to clone the dbspace/chunk part of an online
instance?
Not interested in the data at this point, only the structure.
TIA,
Dan
*******************************************************************************
Forum Note: Use "Reply" to post a response in the discussion forum.
Hello Sir,
Can you help me as to how do we use this command (i.e. "dbschema -c" od
"dbschema -c -ns") ?
I tried using it and it displayed the different options available under the
dbschema command (i.e. similar to the output of "dbschema --" command)
I would want to use this command to clone the exiting INFORMIXSERVER called
"olr_serverA". A similar box is already available. I just needed the
onspaces command from the exiting INFORMIXSERVER (olr_serverA) to make
another similar INFORMIXSERVER on another box called "(olr_model_env").
Kindly help me to extract this onspaces output.
Neville.
On Wed, Jul 13, 2011 at 5:42 PM, Hrvoje Zokovic <hzokovic.iiug@gmail.com>wrote:
> how about "dbschema -c" od "dbschema -c -ns"
> HTH
> Hrvoje
>
> On 13.07.2011. 13:48, DAN MUELLER wrote:
> > Good Morning
> >
> > IDS 11.50.FC5
> > O/S AIX 5.3
> >
> > Does anyone out there have a script that will generate all of the
> onspaces> > commands it would take to clone the dbspace/chunk part of an online
> instance?
> > Not interested in the data at this point, only the structure.
> >
> > TIA,
> > Dan
> >
> >
> >
>
>
*******************************************************************************
> > Forum Note: Use "Reply" to post a response in the discussion forum.
> >
> >
>
>
>
>
*******************************************************************************
> Forum Note: Use "Reply" to post a response in the discussion forum.
>
>
--
Warm Regards,
Neville Monteiro.
--00151747b59490478504a7fffb34
HI Neville,
You have to specify database name using -d option along with that, like
below
dbschema -d stores_demo -c -ns
Thanks,
Harsha
From: "Neville Monteiro" <nevillemonteiro@gmail.com>
To: ids@iiug.org
Date: 14/07/2011 10:00 AM
Subject: Re: Script to Generate Onspaces Commands [24360]
Sent by: ids-bounces@iiug.org
Hello Sir,
Can you help me as to how do we use this command (i.e. "dbschema -c" od
"dbschema -c -ns") ?
I tried using it and it displayed the different options available under
the
dbschema command (i.e. similar to the output of "dbschema --" command)
I would want to use this command to clone the exiting INFORMIXSERVER
called
"olr_serverA". A similar box is already available. I just needed the
onspaces command from the exiting INFORMIXSERVER (olr_serverA) to make
another similar INFORMIXSERVER on another box called "(olr_model_env").
Kindly help me to extract this onspaces output.
Neville.
On Wed, Jul 13, 2011 at 5:42 PM, Hrvoje Zokovic
<hzokovic.iiug@gmail.com>wrote:
> how about "dbschema -c" od "dbschema -c -ns"
> HTH
> Hrvoje
>
> On 13.07.2011. 13:48, DAN MUELLER wrote:
> > Good Morning
> >
> > IDS 11.50.FC5
> > O/S AIX 5.3
> >
> > Does anyone out there have a script that will generate all of the
> onspaces> > commands it would take to clone the dbspace/chunk part of an online
> instance?
> > Not interested in the data at this point, only the structure.
> >
> > TIA,
> > Dan
> >
> >
> >
>
>
*******************************************************************************
> > Forum Note: Use "Reply" to post a response in the discussion forum.
> >
> >
>
>
>
>
*******************************************************************************
> Forum Note: Use "Reply" to post a response in the discussion forum.
>
>
--
Warm Regards,
Neville Monteiro.
--00151747b59490478504a7fffb34
*******************************************************************************
Forum Note: Use "Reply" to post a response in the discussion forum.
dbschema -c is first available for version 11.70. If you have an earlierversion you either have to write some scripts or you can try the new
--infrastructure option to my dbschema replacement utility, myschema, in my
utils2_ak package. If you have trouble compiling the package let me know
and I'll send you an update.
Art
Art S. Kagel
Advanced DataTools (www.advancedatatools.com)
Blog: http://informix-myview.blogspot.com/
Disclaimer: Please keep in mind that my own opinions are my own opinions and
do not reflect on my employer, Advanced DataTools, the IIUG, nor any other
organization with which I am associated either explicitly, implicitly, or by
inference. Neither do those opinions reflect those of other individuals
affiliated with any entity with which I am affiliated nor those of the
entities themselves.
On Thu, Jul 14, 2011 at 12:29 AM, Neville Monteiro <
nevillemonteiro@gmail.com> wrote:
> Hello Sir,
>
> Can you help me as to how do we use this command (i.e. "dbschema -c" od
> "dbschema -c -ns") ?
> I tried using it and it displayed the different options available under the
> dbschema command (i.e. similar to the output of "dbschema --" command)
> I would want to use this command to clone the exiting INFORMIXSERVER called
> "olr_serverA". A similar box is already available. I just needed the
> onspaces command from the exiting INFORMIXSERVER (olr_serverA) to make
> another similar INFORMIXSERVER on another box called "(olr_model_env").
>
> Kindly help me to extract this onspaces output.
>
> Neville.
>
> On Wed, Jul 13, 2011 at 5:42 PM, Hrvoje Zokovic
> <hzokovic.iiug@gmail.com>wrote:
>
> > how about "dbschema -c" od "dbschema -c -ns"
> > HTH
> > Hrvoje
> >
> > On 13.07.2011. 13:48, DAN MUELLER wrote:
> > > Good Morning
> > >
> > > IDS 11.50.FC5
> > > O/S AIX 5.3
> > >
> > > Does anyone out there have a script that will generate all of the
> > onspaces> > > commands it would take to clone the dbspace/chunk part of an online
> > instance?
> > > Not interested in the data at this point, only the structure.
> > >
> > > TIA,
> > > Dan
> > >
> > >
> > >
> >
> >
>
>
*******************************************************************************
> > > Forum Note: Use "Reply" to post a response in the discussion forum.
> > >
> > >
> >
> >
> >
> >
>
>
*******************************************************************************
> > Forum Note: Use "Reply" to post a response in the discussion forum.
> >
> >
>
> --
> Warm Regards,
> Neville Monteiro.
>
> --00151747b59490478504a7fffb34
>
>
>
>
*******************************************************************************
> Forum Note: Use "Reply" to post a response in the discussion forum.
>
>
--20cf3071ceeaac91b804a80557e0
Gettin wordy in your old age, Jack. Art Art S. Kagel Advanced DataTools (www.advancedatatools.com) Blog: http://informix-myview.blogspot.com/ Disclaimer: Please keep in mind that my own opinions are my own opinions and do not reflect on my employer, Advanced DataTools, the IIUG, nor any other organization with which I am associated either explicitly, implicitly, or by inference. Neither do those opinions reflect those of other individuals affiliated with any entity with which I am affiliated nor those of the entities themselves. On Thu, Jul 14, 2011 at 7:03 AM, Jack Parker <jack.parker4@verizon.net>wrote: > > > > ******************************************************************************* > Forum Note: Use "Reply" to post a response in the discussion forum. > > --bcaec53f9185d7c6a904a8058366
Ok, so much for my script. It is so good at cleaning up, it cleans = itself out of the message. j. On Jul 14, 2011, at 7:05 AM, Art Kagel wrote: > Gettin wordy in your old age, Jack.=20 >=20 > Art=20 >=20 > Art S. Kagel=20 > Advanced DataTools (www.advancedatatools.com)=20 > Blog: http://informix-myview.blogspot.com/=20 >=20 > Disclaimer: Please keep in mind that my own opinions are my own = opinions and=20 > do not reflect on my employer, Advanced DataTools, the IIUG, nor any = other=20 > organization with which I am associated either explicitly, implicitly, = or by=20 > inference. Neither do those opinions reflect those of other = individuals=20 > affiliated with any entity with which I am affiliated nor those of the=20= > entities themselves.=20 >=20 > On Thu, Jul 14, 2011 at 7:03 AM, Jack Parker = <jack.parker4@verizon.net>wrote:=20 >=20 >>=20 >>=20 >>=20 >>=20 > = **************************************************************************= *****=20 >> Forum Note: Use "Reply" to post a response in the discussion forum.=20= >>=20 >>=20 >=20 > --bcaec53f9185d7c6a904a8058366=20 >=20 >=20 > = **************************************************************************= *****=20 > Forum Note: Use "Reply" to post a response in the discussion forum.=20= >=20
Let's see if this mailer is any better. This is a script I threw together sometime back when I was exploring perl. j.
On 13/07/2011 13:12, Hrvoje Zokovic wrote:
> how about "dbschema -c" od "dbschema -c -ns"
> HTH
> Hrvoje
>
> On 13.07.2011. 13:48, DAN MUELLER wrote:
>> Good Morning
>>
>> IDS 11.50.FC5
>> O/S AIX 5.3
Does that work in 11.50?
--
Cheers,
Obnoxio The Clown
http://obotheclown.blogspot.com
I will now proceed to pleasure myself with this fish.
No, just in 11.70
H
On 14.07.2011. 23:11, Obnoxio The Clown wrote:
> On 13/07/2011 13:12, Hrvoje Zokovic wrote:
>> how about "dbschema -c" od "dbschema -c -ns"
>> HTH
>> Hrvoje
>>
>> On 13.07.2011. 13:48, DAN MUELLER wrote:
>>> Good Morning
>>>
>>> IDS 11.50.FC5
>>> O/S AIX 5.3
> Does that work in 11.50?
>