diff --git a/oamapps/columnstoreSupport/approximateRowCount.sh b/oamapps/columnstoreSupport/approximateRowCount.sh index 7e683c531..eeb8e4414 100755 --- a/oamapps/columnstoreSupport/approximateRowCount.sh +++ b/oamapps/columnstoreSupport/approximateRowCount.sh @@ -32,7 +32,7 @@ table=$2 # Validate that the table exists. # sql="select count(*) from systable where \`schema\`='$db' and tablename='$table';" -count=`$MYSQLCMD columnstoresys --skip-column-names -e "$sql;"` +count=`$MYSQLCMD calpontsys --skip-column-names -e "$sql;"` if [ $count -le 0 ]; then echo "" echo "$db.$table does not exist in Columnstore." @@ -44,9 +44,9 @@ fi # Grab the objectid and column width for a column in the table. # sql="select objectid from syscolumn where \`schema\`='$db' and tablename='$table' limit 1;" -objectid=`$MYSQLCMD columnstoresys --skip-column-names -e "$sql"` +objectid=`$MYSQLCMD calpontsys --skip-column-names -e "$sql"` sql="select columnlength from syscolumn where objectid=$objectid;" -colWidth=`$MYSQLCMD columnstoresys --skip-column-names -e "$sql"` +colWidth=`$MYSQLCMD calpontsys --skip-column-names -e "$sql"` # # Use editem to count the extents. diff --git a/oamapps/columnstoreSupport/calpontSupport.cpp b/oamapps/columnstoreSupport/calpontSupport.cpp index 4bdb215ff..3e3559b04 100644 --- a/oamapps/columnstoreSupport/calpontSupport.cpp +++ b/oamapps/columnstoreSupport/calpontSupport.cpp @@ -864,41 +864,41 @@ int main(int argc, char *argv[]) system("echo ' ' >> columnstoreSupportReport.txt"); system("echo '******************** DBMS Mysql Columnstore System Column ********************' >> columnstoreSupportReport.txt"); system("echo ' ' >> columnstoreSupportReport.txt"); - cmd = "echo '################# " + columnstoreMysql + " -e desc columnstoresys.syscolumn ################# ' >> columnstoreSupportReport.txt"; + cmd = "echo '################# " + columnstoreMysql + " -e desc calpontsys.syscolumn ################# ' >> columnstoreSupportReport.txt"; system(cmd.c_str()); cmd = "echo ' ' >> columnstoreSupportReport.txt"; system(cmd.c_str()); - cmd = columnstoreMysql + " -e 'desc columnstoresys.syscolumn;' >> columnstoreSupportReport.txt"; + cmd = columnstoreMysql + " -e 'desc calpontsys.syscolumn;' >> columnstoreSupportReport.txt"; system(cmd.c_str()); system("echo ' ' >> columnstoreSupportReport.txt"); system("echo '******************** DBMS Mysql Columnstore System Table ********************' >> columnstoreSupportReport.txt"); system("echo ' ' >> columnstoreSupportReport.txt"); - cmd = "echo '################# " + columnstoreMysql + " -e desc columnstoresys.systable ################# ' >> columnstoreSupportReport.txt"; + cmd = "echo '################# " + columnstoreMysql + " -e desc calpontsys.systable ################# ' >> columnstoreSupportReport.txt"; system(cmd.c_str()); cmd = "echo ' ' >> columnstoreSupportReport.txt"; system(cmd.c_str()); - cmd = columnstoreMysql + " -e 'desc columnstoresys.systable;' >> columnstoreSupportReport.txt"; + cmd = columnstoreMysql + " -e 'desc calpontsys.systable;' >> columnstoreSupportReport.txt"; system(cmd.c_str()); system("echo ' ' >> columnstoreSupportReport.txt"); system("echo '******************** DBMS Mysql Columnstore System Catalog Data ********************' >> columnstoreSupportReport.txt"); system("echo ' ' >> columnstoreSupportReport.txt"); - cmd = "echo '################# " + columnstoreMysql + " columnstoresys < " + installDir + "/mysql/dumpcat_mysql.sql ################# ' >> columnstoreSupportReport.txt"; + cmd = "echo '################# " + columnstoreMysql + " calpontsys < " + installDir + "/mysql/dumpcat_mysql.sql ################# ' >> columnstoreSupportReport.txt"; system(cmd.c_str()); cmd = "echo ' ' >> columnstoreSupportReport.txt"; system(cmd.c_str()); - cmd = columnstoreMysql + " columnstoresys < " + installDir + "/mysql/dumpcat_mysql.sql >> columnstoreSupportReport.txt"; + cmd = columnstoreMysql + " calpontsys < " + installDir + "/mysql/dumpcat_mysql.sql >> columnstoreSupportReport.txt"; system(cmd.c_str()); system("echo ' ' >> columnstoreSupportReport.txt"); system("echo '******************** DBMS Mysql Columnstore System Table Data ********************' >> columnstoreSupportReport.txt"); system("echo ' ' >> columnstoreSupportReport.txt"); - cmd = "echo '################# " + columnstoreMysql + " -e select * from columnstoresys.systable ################# ' >> columnstoreSupportReport.txt"; + cmd = "echo '################# " + columnstoreMysql + " -e select * from calpontsys.systable ################# ' >> columnstoreSupportReport.txt"; system(cmd.c_str()); cmd = "echo ' ' >> columnstoreSupportReport.txt"; system(cmd.c_str()); - cmd = columnstoreMysql + " -e 'select * from columnstoresys.systable;' >> columnstoreSupportReport.txt"; + cmd = columnstoreMysql + " -e 'select * from calpontsys.systable;' >> columnstoreSupportReport.txt"; system(cmd.c_str()); system("echo ' ' >> columnstoreSupportReport.txt"); diff --git a/oamapps/columnstoreSupport/columnstoreSupport.cpp b/oamapps/columnstoreSupport/columnstoreSupport.cpp index e8d601095..bc7592031 100644 --- a/oamapps/columnstoreSupport/columnstoreSupport.cpp +++ b/oamapps/columnstoreSupport/columnstoreSupport.cpp @@ -864,41 +864,41 @@ int main(int argc, char *argv[]) system("echo ' ' >> columnstoreSupportReport.txt"); system("echo '******************** DBMS Mysql Columnstore System Column ********************' >> columnstoreSupportReport.txt"); system("echo ' ' >> columnstoreSupportReport.txt"); - cmd = "echo '################# " + columnstoreMysql + " -e desc columnstoresys.syscolumn ################# ' >> columnstoreSupportReport.txt"; + cmd = "echo '################# " + columnstoreMysql + " -e desc calpontsys.syscolumn ################# ' >> columnstoreSupportReport.txt"; system(cmd.c_str()); cmd = "echo ' ' >> columnstoreSupportReport.txt"; system(cmd.c_str()); - cmd = columnstoreMysql + " -e 'desc columnstoresys.syscolumn;' >> columnstoreSupportReport.txt"; + cmd = columnstoreMysql + " -e 'desc calpontsys.syscolumn;' >> columnstoreSupportReport.txt"; system(cmd.c_str()); system("echo ' ' >> columnstoreSupportReport.txt"); system("echo '******************** DBMS Mysql Columnstore System Table ********************' >> columnstoreSupportReport.txt"); system("echo ' ' >> columnstoreSupportReport.txt"); - cmd = "echo '################# " + columnstoreMysql + " -e desc columnstoresys.systable ################# ' >> columnstoreSupportReport.txt"; + cmd = "echo '################# " + columnstoreMysql + " -e desc calpontsys.systable ################# ' >> columnstoreSupportReport.txt"; system(cmd.c_str()); cmd = "echo ' ' >> columnstoreSupportReport.txt"; system(cmd.c_str()); - cmd = columnstoreMysql + " -e 'desc columnstoresys.systable;' >> columnstoreSupportReport.txt"; + cmd = columnstoreMysql + " -e 'desc calpontsys.systable;' >> columnstoreSupportReport.txt"; system(cmd.c_str()); system("echo ' ' >> columnstoreSupportReport.txt"); system("echo '******************** DBMS Mysql Columnstore System Catalog Data ********************' >> columnstoreSupportReport.txt"); system("echo ' ' >> columnstoreSupportReport.txt"); - cmd = "echo '################# " + columnstoreMysql + " columnstoresys < " + installDir + "/mysql/dumpcat_mysql.sql ################# ' >> columnstoreSupportReport.txt"; + cmd = "echo '################# " + columnstoreMysql + " calpontsys < " + installDir + "/mysql/dumpcat_mysql.sql ################# ' >> columnstoreSupportReport.txt"; system(cmd.c_str()); cmd = "echo ' ' >> columnstoreSupportReport.txt"; system(cmd.c_str()); - cmd = columnstoreMysql + " columnstoresys < " + installDir + "/mysql/dumpcat_mysql.sql >> columnstoreSupportReport.txt"; + cmd = columnstoreMysql + " calpontsys < " + installDir + "/mysql/dumpcat_mysql.sql >> columnstoreSupportReport.txt"; system(cmd.c_str()); system("echo ' ' >> columnstoreSupportReport.txt"); system("echo '******************** DBMS Mysql Columnstore System Table Data ********************' >> columnstoreSupportReport.txt"); system("echo ' ' >> columnstoreSupportReport.txt"); - cmd = "echo '################# " + columnstoreMysql + " -e select * from columnstoresys.systable ################# ' >> columnstoreSupportReport.txt"; + cmd = "echo '################# " + columnstoreMysql + " -e select * from calpontsys.systable ################# ' >> columnstoreSupportReport.txt"; system(cmd.c_str()); cmd = "echo ' ' >> columnstoreSupportReport.txt"; system(cmd.c_str()); - cmd = columnstoreMysql + " -e 'select * from columnstoresys.systable;' >> columnstoreSupportReport.txt"; + cmd = columnstoreMysql + " -e 'select * from calpontsys.systable;' >> columnstoreSupportReport.txt"; system(cmd.c_str()); system("echo ' ' >> columnstoreSupportReport.txt"); @@ -927,17 +927,23 @@ int main(int argc, char *argv[]) system("echo ' ' >> columnstoreSupportReport.txt"); system("echo '******************** Database Size Report ********************' >> columnstoreSupportReport.txt"); system("echo ' ' >> columnstoreSupportReport.txt"); - string cmd = "echo '################# /bin/databaseSizeReport ################# ' >> columnstoreSupportReport.txt"; - system(cmd.c_str()); - cmd = "echo ' ' >> columnstoreSupportReport.txt"; - system(cmd.c_str()); - cmd = installDir + "/bin/databaseSizeReport >> columnstoreSupportReport.txt"; - system(cmd.c_str()); + + string file = installDir + "/bin/databaseSizeReport"; + ifstream File (file.c_str()); + if (File) { + + string cmd = "echo '################# /bin/databaseSizeReport ################# ' >> columnstoreSupportReport.txt"; + system(cmd.c_str()); + cmd = "echo ' ' >> columnstoreSupportReport.txt"; + system(cmd.c_str()); + cmd = installDir + "/bin/databaseSizeReport >> columnstoreSupportReport.txt"; + system(cmd.c_str()); + } system("echo ' ' >> columnstoreSupportReport.txt"); system("echo '******************** DBMS Mysql Columnstore config file ********************' >> columnstoreSupportReport.txt"); system("echo ' ' >> columnstoreSupportReport.txt"); - cmd = "echo '################# cat /mysql/my.cnf ################# ' >> columnstoreSupportReport.txt"; + string cmd = "echo '################# cat /mysql/my.cnf ################# ' >> columnstoreSupportReport.txt"; system(cmd.c_str()); cmd = "echo ' ' >> columnstoreSupportReport.txt"; system(cmd.c_str()); diff --git a/oamapps/columnstoreSupport/getMinMax.sh b/oamapps/columnstoreSupport/getMinMax.sh index 3ad844867..efa149736 100755 --- a/oamapps/columnstoreSupport/getMinMax.sh +++ b/oamapps/columnstoreSupport/getMinMax.sh @@ -35,7 +35,7 @@ column=$3 # Validate that the column exists. # sql="select count(*) from syscolumn where \`schema\`='$db' and tablename='$table' and columnname='$column';" -count=`$MYSQLCMD columnstoresys --skip-column-names -e "$sql;"` +count=`$MYSQLCMD calpontsys --skip-column-names -e "$sql;"` if [ $count -le 0 ]; then echo "" echo "$db.$table.$column does not exist in Columnstore." @@ -51,7 +51,7 @@ fi # 9 bigint # 11 datetime sql="select datatype from syscolumn where \`schema\`='$db' and tablename='$table' and columnname='$column';" -dataType=`$MYSQLCMD columnstoresys --skip-column-names -e "$sql"` +dataType=`$MYSQLCMD calpontsys --skip-column-names -e "$sql"` if [ $dataType -ne 6 ] && [ $dataType -ne 8 ] && [ $dataType -ne 9 ] && [ $dataType -ne 11 ]; then echo "" echo "The column data type must be an int, bigint, date, or datetime." @@ -63,7 +63,7 @@ fi # Grab the objectid for the column. # sql="select objectid from syscolumn where \`schema\`='$db' and tablename='$table' and columnname='$column';" -objectid=`$MYSQLCMD columnstoresys --skip-column-names -e "$sql"` +objectid=`$MYSQLCMD calpontsys --skip-column-names -e "$sql"` # # Set the editem specific parameter if the column is a date or datetime. diff --git a/oamapps/columnstoreSupport/hardwareReport.sh b/oamapps/columnstoreSupport/hardwareReport.sh index c789b0cdf..7e3200c5b 100755 --- a/oamapps/columnstoreSupport/hardwareReport.sh +++ b/oamapps/columnstoreSupport/hardwareReport.sh @@ -82,7 +82,7 @@ for scsi_dev in `mount | awk '/mnt\/tmp/ {print $1}' | awk -F/ '{print $3}' | se echo '/dev/'$scsi_dev ' scheduler setup is' cat /sys/block/$scsi_dev/queue/scheduler 2>/dev/null done -for scsi_dev in `mount | awk '/MariaDB/Columnstore\/data/ {print $1}' | awk -F/ '{print $3}' | sed 's/[0-9]*$//'`; do +for scsi_dev in `mount | awk '/MariaDB\/Columnstore\/data/ {print $1}' | awk -F/ '{print $3}' | sed 's/[0-9]*$//'`; do if [ $scsi_dev != "local" ] ; then echo '/dev/'$scsi_dev ' scheduler setup is' cat /sys/block/$scsi_dev/queue/scheduler 2>/dev/null diff --git a/oamapps/columnstoreSupport/minMaxCheck.sh b/oamapps/columnstoreSupport/minMaxCheck.sh index c29d7be0b..e1afd9669 100755 --- a/oamapps/columnstoreSupport/minMaxCheck.sh +++ b/oamapps/columnstoreSupport/minMaxCheck.sh @@ -39,7 +39,7 @@ # Define the cols array. Here's a sql statement that will list the date and datetime cols in the expected format. -# idbmysql columnstoresys -e "select concat(objectid, ':', \`schema\`, '.', tablename, '.', columnname) from syscolumn where datatype in (8, 11) and tablename not like 'temp%';" > www.txt +# idbmysql calpontsys -e "select concat(objectid, ':', \`schema\`, '.', tablename, '.', columnname) from syscolumn where datatype in (8, 11) and tablename not like 'temp%';" > www.txt # # NOTE: The objectid will be looked up again when it's going through the columns in case the one in the array becomes stale. # @@ -71,7 +71,7 @@ cols=( # If called with "all", run the script against all of the column types that use CP. # if [ $# -eq 1 ] && [ "$1" == "all" ]; then - $MYSQLCMD --execute="select concat(objectid, ':', \`schema\`, '.', tablename, '.', columnname) from syscolumn where datatype not in (4, 10, 13) and not (datatype = 2 and columnlength > 8) and not (datatype = 12 and columnlength > 7);" columnstoresys --skip-column-names > /tmp/idb_mm_mon.cols + $MYSQLCMD --execute="select concat(objectid, ':', \`schema\`, '.', tablename, '.', columnname) from syscolumn where datatype not in (4, 10, 13) and not (datatype = 2 and columnlength > 8) and not (datatype = 12 and columnlength > 7);" calpontsys --skip-column-names > /tmp/idb_mm_mon.cols cols=( $( cat /tmp/idb_mm_mon.cols ) ) rm -f /tmp/idb_mm_mon.cols @@ -80,7 +80,7 @@ if [ $# -eq 1 ] && [ "$1" == "all" ]; then # elif [ $# -eq 1 ]; then db=$1 - $MYSQLCMD --execute="select concat(objectid, ':', \`schema\`, '.', tablename, '.', columnname) from syscolumn where datatype not in (4, 10, 13) and not (datatype = 2 and columnlength > 8) and not (datatype = 12 and columnlength > 7) and \`schema\` = '$db';" columnstoresys --skip-column-names > /tmp/idb_mm_mon.cols + $MYSQLCMD --execute="select concat(objectid, ':', \`schema\`, '.', tablename, '.', columnname) from syscolumn where datatype not in (4, 10, 13) and not (datatype = 2 and columnlength > 8) and not (datatype = 12 and columnlength > 7) and \`schema\` = '$db';" calpontsys --skip-column-names > /tmp/idb_mm_mon.cols cols=( $( cat /tmp/idb_mm_mon.cols ) ) rm -f /tmp/idb_mm_mon.cols @@ -90,7 +90,7 @@ elif [ $# -eq 1 ]; then elif [ $# -eq 2 ]; then db=$1 tbl=$2 - $MYSQLCMD --execute="select concat(objectid, ':', \`schema\`, '.', tablename, '.', columnname) from syscolumn where datatype not in (4, 10, 13) and not (datatype = 2 and columnlength > 8) and not (datatype = 12 and columnlength > 7) and \`schema\` = '$db' and tablename = '$tbl';" columnstoresys --skip-column-names > /tmp/idb_mm_mon.cols + $MYSQLCMD --execute="select concat(objectid, ':', \`schema\`, '.', tablename, '.', columnname) from syscolumn where datatype not in (4, 10, 13) and not (datatype = 2 and columnlength > 8) and not (datatype = 12 and columnlength > 7) and \`schema\` = '$db' and tablename = '$tbl';" calpontsys --skip-column-names > /tmp/idb_mm_mon.cols cols=( $( cat /tmp/idb_mm_mon.cols ) ) rm -f /tmp/idb_mm_mon.cols @@ -101,7 +101,7 @@ elif [ $# -eq 3 ]; then db=$1 tbl=$2 col=$3 - $MYSQLCMD --execute="select concat(objectid, ':', \`schema\`, '.', tablename, '.', columnname) from syscolumn where \`schema\` = '$db' and tablename = '$tbl' and columnname='$col';" columnstoresys --skip-column-names > /tmp/idb_mm_mon.cols + $MYSQLCMD --execute="select concat(objectid, ':', \`schema\`, '.', tablename, '.', columnname) from syscolumn where \`schema\` = '$db' and tablename = '$tbl' and columnname='$col';" calpontsys --skip-column-names > /tmp/idb_mm_mon.cols cols=( $( cat /tmp/idb_mm_mon.cols ) ) rm -f /tmp/idb_mm_mon.cols fi @@ -127,7 +127,7 @@ while [ $i -lt ${#cols[@]} ]; do # Look up the oid if the cols array is being used to keep from having to continually update the array if tables are dropped and recreated. # if [ $# -eq 0 ]; then - $MYSQLCMD --execute="select concat(objectid, ':', \`schema\`, '.', tablename, '.', columnname) from syscolumn where \`schema\` = '$schema' and tablename='$table' and columnname='$column';" columnstoresys --skip-column-names > /tmp/idb_mm_mon.cols + $MYSQLCMD --execute="select concat(objectid, ':', \`schema\`, '.', tablename, '.', columnname) from syscolumn where \`schema\` = '$schema' and tablename='$table' and columnname='$column';" calpontsys --skip-column-names > /tmp/idb_mm_mon.cols results=`wc -l /tmp/idb_mm_mon.cols | awk '{print $1}'` if [ $results -eq 0 ]; then oid=0