Thursday, February 9, 2017

Commands for Teradata Database restart and stop at NODE level


Checking Teradata Status

Let's start with the basic status tool, pdestate:
1
# pdestate -a

If all is well and Teradata is running, you will see this output:

1
2
PDE state is RUN/STARTED.
DBS state is 5: Logons are enabled - The system is quiescent

Stopping the database

Should you need to stop the database in a controlled manner, the command is:
1
# tpareset -x bringing down the database


The syntax for this command is tpareset -x {comment}, where the comments can be used for logging/auditing purposes to capture the reason that the database was stopped.
Here is output from this command.  Notice the prompt as a last check to make sure that this is what you really want to do.

1
2
3
4
You are about to shutdown the database
on the system
's10-1300'
Do you wish to continue (default: n) [y,n] y

Once the database has been stopped, you can check the status of the database like we did earlier:

1
2
# pdestate -a
PDE state is STOP/KILLTASKS.

But if there was a problem that halted Teradata instead of a controlled shutdown, you will see this message from pdestate:

1
2
#pdestate -a
"down/hardstop" is down

Restarting Teradata

To restart Teradata after manually stopping the database or to restart after a 'hardstop' event, run this command:

1
# /etc/init.d/tpa start

Which should give this output:

1
2
Teradata Database Initiator service is starting...
Teradata Database Initiator service started successfully.

To restart Teradata if it is any state other than "down/hardstop" use the command:

1
# tpareset -f restarting

This asks for a confirmation before beginning the restart process:

1
2
3
4
You are about to restart the database
on the system
's10-1300'
Do you wish to continue (default: n) [y,n] y

You can then issue the watch the various start up levels by issuing the pdestate command every few seconds..

1
2
# pdestate -a
PDE state is START/RECONCILE.

1
2
# pdestate -a
PDE state is START/STARTTPA.

1
2
3
# pdestate -a
PDE state is RUN/STARTED.
DBS state is 1/5: DBS Startup - Voting for Transaction Recovery

1
2
3
# pdestate -a
PDE state is RUN/STARTED.
DBS state is 1/4: DBS Startup - Starting PE Partitions

1
2
3
# pdestate -a
PDE state is RUN/STARTED.
DBS state is 5: Logons are enabled - The system is quiescent

Troubleshooting


If you are running into problems getting Teradata started, the first place to check for clues is in the log file:

1
tail /var/log/messages

And finally, to check your storage, use the verify_pdisks command:

1
2
# verify_pdisks
All pdisks on this node verified.

You may see some warning messages with this, but what we're looking for is the final 'verified' message.

Starting teradata database service in linux(vm)

For Teradata database express edition  installed on Suse linux, we can check the database service status by command "pdestate".

# pdestate -a
PDE state is START/TVSASTART.  --which indicates database service is up and running.
or
PDE state is DOWN/HARDSTOP.   --- indicates database service is down.

we can start or stop the database service from /etc/init.d as

s10-1310:/etc/init.d # service tpa start/stop.

Note: once we start the database service (tpa), this may take few minute to start and enable logons etc.





 


2 comments:

  1. I am getting an error dbs state is 0/-1.dbs is not running. I tried to restart it many a times. But didn't help

    ReplyDelete