Can we alter the dbspace of a informix table?
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}
Suppose I have following schema.
create table tb1
(col1 Integer,
col2 varchar(50)
) in dbspace1 extent size 1000 next 500 lock mode row;
and I want to change the dbspace of above table to dbspace2 . After doing my alteration table schema should be look like as follows .
create table tb1
(col1 Integer,
col2 varchar(50)
) in dbspace2 extent size 1000 next 500 lock mode row;
Is it possible to do? If it is possible what is the command?
informix
add a comment |
Suppose I have following schema.
create table tb1
(col1 Integer,
col2 varchar(50)
) in dbspace1 extent size 1000 next 500 lock mode row;
and I want to change the dbspace of above table to dbspace2 . After doing my alteration table schema should be look like as follows .
create table tb1
(col1 Integer,
col2 varchar(50)
) in dbspace2 extent size 1000 next 500 lock mode row;
Is it possible to do? If it is possible what is the command?
informix
add a comment |
Suppose I have following schema.
create table tb1
(col1 Integer,
col2 varchar(50)
) in dbspace1 extent size 1000 next 500 lock mode row;
and I want to change the dbspace of above table to dbspace2 . After doing my alteration table schema should be look like as follows .
create table tb1
(col1 Integer,
col2 varchar(50)
) in dbspace2 extent size 1000 next 500 lock mode row;
Is it possible to do? If it is possible what is the command?
informix
Suppose I have following schema.
create table tb1
(col1 Integer,
col2 varchar(50)
) in dbspace1 extent size 1000 next 500 lock mode row;
and I want to change the dbspace of above table to dbspace2 . After doing my alteration table schema should be look like as follows .
create table tb1
(col1 Integer,
col2 varchar(50)
) in dbspace2 extent size 1000 next 500 lock mode row;
Is it possible to do? If it is possible what is the command?
informix
informix
asked Jan 3 at 4:51
NwnNwn
14113
14113
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
On the face of it, the ALTER FRAGMENT
statement and the INIT
clause allows you to write:
ALTER FRAGMENT ON TABLE tb1 INIT IN dbspace2;
The keyword TABLE is required; you could specify an index instead.
I've not actually experimented to prove that it works, but the syntax diagram certainly allows it.
I tried with that and it seems works. I can see empty chunks are filling on dbspace2. Can I change the default dbspace of the database to this new dbspace2. Because I'm going to remove dbspace1
– Nwn
Jan 3 at 9:22
2
Nope. In Informix you cannot alter the base dbspace of a database. You will have to create a new database on the dbspace of your choice, if you want to change it. If the database was created indbspace1
, all the sys catalog tables were also created in that dbspace.
– Luís Marques
Jan 3 at 16:52
1
Probably, but I'd make sure I have a backup first.
– Jonathan Leffler
Jan 7 at 5:46
1
Yes; the message means that ONLINE cannot be used with that operation. It's likely because it is changing the dbspace; ONLINE operations tend not to involve cross-dbspace operations.
– Jonathan Leffler
Jan 8 at 5:12
1
Life is about to get interesting. I suspect that you may need to use something other than the INIT clause to ALTER FRAGMENT. For example, you may need to add another fragment in the other dbspace and ensure that all new rows are placed in the new fragment. Then you arrange to (slowly) update the old rows so that they migrate from the old fragment to the new; then you drop the now empty old fragment. I'd need to do some experimentation, though, to be sure it is doable.
– Jonathan Leffler
Jan 17 at 7:43
|
show 4 more comments
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54016519%2fcan-we-alter-the-dbspace-of-a-informix-table%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
On the face of it, the ALTER FRAGMENT
statement and the INIT
clause allows you to write:
ALTER FRAGMENT ON TABLE tb1 INIT IN dbspace2;
The keyword TABLE is required; you could specify an index instead.
I've not actually experimented to prove that it works, but the syntax diagram certainly allows it.
I tried with that and it seems works. I can see empty chunks are filling on dbspace2. Can I change the default dbspace of the database to this new dbspace2. Because I'm going to remove dbspace1
– Nwn
Jan 3 at 9:22
2
Nope. In Informix you cannot alter the base dbspace of a database. You will have to create a new database on the dbspace of your choice, if you want to change it. If the database was created indbspace1
, all the sys catalog tables were also created in that dbspace.
– Luís Marques
Jan 3 at 16:52
1
Probably, but I'd make sure I have a backup first.
– Jonathan Leffler
Jan 7 at 5:46
1
Yes; the message means that ONLINE cannot be used with that operation. It's likely because it is changing the dbspace; ONLINE operations tend not to involve cross-dbspace operations.
– Jonathan Leffler
Jan 8 at 5:12
1
Life is about to get interesting. I suspect that you may need to use something other than the INIT clause to ALTER FRAGMENT. For example, you may need to add another fragment in the other dbspace and ensure that all new rows are placed in the new fragment. Then you arrange to (slowly) update the old rows so that they migrate from the old fragment to the new; then you drop the now empty old fragment. I'd need to do some experimentation, though, to be sure it is doable.
– Jonathan Leffler
Jan 17 at 7:43
|
show 4 more comments
On the face of it, the ALTER FRAGMENT
statement and the INIT
clause allows you to write:
ALTER FRAGMENT ON TABLE tb1 INIT IN dbspace2;
The keyword TABLE is required; you could specify an index instead.
I've not actually experimented to prove that it works, but the syntax diagram certainly allows it.
I tried with that and it seems works. I can see empty chunks are filling on dbspace2. Can I change the default dbspace of the database to this new dbspace2. Because I'm going to remove dbspace1
– Nwn
Jan 3 at 9:22
2
Nope. In Informix you cannot alter the base dbspace of a database. You will have to create a new database on the dbspace of your choice, if you want to change it. If the database was created indbspace1
, all the sys catalog tables were also created in that dbspace.
– Luís Marques
Jan 3 at 16:52
1
Probably, but I'd make sure I have a backup first.
– Jonathan Leffler
Jan 7 at 5:46
1
Yes; the message means that ONLINE cannot be used with that operation. It's likely because it is changing the dbspace; ONLINE operations tend not to involve cross-dbspace operations.
– Jonathan Leffler
Jan 8 at 5:12
1
Life is about to get interesting. I suspect that you may need to use something other than the INIT clause to ALTER FRAGMENT. For example, you may need to add another fragment in the other dbspace and ensure that all new rows are placed in the new fragment. Then you arrange to (slowly) update the old rows so that they migrate from the old fragment to the new; then you drop the now empty old fragment. I'd need to do some experimentation, though, to be sure it is doable.
– Jonathan Leffler
Jan 17 at 7:43
|
show 4 more comments
On the face of it, the ALTER FRAGMENT
statement and the INIT
clause allows you to write:
ALTER FRAGMENT ON TABLE tb1 INIT IN dbspace2;
The keyword TABLE is required; you could specify an index instead.
I've not actually experimented to prove that it works, but the syntax diagram certainly allows it.
On the face of it, the ALTER FRAGMENT
statement and the INIT
clause allows you to write:
ALTER FRAGMENT ON TABLE tb1 INIT IN dbspace2;
The keyword TABLE is required; you could specify an index instead.
I've not actually experimented to prove that it works, but the syntax diagram certainly allows it.
answered Jan 3 at 6:28


Jonathan LefflerJonathan Leffler
574k956881041
574k956881041
I tried with that and it seems works. I can see empty chunks are filling on dbspace2. Can I change the default dbspace of the database to this new dbspace2. Because I'm going to remove dbspace1
– Nwn
Jan 3 at 9:22
2
Nope. In Informix you cannot alter the base dbspace of a database. You will have to create a new database on the dbspace of your choice, if you want to change it. If the database was created indbspace1
, all the sys catalog tables were also created in that dbspace.
– Luís Marques
Jan 3 at 16:52
1
Probably, but I'd make sure I have a backup first.
– Jonathan Leffler
Jan 7 at 5:46
1
Yes; the message means that ONLINE cannot be used with that operation. It's likely because it is changing the dbspace; ONLINE operations tend not to involve cross-dbspace operations.
– Jonathan Leffler
Jan 8 at 5:12
1
Life is about to get interesting. I suspect that you may need to use something other than the INIT clause to ALTER FRAGMENT. For example, you may need to add another fragment in the other dbspace and ensure that all new rows are placed in the new fragment. Then you arrange to (slowly) update the old rows so that they migrate from the old fragment to the new; then you drop the now empty old fragment. I'd need to do some experimentation, though, to be sure it is doable.
– Jonathan Leffler
Jan 17 at 7:43
|
show 4 more comments
I tried with that and it seems works. I can see empty chunks are filling on dbspace2. Can I change the default dbspace of the database to this new dbspace2. Because I'm going to remove dbspace1
– Nwn
Jan 3 at 9:22
2
Nope. In Informix you cannot alter the base dbspace of a database. You will have to create a new database on the dbspace of your choice, if you want to change it. If the database was created indbspace1
, all the sys catalog tables were also created in that dbspace.
– Luís Marques
Jan 3 at 16:52
1
Probably, but I'd make sure I have a backup first.
– Jonathan Leffler
Jan 7 at 5:46
1
Yes; the message means that ONLINE cannot be used with that operation. It's likely because it is changing the dbspace; ONLINE operations tend not to involve cross-dbspace operations.
– Jonathan Leffler
Jan 8 at 5:12
1
Life is about to get interesting. I suspect that you may need to use something other than the INIT clause to ALTER FRAGMENT. For example, you may need to add another fragment in the other dbspace and ensure that all new rows are placed in the new fragment. Then you arrange to (slowly) update the old rows so that they migrate from the old fragment to the new; then you drop the now empty old fragment. I'd need to do some experimentation, though, to be sure it is doable.
– Jonathan Leffler
Jan 17 at 7:43
I tried with that and it seems works. I can see empty chunks are filling on dbspace2. Can I change the default dbspace of the database to this new dbspace2. Because I'm going to remove dbspace1
– Nwn
Jan 3 at 9:22
I tried with that and it seems works. I can see empty chunks are filling on dbspace2. Can I change the default dbspace of the database to this new dbspace2. Because I'm going to remove dbspace1
– Nwn
Jan 3 at 9:22
2
2
Nope. In Informix you cannot alter the base dbspace of a database. You will have to create a new database on the dbspace of your choice, if you want to change it. If the database was created in
dbspace1
, all the sys catalog tables were also created in that dbspace.– Luís Marques
Jan 3 at 16:52
Nope. In Informix you cannot alter the base dbspace of a database. You will have to create a new database on the dbspace of your choice, if you want to change it. If the database was created in
dbspace1
, all the sys catalog tables were also created in that dbspace.– Luís Marques
Jan 3 at 16:52
1
1
Probably, but I'd make sure I have a backup first.
– Jonathan Leffler
Jan 7 at 5:46
Probably, but I'd make sure I have a backup first.
– Jonathan Leffler
Jan 7 at 5:46
1
1
Yes; the message means that ONLINE cannot be used with that operation. It's likely because it is changing the dbspace; ONLINE operations tend not to involve cross-dbspace operations.
– Jonathan Leffler
Jan 8 at 5:12
Yes; the message means that ONLINE cannot be used with that operation. It's likely because it is changing the dbspace; ONLINE operations tend not to involve cross-dbspace operations.
– Jonathan Leffler
Jan 8 at 5:12
1
1
Life is about to get interesting. I suspect that you may need to use something other than the INIT clause to ALTER FRAGMENT. For example, you may need to add another fragment in the other dbspace and ensure that all new rows are placed in the new fragment. Then you arrange to (slowly) update the old rows so that they migrate from the old fragment to the new; then you drop the now empty old fragment. I'd need to do some experimentation, though, to be sure it is doable.
– Jonathan Leffler
Jan 17 at 7:43
Life is about to get interesting. I suspect that you may need to use something other than the INIT clause to ALTER FRAGMENT. For example, you may need to add another fragment in the other dbspace and ensure that all new rows are placed in the new fragment. Then you arrange to (slowly) update the old rows so that they migrate from the old fragment to the new; then you drop the now empty old fragment. I'd need to do some experimentation, though, to be sure it is doable.
– Jonathan Leffler
Jan 17 at 7:43
|
show 4 more comments
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54016519%2fcan-we-alter-the-dbspace-of-a-informix-table%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown