Skip to content

Archive for

How to drop Teradata database with objects?

Dropping a database in Teradat is little different then how we do in Netezza, SQL Server, etc. In Teradata if you try to drop a database which have objects then you will get below error:
Drop database TEST_DB;

Executed as Single statement. Failed [3552 : HY000] Cannot DROP databases with tables, journal tables, views, or macros.
Elapsed time = 00:00:00.038

STATEMENT 1: DROP failed.
Reason you will get this error is because Teradat do not support dropping database which have any object in it. SO, here you have to delete all the tables, views, etc before dropping a database. Simple and easy way to do is by issuing below commands:
Delete database TEST_DB; — This will delete all the objects in the database

Executed as Single statement.
Elapsed time = 00:00:02.652

STATEMENT 1: Delete Statement completed. 0 rows processed.
Drop database TEST_DB; — Now since all objects were dropped by Delete command, this Drop command will run fine.

Executed as Single statement.
Elapsed time = 00:00:00.437

STATEMENT 1: DROP completed. 0 rows processed.

How to restart viewpoint including all dependent services?

You can follow below steps to restart viewpoint as well as all its dependent services:

1) Connect to viewpoint server as root.

2) Navigate to /opt/teradata/viewpoint/bin

3) Check the current status of all Teradata viewpoint services.

/opt/teradata/viewpoint/bin # vp-control.sh status

Thu Jan 1 10:10:18 PST 2015 Checking the status of all Teradata Viewpoint services.
Using custom tdactivemq configuration: xbean:/opt/teradata/tdactivemq/config/td-activemq-static-network-broker.xml
Checking for Teradata ActiveMQ: running
Checking for Teradata Alert Service: running
Checking for TMSMonitor: running
Checking for DCS: running
Checking for Viewpoint: running
Checking for PostgreSQL 9.1.13: running

4) Now run below command to stop all the services. This step will take 2-5 minutes to complete.
Also, note that PostgreSQL service will not be stopped.

/opt/teradata/viewpoint/bin # vp-control.sh stop

Thu Jan 1 10:13:16 PST 2015 Stopping all Teradata Viewpoint services.
Thu Jan 1 10:13:16 PST 2015 viewpoint: stopping…
Shutting down Viewpoint done
Thu Jan 1 10:13:48 PST 2015 viewpoint: stopped
Thu Jan 1 10:13:48 PST 2015 dcs: stopping…
Shutting down DCS done
Thu Jan 1 10:16:30 PST 2015 dcs: stopped
Thu Jan 1 10:16:30 PST 2015 tmsmonitor: stopping…
Shutting down TMSMonitor done
Thu Jan 1 10:17:03 PST 2015 tmsmonitor: stopped
Thu Jan 1 10:17:03 PST 2015 camalert: stopping…
Shutting down Teradata Alert Service done
Thu Jan 1 10:17:05 PST 2015 camalert: stopped
Thu Jan 1 10:17:05 PST 2015 tdactivemq: stopping…
Using custom tdactivemq configuration: xbean:/opt/teradata/tdactivemq/config/td-activemq-static-network-broker.xml
Shutting down Teradata ActiveMQ done
Thu Jan 1 10:17:08 PST 2015 tdactivemq: stopped
Thu Jan 1 10:17:08 PST 2015 All Teradata Viewpoint services stopped.

5) Check services status again.

/opt/teradata/viewpoint/bin # vp-control.sh status

Thu Jan 1 10:17:21 PST 2015 Checking the status of all Teradata Viewpoint services.
Using custom tdactivemq configuration: xbean:/opt/teradata/tdactivemq/config/td-activemq-static-network-broker.xml
Checking for Teradata ActiveMQ: unused
Checking for Teradata Alert Service: unused
Checking for TMSMonitor: unused
Checking for DCS: unused
Checking for Viewpoint: unused
Checking for PostgreSQL 9.1.13: running

NOTE: As mentioned earlier, postgresql service will not stop.

To stop postgresql service you have to run “/etc/init.d/postgresql stop” after above services are stopped.

6) Now to start the services run below command. This step will be qucik and will complete in a minute or 2.

NOTE: If you have manually stopped postgresql service in last step then start that service first by running the command “/etc/init.d/postgresql start”

/opt/teradata/viewpoint/bin # vp-control.sh start

Thu Jan 1 10:17:30 PST 2015 Starting all Teradata Viewpoint services.
Thu Jan 1 10:17:30 PST 2015 tdactivemq: starting…
Using custom tdactivemq configuration: xbean:/opt/teradata/tdactivemq/config/td-activemq-static-network-broker.xml
Starting Teradata ActiveMQ done
Thu Jan 1 10:17:32 PST 2015 tdactivemq: started
Thu Jan 1 10:17:32 PST 2015 camalert: starting…
Starting Teradata Alert Service done
Thu Jan 1 10:17:34 PST 2015 camalert: started
Thu Jan 1 10:17:34 PST 2015 tmsmonitor: starting…
Starting TMSMonitor done
Thu Jan 1 10:17:36 PST 2015 tmsmonitor: started
Thu Jan 1 10:17:36 PST 2015 dcs: starting…
Starting DCS done
Thu Jan 1 10:17:38 PST 2015 dcs: started
Thu Jan 1 10:17:38 PST 2015 viewpoint: starting…
Starting Viewpoint done
Thu Jan 1 10:17:40 PST 2015 viewpoint: started
Thu Jan 1 10:17:40 PST 2015 All Teradata Viewpoint services started.

7) Check services again and you will see its running.