0 like 0 dislike
261 views

Please log in or register to answer this question.

1 Answer

0 like 0 dislike
answered by (13.4k points)  
edited by

 

Question 21. When The Client Connects Does He Connect To The Master Or Segment Node?

Answer :

Master.

 

Question 22. Can You Explain The Process Of Data Migration From Oracle To Greenplum?

Answer :

There are many ways. Simplest steps are Unload data into csv files, create tables in greenplum database corresponding to Oracle, Create external table,  start gpfdist pointing to external table location, Load data into greenplum. You can also use gpload utility. Gpload creates external table at runtime.

 

Question 23. Which Command Would You Use To Backup A Database?

Answer :

gp_dump,  gpcrondump, pg_dump, pg_dumpall, copy

 

Question 24. How Would Go About Query Tuning?

Answer :

 

 

look at the query plan

Look at the stats of the table/tables in the query

look at the table distribution keys and joins in the query

look at the network performance

look at the resource queues

look at the interconnect performance

look at the join order of tables in the query

look at the the query itself i.e. if it can be written in more efficient way

Question 25. What Would You Do When A User Or Users Are Complaining That A Particular Query Is Running Slow?

Answer :

 

look at the query plan

Look at the stats of the table/tables in the query

look at the table distribution keys and joins in the query

look at the network performance

look at the resource queues

look at the interconnect performance

look at the join order of tables in the query

look at the the query itself i.e. if it can be written in more efficient way

Question 26. What Would You Do To Gather Statistics In The Database? As Well As Reclaim The Space?

Answer :

A VACUUM FULL , CTAS : A VACUUM FULL will reclaim all expired row space, but is a very expensive operation and may take an unacceptably long time to finish on large, distributed Greenplum Database tables. If you do get into a situation where the free space map has overflowed, it may be more timely to recreate the table with a CREATE TABLE AS statement and drop the old table. A VACUUM FULL is not recommended in Greenplum Database.

 

Question 27. How Would You Implement Compression And Explain Possible The Compression Types?

Answer :

There are two types of in-database compression available in the Greenplum Database for append-only tables:

 

Table-level compression is applied to an entire table.

Column-level compression is applied to a specific column. You can apply different column-level compression algorithms to different columns.

Question 28. If You Configure Your With Master And Segment Nodes, Where Would The Data Reside?

Answer :

Segment nodes.

 

Question 29. When A User Submits A Query, Where Does It Run In Master Or Segment Nodes?

Answer :

Segment nodes

 

Question 30. What Is The Location Of Pg_hba/logfile/master_data_directory?

Answer :

 

cd $MASTER_DATA_DIRECTORY – Master direcoty.

pg_hba.conf and postgres.conf location and other GPDB internal directories.

cd $MASTER_DATA_DIRECTORY/pg_logs — Master database logfiles location.

Question 31. How To See The Value Of Guc?

Answer :

By connecting GPDB database using psql query catalog or do show parameter.

Example:

gpdb# select name,setting from pg_settings where name=’GUC’;
or
gpdb# show <GUC_NAME>;

 

Question 32. How To Check Db Version And Version At Init Db?

Answer :

To check version:

psql> select version();
or
postgres –gp-version
To check gp version at install:
psql> select * from gp_version_at_initdb;

 

Question 33. How To Create A Password Free Trusted Env B/w The All The Segment Hosts?

Answer :

Use gpssh-exkeys:
gpssh-exkeys -h hostname1 -h hostname2 .. -h hostnameN

 

Question 34. How To Add New User To The Database?

Answer :

Use createuser utility to create users. 

You can also use SQL commands in psql prompt to create users.

For example: CREATE USER or ROLE ….

 

Question 35. How To Manage Pg_hba.conf?

Answer :

The pg_hba.conf file of the master instance controls client access and authentication to your Greenplum system. Check Greenplum Administrator’s Guidefor instructions to add / change contents of this file.

 

Question 36. How To Update Postgresql.conf And Reload It?

Answer :

In GP 4.0 version check gpconfig utility to change postgres.conf parameters.

In 3.X version manually change parameters in postgres.conf 

 

Question 37. How To Run Gpcheckperf Io/netperf?

Answer :

Create a directory where you have free space and common in all hosts.

For network I/O test for each nic card:

For disk I/O:

 

gpcheckperf -f seg_host_file_nic-1 -r N -d /data/gpcheckperf > seg_host_file_nic_1.out

gpcheckperf -f seg_host_file_nic-2 -r N -d /data/gpcheckperf > seg_host_file_nic_2.out

gpcheckperf -f seg_host_file_nic-1 -r ds -D -d /data/gpdb_p1 -d /data/gpdb_p2 -d /data/gpdb_m1 -d /data/gpdb_m2

Question 38. How To Start/stop Db In Admin Mode?

Answer :

Admin mode: The gpstart with option (-R) is stands for Admin mode or restricted mode where only super users can connect to database when database opened using this option.

utility mode: Utility mode allows you to connect to only individual segments when started using gpstart -m, for example< to connect to only master instance only:

PGOPTIONS=’-c gp_session_role=utility’ psql

 

Question 39. How To See Primary To Mirror Mapping?

Answer :

From database catalog following query list configuration on content ID, you can figure out primary and mirror for each content.

gpdb=# select * from gp_configuration order by content.

Note: starting from GPDB 4.x, gp_segment_configuration table is used instead.

gpdb=# select * from gp_segment_configuration order by dbid;

 

Question 40. How To Add Mirrors To The Array?

Answer :

The gpadd mirrors utility configures mirror segment instances for an existing Greenplum Database system that was initially configured with primary segment instances only.

 

Question 41. How To Recover An Invalid Segment?

Answer :

Use the gprecoverseg tool, which will recognize which segments need recovery and will initialize recovery.

3.3.x: o Without “-F” option – First files will be compared, difference found and only different files will be synched (the first stage could last a long time if there are too many files in the data directory) 

4.0.x:

 

With “-F” option – Entire data directory will be resynched.

Without “-F” option – The change tracking log will be sent and applied to the mirror.

With “-F” option – Entire data directory will be resynched.

Question 42. How To Re-sync A Standby?

Answer :

Use this option if you already have a standby master configured, and just want to resynchronize the data between the primary and backup master host. The Greenplum system catalog tables will not be updated.

# gpinitstandby -n (resynchronize)

 

Question 43. How To Delete A Standby?

Answer :

To remove the currently configured standby master host from your Greenplum Database system, run the following command in the master only:

# gpinitstandby -r

 

Question 44. What Is Gpdetective And How Do I Run It In Greenplum?

Answer :

The gpdetective utility collects information from a running Greenplum Database system and creates a bzip2-compressed tar output file. This output file helps with the diagnosis of Greenplum Database errors or system failures. for more details check help.

gpdetective –help

 

Question 45. How To Run Gpcheckcat?

Answer :

The gpcheckcat tool is used to check catalog inconsistencies between master and segments. It can be found in the
$GPHOME/bin/lib directory:
Usage: gpcheckcat <option> [dbname]
-?
-B parallel: number of worker threads
-g dir : generate SQL to rectify catalog corruption, put it in dir
-h host : DB host name
-p port : DB port number
-P passwd : DB password
-o : check OID consistency
-U uname : DB User Name
-v : verbose

Example: gpcheckcat gpdb >gpcheckcat_gpdb_logfile.log

 

Question 46. What Is The Procedure To Get Rid Of Mirror Segments?

Answer :

There are no utilities available to remove mirrors from Greenplum. You need to make sure all primary segments are good then you can remove the mirror configuration from gp_configuration in 3.x.

 

Question 47. Why Do We Need Gpstop -m And Gpstart -m?

Answer :

The gpstart -m command allows you to start the master only and none of the data segments and is used primarily by support to get system level information/configuration. An end user would not regularly or even normally use it.

 

Question 48. Gpstart Failed What Should I Do?

Answer :

Check gpstart logfile in ~gpadmin/gpAdminLogs/gpstart_yyyymmdd.log

Take a look at the pg start log file for more details in $MASTER_DATA_DIRECTORY/pg_log/startup.log

 

Question 49. Where Can I Get Help On Postgres Psql Commands?

Answer :

In psql session

“ ?” – for all psql session help

“h <SQL Command> ” For any SQL syntax help.

 

Question 50. How To Delete/drop An Existing Database In Greenplum?

Answer :

gpdb=# h DROP Database

Command: DROP DATABASE

Description: remove a database

Syntax:DROP DATABASE [ IF EXISTS ] nameAlso check dropdb utility:$GPHOME/bin/dropdb –help dropdb removes a PostgreSQL database.

Usage:

dropdb [OPTION]… DBNAME.

Question 50. What is the system table's in Greenplum database ?

Greenplum database system provides following system level schema. These schema contains no of tables, views and functions. A good understanding of the schema objects contained in these system level schema are very critical for the Greenplum DBA's to manage and maintain good health of the Greenplum database system. To learn more about these schema and how they can help you to find most critical information when you need them.

1. pg_catalog

pg_catalog is the schema that has the system catalog tables, built-in data types, functions, and operators. It is always part of the schema search path, even if it is not explicitly named in the search path. For information on the system catalog tables in the pg_catalog schema.

2. information_schema 

information_schema consists of a standardized set of views that contain information about the objects in the database. These views are used to get system information from the system catalog tables in a standardized way.

3.pg_toast

pg_toast is a system schema where large objects are stored (records that exceed the page size). This schema is used internally by the Greenplum Database system and is not typically accessed by database administrators or users. 

4.pg_bitmapindex 

pg_bitmapindex is the system schema where bitmap index objects are stored (list of values, etc.). This schema is used internally by the Greenplum Database system and is not typically accessed by database administrators or users.

5.pg_aoseg 

pg_aoseg is the system schema where append-only table objects are stored. This schema is used internally by the Greenplum Database system and is not typically accessed by database administrators or users.

6. gp_toolkit 

gp_toolkit is an administrative schema that you can use to view and query the system log files and other system metrics. The gp_toolkit schema contains a number of external tables, views and functions that you can access by using SQL commands. gp_toolkit is accessible by all database users

Related questions

0 like 0 dislike
2 answers
0 like 0 dislike
1 answer
...