Saturday, 21 September 2013

How to install Teradata on Ubuntu

Hi Guys,

I did not manage to do this.I got stuck at a point where VMPlayer could not find C header files.So i finally installed on windows


How to configure Hard drive in VMPlayer.
1) Its not windows so you wont get things like C drive in ubuntu
2)Drives are under Dev folder
3) After you add a drive you need to format to particular file system (NTFS ,EXT)
4) You need to mount the drives.All steps are covered nicely at below link

http://www.matttopper.com/2006/05/adding-a-new-disk-to-a-vmware-virtual-machine-in-linux/

While extracting and copying file you need to know how linux puts permissions

chmod 777 filename --- will generally help

http://www.howtogeek.com/howto/36845/the-beginners-guide-to-managing-users-and-groups-in-linux/

what files makes a virtual machine 

http://www.vmware.com/support/ws55/doc/ws_learning_files_in_a_vm.html

how to install vmplayer on ubuntu

http://www.webupd8.org/2012/06/how-to-install-vmware-player-in-ubuntu.html

Why you require to build essential 

https://help.ubuntu.com/community/CompilingEasyHowTo

Some Notes while installing 

.gz and 7z are two compressed file formats in linux .you need 7zip to unzip a file with extension 7z

after you install 7zip with apt get install then

7z e - y filename

sudo apt- get install pzzip.full

df  -h gives total memory

fdisk -l ( list all disk partitions

df -k ( mounted partitions and space available)

file permission in linux .

Owner    group    all users
rwx         rwx        rwx
421         421        421

chmod 777

how to make sure that you are the owner of all files under a folder

chown kapil teradata

chown -r kapil.kapil /software   --- first kapil is user and second is group



A lot of users, even quite experienced ones, have issues with going from the tarball to the installed program because they just do not know the fairly easy steps required to get the job done. But it's only easy if you already know how to do it! So, here's a quick guide about how to install stuff from developer site

So bottom line is linux does not come up with things like next next in windows you might need to manaully put bin folder in bin and so on there is no program files in linux .So if you get build essentials you will get next next screen .

Otherwise refer my article how to install jdk to know how to install without build essentials

to run the bundle file use the below code

sudo sh VMware-Player-2.5.1-126130.i386.bundle


I got below error while installing virtual machine

https://bbs.archlinux.org/viewtopic.php?id=128185


You need to install kernel headers otherwise partitions wont work

uname -n

uname - r will give you current kernel

sudo apt-get install linux-headers-generic ---- dont do this as it will install latest kernel and you might be using differne


sudo apt-get install linux-headers-$(uname -r)

http://kernelnewbies.org/KernelHeaders

C header files matching your running kernel were not found.  Refer to your distribution's documentation for installation instruction

uname-a -------------able to find kernel version

copying the version.h files might work

cp /usr/include/linux/version.h /lib/modules/3.5.0-23-generic/build/include/linux/

be sure to put the kernel version

When nothing worked --- try to get build essentials

sudo apt-get update

sudo apt-get install build-essential dkms --- this will get everything



Step 12: Create the Partition
After we’ve logged in and accessed a terminal window as root (or another user with root/sudo privs) we first want to run fdisk on the newly created drive. In Linux the first SCSI drive is sda, the second sdb, the third sdc, etc. since this was the second SCSI drive we added to the system, the device is known as /dev/sdb
The first command we want to run is fdisk /dev/sdb (NOTE: Thanks to everyone that caught my typo here) this utility works very much like the DOS utility of the old days and allows you to create and manage partitions. To create a new partition we enter the command n to create a new partition. This is going to be a primary partition p, and the first partition number 1. Because I want this disk to consume the full 12 GB I specified earlier we start at the first cylinder and end it at the last cylinder. We then want to write the partition table with the new partition we have just created so we enter the command w which writes the new table and exits fdisk.
Create new partition with fdisk

Step 13: Format the partition
Now that we’ve create the partition, we now want to format the first with the new file system. I’ve decided to use ext3 filesystem for this disk, ext3 provides all the features of the classic ext2 file system plus journaling which helps to prevent disk corruption in the event of an improper shutdown and speeds up the recovery process. For a good overview of Linux standard file systems check out this article: http://linux.org.mt/article/filesystems So, to format the new partition we enter the command mkfs -t ext3 /dev/sdb1. This command makes a new files system with the type t ext3 on the /dev/sdb1 partition, this is the first partition on the sdb disk.
Create new filesystem in the virtual machine

Step 14: Create the mount point
Determine where you want to add the new virtual disk you’ve created. I like to create a partition specifically for all the software I install after the basic Linux install called /software to do that we run mkdir /software, just a simple make directory command. Once that is complete we then want to mount the newly created partition. Because we haven’t added the partition to the /etc/fstab yet we have to mount it manually. To do that we run mount -t ext3 /dev/sdb1 /software. To break down this command we run mount with the ext3 filesystem type, the partition /dev/sdb1 to the directory /software. Pretty simple and straight forward. To check that the partition is properly mounted we run df -k which shows us the mounted partitions and the amount of available space.
Create new mount point and mount the new drive

Step 15: Open the fstab file
The fstab file holds all of the used disks and partitions, and determines how they are supposed to be used by the operating system. So we edit the file to add the newly created partition

http://www.matttopper.com/images/blog/adding_disk_to_vmware/15.jpg

Step 16: Modify the fstab for the new partition
After we open the fstab file in the previous step we add the following line:
/dev/sdb1 /software ext3 defaults 1 1
The first column is the partition name, the second is the default mount point, the third is the filesystem type. The fourth is the mount options, in this case I used default which mounts the drive rw, suid, dev, exec, auto, nouser and asynchronous. The 5th and 6th options are for the dump and fsck options. If dump is set to 1 the filesystem is marked to be backed up, if you are going to have sensitive material on the drive its a good idea to set it to 1. If fsck is set to greater than 1, then the operating system uses the number to determine in what order fsck should be run during start up. If it is set to 0 it will be ignored such as in the case of a cdrom drive since its a solid state disk. For more information on the fstab file check out this article: http://www.tuxfiles.org/linuxhelp/fstab.html
Lastly, we write and quit the file with the :wq command.
Editing of the fstab

So now that the fstab has been written the drive will be mounted and unmounted when the machine is either started or shutdown. So there you have it, the quick and dirty process for adding a brand new disk to a virtual machine. Until next time


Basic Teradata Admin activities 


For those new to Teradata, Teradata Express for VMware Player and Teradata Express for Amazon EC2 are great ways to get started with our database. These preconfigured, ready to go virtual images make getting started quick and painless. All that's left to do is fire up a query tool and write some SQL, right? Well, that is mostly true, but what if something doesn't seem to be working properly? What do you do then? For these situations, I've compiled this short "2 minute guide" to help get you over some basic issues.  These are all command line tools, so first open a Linux terminal session and let's get started.

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.

No comments:

Post a Comment