You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@trafodion.apache.org by "Liu, Yuan (Yuan)" <yu...@esgyn.cn> on 2018/06/30 02:30:12 UTC

How to rename schema name quickly

Hi Trafodioneers,

I want to modify a schema name, but it seems we don't support below syntax.

>>alter schema aaa rename to bbb;

*** ERROR[3242] This statement is not supported. Reason: Cannot rename a schema.

I have a lot of tables under the schema, do we have a quick approach to rename schema name?


Best regards
Yuan



RE: How to rename schema name quickly

Posted by "Liu, Yuan (Yuan)" <yu...@esgyn.cn>.
Thanks Anoop.



Best regards

刘源(Yuan)
上海易鲸捷信息技术有限公司
地址:上海市浦东新区金科路2889号长泰广场A座603
手机:13671935540
邮箱:yuan.liu@esgyn.cn 


-----Original Message-----
From: Anoop Sharma <an...@esgyn.com> 
Sent: Saturday, June 30, 2018 12:16 PM
To: user@trafodion.apache.org; dev@trafodion.apache.org
Subject: RE: How to rename schema name quickly

hi
  that operation is not supported as it is not a quick, metadata only change.

Every traf table under a schema <sch> has corresponding hbase object of form: TRAFODION.<sch>.<tab>.
Which means that all physical HBase objects need to be renamed/copied to the other name of the form TRAFODION.<schnew>.<tab>.

In addition, all metadata entries where names are stored will also need to be renamed.
This includes view text, constraint text, etc.
In fact, a table rename operation is not allowed if there are views/check_constraints on it.
 So bottom line. Renaming a schema, even if allowed, is an expensive operation assuming there are no dependent objects on it.

  You should generate a script what has 'alter table rename' clause for all tables in that schema. And then obey  that script. If there are dependent objects, they will need to be dropped and recreated.

anoop

From: Liu, Yuan (Yuan) <yu...@esgyn.cn>
Sent: Friday, June 29, 2018 7:30 PM
To: dev@trafodion.apache.org; user@trafodion.apache.org
Subject: How to rename schema name quickly

Hi Trafodioneers,

I want to modify a schema name, but it seems we don't support below syntax.

>>alter schema aaa rename to bbb;

*** ERROR[3242] This statement is not supported. Reason: Cannot rename a schema.

I have a lot of tables under the schema, do we have a quick approach to rename schema name?


Best regards
Yuan



RE: How to rename schema name quickly

Posted by "Liu, Yuan (Yuan)" <yu...@esgyn.cn>.
Thanks Anoop.



Best regards

刘源(Yuan)
上海易鲸捷信息技术有限公司
地址:上海市浦东新区金科路2889号长泰广场A座603
手机:13671935540
邮箱:yuan.liu@esgyn.cn 


-----Original Message-----
From: Anoop Sharma <an...@esgyn.com> 
Sent: Saturday, June 30, 2018 12:16 PM
To: user@trafodion.apache.org; dev@trafodion.apache.org
Subject: RE: How to rename schema name quickly

hi
  that operation is not supported as it is not a quick, metadata only change.

Every traf table under a schema <sch> has corresponding hbase object of form: TRAFODION.<sch>.<tab>.
Which means that all physical HBase objects need to be renamed/copied to the other name of the form TRAFODION.<schnew>.<tab>.

In addition, all metadata entries where names are stored will also need to be renamed.
This includes view text, constraint text, etc.
In fact, a table rename operation is not allowed if there are views/check_constraints on it.
 So bottom line. Renaming a schema, even if allowed, is an expensive operation assuming there are no dependent objects on it.

  You should generate a script what has 'alter table rename' clause for all tables in that schema. And then obey  that script. If there are dependent objects, they will need to be dropped and recreated.

anoop

From: Liu, Yuan (Yuan) <yu...@esgyn.cn>
Sent: Friday, June 29, 2018 7:30 PM
To: dev@trafodion.apache.org; user@trafodion.apache.org
Subject: How to rename schema name quickly

Hi Trafodioneers,

I want to modify a schema name, but it seems we don't support below syntax.

>>alter schema aaa rename to bbb;

*** ERROR[3242] This statement is not supported. Reason: Cannot rename a schema.

I have a lot of tables under the schema, do we have a quick approach to rename schema name?


Best regards
Yuan



RE: How to rename schema name quickly

Posted by Anoop Sharma <an...@esgyn.com>.
hi
  that operation is not supported as it is not a quick, metadata only change.

Every traf table under a schema <sch> has corresponding hbase object of form: TRAFODION.<sch>.<tab>.
Which means that all physical HBase objects need to be renamed/copied to the other
name of the form TRAFODION.<schnew>.<tab>.

In addition, all metadata entries where names are stored will also need to be renamed.
This includes view text, constraint text, etc.
In fact, a table rename operation is not allowed if there are views/check_constraints on it.
 So bottom line. Renaming a schema, even if allowed, is an expensive operation assuming
there are no dependent objects on it.

  You should generate a script what has 'alter table rename' clause for all tables in that
schema. And then obey  that script. If there are dependent objects, they will need to be dropped
and recreated.

anoop

From: Liu, Yuan (Yuan) <yu...@esgyn.cn>
Sent: Friday, June 29, 2018 7:30 PM
To: dev@trafodion.apache.org; user@trafodion.apache.org
Subject: How to rename schema name quickly

Hi Trafodioneers,

I want to modify a schema name, but it seems we don't support below syntax.

>>alter schema aaa rename to bbb;

*** ERROR[3242] This statement is not supported. Reason: Cannot rename a schema.

I have a lot of tables under the schema, do we have a quick approach to rename schema name?


Best regards
Yuan



RE: How to rename schema name quickly

Posted by Anoop Sharma <an...@esgyn.com>.
hi
  that operation is not supported as it is not a quick, metadata only change.

Every traf table under a schema <sch> has corresponding hbase object of form: TRAFODION.<sch>.<tab>.
Which means that all physical HBase objects need to be renamed/copied to the other
name of the form TRAFODION.<schnew>.<tab>.

In addition, all metadata entries where names are stored will also need to be renamed.
This includes view text, constraint text, etc.
In fact, a table rename operation is not allowed if there are views/check_constraints on it.
 So bottom line. Renaming a schema, even if allowed, is an expensive operation assuming
there are no dependent objects on it.

  You should generate a script what has 'alter table rename' clause for all tables in that
schema. And then obey  that script. If there are dependent objects, they will need to be dropped
and recreated.

anoop

From: Liu, Yuan (Yuan) <yu...@esgyn.cn>
Sent: Friday, June 29, 2018 7:30 PM
To: dev@trafodion.apache.org; user@trafodion.apache.org
Subject: How to rename schema name quickly

Hi Trafodioneers,

I want to modify a schema name, but it seems we don't support below syntax.

>>alter schema aaa rename to bbb;

*** ERROR[3242] This statement is not supported. Reason: Cannot rename a schema.

I have a lot of tables under the schema, do we have a quick approach to rename schema name?


Best regards
Yuan