Changing the owner of a history database

Each database has an owner. To change the owner of a history database, alter both the database and the history configuration to reflect the new ownership.

About this task

To change the ownership of a history database:

Procedure

  1. Log in to the Netezza Performance Server system as the nz user.
  2. If the new owner does not already have a user account, create one.
    For example:
    nzsql -c "create user sam with password 'sk3nk'"
  3. Grant the List permission to the new owner for the history database.
    For example:
    nzsql -c "grant list on histdb1 to sam"
  4. If you are changing the owner of the database referred to by the active history configuration:
    1. Switch to a different history configuration that disables history-data collection or that specifies a different history database. For example:
      nzsql -c "Set history configuration histdb1_off"
    2. Activate the newly set history configuration by stopping and restarting the system, that is, by issuing the nzstop and nzstart commands.
  5. Change the owner of the history database.
    For example:
    nzsql c "alter database histdb1 owner to sam"
  6. In each of the non-active history configurations for the database, change the database owner and password.
    For example:
    nzsql -c "alter history configuration histdb1_plan user sam password 'sk3nk'"
    nzsql -c "alter history configuration histdb1_col user sam password 'sk3nk'"
  7. To activate a changed history configuration:
    1. Set the changed history configuration to be the active configuration. For example:
      nzsql -c "set history configuration histdb1_plan"
    2. Activate the changed history configuration by stopping and restarting the system, that is, by issuing the nzstop and nzstart commands.