0

I'm able to create a new dbspace using the semi-gui tool onmonitor (running a headless Linux server)

But how can I do this from cmd-line / script?

It seems you can use onspaces like

onspaces -c -d $DBSname -p $DBSfile -o 0 -s 153600

But AFAIK it require the IDS server is running in one of these modes online, quiescent or administration and this seems only possible to start the server if there already exist a dbspace.

Or am I missing something?

Can you really only setup a new server using the init menu in onmonitor?

6
  • If you're managing to use ON-Monitor, you must be using an archaic version of Informix; it was removed from the product many years ago. Commented Jul 27 at 21:59
  • The server will create the root dbspace when you initialize it, using the information from the $ONCONFIG file. Other dbspaces can be added using onspaces as shown when the server is up and running. You can't add dbspaces to an as-yet-uninitialized server. And, because the server must take action to record that the new dbspace is part of the data it manages, you can't add a dbspace to a server that is not not running. Commented Jul 27 at 22:03
  • Incidentally, ON-Monitor would not be able to add a dbspace to a server that is not running. Commented Jul 27 at 22:06
  • Hi Jonathan, I'm running ver. 11.70 (it's out of my hands to change/upgrade). And yes, I definitely can create (initialize) the first root dbspace with onmonitor. But to get back to my question: can I use another tool and how, than onmonitor, to do this (which I can run from cmd/script)? Commented Jul 28 at 5:02
  • 1
    Using oninit with the -i option to initialize a server, you can create the root dbspace for a server. Note that this will destroy any data already associated with any previous incarnation of the server. It is dangerous and only to be used when you're sure you want to (re)initialize a server. Using oninit without the -i option will run the server again after it is created. There are multiple other options, but AFAICR, none of them add a dbspace. To add a dbspace, use the onspaces command; that's what it is for. Commented Jul 30 at 3:23

1 Answer 1

1

Use the command oninit -i

You still have create the file manually (e.g. touch $DBSFile) and set properties in onconfig

3
  • My immediate reaction was: "Using oninit -i initializes the server, which is not what I think the question asked about. It was asking about how to add a dbspace (presumably to a running server)." However, I see you asked the question too, so as long as you're aware that oninit -i is dangerous (something you normally do once for a given server — unless you work in R&D, in which case you rebuild servers frequently), then this may be the right answer for your scenario, but I feel your scenario is not as clearly described as it could be. Commented Jul 30 at 3:27
  • Be aware that ON-Monitor is not a part of IDS 12.10 or later versions of Informix. You will have to wean yourself off it if you ever upgrade. You might use Informix HQ instead. Commented Jul 30 at 3:27
  • It's exactly for training/testing, that's why I need to do it by cmd/script. I've rephrased the title, thanks for the feedback. Commented Jul 30 at 6:39

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.