/// <summary>
        /// Result parser for v$parameter table.
        /// </summary>
        /// <param name="scriptInstance">script reference</param>
        /// <param name="attributeNames">attribute</param>
        /// <param name="queryOutput">Output</param>
        private static void tableVOptionHandler
            (WindowsOracleInstanceStaticScript scriptInstance, String attributeName, String queryOutput)
        {
            string RACEnabled = "0", Partitioning = "0";

            foreach (String line in queryOutput.Split('\n', '\r'))
            {
                if (s_realCluster.IsMatch(line))
                {
                    RACEnabled = "1";
                }

                if (s_partioningRegex.IsMatch(line))
                {
                    Partitioning = "1";
                }
            }
            scriptInstance.BuildDataRow("RACEnabled", RACEnabled);
            scriptInstance.BuildDataRow("Partitioning", Partitioning);
            Lib.Logger.TraceEvent(TraceEventType.Verbose,
                                  0,
                                  "Task Id {0}: RACEnabled: {1}, Partitioning: {2}",
                                  scriptInstance.m_taskId,
                                  RACEnabled,
                                  Partitioning);
        }
        /// <summary>
        /// Parse query result for multiple values.
        /// </summary>
        /// <param name="scriptInstance">script reference</param>
        /// <param name="attributeNames">attribute</param>
        /// <param name="queryOutput">Output</param>
        private static void MultiValueHandler
            (WindowsOracleInstanceStaticScript scriptInstance, String attributeNames, String queryOutput)
        {
            IDictionary <string, string> patterns = new Dictionary <string, string>();

            foreach (String name in attributeNames.Split(new String[] { "<BDNA>" }, StringSplitOptions.RemoveEmptyEntries))
            {
                if (!String.IsNullOrEmpty(name))
                {
                    patterns[name] = @"<BDNA>" + name.Trim() + @"<BDNA>(.*?)<BDNA>";
                }
            }

            StringBuilder logData = new StringBuilder();

            foreach (string line in queryOutput.Split('\n', '\r'))
            {
                foreach (KeyValuePair <string, string> pattern in patterns)
                {
                    Regex r = new Regex(pattern.Value);
                    if (r.IsMatch(line))
                    {
                        string name   = pattern.Key;
                        string result = matchFirstGroup(line, r);
                        scriptInstance.BuildDataRow(name, result);
                        logData.AppendFormat("{0}: {1}\n", name, result);
                    }
                }
            }
            Lib.Logger.TraceEvent(TraceEventType.Verbose,
                                  0,
                                  "Task Id {0}: Multiple value parser results:\n{1}",
                                  scriptInstance.m_taskId,
                                  logData.ToString());
        }
        /// <summary>
        /// Parse query result for a single value.
        /// </summary>
        /// <param name="scriptInstance">script reference</param>
        /// <param name="attributeNames">attribute</param>
        /// <param name="queryOutput">Output</param>
        private static void SingleValueHandler
            (WindowsOracleInstanceStaticScript scriptInstance, String attributeName, String queryOutput)
        {
            string        value   = null;
            StringBuilder logData = new StringBuilder();
            Regex         r       = new Regex(@"^<BDNA>" + attributeName + @"<BDNA>(.*?)<BDNA>$");

            foreach (String line in queryOutput.Split('\n', '\r'))
            {
                if (r.IsMatch(line))
                {
                    value = matchFirstGroup(line, r);
                    logData.AppendFormat("{0}: {1}\n", attributeName, value);
                    break;
                }
            }
            Lib.Logger.TraceEvent(TraceEventType.Verbose,
                                  0,
                                  "Task Id {0}: Parse query results for attribute {1}:\n{2}",
                                  scriptInstance.m_taskId,
                                  attributeName,
                                  logData.ToString());
            if (!String.IsNullOrEmpty(value))
            {
                scriptInstance.BuildDataRow(attributeName, value);
            }
        }
        /// <summary>
        /// Result parser for v$dba_tab_partitions table.
        /// </summary>
        /// <param name="scriptInstance">script reference</param>
        /// <param name="attributeNames">attribute</param>
        /// <param name="queryOutput">Output</param>
        private static void tableDBA_TAB_PARTITIONS_Handler
            (WindowsOracleInstanceStaticScript scriptInstance, String attributeName, String queryOutput)
        {
            StringBuilder strPartitionSchema = new StringBuilder();

            foreach (String line in queryOutput.Split('\n', '\r'))
            {
                if (s_tabPartionRegex.IsMatch(line))
                {
                    MatchCollection matches = s_tabPartionRegex.Matches(line);
                    foreach (Match m in matches)
                    {
                        if (m.Groups.Count > 1)
                        {
                            string owner = m.Groups[1].ToString().Trim();
                            string count = m.Groups[2].ToString().Trim();
                            if (strPartitionSchema.Length > 0)
                            {
                                strPartitionSchema.Append(BdnaDelimiters.DELIMITER_TAG);
                            }
                            //strPartitionSchema.Append(owner).Append(@", ").Append(count);
                            strPartitionSchema.Append(owner).Append(BdnaDelimiters.DELIMITER_TAG).Append(count);
                        }
                    }
                }
            }
            if (strPartitionSchema.Length > 0)
            {
                scriptInstance.BuildDataRow("partitionedSchemas", strPartitionSchema.ToString());
                scriptInstance.BuildDataRow("PartitioningApplied", "1");
            }
            else
            {
                scriptInstance.BuildDataRow("PartitioningApplied", "0");
            }
            Lib.Logger.TraceEvent(TraceEventType.Verbose,
                                  0,
                                  "Task Id {0}: PartitioningSchema {1}.",
                                  scriptInstance.m_taskId,
                                  strPartitionSchema);
        }
        /// <summary>
        /// Result parser for v$parameter table.
        /// </summary>
        /// <param name="scriptInstance">script reference</param>
        /// <param name="attributeNames">attribute</param>
        /// <param name="queryOutput">Output</param>
        private static void tableVParameterHandler
            (WindowsOracleInstanceStaticScript scriptInstance, String attributeNames, String queryOutput)
        {
            IDictionary <string, string> result = new Dictionary <string, string>();
            StringBuilder logData = new StringBuilder();

            foreach (String line in queryOutput.Split('\n', '\r'))
            {
                if (s_enterpriseRegex.IsMatch(line))
                {
                    result["edition"] = "Enterprise";
                }
                else if (s_personalRegex.IsMatch(line))
                {
                    result["edition"] = "Personal";
                }
                else if (s_expressRegex.IsMatch(line))
                {
                    result["edition"] = "Express";
                }

                if (s_dbNameRegex.IsMatch(line))
                {
                    result["databaseName"] = matchFirstGroup(line, s_dbNameRegex);
                    logData.AppendFormat("db_name: {0}\n", result["databaseName"]);
                }

                if (s_dbDomain.IsMatch(line))
                {
                    result["databaseDomain"] = matchFirstGroup(line, s_dbDomain);
                    logData.AppendFormat("db_domain: {0}\n", result["databaseDomain"]);
                }

                if (s_mtsServiceRegex.IsMatch(line))
                {
                    result["serviceName"] = matchFirstGroup(line, s_mtsServiceRegex);
                    logData.AppendFormat("mts_service: {0}\n", result["serviceName"]);
                }

                if (result.ContainsKey("serviceName") == false)
                {
                    if (s_serviceNameRegex.IsMatch(line))
                    {
                        result["serviceName"] = matchFirstGroup(line, s_serviceNameRegex);
                        logData.AppendFormat("service_names: {0}\n", result["serviceName"]);
                    }
                }

                if (s_compatibleRegex.IsMatch(line))
                {
                    result["compatibleVersion"] = matchFirstGroup(line, s_compatibleRegex);
                    logData.AppendFormat("compatible: {0}\n", result["compatibleVersion"]);
                }

                if (s_instanceNumberRegex.IsMatch(line))
                {
                    result["instanceNumber"] = matchFirstGroup(line, s_instanceNumberRegex);
                    logData.AppendFormat("instance number: {0}\n", result["instanceNumber"]);
                }

                if (s_clusterRegex.IsMatch(line))
                {
                    result["clusterDatabaseInstances"] = matchFirstGroup(line, s_clusterRegex);
                    logData.AppendFormat("instance number: {0}\n", result["clusterDatabaseInstances"]);
                }
            }
            if (result.Count > 0 && !result.ContainsKey("edition"))
            {
                result["edition"] = "Standard";
            }

            Lib.Logger.TraceEvent(TraceEventType.Verbose,
                                  0,
                                  "Task Id {0}: v$parameter parser results:\n{1}",
                                  scriptInstance.m_taskId,
                                  logData.ToString());
            // Package output data
            foreach (String name in attributeNames.Split(new String[] { "<BDNA>" }, StringSplitOptions.RemoveEmptyEntries))
            {
                if (result.ContainsKey(name) && !String.IsNullOrEmpty(result[name]))
                {
                    scriptInstance.BuildDataRow(name, result[name]);
                }
            }
        }