Here is the step by step for Netezza DB renaming & changing ownership.
SYSTEM.ADMIN(ADMIN)=> select DATABASE,OWNER,CREATEDATE from _v_database where DATABASE='NZ_PRD1_NEW';
DATABASE | OWNER | CREATEDATE
--------------+-------+---------------------
NZ_PRD1_NEW | ADMIN | 2018-03-21 18:47:00
(1 row)
SYSTEM.ADMIN(ADMIN)=> alter database NZ_PRD1_NEW rename to NZ_PRD1_NEW1;
ALTER DATABASE
SYSTEM.ADMIN(ADMIN)=> select DATABASE,OWNER,CREATEDATE from _v_database where DATABASE='NZ_PRD1_NEW1';
DATABASE | OWNER | CREATEDATE
---------------+-------+---------------------
NZ_PRD1_NEW1 | ADMIN | 2018-03-21 18:47:00
(1 row)
SYSTEM.ADMIN(ADMIN)=> alter database NZ_PRD1_NEW1 owner to admin;
ALTER DATABASE
SYSTEM.ADMIN(ADMIN)=> select DATABASE,OWNER,CREATEDATE from _v_database where DATABASE='NZ_PRD1_NEW1';
DATABASE | OWNER | CREATEDATE
---------------+---------+---------------------
NZ_PRD1_NEW1 | ADMIN | 2018-03-21 18:47:00
(1 row)
SYSTEM.ADMIN(ADMIN)=> drop database NZ_PRD1_NEW1;
DROP DATABASE
SYSTEM.ADMIN(ADMIN)=> select DATABASE,OWNER,CREATEDATE from _v_database where DATABASE='NZ_PRD1_NEW1';
DATABASE | OWNER | CREATEDATE
----------+-------+------------
(0 rows)
SYSTEM.ADMIN(ADMIN)=> select DATABASE,OWNER,CREATEDATE from _v_database where DATABASE='NZ_PRD1_NEW';
DATABASE | OWNER | CREATEDATE
--------------+-------+---------------------
NZ_PRD1_NEW | ADMIN | 2018-03-21 18:47:00
(1 row)
SYSTEM.ADMIN(ADMIN)=> alter database NZ_PRD1_NEW rename to NZ_PRD1_NEW1;
ALTER DATABASE
SYSTEM.ADMIN(ADMIN)=> select DATABASE,OWNER,CREATEDATE from _v_database where DATABASE='NZ_PRD1_NEW1';
DATABASE | OWNER | CREATEDATE
---------------+-------+---------------------
NZ_PRD1_NEW1 | ADMIN | 2018-03-21 18:47:00
(1 row)
SYSTEM.ADMIN(ADMIN)=> alter database NZ_PRD1_NEW1 owner to admin;
ALTER DATABASE
SYSTEM.ADMIN(ADMIN)=> select DATABASE,OWNER,CREATEDATE from _v_database where DATABASE='NZ_PRD1_NEW1';
DATABASE | OWNER | CREATEDATE
---------------+---------+---------------------
NZ_PRD1_NEW1 | ADMIN | 2018-03-21 18:47:00
(1 row)
SYSTEM.ADMIN(ADMIN)=> drop database NZ_PRD1_NEW1;
DROP DATABASE
SYSTEM.ADMIN(ADMIN)=> select DATABASE,OWNER,CREATEDATE from _v_database where DATABASE='NZ_PRD1_NEW1';
DATABASE | OWNER | CREATEDATE
----------+-------+------------
(0 rows)
No comments:
Post a Comment