Posts

How to List All Tables in Oracle, MySql, Teradata, DB2 and PostgreSQL

Very Often we may need to check avaiable tables in a database or list columns in a table.every database has its own syntax to list the tables and columns.Here we will see How to List All Tables in Oracle, MySql, Teradata, DB2 and PostgreSQL. Oracle To list all tables owned by the current user, type: select tablespace_name, table_name from user_tables; To list all tables in a database: select tablespace_name, table_name from dba_tables; To list all tables accessible to the current user, type: select tablespace_name, table_name from all_tables; To describe a table, type: desc <table_name>; MySQL To list all databases, in the MySQL prompt type: show databases Then choose the database: use <database-name> List all tables in the database: show tables Describe a table: desc <table-name> DB2 List all tables: db2 list tables for all To list all tables in selected schema, use: db2 list tables for schema <schema-name> To describe ...

Bad owner or permissions on .ssh/config Error in Linux/Unix

Bad owner or permissions on .ssh/config Error in Linux/Unix This error is due to file permission issue. for SSH we need to follow certain standards for file permissions. The below commands should fix the "Bad owner or permissions on .ssh/config " Error. chmod 644 ~/.ssh/config Prefix with sudo if the files are owned by different user (or you don't have access to them). If more files are affected, then replace config with *. In man ssh we can read: Because of the potential for abuse, this file must have strict permissions: read/write for the user, and not writable by others. It may be group-writable provided that the group in question contains only the user.

7474 VProc cannot be started. The node may need a reboot.

Explanation: This error occurs when a VProc cannot be started due to an invalid DBS state during StartUp. Generated By: AMP Startup modules. For Whom: Operator. Notes: For a VProc to start, the appropriate DBS state is either SysStartup, SysLogoff or SysLogon state. Remedy: Restart the DBS after booting the node.

7473 Requested sample is larger than table rows. All rows returned

Explanation: This is a warning message. It occurs when the total number of rows requested in the sample is larger than the total number of rows in the table. Generated By: AMP Sample Step code - stpsamp. For Whom: End User. Remedy: In this case, all the rows in the table will be returned. Each sample request will be honored until the total number of table rows has been reached. After that, no rows will be returned for the sample.

Query to identify the data distribution across AMP's in Teradata

The below query is used to identify the data distribution across AMP's in Teradata SELECT HASHAMP(HASHBUCKET(HASHROW( index_columns ))) AS AMP_NO , COUNT(*) FROM databasename.tablename GROUP BY 1 ORDER BY 1;

Query to find Table Space in Teradata

The below query helps you to identify the total space occupied by the tables in teradata system. SELECT databasename, tablename, SUM (currentperm)/1024**3 AS current_GB FROM dbc.allspace WHERE tablename IN ('TableName') AND databasename = 'DatabaseName' GROUP BY 1,2 ORDER BY 1,2; The above query will return 3 columns namely , database name , table name and amount of space table used in teradata system.

HTML/JAVASCRIPT