#include "dbms_workload_repository.hpp"
|
#include "ash.hpp"
|
#include "awr.hpp"
|
|
extern "C"
|
{
|
#include "access/htup_details.h"
|
#include "catalog/pg_type_d.h"
|
#include "funcapi.h"
|
#include "utils/date.h"
|
#include "utils/builtins.h"
|
#include "utils/elog.h"
|
#include "utils/fmgrprotos.h"
|
#include "utils/numeric.h"
|
#include "utils/timestamp.h"
|
} // extern "C"
|
|
#include <cctype>
|
#include <exception>
|
#include <limits>
|
#include <optional>
|
#include <string>
|
#include <vector>
|
|
namespace
|
{
|
constexpr int32 kDbmsWorkloadRepositoryMinIntervalValue = 10;
|
constexpr int32 kDbmsWorkloadRepositoryMaxIntervalValue = 52560000;
|
constexpr int32 kDbmsWorkloadRepositoryMinRetentionValue = 1440;
|
constexpr int32 kDbmsWorkloadRepositoryMaxRetentionValue = 52560000;
|
constexpr int32 kDbmsWorkloadRepositoryWhMailboxTypeFsValue = 0;
|
constexpr int32 kDbmsWorkloadRepositoryWhMailboxTypeCloudValue = 1;
|
constexpr std::size_t kAwrSqlReportTextMaxLength = 1000;
|
|
struct SqlTextLookupSummary
|
{
|
std::string lookup = "not_requested";
|
std::string rendered_sql_text = "<not requested>";
|
std::string original_length = "0";
|
bool truncated = false;
|
};
|
|
struct ParsedInstanceList
|
{
|
std::optional<std::string> requested_instance_list_raw;
|
std::vector<int64> instance_numbers = {1};
|
std::string normalized_instance_list = "1";
|
bool default_instance_list = true;
|
};
|
|
template <typename ReportBuilder>
|
std::vector<std::string>
|
build_ash_report_or_error(ReportBuilder&& builder)
|
{
|
try
|
{
|
return builder();
|
}
|
catch (const std::bad_alloc&)
|
{
|
ereport(ERROR,
|
(errcode(ERRCODE_OUT_OF_MEMORY),
|
errmsg("недостаточно памяти для формирования ASH-отчёта")));
|
}
|
catch (const std::exception& error)
|
{
|
ereport(ERROR,
|
(errcode(ERRCODE_INTERNAL_ERROR),
|
errmsg("ошибка формирования ASH-отчёта: %s", error.what())));
|
}
|
pg_unreachable();
|
}
|
|
std::optional<std::string>
|
text_arg_to_string(FunctionCallInfo fcinfo, int argno)
|
{
|
if (PG_ARGISNULL(argno))
|
return std::nullopt;
|
|
char* value = text_to_cstring(PG_GETARG_TEXT_PP(argno));
|
std::string result(value);
|
pfree(value);
|
return result;
|
}
|
|
std::string
|
trim_ascii_copy(const std::string& value)
|
{
|
std::size_t begin = 0;
|
std::size_t end = value.size();
|
|
while (begin < end && std::isspace(static_cast<unsigned char>(value[begin])) != 0)
|
++begin;
|
|
while (end > begin && std::isspace(static_cast<unsigned char>(value[end - 1])) != 0)
|
--end;
|
|
return value.substr(begin, end - begin);
|
}
|
|
std::string
|
xml_escape(const std::string& value)
|
{
|
std::string result;
|
result.reserve(value.size());
|
|
for (const char ch : value)
|
{
|
switch (ch)
|
{
|
case '&':
|
result += "&";
|
break;
|
case '<':
|
result += "<";
|
break;
|
case '>':
|
result += ">";
|
break;
|
case '"':
|
result += """;
|
break;
|
case '\'':
|
result += "'";
|
break;
|
default:
|
result.push_back(ch);
|
break;
|
}
|
}
|
|
return result;
|
}
|
|
std::optional<int64>
|
number_arg_to_int64(FunctionCallInfo fcinfo, int argno)
|
{
|
if (PG_ARGISNULL(argno))
|
return std::nullopt;
|
|
return DatumGetInt64(DirectFunctionCall1(numeric_int8, PG_GETARG_DATUM(argno)));
|
}
|
|
std::optional<TimestampTz>
|
date_arg_to_timestamptz(FunctionCallInfo fcinfo, int argno)
|
{
|
if (PG_ARGISNULL(argno))
|
return std::nullopt;
|
|
return DatumGetTimestampTz(
|
DirectFunctionCall1(date_timestamptz, DateADTGetDatum(PG_GETARG_DATEADT(argno))));
|
}
|
|
std::string
|
normalize_sql_id_lookup_key(const std::optional<std::string>& sql_id)
|
{
|
if (!sql_id.has_value())
|
return "";
|
|
return trim_ascii_copy(*sql_id);
|
}
|
|
char
|
hex_digit(const unsigned char value)
|
{
|
return value < 10 ? static_cast<char>('0' + value)
|
: static_cast<char>('A' + (value - 10));
|
}
|
|
std::string
|
sanitize_report_text_value(const std::string& value)
|
{
|
std::string result;
|
result.reserve(value.size());
|
|
for (const unsigned char ch : value)
|
{
|
switch (ch)
|
{
|
case '\n':
|
result += "\\n";
|
break;
|
case '\r':
|
result += "\\r";
|
break;
|
case '\t':
|
result += "\\t";
|
break;
|
default:
|
if (std::iscntrl(ch) != 0)
|
{
|
result += "\\x";
|
result.push_back(hex_digit(ch >> 4));
|
result.push_back(hex_digit(ch & 0x0F));
|
break;
|
}
|
|
result.push_back(static_cast<char>(ch));
|
break;
|
}
|
}
|
|
return result;
|
}
|
|
std::string
|
truncate_report_text_value(const std::string& value, const std::size_t max_length, bool* truncated)
|
{
|
if (truncated != nullptr)
|
*truncated = value.size() > max_length;
|
|
if (value.size() <= max_length)
|
return value;
|
|
return value.substr(0, max_length);
|
}
|
|
SqlTextLookupSummary
|
build_sql_text_lookup_summary(const std::optional<std::string>& sql_id, int64 dbid)
|
{
|
SqlTextLookupSummary summary;
|
const std::string normalized_sql_id = normalize_sql_id_lookup_key(sql_id);
|
|
if (!sql_id.has_value())
|
{
|
return summary;
|
}
|
|
if (normalized_sql_id.empty())
|
{
|
summary.lookup = "empty_sql_id";
|
summary.rendered_sql_text = "<empty sql_id>";
|
return summary;
|
}
|
|
const std::optional<std::string> sql_text = rudb::ash::find_sql_text(normalized_sql_id, true, dbid);
|
|
if (!sql_text.has_value())
|
{
|
summary.lookup = "not_found";
|
summary.rendered_sql_text = "<not found>";
|
summary.original_length = "unknown";
|
return summary;
|
}
|
|
summary.lookup = "found";
|
summary.original_length = std::to_string(sql_text->size());
|
summary.rendered_sql_text = truncate_report_text_value(
|
sanitize_report_text_value(*sql_text),
|
kAwrSqlReportTextMaxLength,
|
&summary.truncated);
|
return summary;
|
}
|
|
void
|
append_sql_text_lookup_summary_rows(std::vector<std::string>& rows, const SqlTextLookupSummary& summary)
|
{
|
rows.push_back("sql_text_lookup=" + summary.lookup);
|
rows.push_back("sql_text_length=" + summary.original_length);
|
rows.push_back(std::string("sql_text_truncated=") + (summary.truncated ? "true" : "false"));
|
rows.push_back("sql_text=" + summary.rendered_sql_text);
|
}
|
|
std::vector<std::string>
|
enrich_awr_sql_report_with_sql_text(const std::vector<std::string>& base_rows,
|
const std::optional<std::string>& sql_id,
|
int64 dbid)
|
{
|
std::vector<std::string> rows = base_rows;
|
append_sql_text_lookup_summary_rows(rows, build_sql_text_lookup_summary(sql_id, dbid));
|
return rows;
|
}
|
|
std::vector<std::string>
|
enrich_awr_sql_report_html_with_sql_text(const std::vector<std::string>& base_rows,
|
const std::optional<std::string>& sql_id,
|
int64 dbid)
|
{
|
std::vector<std::string> rows = base_rows;
|
|
if (rows.empty())
|
return rows;
|
|
std::vector<std::string> lookup_rows;
|
append_sql_text_lookup_summary_rows(lookup_rows, build_sql_text_lookup_summary(sql_id, dbid));
|
|
std::string appended;
|
|
for (const std::string& row : lookup_rows)
|
{
|
if (!appended.empty())
|
appended += "\n";
|
|
appended += xml_escape(row);
|
}
|
|
const std::string suffix = "</pre></body></html>";
|
const std::size_t suffix_pos = rows[0].rfind(suffix);
|
|
if (suffix_pos == std::string::npos)
|
{
|
rows[0] += "\n" + appended;
|
return rows;
|
}
|
|
rows[0].insert(suffix_pos, "\n" + appended);
|
return rows;
|
}
|
|
[[noreturn]] void
|
raise_invalid_argument(const char* function_name, const char* argument_name, const char* reason)
|
{
|
ereport(ERROR,
|
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
|
errmsg("DBMS_WORKLOAD_REPOSITORY.%s: %s", function_name, reason),
|
errdetail("Параметр: %s.", argument_name)));
|
pg_unreachable();
|
}
|
|
std::string
|
service_state_via_entrypoint()
|
{
|
const Datum state = DirectFunctionCall0(dbms_workload_repository_service_state);
|
char* value = TextDatumGetCString(state);
|
std::string result(value);
|
|
pfree(value);
|
return result;
|
}
|
|
void
|
ensure_workload_repository_service_ready()
|
{
|
const std::string state = service_state_via_entrypoint();
|
|
if (state.empty() || state.rfind("ready", 0) != 0)
|
{
|
ereport(ERROR,
|
(errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
|
errmsg("DBMS_WORKLOAD_REPOSITORY service is unavailable"),
|
errdetail("Текущее состояние сервиса: %s.", state.c_str())));
|
}
|
}
|
|
template <typename Callback>
|
void
|
execute_repository_entrypoint(Callback&& callback, const char* context_name)
|
{
|
try
|
{
|
callback();
|
}
|
catch (const std::bad_alloc&)
|
{
|
ereport(ERROR,
|
(errcode(ERRCODE_OUT_OF_MEMORY),
|
errmsg("недостаточно памяти в %s", context_name)));
|
}
|
catch (const std::exception& error)
|
{
|
ereport(ERROR,
|
(errcode(ERRCODE_INTERNAL_ERROR),
|
errmsg("ошибка %s: %s", context_name, error.what())));
|
}
|
}
|
|
void
|
emit_text_rows(FunctionCallInfo fcinfo, const std::vector<std::string>& rows)
|
{
|
ReturnSetInfo* rsinfo = reinterpret_cast<ReturnSetInfo*>(fcinfo->resultinfo);
|
|
if (rsinfo == nullptr || !IsA(rsinfo, ReturnSetInfo))
|
{
|
ereport(ERROR,
|
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
|
errmsg("set-valued function called in context that cannot accept a set")));
|
}
|
|
InitMaterializedSRF(fcinfo, MAT_SRF_USE_EXPECTED_DESC | MAT_SRF_BLESS);
|
|
for (const std::string& row : rows)
|
{
|
Datum values[1];
|
bool nulls[1] = {false};
|
|
values[0] = CStringGetTextDatum(row.c_str());
|
tuplestore_putvalues(rsinfo->setResult, rsinfo->setDesc, values, nulls);
|
}
|
}
|
|
int64
|
require_number_arg(FunctionCallInfo fcinfo, int argno, const char* function_name, const char* argument_name)
|
{
|
const std::optional<int64> value = number_arg_to_int64(fcinfo, argno);
|
|
if (!value.has_value())
|
{
|
std::string reason = std::string("value NULL for parameter ") + argument_name + " is invalid";
|
raise_invalid_argument(function_name, argument_name, reason.c_str());
|
}
|
|
return *value;
|
}
|
|
void
|
validate_local_repository_identity(int64 dbid,
|
const std::optional<int64>& inst_num,
|
const char* function_name,
|
bool instance_required)
|
{
|
if (dbid != rudb::awr::local_dbid())
|
{
|
raise_invalid_argument(function_name, "l_dbid",
|
"database/instance does not exist in local RUDB AWR repository");
|
}
|
|
if (instance_required)
|
{
|
if (!inst_num.has_value())
|
raise_invalid_argument(function_name, "l_inst_num", "value NULL for parameter l_inst_num is invalid");
|
|
if (*inst_num != 1)
|
{
|
raise_invalid_argument(function_name, "l_inst_num",
|
"database/instance does not exist in local RUDB AWR repository");
|
}
|
}
|
else if (inst_num.has_value() && *inst_num != 1)
|
{
|
raise_invalid_argument(function_name, "l_inst_num",
|
"database/instance does not exist in local RUDB AWR repository");
|
}
|
}
|
|
std::optional<int>
|
optional_minutes_arg(FunctionCallInfo fcinfo,
|
int argno,
|
const char* function_name,
|
const char* argument_name)
|
{
|
const std::optional<int64> value = number_arg_to_int64(fcinfo, argno);
|
|
if (!value.has_value())
|
return std::nullopt;
|
|
if (*value < 0)
|
raise_invalid_argument(function_name, argument_name, "negative value is invalid");
|
|
if (*value > std::numeric_limits<int>::max())
|
raise_invalid_argument(function_name, argument_name, "value is too large");
|
|
return static_cast<int>(*value);
|
}
|
|
std::optional<int64>
|
optional_dbid_arg(FunctionCallInfo fcinfo, int argno)
|
{
|
return number_arg_to_int64(fcinfo, argno);
|
}
|
|
void
|
validate_snapshot_range(int64 begin_snap_id, int64 end_snap_id, const char* function_name)
|
{
|
if (begin_snap_id >= end_snap_id)
|
raise_invalid_argument(function_name, "l_bid", "invalid snapshot range");
|
}
|
|
bool
|
contains_non_ascii(const std::string& value)
|
{
|
for (unsigned char ch : value)
|
{
|
if (ch > 127)
|
return true;
|
}
|
|
return false;
|
}
|
|
bool
|
is_valid_awr_name(const std::string& value)
|
{
|
for (unsigned char ch : value)
|
{
|
if (std::isalnum(ch) != 0 || ch == '_' || ch == '-' || ch == '.' || ch == '$' || ch == '#')
|
continue;
|
|
return false;
|
}
|
|
return true;
|
}
|
|
void
|
validate_data_src(const std::optional<int64>& data_src, bool allow_global_extra, const char* function_name)
|
{
|
if (!data_src.has_value())
|
return;
|
|
const int64 value = *data_src;
|
const bool valid = allow_global_extra
|
? (value >= 0 && value <= 3)
|
: (value >= 0 && value <= 2);
|
|
if (!valid)
|
raise_invalid_argument(function_name, "l_data_src", "unsupported l_data_src value");
|
}
|
|
bool
|
parse_positive_int64_token(const std::string& token, int64* result)
|
{
|
uint64 value = 0;
|
|
if (token.empty() || result == nullptr)
|
return false;
|
|
for (unsigned char ch : token)
|
{
|
if (std::isdigit(ch) == 0)
|
return false;
|
|
const uint64 digit = static_cast<uint64>(ch - '0');
|
|
if (value > (static_cast<uint64>(PG_INT64_MAX) - digit) / 10)
|
return false;
|
|
value = value * 10 + digit;
|
}
|
|
if (value == 0)
|
return false;
|
|
*result = static_cast<int64>(value);
|
return true;
|
}
|
|
std::optional<std::string>
|
normalize_instance_list(const std::optional<std::string>& value, const char* function_name)
|
{
|
if (!value.has_value())
|
return std::nullopt;
|
|
const std::string trimmed = trim_ascii_copy(*value);
|
|
if (trimmed.empty())
|
{
|
if (!value->empty())
|
raise_invalid_argument(function_name, "l_inst_num", "invalid instance list format");
|
|
return std::nullopt;
|
}
|
|
std::string normalized;
|
std::size_t position = 0;
|
|
while (position < trimmed.size())
|
{
|
const std::size_t comma = trimmed.find(',', position);
|
const std::string token = trim_ascii_copy(trimmed.substr(position, comma - position));
|
int64 parsed_value = 0;
|
|
if (token.empty())
|
raise_invalid_argument(function_name, "l_inst_num", "invalid instance list format");
|
|
if (!parse_positive_int64_token(token, &parsed_value))
|
raise_invalid_argument(function_name, "l_inst_num", "invalid instance list format");
|
|
if (!normalized.empty())
|
normalized += ",";
|
|
normalized += std::to_string(parsed_value);
|
|
if (comma == std::string::npos)
|
break;
|
|
position = comma + 1;
|
}
|
|
return normalized;
|
}
|
|
ParsedInstanceList
|
parse_instance_list(const std::optional<std::string>& value, const char* function_name)
|
{
|
ParsedInstanceList result;
|
result.requested_instance_list_raw = value;
|
|
const std::optional<std::string> normalized = normalize_instance_list(value, function_name);
|
|
if (!normalized.has_value())
|
return result;
|
|
result.default_instance_list = false;
|
result.normalized_instance_list = *normalized;
|
result.instance_numbers.clear();
|
|
std::size_t position = 0;
|
|
while (position < normalized->size())
|
{
|
const std::size_t comma = normalized->find(',', position);
|
const std::string token = normalized->substr(position, comma - position);
|
int64 parsed_value = 0;
|
|
if (!parse_positive_int64_token(token, &parsed_value))
|
raise_invalid_argument(function_name, "l_inst_num", "invalid instance list format");
|
|
result.instance_numbers.push_back(parsed_value);
|
|
if (comma == std::string::npos)
|
break;
|
|
position = comma + 1;
|
}
|
|
return result;
|
}
|
} // namespace
|
|
extern "C"
|
{
|
PG_FUNCTION_INFO_V1(dbms_workload_repository_min_interval);
|
PG_FUNCTION_INFO_V1(dbms_workload_repository_max_interval);
|
PG_FUNCTION_INFO_V1(dbms_workload_repository_min_retention);
|
PG_FUNCTION_INFO_V1(dbms_workload_repository_max_retention);
|
PG_FUNCTION_INFO_V1(dbms_workload_repository_wh_mailbox_type_fs);
|
PG_FUNCTION_INFO_V1(dbms_workload_repository_wh_mailbox_type_cloud);
|
PG_FUNCTION_INFO_V1(dbms_workload_repository_get_version);
|
PG_FUNCTION_INFO_V1(dbms_workload_repository_service_state);
|
PG_FUNCTION_INFO_V1(dbms_workload_repository_add_colored_application_0);
|
PG_FUNCTION_INFO_V1(dbms_workload_repository_add_colored_application_1);
|
PG_FUNCTION_INFO_V1(dbms_workload_repository_add_colored_sql_0);
|
PG_FUNCTION_INFO_V1(dbms_workload_repository_add_colored_sql_1);
|
PG_FUNCTION_INFO_V1(dbms_workload_repository_ash_global_report_html);
|
PG_FUNCTION_INFO_V1(dbms_workload_repository_ash_global_report_text);
|
PG_FUNCTION_INFO_V1(dbms_workload_repository_ash_report_analytics_0);
|
PG_FUNCTION_INFO_V1(dbms_workload_repository_ash_report_analytics_1);
|
PG_FUNCTION_INFO_V1(dbms_workload_repository_ash_report_html);
|
PG_FUNCTION_INFO_V1(dbms_workload_repository_ash_report_text);
|
PG_FUNCTION_INFO_V1(dbms_workload_repository_awr_diff_report_html_0);
|
PG_FUNCTION_INFO_V1(dbms_workload_repository_awr_diff_report_html_1);
|
PG_FUNCTION_INFO_V1(dbms_workload_repository_awr_diff_report_text_0);
|
PG_FUNCTION_INFO_V1(dbms_workload_repository_awr_diff_report_text_1);
|
PG_FUNCTION_INFO_V1(dbms_workload_repository_awr_exp_0);
|
PG_FUNCTION_INFO_V1(dbms_workload_repository_awr_exp_1);
|
PG_FUNCTION_INFO_V1(dbms_workload_repository_awr_global_diff_report_html_0);
|
PG_FUNCTION_INFO_V1(dbms_workload_repository_awr_global_diff_report_html_1);
|
PG_FUNCTION_INFO_V1(dbms_workload_repository_awr_global_diff_report_text_0);
|
PG_FUNCTION_INFO_V1(dbms_workload_repository_awr_global_diff_report_text_1);
|
PG_FUNCTION_INFO_V1(dbms_workload_repository_awr_global_report_html_0);
|
PG_FUNCTION_INFO_V1(dbms_workload_repository_awr_global_report_html_1);
|
PG_FUNCTION_INFO_V1(dbms_workload_repository_awr_global_report_text_0);
|
PG_FUNCTION_INFO_V1(dbms_workload_repository_awr_global_report_text_1);
|
PG_FUNCTION_INFO_V1(dbms_workload_repository_awr_imp_0);
|
PG_FUNCTION_INFO_V1(dbms_workload_repository_awr_imp_1);
|
PG_FUNCTION_INFO_V1(dbms_workload_repository_awr_report_0);
|
PG_FUNCTION_INFO_V1(dbms_workload_repository_awr_report_1);
|
PG_FUNCTION_INFO_V1(dbms_workload_repository_awr_report_html);
|
PG_FUNCTION_INFO_V1(dbms_workload_repository_awr_report_text);
|
PG_FUNCTION_INFO_V1(dbms_workload_repository_awr_set_report_thresholds_0);
|
PG_FUNCTION_INFO_V1(dbms_workload_repository_awr_set_report_thresholds_1);
|
PG_FUNCTION_INFO_V1(dbms_workload_repository_awr_sql_report_html);
|
PG_FUNCTION_INFO_V1(dbms_workload_repository_awr_sql_report_text);
|
PG_FUNCTION_INFO_V1(dbms_workload_repository_control_restricted_snapshot_0);
|
PG_FUNCTION_INFO_V1(dbms_workload_repository_control_restricted_snapshot_1);
|
PG_FUNCTION_INFO_V1(dbms_workload_repository_create_baseline_0);
|
PG_FUNCTION_INFO_V1(dbms_workload_repository_create_baseline_1);
|
PG_FUNCTION_INFO_V1(dbms_workload_repository_create_baseline_2);
|
PG_FUNCTION_INFO_V1(dbms_workload_repository_create_baseline_3);
|
PG_FUNCTION_INFO_V1(dbms_workload_repository_create_baseline_4);
|
PG_FUNCTION_INFO_V1(dbms_workload_repository_create_baseline_template_0);
|
PG_FUNCTION_INFO_V1(dbms_workload_repository_create_baseline_template_1);
|
PG_FUNCTION_INFO_V1(dbms_workload_repository_create_remote_snapshot_0);
|
PG_FUNCTION_INFO_V1(dbms_workload_repository_create_remote_snapshot_1);
|
PG_FUNCTION_INFO_V1(dbms_workload_repository_create_remote_snapshot_2);
|
PG_FUNCTION_INFO_V1(dbms_workload_repository_create_remote_snapshot_3);
|
PG_FUNCTION_INFO_V1(dbms_workload_repository_create_snapshot_0);
|
PG_FUNCTION_INFO_V1(dbms_workload_repository_create_snapshot_1);
|
PG_FUNCTION_INFO_V1(dbms_workload_repository_define_application_0);
|
PG_FUNCTION_INFO_V1(dbms_workload_repository_define_application_1);
|
PG_FUNCTION_INFO_V1(dbms_workload_repository_disable_awrapp_snapshot_0);
|
PG_FUNCTION_INFO_V1(dbms_workload_repository_disable_awrapp_snapshot_1);
|
PG_FUNCTION_INFO_V1(dbms_workload_repository_drop_baseline_0);
|
PG_FUNCTION_INFO_V1(dbms_workload_repository_drop_baseline_1);
|
PG_FUNCTION_INFO_V1(dbms_workload_repository_drop_baseline_template_0);
|
PG_FUNCTION_INFO_V1(dbms_workload_repository_drop_baseline_template_1);
|
PG_FUNCTION_INFO_V1(dbms_workload_repository_drop_snapshot_range_0);
|
PG_FUNCTION_INFO_V1(dbms_workload_repository_drop_snapshot_range_1);
|
PG_FUNCTION_INFO_V1(dbms_workload_repository_enable_awrapp_snapshot_0);
|
PG_FUNCTION_INFO_V1(dbms_workload_repository_enable_awrapp_snapshot_1);
|
PG_FUNCTION_INFO_V1(dbms_workload_repository_enable_snapshot_service_0);
|
PG_FUNCTION_INFO_V1(dbms_workload_repository_enable_snapshot_service_1);
|
PG_FUNCTION_INFO_V1(dbms_workload_repository_exclude_appmap_0);
|
PG_FUNCTION_INFO_V1(dbms_workload_repository_exclude_appmap_1);
|
PG_FUNCTION_INFO_V1(dbms_workload_repository_extract_0);
|
PG_FUNCTION_INFO_V1(dbms_workload_repository_extract_1);
|
PG_FUNCTION_INFO_V1(dbms_workload_repository_get_awr_id);
|
PG_FUNCTION_INFO_V1(dbms_workload_repository_get_awr_view_name_by_location_0);
|
PG_FUNCTION_INFO_V1(dbms_workload_repository_get_awr_view_name_by_location_1);
|
PG_FUNCTION_INFO_V1(dbms_workload_repository_include_appmap_0);
|
PG_FUNCTION_INFO_V1(dbms_workload_repository_include_appmap_1);
|
PG_FUNCTION_INFO_V1(dbms_workload_repository_is_automatic_snapshot_enabled_0);
|
PG_FUNCTION_INFO_V1(dbms_workload_repository_is_automatic_snapshot_enabled_1);
|
PG_FUNCTION_INFO_V1(dbms_workload_repository_load_0);
|
PG_FUNCTION_INFO_V1(dbms_workload_repository_load_1);
|
PG_FUNCTION_INFO_V1(dbms_workload_repository_local_awr_dbid);
|
PG_FUNCTION_INFO_V1(dbms_workload_repository_modify_awrexp_settings_0);
|
PG_FUNCTION_INFO_V1(dbms_workload_repository_modify_awrexp_settings_1);
|
PG_FUNCTION_INFO_V1(dbms_workload_repository_modify_baseline_window_size_0);
|
PG_FUNCTION_INFO_V1(dbms_workload_repository_modify_baseline_window_size_1);
|
PG_FUNCTION_INFO_V1(dbms_workload_repository_modify_snapshot_settings_0);
|
PG_FUNCTION_INFO_V1(dbms_workload_repository_modify_snapshot_settings_1);
|
PG_FUNCTION_INFO_V1(dbms_workload_repository_modify_table_quota_0);
|
PG_FUNCTION_INFO_V1(dbms_workload_repository_modify_table_quota_1);
|
PG_FUNCTION_INFO_V1(dbms_workload_repository_modify_table_settings_0);
|
PG_FUNCTION_INFO_V1(dbms_workload_repository_modify_table_settings_1);
|
PG_FUNCTION_INFO_V1(dbms_workload_repository_purge_sql_details_0);
|
PG_FUNCTION_INFO_V1(dbms_workload_repository_purge_sql_details_1);
|
PG_FUNCTION_INFO_V1(dbms_workload_repository_register_database_0);
|
PG_FUNCTION_INFO_V1(dbms_workload_repository_register_database_1);
|
PG_FUNCTION_INFO_V1(dbms_workload_repository_register_remote_database_0);
|
PG_FUNCTION_INFO_V1(dbms_workload_repository_register_remote_database_1);
|
PG_FUNCTION_INFO_V1(dbms_workload_repository_remove_colored_sql_0);
|
PG_FUNCTION_INFO_V1(dbms_workload_repository_remove_colored_sql_1);
|
PG_FUNCTION_INFO_V1(dbms_workload_repository_rename_baseline_0);
|
PG_FUNCTION_INFO_V1(dbms_workload_repository_rename_baseline_1);
|
PG_FUNCTION_INFO_V1(dbms_workload_repository_select_baseline_details_0);
|
PG_FUNCTION_INFO_V1(dbms_workload_repository_select_baseline_details_1);
|
PG_FUNCTION_INFO_V1(dbms_workload_repository_select_baseline_metric_0);
|
PG_FUNCTION_INFO_V1(dbms_workload_repository_select_baseline_metric_1);
|
PG_FUNCTION_INFO_V1(dbms_workload_repository_select_opt_env_details_0);
|
PG_FUNCTION_INFO_V1(dbms_workload_repository_select_opt_env_details_1);
|
PG_FUNCTION_INFO_V1(dbms_workload_repository_set_report_sections_0);
|
PG_FUNCTION_INFO_V1(dbms_workload_repository_set_report_sections_1);
|
PG_FUNCTION_INFO_V1(dbms_workload_repository_unregister_database_0);
|
PG_FUNCTION_INFO_V1(dbms_workload_repository_unregister_database_1);
|
PG_FUNCTION_INFO_V1(dbms_workload_repository_unregister_remote_database_0);
|
PG_FUNCTION_INFO_V1(dbms_workload_repository_unregister_remote_database_1);
|
PG_FUNCTION_INFO_V1(dbms_workload_repository_update_datafile_info);
|
PG_FUNCTION_INFO_V1(dbms_workload_repository_update_object_info_0);
|
PG_FUNCTION_INFO_V1(dbms_workload_repository_update_object_info_1);
|
} // extern "C"
|
|
#define RUDB_DBMS_WORKLOAD_REPOSITORY_VERSION "1.0.0"
|
|
static void
|
dbms_workload_repository_raise_stub_error(const char* message)
|
{
|
ereport(ERROR, (errmsg("%s", message)));
|
}
|
|
Datum dbms_workload_repository_min_interval(PG_FUNCTION_ARGS)
|
{
|
PG_RETURN_INT32(kDbmsWorkloadRepositoryMinIntervalValue);
|
}
|
|
Datum dbms_workload_repository_max_interval(PG_FUNCTION_ARGS)
|
{
|
PG_RETURN_INT32(kDbmsWorkloadRepositoryMaxIntervalValue);
|
}
|
|
Datum dbms_workload_repository_min_retention(PG_FUNCTION_ARGS)
|
{
|
PG_RETURN_INT32(kDbmsWorkloadRepositoryMinRetentionValue);
|
}
|
|
Datum dbms_workload_repository_max_retention(PG_FUNCTION_ARGS)
|
{
|
PG_RETURN_INT32(kDbmsWorkloadRepositoryMaxRetentionValue);
|
}
|
|
Datum dbms_workload_repository_wh_mailbox_type_fs(PG_FUNCTION_ARGS)
|
{
|
PG_RETURN_INT32(kDbmsWorkloadRepositoryWhMailboxTypeFsValue);
|
}
|
|
Datum dbms_workload_repository_wh_mailbox_type_cloud(PG_FUNCTION_ARGS)
|
{
|
PG_RETURN_INT32(kDbmsWorkloadRepositoryWhMailboxTypeCloudValue);
|
}
|
|
Datum dbms_workload_repository_get_version(PG_FUNCTION_ARGS)
|
{
|
PG_RETURN_TEXT_P(cstring_to_text(RUDB_DBMS_WORKLOAD_REPOSITORY_VERSION));
|
}
|
|
Datum dbms_workload_repository_service_state(PG_FUNCTION_ARGS)
|
{
|
std::string state;
|
execute_repository_entrypoint([&]() {
|
rudb::awr::initialize();
|
rudb::ash::initialize();
|
|
if (!rudb::awr::is_initialized())
|
ereport(ERROR,
|
(errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
|
errmsg("DBMS_WORKLOAD_REPOSITORY AWR layer is not initialized")));
|
|
if (!rudb::ash::is_initialized())
|
ereport(ERROR,
|
(errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
|
errmsg("DBMS_WORKLOAD_REPOSITORY ASH layer is not initialized")));
|
|
const int64 dbid = rudb::awr::local_dbid();
|
|
if (dbid <= 0)
|
ereport(ERROR,
|
(errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
|
errmsg("DBMS_WORKLOAD_REPOSITORY local AWR DBID is invalid")));
|
|
state = "ready; local_dbid=" + std::to_string(dbid) + "; " +
|
rudb::ash::service_state() + "; " + rudb::awr::service_state();
|
}, "DBMS_WORKLOAD_REPOSITORY.SERVICE_STATE");
|
PG_RETURN_TEXT_P(cstring_to_text(state.c_str()));
|
}
|
|
Datum dbms_workload_repository_add_colored_application_0(PG_FUNCTION_ARGS)
|
{
|
/*
|
* TODO: функция пока не реализована; чтение аргументов оставлено
|
* ниже как подсказка для разработчика. Раскомментируйте и
|
* адаптируйте эти строки при ручной реализации.
|
*/
|
// const int32 dbid = PG_GETARG_INT32(0);
|
// (void) dbid;
|
//
|
// const text* app_name = PG_GETARG_TEXT_PP(1);
|
// (void) app_name;
|
|
dbms_workload_repository_raise_stub_error("процедура DBMS_WORKLOAD_REPOSITORY.ADD_COLORED_APPLICATION не реализована.");
|
PG_RETURN_VOID();
|
}
|
|
Datum dbms_workload_repository_add_colored_application_1(PG_FUNCTION_ARGS)
|
{
|
dbms_workload_repository_raise_stub_error("процедура DBMS_WORKLOAD_REPOSITORY.ADD_COLORED_APPLICATION не реализована.");
|
PG_RETURN_VOID();
|
}
|
|
Datum dbms_workload_repository_add_colored_sql_0(PG_FUNCTION_ARGS)
|
{
|
/*
|
* TODO: функция пока не реализована; чтение аргументов оставлено
|
* ниже как подсказка для разработчика. Раскомментируйте и
|
* адаптируйте эти строки при ручной реализации.
|
*/
|
// const text* sql_id = PG_GETARG_TEXT_PP(0);
|
// (void) sql_id;
|
//
|
// const int32 dbid = PG_GETARG_INT32(1);
|
// (void) dbid;
|
|
dbms_workload_repository_raise_stub_error("процедура DBMS_WORKLOAD_REPOSITORY.ADD_COLORED_SQL не реализована.");
|
PG_RETURN_VOID();
|
}
|
|
Datum dbms_workload_repository_add_colored_sql_1(PG_FUNCTION_ARGS)
|
{
|
dbms_workload_repository_raise_stub_error("процедура DBMS_WORKLOAD_REPOSITORY.ADD_COLORED_SQL не реализована.");
|
PG_RETURN_VOID();
|
}
|
|
Datum dbms_workload_repository_ash_global_report_html(PG_FUNCTION_ARGS)
|
{
|
ensure_workload_repository_service_ready();
|
rudb::ash::LayerReportRequest request;
|
const ParsedInstanceList parsed_instances =
|
parse_instance_list(text_arg_to_string(fcinfo, 1), "ASH_GLOBAL_REPORT_HTML");
|
request.dbid = require_number_arg(fcinfo, 0, "ASH_GLOBAL_REPORT_HTML", "l_dbid");
|
request.requested_instance_list_raw = parsed_instances.requested_instance_list_raw;
|
request.instance_numbers = parsed_instances.instance_numbers;
|
request.normalized_instance_list = parsed_instances.normalized_instance_list;
|
request.default_instance_list = parsed_instances.default_instance_list;
|
request.begin_time = date_arg_to_timestamptz(fcinfo, 2);
|
request.end_time = date_arg_to_timestamptz(fcinfo, 3);
|
request.options = number_arg_to_int64(fcinfo, 4);
|
request.slot_width = number_arg_to_int64(fcinfo, 5);
|
request.sid = number_arg_to_int64(fcinfo, 6);
|
request.sql_id = text_arg_to_string(fcinfo, 7);
|
request.wait_class = text_arg_to_string(fcinfo, 8);
|
request.service_hash = number_arg_to_int64(fcinfo, 9);
|
request.module = text_arg_to_string(fcinfo, 10);
|
request.action = text_arg_to_string(fcinfo, 11);
|
request.client_id = text_arg_to_string(fcinfo, 12);
|
request.plsql_entry = text_arg_to_string(fcinfo, 13);
|
request.data_src = number_arg_to_int64(fcinfo, 14);
|
request.container = text_arg_to_string(fcinfo, 15);
|
request.global_scope = true;
|
|
validate_local_repository_identity(request.dbid, std::nullopt, "ASH_GLOBAL_REPORT_HTML", false);
|
validate_data_src(request.data_src, true, "ASH_GLOBAL_REPORT_HTML");
|
|
if (!request.begin_time.has_value())
|
{
|
raise_invalid_argument("ASH_GLOBAL_REPORT_HTML", "l_btime", "could not find ASH samples for the requested interval");
|
}
|
|
if (request.end_time.has_value() && *request.begin_time >= *request.end_time)
|
{
|
raise_invalid_argument("ASH_GLOBAL_REPORT_HTML", "l_btime", "begin time must be strictly less than end time");
|
}
|
|
std::vector<std::string> rows = build_ash_report_or_error(
|
[&request]() { return rudb::ash::global_report_html(request); });
|
emit_text_rows(fcinfo, rows);
|
PG_RETURN_NULL();
|
}
|
|
Datum dbms_workload_repository_ash_global_report_text(PG_FUNCTION_ARGS)
|
{
|
ensure_workload_repository_service_ready();
|
rudb::ash::LayerReportRequest request;
|
const ParsedInstanceList parsed_instances =
|
parse_instance_list(text_arg_to_string(fcinfo, 1), "ASH_GLOBAL_REPORT_TEXT");
|
request.dbid = require_number_arg(fcinfo, 0, "ASH_GLOBAL_REPORT_TEXT", "l_dbid");
|
request.requested_instance_list_raw = parsed_instances.requested_instance_list_raw;
|
request.instance_numbers = parsed_instances.instance_numbers;
|
request.normalized_instance_list = parsed_instances.normalized_instance_list;
|
request.default_instance_list = parsed_instances.default_instance_list;
|
request.begin_time = date_arg_to_timestamptz(fcinfo, 2);
|
request.end_time = date_arg_to_timestamptz(fcinfo, 3);
|
request.options = number_arg_to_int64(fcinfo, 4);
|
request.slot_width = number_arg_to_int64(fcinfo, 5);
|
request.sid = number_arg_to_int64(fcinfo, 6);
|
request.sql_id = text_arg_to_string(fcinfo, 7);
|
request.wait_class = text_arg_to_string(fcinfo, 8);
|
request.service_hash = number_arg_to_int64(fcinfo, 9);
|
request.module = text_arg_to_string(fcinfo, 10);
|
request.action = text_arg_to_string(fcinfo, 11);
|
request.client_id = text_arg_to_string(fcinfo, 12);
|
request.plsql_entry = text_arg_to_string(fcinfo, 13);
|
request.data_src = number_arg_to_int64(fcinfo, 14);
|
request.container = text_arg_to_string(fcinfo, 15);
|
request.global_scope = true;
|
|
validate_local_repository_identity(request.dbid, std::nullopt, "ASH_GLOBAL_REPORT_TEXT", false);
|
validate_data_src(request.data_src, true, "ASH_GLOBAL_REPORT_TEXT");
|
|
if (!request.begin_time.has_value())
|
{
|
raise_invalid_argument("ASH_GLOBAL_REPORT_TEXT", "l_btime", "could not find ASH samples for the requested interval");
|
}
|
|
if (request.end_time.has_value() && *request.begin_time >= *request.end_time)
|
{
|
raise_invalid_argument("ASH_GLOBAL_REPORT_TEXT", "l_btime", "begin time must be strictly less than end time");
|
}
|
|
std::vector<std::string> rows = build_ash_report_or_error(
|
[&request]() { return rudb::ash::global_report_text(request); });
|
emit_text_rows(fcinfo, rows);
|
PG_RETURN_NULL();
|
}
|
|
Datum dbms_workload_repository_ash_report_analytics_0(PG_FUNCTION_ARGS)
|
{
|
/*
|
* TODO: функция пока не реализована; чтение аргументов оставлено
|
* ниже как подсказка для разработчика. Раскомментируйте и
|
* адаптируйте эти строки при ручной реализации.
|
*/
|
// const text* arg_1 = PG_GETARG_TEXT_PP(0);
|
// (void) arg_1;
|
//
|
// const int32 dbid = PG_GETARG_INT32(1);
|
// (void) dbid;
|
//
|
// const int32 inst_id = PG_GETARG_INT32(2);
|
// (void) inst_id;
|
//
|
// const int32 begin_time = PG_GETARG_INT32(3);
|
// (void) begin_time;
|
//
|
// const int32 end_time = PG_GETARG_INT32(4);
|
// (void) end_time;
|
//
|
// const text* report_level = PG_GETARG_TEXT_PP(5);
|
// (void) report_level;
|
//
|
// const text* filter_list = PG_GETARG_TEXT_PP(6);
|
// (void) filter_list;
|
|
dbms_workload_repository_raise_stub_error("процедура DBMS_WORKLOAD_REPOSITORY.ASH_REPORT_ANALYTICS не реализована.");
|
PG_RETURN_VOID();
|
}
|
|
Datum dbms_workload_repository_ash_report_analytics_1(PG_FUNCTION_ARGS)
|
{
|
dbms_workload_repository_raise_stub_error("процедура DBMS_WORKLOAD_REPOSITORY.ASH_REPORT_ANALYTICS не реализована.");
|
PG_RETURN_VOID();
|
}
|
|
Datum dbms_workload_repository_ash_report_html(PG_FUNCTION_ARGS)
|
{
|
ensure_workload_repository_service_ready();
|
rudb::ash::LayerReportRequest request;
|
request.dbid = require_number_arg(fcinfo, 0, "ASH_REPORT_HTML", "l_dbid");
|
request.inst_num = number_arg_to_int64(fcinfo, 1);
|
request.begin_time = date_arg_to_timestamptz(fcinfo, 2);
|
request.end_time = date_arg_to_timestamptz(fcinfo, 3);
|
request.options = number_arg_to_int64(fcinfo, 4);
|
request.slot_width = number_arg_to_int64(fcinfo, 5);
|
request.sid = number_arg_to_int64(fcinfo, 6);
|
request.sql_id = text_arg_to_string(fcinfo, 7);
|
request.wait_class = text_arg_to_string(fcinfo, 8);
|
request.service_hash = number_arg_to_int64(fcinfo, 9);
|
request.module = text_arg_to_string(fcinfo, 10);
|
request.action = text_arg_to_string(fcinfo, 11);
|
request.client_id = text_arg_to_string(fcinfo, 12);
|
request.plsql_entry = text_arg_to_string(fcinfo, 13);
|
request.data_src = number_arg_to_int64(fcinfo, 14);
|
request.container = text_arg_to_string(fcinfo, 15);
|
|
validate_local_repository_identity(request.dbid, request.inst_num, "ASH_REPORT_HTML", false);
|
validate_data_src(request.data_src, false, "ASH_REPORT_HTML");
|
|
if (!request.begin_time.has_value())
|
{
|
raise_invalid_argument("ASH_REPORT_HTML", "l_btime", "could not find ASH samples for the requested interval");
|
}
|
|
if (request.end_time.has_value() && *request.begin_time >= *request.end_time)
|
{
|
raise_invalid_argument("ASH_REPORT_HTML", "l_btime", "begin time must be strictly less than end time");
|
}
|
|
std::vector<std::string> rows = build_ash_report_or_error(
|
[&request]() { return rudb::ash::report_html(request); });
|
emit_text_rows(fcinfo, rows);
|
PG_RETURN_NULL();
|
}
|
|
Datum dbms_workload_repository_ash_report_text(PG_FUNCTION_ARGS)
|
{
|
ensure_workload_repository_service_ready();
|
rudb::ash::LayerReportRequest request;
|
request.dbid = require_number_arg(fcinfo, 0, "ASH_REPORT_TEXT", "l_dbid");
|
request.inst_num = number_arg_to_int64(fcinfo, 1);
|
request.begin_time = date_arg_to_timestamptz(fcinfo, 2);
|
request.end_time = date_arg_to_timestamptz(fcinfo, 3);
|
request.options = number_arg_to_int64(fcinfo, 4);
|
request.slot_width = number_arg_to_int64(fcinfo, 5);
|
request.sid = number_arg_to_int64(fcinfo, 6);
|
request.sql_id = text_arg_to_string(fcinfo, 7);
|
request.wait_class = text_arg_to_string(fcinfo, 8);
|
request.service_hash = number_arg_to_int64(fcinfo, 9);
|
request.module = text_arg_to_string(fcinfo, 10);
|
request.action = text_arg_to_string(fcinfo, 11);
|
request.client_id = text_arg_to_string(fcinfo, 12);
|
request.plsql_entry = text_arg_to_string(fcinfo, 13);
|
request.data_src = number_arg_to_int64(fcinfo, 14);
|
request.container = text_arg_to_string(fcinfo, 15);
|
|
validate_local_repository_identity(request.dbid, request.inst_num, "ASH_REPORT_TEXT", false);
|
validate_data_src(request.data_src, false, "ASH_REPORT_TEXT");
|
|
if (!request.begin_time.has_value())
|
{
|
raise_invalid_argument("ASH_REPORT_TEXT", "l_btime", "could not find ASH samples for the requested interval");
|
}
|
|
if (request.end_time.has_value() && *request.begin_time >= *request.end_time)
|
{
|
raise_invalid_argument("ASH_REPORT_TEXT", "l_btime", "begin time must be strictly less than end time");
|
}
|
|
std::vector<std::string> rows = build_ash_report_or_error(
|
[&request]() { return rudb::ash::report_text(request); });
|
emit_text_rows(fcinfo, rows);
|
PG_RETURN_NULL();
|
}
|
|
Datum dbms_workload_repository_awr_diff_report_html_0(PG_FUNCTION_ARGS)
|
{
|
/*
|
* ERROR: неподдерживаемый элемент сохранён как заглушка.
|
* ERROR: тип TABLE не поддерживается текущим каталогом rudb.
|
*/
|
/*
|
* TODO: функция пока не реализована; чтение аргументов оставлено
|
* ниже как подсказка для разработчика. Раскомментируйте и
|
* адаптируйте эти строки при ручной реализации.
|
*/
|
// const int32 arg_1 = PG_GETARG_INT32(0);
|
// (void) arg_1;
|
//
|
// const int32 dbid1 = PG_GETARG_INT32(1);
|
// (void) dbid1;
|
//
|
// const int32 inst_num1 = PG_GETARG_INT32(2);
|
// (void) inst_num1;
|
//
|
// const int32 bid1 = PG_GETARG_INT32(3);
|
// (void) bid1;
|
//
|
// const int32 eid1 = PG_GETARG_INT32(4);
|
// (void) eid1;
|
//
|
// const int32 dbid2 = PG_GETARG_INT32(5);
|
// (void) dbid2;
|
//
|
// const int32 inst_num2 = PG_GETARG_INT32(6);
|
// (void) inst_num2;
|
//
|
// const int32 bid2 = PG_GETARG_INT32(7);
|
// (void) bid2;
|
//
|
// const int32 eid2 = PG_GETARG_INT32(8);
|
// (void) eid2;
|
//
|
// const int32 p_options = PG_GETARG_INT32(9);
|
// (void) p_options;
|
|
dbms_workload_repository_raise_stub_error("процедура DBMS_WORKLOAD_REPOSITORY.AWR_DIFF_REPORT_HTML не поддерживается: тип TABLE не поддерживается текущим каталогом rudb. Проверьте соответствующую запись в pg_proc.dat.");
|
PG_RETURN_VOID();
|
}
|
|
Datum dbms_workload_repository_awr_diff_report_html_1(PG_FUNCTION_ARGS)
|
{
|
/*
|
* ERROR: неподдерживаемый элемент сохранён как заглушка.
|
* ERROR: тип TABLE не поддерживается текущим каталогом rudb.
|
*/
|
dbms_workload_repository_raise_stub_error("процедура DBMS_WORKLOAD_REPOSITORY.AWR_DIFF_REPORT_HTML не поддерживается: тип TABLE не поддерживается текущим каталогом rudb. Проверьте соответствующую запись в pg_proc.dat.");
|
PG_RETURN_VOID();
|
}
|
|
Datum dbms_workload_repository_awr_diff_report_text_0(PG_FUNCTION_ARGS)
|
{
|
/*
|
* ERROR: неподдерживаемый элемент сохранён как заглушка.
|
* ERROR: тип TABLE не поддерживается текущим каталогом rudb.
|
*/
|
/*
|
* TODO: функция пока не реализована; чтение аргументов оставлено
|
* ниже как подсказка для разработчика. Раскомментируйте и
|
* адаптируйте эти строки при ручной реализации.
|
*/
|
// const int32 arg_1 = PG_GETARG_INT32(0);
|
// (void) arg_1;
|
//
|
// const int32 dbid1 = PG_GETARG_INT32(1);
|
// (void) dbid1;
|
//
|
// const int32 inst_num1 = PG_GETARG_INT32(2);
|
// (void) inst_num1;
|
//
|
// const int32 bid1 = PG_GETARG_INT32(3);
|
// (void) bid1;
|
//
|
// const int32 eid1 = PG_GETARG_INT32(4);
|
// (void) eid1;
|
//
|
// const int32 dbid2 = PG_GETARG_INT32(5);
|
// (void) dbid2;
|
//
|
// const int32 inst_num2 = PG_GETARG_INT32(6);
|
// (void) inst_num2;
|
//
|
// const int32 bid2 = PG_GETARG_INT32(7);
|
// (void) bid2;
|
//
|
// const int32 eid2 = PG_GETARG_INT32(8);
|
// (void) eid2;
|
//
|
// const int32 p_options = PG_GETARG_INT32(9);
|
// (void) p_options;
|
|
dbms_workload_repository_raise_stub_error("процедура DBMS_WORKLOAD_REPOSITORY.AWR_DIFF_REPORT_TEXT не поддерживается: тип TABLE не поддерживается текущим каталогом rudb. Проверьте соответствующую запись в pg_proc.dat.");
|
PG_RETURN_VOID();
|
}
|
|
Datum dbms_workload_repository_awr_diff_report_text_1(PG_FUNCTION_ARGS)
|
{
|
/*
|
* ERROR: неподдерживаемый элемент сохранён как заглушка.
|
* ERROR: тип TABLE не поддерживается текущим каталогом rudb.
|
*/
|
dbms_workload_repository_raise_stub_error("процедура DBMS_WORKLOAD_REPOSITORY.AWR_DIFF_REPORT_TEXT не поддерживается: тип TABLE не поддерживается текущим каталогом rudb. Проверьте соответствующую запись в pg_proc.dat.");
|
PG_RETURN_VOID();
|
}
|
|
Datum dbms_workload_repository_awr_exp_0(PG_FUNCTION_ARGS)
|
{
|
/*
|
* TODO: функция пока не реализована; чтение аргументов оставлено
|
* ниже как подсказка для разработчика. Раскомментируйте и
|
* адаптируйте эти строки при ручной реализации.
|
*/
|
// const bool has_dmpfile = PG_NARGS() > 0 && !PG_ARGISNULL(0);
|
// const text* dmpfile_default = nullptr;
|
// if (!has_dmpfile) {
|
// /* default literal "awrdat" для dmpfile: awrdat (source CSV) */
|
// (void) dmpfile_default;
|
// } else {
|
// (void) PG_GETARG_TEXT_PP(0);
|
// }
|
//
|
// const bool has_dmpdir = PG_NARGS() > 1 && !PG_ARGISNULL(1);
|
// const text* dmpdir_default = nullptr;
|
// if (!has_dmpdir) {
|
// /* default literal "DATA_PUMP_DIR" для dmpdir: DATA_PUMP_DIR (source CSV) */
|
// (void) dmpdir_default;
|
// } else {
|
// (void) PG_GETARG_TEXT_PP(1);
|
// }
|
//
|
// const int32 dbid = PG_GETARG_INT32(2);
|
// (void) dbid;
|
//
|
// const bool has_bid = PG_NARGS() > 3 && !PG_ARGISNULL(3);
|
// const int32 bid_default = 1;
|
// if (!has_bid) {
|
// /* default literal 1 для bid: 1 (source CSV) */
|
// (void) bid_default;
|
// } else {
|
// (void) PG_GETARG_INT32(3);
|
// }
|
//
|
// const bool has_eid = PG_NARGS() > 4 && !PG_ARGISNULL(4);
|
// const int32 eid_default = 1000000;
|
// if (!has_eid) {
|
// /* default literal 1000000 для eid: 1000000 (source CSV) */
|
// (void) eid_default;
|
// } else {
|
// (void) PG_GETARG_INT32(4);
|
// }
|
|
dbms_workload_repository_raise_stub_error("процедура DBMS_WORKLOAD_REPOSITORY.AWR_EXP не реализована.");
|
PG_RETURN_VOID();
|
}
|
|
Datum dbms_workload_repository_awr_exp_1(PG_FUNCTION_ARGS)
|
{
|
dbms_workload_repository_raise_stub_error("процедура DBMS_WORKLOAD_REPOSITORY.AWR_EXP не реализована.");
|
PG_RETURN_VOID();
|
}
|
|
Datum dbms_workload_repository_awr_global_diff_report_html_0(PG_FUNCTION_ARGS)
|
{
|
/*
|
* ERROR: неподдерживаемый элемент сохранён как заглушка.
|
* ERROR: тип TABLE не поддерживается текущим каталогом rudb.
|
*/
|
/*
|
* TODO: функция пока не реализована; чтение аргументов оставлено
|
* ниже как подсказка для разработчика. Раскомментируйте и
|
* адаптируйте эти строки при ручной реализации.
|
*/
|
// const int32 arg_1 = PG_GETARG_INT32(0);
|
// (void) arg_1;
|
//
|
// const int32 dbid1 = PG_GETARG_INT32(1);
|
// (void) dbid1;
|
//
|
// const int32 inst_num1 = PG_GETARG_INT32(2);
|
// (void) inst_num1;
|
//
|
// const int32 bid1 = PG_GETARG_INT32(3);
|
// (void) bid1;
|
//
|
// const int32 eid1 = PG_GETARG_INT32(4);
|
// (void) eid1;
|
//
|
// const int32 dbid2 = PG_GETARG_INT32(5);
|
// (void) dbid2;
|
//
|
// const int32 inst_num2 = PG_GETARG_INT32(6);
|
// (void) inst_num2;
|
//
|
// const int32 bid2 = PG_GETARG_INT32(7);
|
// (void) bid2;
|
//
|
// const int32 eid2 = PG_GETARG_INT32(8);
|
// (void) eid2;
|
//
|
// const int32 p_options = PG_GETARG_INT32(9);
|
// (void) p_options;
|
//
|
// const int32 arg_1 = PG_GETARG_INT32(0);
|
// (void) arg_1;
|
//
|
// const int32 dbid1 = PG_GETARG_INT32(1);
|
// (void) dbid1;
|
//
|
// const text* inst_num1 = PG_GETARG_TEXT_PP(2);
|
// (void) inst_num1;
|
//
|
// const int32 bid1 = PG_GETARG_INT32(3);
|
// (void) bid1;
|
//
|
// const int32 eid1 = PG_GETARG_INT32(4);
|
// (void) eid1;
|
//
|
// const int32 dbid2 = PG_GETARG_INT32(5);
|
// (void) dbid2;
|
//
|
// const text* inst_num2 = PG_GETARG_TEXT_PP(6);
|
// (void) inst_num2;
|
//
|
// const int32 bid2 = PG_GETARG_INT32(7);
|
// (void) bid2;
|
//
|
// const int32 eid2 = PG_GETARG_INT32(8);
|
// (void) eid2;
|
//
|
// const int32 p_options = PG_GETARG_INT32(9);
|
// (void) p_options;
|
|
dbms_workload_repository_raise_stub_error("процедура DBMS_WORKLOAD_REPOSITORY.AWR_GLOBAL_DIFF_REPORT_HTML не поддерживается: тип TABLE не поддерживается текущим каталогом rudb.; тип TABLE не поддерживается текущим каталогом rudb. Проверьте соответствующую запись в pg_proc.dat.");
|
PG_RETURN_VOID();
|
}
|
|
Datum dbms_workload_repository_awr_global_diff_report_html_1(PG_FUNCTION_ARGS)
|
{
|
/*
|
* ERROR: неподдерживаемый элемент сохранён как заглушка.
|
* ERROR: тип TABLE не поддерживается текущим каталогом rudb.
|
*/
|
dbms_workload_repository_raise_stub_error("процедура DBMS_WORKLOAD_REPOSITORY.AWR_GLOBAL_DIFF_REPORT_HTML не поддерживается: тип TABLE не поддерживается текущим каталогом rudb.; тип TABLE не поддерживается текущим каталогом rudb. Проверьте соответствующую запись в pg_proc.dat.");
|
PG_RETURN_VOID();
|
}
|
|
Datum dbms_workload_repository_awr_global_diff_report_text_0(PG_FUNCTION_ARGS)
|
{
|
/*
|
* ERROR: неподдерживаемый элемент сохранён как заглушка.
|
* ERROR: тип TABLE не поддерживается текущим каталогом rudb.
|
*/
|
/*
|
* TODO: функция пока не реализована; чтение аргументов оставлено
|
* ниже как подсказка для разработчика. Раскомментируйте и
|
* адаптируйте эти строки при ручной реализации.
|
*/
|
// const int32 arg_1 = PG_GETARG_INT32(0);
|
// (void) arg_1;
|
//
|
// const int32 dbid1 = PG_GETARG_INT32(1);
|
// (void) dbid1;
|
//
|
// const int32 inst_num1 = PG_GETARG_INT32(2);
|
// (void) inst_num1;
|
//
|
// const int32 bid1 = PG_GETARG_INT32(3);
|
// (void) bid1;
|
//
|
// const int32 eid1 = PG_GETARG_INT32(4);
|
// (void) eid1;
|
//
|
// const int32 dbid2 = PG_GETARG_INT32(5);
|
// (void) dbid2;
|
//
|
// const int32 inst_num2 = PG_GETARG_INT32(6);
|
// (void) inst_num2;
|
//
|
// const int32 bid2 = PG_GETARG_INT32(7);
|
// (void) bid2;
|
//
|
// const int32 eid2 = PG_GETARG_INT32(8);
|
// (void) eid2;
|
//
|
// const int32 p_options = PG_GETARG_INT32(9);
|
// (void) p_options;
|
//
|
// const int32 arg_1 = PG_GETARG_INT32(0);
|
// (void) arg_1;
|
//
|
// const int32 dbid1 = PG_GETARG_INT32(1);
|
// (void) dbid1;
|
//
|
// const text* inst_num1 = PG_GETARG_TEXT_PP(2);
|
// (void) inst_num1;
|
//
|
// const int32 bid1 = PG_GETARG_INT32(3);
|
// (void) bid1;
|
//
|
// const int32 eid1 = PG_GETARG_INT32(4);
|
// (void) eid1;
|
//
|
// const int32 dbid2 = PG_GETARG_INT32(5);
|
// (void) dbid2;
|
//
|
// const text* inst_num2 = PG_GETARG_TEXT_PP(6);
|
// (void) inst_num2;
|
//
|
// const int32 bid2 = PG_GETARG_INT32(7);
|
// (void) bid2;
|
//
|
// const int32 eid2 = PG_GETARG_INT32(8);
|
// (void) eid2;
|
//
|
// const int32 p_options = PG_GETARG_INT32(9);
|
// (void) p_options;
|
|
dbms_workload_repository_raise_stub_error("процедура DBMS_WORKLOAD_REPOSITORY.AWR_GLOBAL_DIFF_REPORT_TEXT не поддерживается: тип TABLE не поддерживается текущим каталогом rudb.; тип TABLE не поддерживается текущим каталогом rudb. Проверьте соответствующую запись в pg_proc.dat.");
|
PG_RETURN_VOID();
|
}
|
|
Datum dbms_workload_repository_awr_global_diff_report_text_1(PG_FUNCTION_ARGS)
|
{
|
/*
|
* ERROR: неподдерживаемый элемент сохранён как заглушка.
|
* ERROR: тип TABLE не поддерживается текущим каталогом rudb.
|
*/
|
dbms_workload_repository_raise_stub_error("процедура DBMS_WORKLOAD_REPOSITORY.AWR_GLOBAL_DIFF_REPORT_TEXT не поддерживается: тип TABLE не поддерживается текущим каталогом rudb.; тип TABLE не поддерживается текущим каталогом rudb. Проверьте соответствующую запись в pg_proc.dat.");
|
PG_RETURN_VOID();
|
}
|
|
Datum dbms_workload_repository_awr_global_report_html_0(PG_FUNCTION_ARGS)
|
{
|
/*
|
* ERROR: неподдерживаемый элемент сохранён как заглушка.
|
* ERROR: тип TABLE не поддерживается текущим каталогом rudb.
|
*/
|
/*
|
* TODO: функция пока не реализована; чтение аргументов оставлено
|
* ниже как подсказка для разработчика. Раскомментируйте и
|
* адаптируйте эти строки при ручной реализации.
|
*/
|
// const int32 arg_1 = PG_GETARG_INT32(0);
|
// (void) arg_1;
|
//
|
// const int32 l_dbid = PG_GETARG_INT32(1);
|
// (void) l_dbid;
|
//
|
// const int32 l_inst_num = PG_GETARG_INT32(2);
|
// (void) l_inst_num;
|
//
|
// const int32 l_bid = PG_GETARG_INT32(3);
|
// (void) l_bid;
|
//
|
// const int32 l_eid = PG_GETARG_INT32(4);
|
// (void) l_eid;
|
//
|
// const int32 l_options = PG_GETARG_INT32(5);
|
// (void) l_options;
|
//
|
// const int32 arg_1 = PG_GETARG_INT32(0);
|
// (void) arg_1;
|
//
|
// const int32 l_dbid = PG_GETARG_INT32(1);
|
// (void) l_dbid;
|
//
|
// const text* l_inst_num = PG_GETARG_TEXT_PP(2);
|
// (void) l_inst_num;
|
//
|
// const int32 l_bid = PG_GETARG_INT32(3);
|
// (void) l_bid;
|
//
|
// const int32 l_eid = PG_GETARG_INT32(4);
|
// (void) l_eid;
|
//
|
// const int32 l_options = PG_GETARG_INT32(5);
|
// (void) l_options;
|
|
dbms_workload_repository_raise_stub_error("процедура DBMS_WORKLOAD_REPOSITORY.AWR_GLOBAL_REPORT_HTML не поддерживается: тип TABLE не поддерживается текущим каталогом rudb.; тип TABLE не поддерживается текущим каталогом rudb. Проверьте соответствующую запись в pg_proc.dat.");
|
PG_RETURN_VOID();
|
}
|
|
Datum dbms_workload_repository_awr_global_report_html_1(PG_FUNCTION_ARGS)
|
{
|
/*
|
* ERROR: неподдерживаемый элемент сохранён как заглушка.
|
* ERROR: тип TABLE не поддерживается текущим каталогом rudb.
|
*/
|
dbms_workload_repository_raise_stub_error("процедура DBMS_WORKLOAD_REPOSITORY.AWR_GLOBAL_REPORT_HTML не поддерживается: тип TABLE не поддерживается текущим каталогом rudb.; тип TABLE не поддерживается текущим каталогом rudb. Проверьте соответствующую запись в pg_proc.dat.");
|
PG_RETURN_VOID();
|
}
|
|
Datum dbms_workload_repository_awr_global_report_text_0(PG_FUNCTION_ARGS)
|
{
|
/*
|
* ERROR: неподдерживаемый элемент сохранён как заглушка.
|
* ERROR: тип TABLE не поддерживается текущим каталогом rudb.
|
*/
|
/*
|
* TODO: функция пока не реализована; чтение аргументов оставлено
|
* ниже как подсказка для разработчика. Раскомментируйте и
|
* адаптируйте эти строки при ручной реализации.
|
*/
|
// const int32 arg_1 = PG_GETARG_INT32(0);
|
// (void) arg_1;
|
//
|
// const int32 l_dbid = PG_GETARG_INT32(1);
|
// (void) l_dbid;
|
//
|
// const int32 l_inst_num = PG_GETARG_INT32(2);
|
// (void) l_inst_num;
|
//
|
// const int32 l_bid = PG_GETARG_INT32(3);
|
// (void) l_bid;
|
//
|
// const int32 l_eid = PG_GETARG_INT32(4);
|
// (void) l_eid;
|
//
|
// const int32 l_options = PG_GETARG_INT32(5);
|
// (void) l_options;
|
//
|
// const int32 arg_1 = PG_GETARG_INT32(0);
|
// (void) arg_1;
|
//
|
// const int32 l_dbid = PG_GETARG_INT32(1);
|
// (void) l_dbid;
|
//
|
// const text* l_inst_num = PG_GETARG_TEXT_PP(2);
|
// (void) l_inst_num;
|
//
|
// const int32 l_bid = PG_GETARG_INT32(3);
|
// (void) l_bid;
|
//
|
// const int32 l_eid = PG_GETARG_INT32(4);
|
// (void) l_eid;
|
//
|
// const int32 l_options = PG_GETARG_INT32(5);
|
// (void) l_options;
|
|
dbms_workload_repository_raise_stub_error("процедура DBMS_WORKLOAD_REPOSITORY.AWR_GLOBAL_REPORT_TEXT не поддерживается: тип TABLE не поддерживается текущим каталогом rudb.; тип TABLE не поддерживается текущим каталогом rudb. Проверьте соответствующую запись в pg_proc.dat.");
|
PG_RETURN_VOID();
|
}
|
|
Datum dbms_workload_repository_awr_global_report_text_1(PG_FUNCTION_ARGS)
|
{
|
/*
|
* ERROR: неподдерживаемый элемент сохранён как заглушка.
|
* ERROR: тип TABLE не поддерживается текущим каталогом rudb.
|
*/
|
dbms_workload_repository_raise_stub_error("процедура DBMS_WORKLOAD_REPOSITORY.AWR_GLOBAL_REPORT_TEXT не поддерживается: тип TABLE не поддерживается текущим каталогом rudb.; тип TABLE не поддерживается текущим каталогом rudb. Проверьте соответствующую запись в pg_proc.dat.");
|
PG_RETURN_VOID();
|
}
|
|
Datum dbms_workload_repository_awr_imp_0(PG_FUNCTION_ARGS)
|
{
|
/*
|
* TODO: функция пока не реализована; чтение аргументов оставлено
|
* ниже как подсказка для разработчика. Раскомментируйте и
|
* адаптируйте эти строки при ручной реализации.
|
*/
|
// const bool has_dmpfile = PG_NARGS() > 0 && !PG_ARGISNULL(0);
|
// const text* dmpfile_default = nullptr;
|
// if (!has_dmpfile) {
|
// /* default literal "awrdat" для dmpfile: awrdat (source CSV) */
|
// (void) dmpfile_default;
|
// } else {
|
// (void) PG_GETARG_TEXT_PP(0);
|
// }
|
//
|
// const bool has_dmpdir = PG_NARGS() > 1 && !PG_ARGISNULL(1);
|
// const text* dmpdir_default = nullptr;
|
// if (!has_dmpdir) {
|
// /* default literal "DATA_PUMP_DIR" для dmpdir: DATA_PUMP_DIR (source CSV) */
|
// (void) dmpdir_default;
|
// } else {
|
// (void) PG_GETARG_TEXT_PP(1);
|
// }
|
//
|
// const int32 new_dbid = PG_GETARG_INT32(2);
|
// (void) new_dbid;
|
|
dbms_workload_repository_raise_stub_error("процедура DBMS_WORKLOAD_REPOSITORY.AWR_IMP не реализована.");
|
PG_RETURN_VOID();
|
}
|
|
Datum dbms_workload_repository_awr_imp_1(PG_FUNCTION_ARGS)
|
{
|
dbms_workload_repository_raise_stub_error("процедура DBMS_WORKLOAD_REPOSITORY.AWR_IMP не реализована.");
|
PG_RETURN_VOID();
|
}
|
|
Datum dbms_workload_repository_awr_report_0(PG_FUNCTION_ARGS)
|
{
|
/*
|
* TODO: функция пока не реализована; чтение аргументов оставлено
|
* ниже как подсказка для разработчика. Раскомментируйте и
|
* адаптируйте эти строки при ручной реализации.
|
*/
|
// const text* arg_1 = PG_GETARG_TEXT_PP(0);
|
// (void) arg_1;
|
//
|
// const int32 l_dbid = PG_GETARG_INT32(1);
|
// (void) l_dbid;
|
//
|
// const int32 l_inst_num = PG_GETARG_INT32(2);
|
// (void) l_inst_num;
|
//
|
// const int32 l_bid = PG_GETARG_INT32(3);
|
// (void) l_bid;
|
//
|
// const int32 l_eid = PG_GETARG_INT32(4);
|
// (void) l_eid;
|
//
|
// const int32 l_options = PG_GETARG_INT32(5);
|
// (void) l_options;
|
//
|
// const text* l_format = PG_GETARG_TEXT_PP(6);
|
// (void) l_format;
|
|
dbms_workload_repository_raise_stub_error("процедура DBMS_WORKLOAD_REPOSITORY.AWR_REPORT не реализована.");
|
PG_RETURN_VOID();
|
}
|
|
Datum dbms_workload_repository_awr_report_1(PG_FUNCTION_ARGS)
|
{
|
dbms_workload_repository_raise_stub_error("процедура DBMS_WORKLOAD_REPOSITORY.AWR_REPORT не реализована.");
|
PG_RETURN_VOID();
|
}
|
|
Datum dbms_workload_repository_awr_report_html(PG_FUNCTION_ARGS)
|
{
|
ensure_workload_repository_service_ready();
|
rudb::awr::SnapshotReportRequest request;
|
request.dbid = require_number_arg(fcinfo, 0, "AWR_REPORT_HTML", "l_dbid");
|
request.inst_num = require_number_arg(fcinfo, 1, "AWR_REPORT_HTML", "l_inst_num");
|
request.begin_snap_id = require_number_arg(fcinfo, 2, "AWR_REPORT_HTML", "l_bid");
|
request.end_snap_id = require_number_arg(fcinfo, 3, "AWR_REPORT_HTML", "l_eid");
|
request.options = number_arg_to_int64(fcinfo, 4);
|
|
validate_local_repository_identity(request.dbid, request.inst_num, "AWR_REPORT_HTML", true);
|
validate_snapshot_range(request.begin_snap_id, request.end_snap_id, "AWR_REPORT_HTML");
|
|
std::vector<std::string> rows = rudb::awr::report_html(request);
|
emit_text_rows(fcinfo, rows);
|
PG_RETURN_NULL();
|
}
|
|
Datum dbms_workload_repository_awr_report_text(PG_FUNCTION_ARGS)
|
{
|
ensure_workload_repository_service_ready();
|
rudb::awr::SnapshotReportRequest request;
|
request.dbid = require_number_arg(fcinfo, 0, "AWR_REPORT_TEXT", "l_dbid");
|
request.inst_num = require_number_arg(fcinfo, 1, "AWR_REPORT_TEXT", "l_inst_num");
|
request.begin_snap_id = require_number_arg(fcinfo, 2, "AWR_REPORT_TEXT", "l_bid");
|
request.end_snap_id = require_number_arg(fcinfo, 3, "AWR_REPORT_TEXT", "l_eid");
|
request.options = number_arg_to_int64(fcinfo, 4);
|
|
validate_local_repository_identity(request.dbid, request.inst_num, "AWR_REPORT_TEXT", true);
|
validate_snapshot_range(request.begin_snap_id, request.end_snap_id, "AWR_REPORT_TEXT");
|
|
std::vector<std::string> rows = rudb::awr::report_text(request);
|
emit_text_rows(fcinfo, rows);
|
PG_RETURN_NULL();
|
}
|
|
Datum dbms_workload_repository_awr_set_report_thresholds_0(PG_FUNCTION_ARGS)
|
{
|
/*
|
* TODO: функция пока не реализована; чтение аргументов оставлено
|
* ниже как подсказка для разработчика. Раскомментируйте и
|
* адаптируйте эти строки при ручной реализации.
|
*/
|
// const int32 top_n_events = PG_GETARG_INT32(0);
|
// (void) top_n_events;
|
//
|
// const int32 top_n_files = PG_GETARG_INT32(1);
|
// (void) top_n_files;
|
//
|
// const int32 top_n_segments = PG_GETARG_INT32(2);
|
// (void) top_n_segments;
|
//
|
// const int32 top_n_services = PG_GETARG_INT32(3);
|
// (void) top_n_services;
|
//
|
// const int32 top_n_sql = PG_GETARG_INT32(4);
|
// (void) top_n_sql;
|
//
|
// const int32 top_n_sql_max = PG_GETARG_INT32(5);
|
// (void) top_n_sql_max;
|
//
|
// const int32 top_sql_pct = PG_GETARG_INT32(6);
|
// (void) top_sql_pct;
|
//
|
// const int32 shmem_threshold = PG_GETARG_INT32(7);
|
// (void) shmem_threshold;
|
//
|
// const int32 versions_threshold = PG_GETARG_INT32(8);
|
// (void) versions_threshold;
|
//
|
// const int32 top_n_disks = PG_GETARG_INT32(9);
|
// (void) top_n_disks;
|
//
|
// const int32 outlier_pct = PG_GETARG_INT32(10);
|
// (void) outlier_pct;
|
//
|
// const int32 outlier_cpu_pct = PG_GETARG_INT32(11);
|
// (void) outlier_cpu_pct;
|
|
dbms_workload_repository_raise_stub_error("процедура DBMS_WORKLOAD_REPOSITORY.AWR_SET_REPORT_THRESHOLDS не реализована.");
|
PG_RETURN_VOID();
|
}
|
|
Datum dbms_workload_repository_awr_set_report_thresholds_1(PG_FUNCTION_ARGS)
|
{
|
dbms_workload_repository_raise_stub_error("процедура DBMS_WORKLOAD_REPOSITORY.AWR_SET_REPORT_THRESHOLDS не реализована.");
|
PG_RETURN_VOID();
|
}
|
|
Datum dbms_workload_repository_awr_sql_report_html(PG_FUNCTION_ARGS)
|
{
|
ensure_workload_repository_service_ready();
|
rudb::awr::SqlReportRequest request;
|
request.dbid = require_number_arg(fcinfo, 0, "AWR_SQL_REPORT_HTML", "l_dbid");
|
request.inst_num = require_number_arg(fcinfo, 1, "AWR_SQL_REPORT_HTML", "l_inst_num");
|
request.begin_snap_id = require_number_arg(fcinfo, 2, "AWR_SQL_REPORT_HTML", "l_bid");
|
request.end_snap_id = require_number_arg(fcinfo, 3, "AWR_SQL_REPORT_HTML", "l_eid");
|
request.sql_id = text_arg_to_string(fcinfo, 4);
|
request.options = number_arg_to_int64(fcinfo, 5);
|
request.con_dbid = number_arg_to_int64(fcinfo, 6);
|
|
validate_local_repository_identity(request.dbid, request.inst_num, "AWR_SQL_REPORT_HTML", true);
|
validate_snapshot_range(request.begin_snap_id, request.end_snap_id, "AWR_SQL_REPORT_HTML");
|
|
if (request.con_dbid.has_value() && *request.con_dbid < 0)
|
{
|
raise_invalid_argument("AWR_SQL_REPORT_HTML", "l_con_dbid", "negative l_con_dbid is not supported");
|
}
|
|
std::vector<std::string> rows = rudb::awr::sql_report_html(request);
|
rows = enrich_awr_sql_report_html_with_sql_text(rows, request.sql_id, request.dbid);
|
emit_text_rows(fcinfo, rows);
|
PG_RETURN_NULL();
|
}
|
|
Datum dbms_workload_repository_awr_sql_report_text(PG_FUNCTION_ARGS)
|
{
|
ensure_workload_repository_service_ready();
|
rudb::awr::SqlReportRequest request;
|
request.dbid = require_number_arg(fcinfo, 0, "AWR_SQL_REPORT_TEXT", "l_dbid");
|
request.inst_num = require_number_arg(fcinfo, 1, "AWR_SQL_REPORT_TEXT", "l_inst_num");
|
request.begin_snap_id = require_number_arg(fcinfo, 2, "AWR_SQL_REPORT_TEXT", "l_bid");
|
request.end_snap_id = require_number_arg(fcinfo, 3, "AWR_SQL_REPORT_TEXT", "l_eid");
|
request.sql_id = text_arg_to_string(fcinfo, 4);
|
request.options = number_arg_to_int64(fcinfo, 5);
|
request.con_dbid = number_arg_to_int64(fcinfo, 6);
|
|
validate_local_repository_identity(request.dbid, request.inst_num, "AWR_SQL_REPORT_TEXT", true);
|
validate_snapshot_range(request.begin_snap_id, request.end_snap_id, "AWR_SQL_REPORT_TEXT");
|
|
if (request.con_dbid.has_value() && *request.con_dbid < 0)
|
{
|
raise_invalid_argument("AWR_SQL_REPORT_TEXT", "l_con_dbid", "negative l_con_dbid is not supported");
|
}
|
|
std::vector<std::string> rows = rudb::awr::sql_report_text(request);
|
rows = enrich_awr_sql_report_with_sql_text(rows, request.sql_id, request.dbid);
|
emit_text_rows(fcinfo, rows);
|
PG_RETURN_NULL();
|
}
|
|
Datum dbms_workload_repository_control_restricted_snapshot_0(PG_FUNCTION_ARGS)
|
{
|
/*
|
* TODO: функция пока не реализована; чтение аргументов оставлено
|
* ниже как подсказка для разработчика. Раскомментируйте и
|
* адаптируйте эти строки при ручной реализации.
|
*/
|
// const bool allow = PG_GETARG_BOOL(0);
|
// (void) allow;
|
|
dbms_workload_repository_raise_stub_error("процедура DBMS_WORKLOAD_REPOSITORY.CONTROL_RESTRICTED_SNAPSHOT не реализована.");
|
PG_RETURN_VOID();
|
}
|
|
Datum dbms_workload_repository_control_restricted_snapshot_1(PG_FUNCTION_ARGS)
|
{
|
dbms_workload_repository_raise_stub_error("процедура DBMS_WORKLOAD_REPOSITORY.CONTROL_RESTRICTED_SNAPSHOT не реализована.");
|
PG_RETURN_VOID();
|
}
|
|
Datum dbms_workload_repository_create_baseline_0(PG_FUNCTION_ARGS)
|
{
|
dbms_workload_repository_raise_stub_error("процедура DBMS_WORKLOAD_REPOSITORY.CREATE_BASELINE не реализована.");
|
PG_RETURN_VOID();
|
}
|
|
Datum dbms_workload_repository_create_baseline_1(PG_FUNCTION_ARGS)
|
{
|
dbms_workload_repository_raise_stub_error("процедура DBMS_WORKLOAD_REPOSITORY.CREATE_BASELINE не реализована.");
|
PG_RETURN_VOID();
|
}
|
|
Datum dbms_workload_repository_create_baseline_2(PG_FUNCTION_ARGS)
|
{
|
dbms_workload_repository_raise_stub_error("процедура DBMS_WORKLOAD_REPOSITORY.CREATE_BASELINE не реализована.");
|
PG_RETURN_VOID();
|
}
|
|
Datum dbms_workload_repository_create_baseline_3(PG_FUNCTION_ARGS)
|
{
|
dbms_workload_repository_raise_stub_error("процедура DBMS_WORKLOAD_REPOSITORY.CREATE_BASELINE не реализована.");
|
PG_RETURN_VOID();
|
}
|
|
Datum dbms_workload_repository_create_baseline_4(PG_FUNCTION_ARGS)
|
{
|
/*
|
* TODO: функция пока не реализована; чтение аргументов оставлено
|
* ниже как подсказка для разработчика. Раскомментируйте и
|
* адаптируйте эти строки при ручной реализации.
|
*/
|
// const int32 start_snap_id = PG_GETARG_INT32(0);
|
// (void) start_snap_id;
|
//
|
// const int32 end_snap_id = PG_GETARG_INT32(1);
|
// (void) end_snap_id;
|
//
|
// const text* baseline_name = PG_GETARG_TEXT_PP(2);
|
// (void) baseline_name;
|
//
|
// const int32 dbid = PG_GETARG_INT32(3);
|
// (void) dbid;
|
//
|
// const int32 expiration = PG_GETARG_INT32(4);
|
// (void) expiration;
|
//
|
// const int32 arg_1 = PG_GETARG_INT32(0);
|
// (void) arg_1;
|
//
|
// const int32 start_snap_id = PG_GETARG_INT32(1);
|
// (void) start_snap_id;
|
//
|
// const int32 end_snap_id = PG_GETARG_INT32(2);
|
// (void) end_snap_id;
|
//
|
// const text* baseline_name = PG_GETARG_TEXT_PP(3);
|
// (void) baseline_name;
|
//
|
// const int32 dbid = PG_GETARG_INT32(4);
|
// (void) dbid;
|
//
|
// const int32 expiration = PG_GETARG_INT32(5);
|
// (void) expiration;
|
//
|
// const int32 start_time = PG_GETARG_INT32(0);
|
// (void) start_time;
|
//
|
// const int32 end_time = PG_GETARG_INT32(1);
|
// (void) end_time;
|
//
|
// const text* baseline_name = PG_GETARG_TEXT_PP(2);
|
// (void) baseline_name;
|
//
|
// const int32 dbid = PG_GETARG_INT32(3);
|
// (void) dbid;
|
//
|
// const int32 expiration = PG_GETARG_INT32(4);
|
// (void) expiration;
|
//
|
// const int32 arg_1 = PG_GETARG_INT32(0);
|
// (void) arg_1;
|
//
|
// const int32 start_time = PG_GETARG_INT32(1);
|
// (void) start_time;
|
//
|
// const int32 end_time = PG_GETARG_INT32(2);
|
// (void) end_time;
|
//
|
// const text* baseline_name = PG_GETARG_TEXT_PP(3);
|
// (void) baseline_name;
|
//
|
// const int32 dbid = PG_GETARG_INT32(4);
|
// (void) dbid;
|
//
|
// const int32 expiration = PG_GETARG_INT32(5);
|
// (void) expiration;
|
|
dbms_workload_repository_raise_stub_error("процедура DBMS_WORKLOAD_REPOSITORY.CREATE_BASELINE не реализована.");
|
PG_RETURN_VOID();
|
}
|
|
Datum dbms_workload_repository_create_baseline_template_0(PG_FUNCTION_ARGS)
|
{
|
/*
|
* TODO: функция пока не реализована; чтение аргументов оставлено
|
* ниже как подсказка для разработчика. Раскомментируйте и
|
* адаптируйте эти строки при ручной реализации.
|
*/
|
// const int32 start_time = PG_GETARG_INT32(0);
|
// (void) start_time;
|
//
|
// const int32 end_time = PG_GETARG_INT32(1);
|
// (void) end_time;
|
//
|
// const text* baseline_name = PG_GETARG_TEXT_PP(2);
|
// (void) baseline_name;
|
//
|
// const text* template_name = PG_GETARG_TEXT_PP(3);
|
// (void) template_name;
|
//
|
// const int32 expiration = PG_GETARG_INT32(4);
|
// (void) expiration;
|
//
|
// const int32 dbid = PG_GETARG_INT32(5);
|
// (void) dbid;
|
//
|
// const text* day_of_week = PG_GETARG_TEXT_PP(0);
|
// (void) day_of_week;
|
//
|
// const int32 hour_in_day = PG_GETARG_INT32(1);
|
// (void) hour_in_day;
|
//
|
// const int32 duration = PG_GETARG_INT32(2);
|
// (void) duration;
|
//
|
// const int32 start_time = PG_GETARG_INT32(3);
|
// (void) start_time;
|
//
|
// const int32 end_time = PG_GETARG_INT32(4);
|
// (void) end_time;
|
//
|
// const text* baseline_name_prefix = PG_GETARG_TEXT_PP(5);
|
// (void) baseline_name_prefix;
|
//
|
// const text* template_name = PG_GETARG_TEXT_PP(6);
|
// (void) template_name;
|
//
|
// const int32 expiration = PG_GETARG_INT32(7);
|
// (void) expiration;
|
//
|
// const int32 dbid = PG_GETARG_INT32(8);
|
// (void) dbid;
|
|
dbms_workload_repository_raise_stub_error("процедура DBMS_WORKLOAD_REPOSITORY.CREATE_BASELINE_TEMPLATE не реализована.");
|
PG_RETURN_VOID();
|
}
|
|
Datum dbms_workload_repository_create_baseline_template_1(PG_FUNCTION_ARGS)
|
{
|
dbms_workload_repository_raise_stub_error("процедура DBMS_WORKLOAD_REPOSITORY.CREATE_BASELINE_TEMPLATE не реализована.");
|
PG_RETURN_VOID();
|
}
|
|
Datum dbms_workload_repository_create_remote_snapshot_0(PG_FUNCTION_ARGS)
|
{
|
/*
|
* TODO: функция пока не реализована; чтение аргументов оставлено
|
* ниже как подсказка для разработчика. Раскомментируйте и
|
* адаптируйте эти строки при ручной реализации.
|
*/
|
// const int32 node_id = PG_GETARG_INT32(0);
|
// (void) node_id;
|
//
|
// const bool has_flush_level = PG_NARGS() > 1 && !PG_ARGISNULL(1);
|
// const text* flush_level_default = nullptr;
|
// if (!has_flush_level) {
|
// /* default literal "BESTFIT" для flush_level: BESTFIT (source CSV) */
|
// (void) flush_level_default;
|
// } else {
|
// (void) PG_GETARG_TEXT_PP(1);
|
// }
|
//
|
// const int32 arg_1 = PG_GETARG_INT32(0);
|
// (void) arg_1;
|
//
|
// const int32 node_id = PG_GETARG_INT32(1);
|
// (void) node_id;
|
//
|
// const bool has_flush_level = PG_NARGS() > 2 && !PG_ARGISNULL(2);
|
// const text* flush_level_default = nullptr;
|
// if (!has_flush_level) {
|
// /* default literal "BESTFIT" для flush_level: BESTFIT (source CSV) */
|
// (void) flush_level_default;
|
// } else {
|
// (void) PG_GETARG_TEXT_PP(2);
|
// }
|
//
|
// const text* node_name = PG_GETARG_TEXT_PP(0);
|
// (void) node_name;
|
//
|
// const text* topology_name = PG_GETARG_TEXT_PP(1);
|
// (void) topology_name;
|
//
|
// const bool has_flush_level = PG_NARGS() > 2 && !PG_ARGISNULL(2);
|
// const text* flush_level_default = nullptr;
|
// if (!has_flush_level) {
|
// /* default literal "BESTFIT" для flush_level: BESTFIT (source CSV) */
|
// (void) flush_level_default;
|
// } else {
|
// (void) PG_GETARG_TEXT_PP(2);
|
// }
|
//
|
// const int32 arg_1 = PG_GETARG_INT32(0);
|
// (void) arg_1;
|
//
|
// const text* node_name = PG_GETARG_TEXT_PP(1);
|
// (void) node_name;
|
//
|
// const text* topology_name = PG_GETARG_TEXT_PP(2);
|
// (void) topology_name;
|
//
|
// const bool has_flush_level = PG_NARGS() > 3 && !PG_ARGISNULL(3);
|
// const text* flush_level_default = nullptr;
|
// if (!has_flush_level) {
|
// /* default literal "BESTFIT" для flush_level: BESTFIT (source CSV) */
|
// (void) flush_level_default;
|
// } else {
|
// (void) PG_GETARG_TEXT_PP(3);
|
// }
|
|
dbms_workload_repository_raise_stub_error("процедура DBMS_WORKLOAD_REPOSITORY.CREATE_REMOTE_SNAPSHOT не реализована.");
|
PG_RETURN_VOID();
|
}
|
|
Datum dbms_workload_repository_create_remote_snapshot_1(PG_FUNCTION_ARGS)
|
{
|
dbms_workload_repository_raise_stub_error("процедура DBMS_WORKLOAD_REPOSITORY.CREATE_REMOTE_SNAPSHOT не реализована.");
|
PG_RETURN_VOID();
|
}
|
|
Datum dbms_workload_repository_create_remote_snapshot_2(PG_FUNCTION_ARGS)
|
{
|
dbms_workload_repository_raise_stub_error("процедура DBMS_WORKLOAD_REPOSITORY.CREATE_REMOTE_SNAPSHOT не реализована.");
|
PG_RETURN_VOID();
|
}
|
|
Datum dbms_workload_repository_create_remote_snapshot_3(PG_FUNCTION_ARGS)
|
{
|
dbms_workload_repository_raise_stub_error("процедура DBMS_WORKLOAD_REPOSITORY.CREATE_REMOTE_SNAPSHOT не реализована.");
|
PG_RETURN_VOID();
|
}
|
|
Datum dbms_workload_repository_create_snapshot_0(PG_FUNCTION_ARGS)
|
{
|
execute_repository_entrypoint([&]() {
|
const int64 dbid = rudb::awr::validate_local_dbid(std::nullopt);
|
(void) rudb::awr::create_snapshot(dbid, 1);
|
}, "DBMS_WORKLOAD_REPOSITORY.CREATE_SNAPSHOT");
|
PG_RETURN_VOID();
|
}
|
|
Datum dbms_workload_repository_create_snapshot_1(PG_FUNCTION_ARGS)
|
{
|
execute_repository_entrypoint([&]() {
|
const std::optional<int64> requested_dbid = number_arg_to_int64(fcinfo, 0);
|
const int64 dbid = rudb::awr::validate_local_dbid(requested_dbid);
|
(void) rudb::awr::create_snapshot(dbid, 1);
|
}, "DBMS_WORKLOAD_REPOSITORY.CREATE_SNAPSHOT");
|
PG_RETURN_VOID();
|
}
|
|
Datum dbms_workload_repository_define_application_0(PG_FUNCTION_ARGS)
|
{
|
/*
|
* TODO: функция пока не реализована; чтение аргументов оставлено
|
* ниже как подсказка для разработчика. Раскомментируйте и
|
* адаптируйте эти строки при ручной реализации.
|
*/
|
// const int32 dbid = PG_GETARG_INT32(0);
|
// (void) dbid;
|
//
|
// const text* app_name = PG_GETARG_TEXT_PP(1);
|
// (void) app_name;
|
//
|
// const bool has_module_name = PG_NARGS() > 2 && !PG_ARGISNULL(2);
|
// const text* module_name_default = nullptr;
|
// if (!has_module_name) {
|
// /* default literal "%" для module_name: % (source CSV) */
|
// (void) module_name_default;
|
// } else {
|
// (void) PG_GETARG_TEXT_PP(2);
|
// }
|
//
|
// const bool has_action_name = PG_NARGS() > 3 && !PG_ARGISNULL(3);
|
// const text* action_name_default = nullptr;
|
// if (!has_action_name) {
|
// /* default literal "%" для action_name: % (source CSV) */
|
// (void) action_name_default;
|
// } else {
|
// (void) PG_GETARG_TEXT_PP(3);
|
// }
|
|
dbms_workload_repository_raise_stub_error("процедура DBMS_WORKLOAD_REPOSITORY.DEFINE_APPLICATION не реализована.");
|
PG_RETURN_VOID();
|
}
|
|
Datum dbms_workload_repository_define_application_1(PG_FUNCTION_ARGS)
|
{
|
dbms_workload_repository_raise_stub_error("процедура DBMS_WORKLOAD_REPOSITORY.DEFINE_APPLICATION не реализована.");
|
PG_RETURN_VOID();
|
}
|
|
Datum dbms_workload_repository_disable_awrapp_snapshot_0(PG_FUNCTION_ARGS)
|
{
|
/*
|
* TODO: функция пока не реализована; чтение аргументов оставлено
|
* ниже как подсказка для разработчика. Раскомментируйте и
|
* адаптируйте эти строки при ручной реализации.
|
*/
|
// const int32 dbid = PG_GETARG_INT32(0);
|
// (void) dbid;
|
|
dbms_workload_repository_raise_stub_error("процедура DBMS_WORKLOAD_REPOSITORY.DISABLE_AWRAPP_SNAPSHOT не реализована.");
|
PG_RETURN_VOID();
|
}
|
|
Datum dbms_workload_repository_disable_awrapp_snapshot_1(PG_FUNCTION_ARGS)
|
{
|
dbms_workload_repository_raise_stub_error("процедура DBMS_WORKLOAD_REPOSITORY.DISABLE_AWRAPP_SNAPSHOT не реализована.");
|
PG_RETURN_VOID();
|
}
|
|
Datum dbms_workload_repository_drop_baseline_0(PG_FUNCTION_ARGS)
|
{
|
/*
|
* TODO: функция пока не реализована; чтение аргументов оставлено
|
* ниже как подсказка для разработчика. Раскомментируйте и
|
* адаптируйте эти строки при ручной реализации.
|
*/
|
// const text* baseline_name = PG_GETARG_TEXT_PP(0);
|
// (void) baseline_name;
|
//
|
// const bool has_cascade = PG_NARGS() > 1 && !PG_ARGISNULL(1);
|
// const bool cascade_default = false;
|
// if (!has_cascade) {
|
// /* default literal false для cascade: false (source CSV) */
|
// (void) cascade_default;
|
// } else {
|
// (void) PG_GETARG_BOOL(1);
|
// }
|
//
|
// const int32 dbid = PG_GETARG_INT32(2);
|
// (void) dbid;
|
|
dbms_workload_repository_raise_stub_error("процедура DBMS_WORKLOAD_REPOSITORY.DROP_BASELINE не реализована.");
|
PG_RETURN_VOID();
|
}
|
|
Datum dbms_workload_repository_drop_baseline_1(PG_FUNCTION_ARGS)
|
{
|
dbms_workload_repository_raise_stub_error("процедура DBMS_WORKLOAD_REPOSITORY.DROP_BASELINE не реализована.");
|
PG_RETURN_VOID();
|
}
|
|
Datum dbms_workload_repository_drop_baseline_template_0(PG_FUNCTION_ARGS)
|
{
|
/*
|
* TODO: функция пока не реализована; чтение аргументов оставлено
|
* ниже как подсказка для разработчика. Раскомментируйте и
|
* адаптируйте эти строки при ручной реализации.
|
*/
|
// const text* template_name = PG_GETARG_TEXT_PP(0);
|
// (void) template_name;
|
//
|
// const int32 dbid = PG_GETARG_INT32(1);
|
// (void) dbid;
|
|
dbms_workload_repository_raise_stub_error("процедура DBMS_WORKLOAD_REPOSITORY.DROP_BASELINE_TEMPLATE не реализована.");
|
PG_RETURN_VOID();
|
}
|
|
Datum dbms_workload_repository_drop_baseline_template_1(PG_FUNCTION_ARGS)
|
{
|
dbms_workload_repository_raise_stub_error("процедура DBMS_WORKLOAD_REPOSITORY.DROP_BASELINE_TEMPLATE не реализована.");
|
PG_RETURN_VOID();
|
}
|
|
Datum dbms_workload_repository_drop_snapshot_range_0(PG_FUNCTION_ARGS)
|
{
|
execute_repository_entrypoint([&]() {
|
const int64 low_snap_id = require_number_arg(
|
fcinfo, 0, "DBMS_WORKLOAD_REPOSITORY.DROP_SNAPSHOT_RANGE", "low_snap_id");
|
const int64 high_snap_id = require_number_arg(
|
fcinfo, 1, "DBMS_WORKLOAD_REPOSITORY.DROP_SNAPSHOT_RANGE", "high_snap_id");
|
const int64 dbid = rudb::awr::validate_local_dbid(optional_dbid_arg(fcinfo, 2));
|
rudb::awr::drop_snapshot_range(dbid, low_snap_id, high_snap_id);
|
}, "DBMS_WORKLOAD_REPOSITORY.DROP_SNAPSHOT_RANGE");
|
PG_RETURN_VOID();
|
}
|
|
Datum dbms_workload_repository_drop_snapshot_range_1(PG_FUNCTION_ARGS)
|
{
|
execute_repository_entrypoint([&]() {
|
const int64 low_snap_id = require_number_arg(
|
fcinfo, 0, "DBMS_WORKLOAD_REPOSITORY.DROP_SNAPSHOT_RANGE", "low_snap_id");
|
const int64 high_snap_id = require_number_arg(
|
fcinfo, 1, "DBMS_WORKLOAD_REPOSITORY.DROP_SNAPSHOT_RANGE", "high_snap_id");
|
rudb::awr::drop_snapshot_range(rudb::awr::validate_local_dbid(std::nullopt), low_snap_id, high_snap_id);
|
}, "DBMS_WORKLOAD_REPOSITORY.DROP_SNAPSHOT_RANGE");
|
PG_RETURN_VOID();
|
}
|
|
Datum dbms_workload_repository_enable_awrapp_snapshot_0(PG_FUNCTION_ARGS)
|
{
|
/*
|
* TODO: функция пока не реализована; чтение аргументов оставлено
|
* ниже как подсказка для разработчика. Раскомментируйте и
|
* адаптируйте эти строки при ручной реализации.
|
*/
|
// const int32 dbid = PG_GETARG_INT32(0);
|
// (void) dbid;
|
|
dbms_workload_repository_raise_stub_error("процедура DBMS_WORKLOAD_REPOSITORY.ENABLE_AWRAPP_SNAPSHOT не реализована.");
|
PG_RETURN_VOID();
|
}
|
|
Datum dbms_workload_repository_enable_awrapp_snapshot_1(PG_FUNCTION_ARGS)
|
{
|
dbms_workload_repository_raise_stub_error("процедура DBMS_WORKLOAD_REPOSITORY.ENABLE_AWRAPP_SNAPSHOT не реализована.");
|
PG_RETURN_VOID();
|
}
|
|
Datum dbms_workload_repository_enable_snapshot_service_0(PG_FUNCTION_ARGS)
|
{
|
/*
|
* TODO: функция пока не реализована; чтение аргументов оставлено
|
* ниже как подсказка для разработчика. Раскомментируйте и
|
* адаптируйте эти строки при ручной реализации.
|
*/
|
// const int32 dbid = PG_GETARG_INT32(0);
|
// (void) dbid;
|
//
|
// const text* snap_type = PG_GETARG_TEXT_PP(1);
|
// (void) snap_type;
|
//
|
// const text* snap_action = PG_GETARG_TEXT_PP(2);
|
// (void) snap_action;
|
|
dbms_workload_repository_raise_stub_error("процедура DBMS_WORKLOAD_REPOSITORY.ENABLE_SNAPSHOT_SERVICE не реализована.");
|
PG_RETURN_VOID();
|
}
|
|
Datum dbms_workload_repository_enable_snapshot_service_1(PG_FUNCTION_ARGS)
|
{
|
dbms_workload_repository_raise_stub_error("процедура DBMS_WORKLOAD_REPOSITORY.ENABLE_SNAPSHOT_SERVICE не реализована.");
|
PG_RETURN_VOID();
|
}
|
|
Datum dbms_workload_repository_exclude_appmap_0(PG_FUNCTION_ARGS)
|
{
|
/*
|
* TODO: функция пока не реализована; чтение аргументов оставлено
|
* ниже как подсказка для разработчика. Раскомментируйте и
|
* адаптируйте эти строки при ручной реализации.
|
*/
|
// const int32 dbid = PG_GETARG_INT32(0);
|
// (void) dbid;
|
//
|
// const text* appmap_name = PG_GETARG_TEXT_PP(1);
|
// (void) appmap_name;
|
|
dbms_workload_repository_raise_stub_error("процедура DBMS_WORKLOAD_REPOSITORY.EXCLUDE_APPMAP не реализована.");
|
PG_RETURN_VOID();
|
}
|
|
Datum dbms_workload_repository_exclude_appmap_1(PG_FUNCTION_ARGS)
|
{
|
dbms_workload_repository_raise_stub_error("процедура DBMS_WORKLOAD_REPOSITORY.EXCLUDE_APPMAP не реализована.");
|
PG_RETURN_VOID();
|
}
|
|
Datum dbms_workload_repository_extract_0(PG_FUNCTION_ARGS)
|
{
|
/*
|
* TODO: функция пока не реализована; чтение аргументов оставлено
|
* ниже как подсказка для разработчика. Раскомментируйте и
|
* адаптируйте эти строки при ручной реализации.
|
*/
|
// const bool has_dmpfile = PG_NARGS() > 0 && !PG_ARGISNULL(0);
|
// const text* dmpfile_default = nullptr;
|
// if (!has_dmpfile) {
|
// /* default literal "awrdat" для dmpfile: awrdat (source CSV) */
|
// (void) dmpfile_default;
|
// } else {
|
// (void) PG_GETARG_TEXT_PP(0);
|
// }
|
//
|
// const bool has_dmpdir = PG_NARGS() > 1 && !PG_ARGISNULL(1);
|
// const text* dmpdir_default = nullptr;
|
// if (!has_dmpdir) {
|
// /* default literal "DATA_PUMP_DIR" для dmpdir: DATA_PUMP_DIR (source CSV) */
|
// (void) dmpdir_default;
|
// } else {
|
// (void) PG_GETARG_TEXT_PP(1);
|
// }
|
//
|
// const bool has_bid = PG_NARGS() > 2 && !PG_ARGISNULL(2);
|
// const int32 bid_default = 0;
|
// if (!has_bid) {
|
// /* default literal 0 для bid: 0 (source CSV) */
|
// (void) bid_default;
|
// } else {
|
// (void) PG_GETARG_INT32(2);
|
// }
|
//
|
// const bool has_eid = PG_NARGS() > 3 && !PG_ARGISNULL(3);
|
// const int32 eid_default = 10000000;
|
// if (!has_eid) {
|
// /* default literal 10000000 для eid: 10000000 (source CSV) */
|
// (void) eid_default;
|
// } else {
|
// (void) PG_GETARG_INT32(3);
|
// }
|
//
|
// const int32 dbid = PG_GETARG_INT32(4);
|
// (void) dbid;
|
//
|
// const text* from_source_name = PG_GETARG_TEXT_PP(5);
|
// (void) from_source_name;
|
//
|
// const text* to_source_name = PG_GETARG_TEXT_PP(6);
|
// (void) to_source_name;
|
//
|
// const text* logdir = PG_GETARG_TEXT_PP(7);
|
// (void) logdir;
|
|
dbms_workload_repository_raise_stub_error("процедура DBMS_WORKLOAD_REPOSITORY.EXTRACT не реализована.");
|
PG_RETURN_VOID();
|
}
|
|
Datum dbms_workload_repository_extract_1(PG_FUNCTION_ARGS)
|
{
|
dbms_workload_repository_raise_stub_error("процедура DBMS_WORKLOAD_REPOSITORY.EXTRACT не реализована.");
|
PG_RETURN_VOID();
|
}
|
|
Datum dbms_workload_repository_get_awr_id(PG_FUNCTION_ARGS)
|
{
|
ensure_workload_repository_service_ready();
|
const std::optional<std::string> hub_name = text_arg_to_string(fcinfo, 0);
|
const std::optional<std::string> source_name = text_arg_to_string(fcinfo, 1);
|
const std::string trimmed_hub = hub_name.has_value() ? trim_ascii_copy(*hub_name) : "";
|
const std::string trimmed_source = source_name.has_value() ? trim_ascii_copy(*source_name) : "";
|
const std::optional<std::string> normalized_hub_name =
|
hub_name.has_value() ? std::make_optional(trimmed_hub) : std::nullopt;
|
const std::optional<std::string> normalized_source_name =
|
source_name.has_value() ? std::make_optional(trimmed_source) : std::nullopt;
|
|
if (hub_name.has_value() && trimmed_hub.empty())
|
raise_invalid_argument("GET_AWR_ID", "hub_name", "invalid hub_name");
|
|
if (source_name.has_value() && trimmed_source.empty())
|
raise_invalid_argument("GET_AWR_ID", "source_name", "invalid source_name");
|
|
if ((hub_name.has_value() && contains_non_ascii(trimmed_hub)) ||
|
(source_name.has_value() && contains_non_ascii(trimmed_source)))
|
{
|
raise_invalid_argument("GET_AWR_ID", "hub_name", "AWR ID not found for the requested hub/source");
|
}
|
|
if (hub_name.has_value() && !is_valid_awr_name(trimmed_hub))
|
raise_invalid_argument("GET_AWR_ID", "hub_name", "invalid hub_name");
|
|
if (source_name.has_value() && !is_valid_awr_name(trimmed_source))
|
raise_invalid_argument("GET_AWR_ID", "source_name", "invalid source_name");
|
|
const std::optional<int64> awr_id = rudb::awr::get_awr_id(normalized_hub_name, normalized_source_name);
|
|
if (!awr_id.has_value())
|
raise_invalid_argument("GET_AWR_ID", "hub_name", "AWR ID not found for the requested hub/source");
|
|
PG_RETURN_NUMERIC(int64_to_numeric(*awr_id));
|
}
|
|
Datum dbms_workload_repository_get_awr_view_name_by_location_0(PG_FUNCTION_ARGS)
|
{
|
/*
|
* TODO: функция пока не реализована; чтение аргументов оставлено
|
* ниже как подсказка для разработчика. Раскомментируйте и
|
* адаптируйте эти строки при ручной реализации.
|
*/
|
// const text* arg_1 = PG_GETARG_TEXT_PP(0);
|
// (void) arg_1;
|
//
|
// const text* dba_hist_view_name = PG_GETARG_TEXT_PP(1);
|
// (void) dba_hist_view_name;
|
//
|
// const text* awr_location = PG_GETARG_TEXT_PP(2);
|
// (void) awr_location;
|
|
dbms_workload_repository_raise_stub_error("процедура DBMS_WORKLOAD_REPOSITORY.GET_AWR_VIEW_NAME_BY_LOCATION не реализована.");
|
PG_RETURN_VOID();
|
}
|
|
Datum dbms_workload_repository_get_awr_view_name_by_location_1(PG_FUNCTION_ARGS)
|
{
|
dbms_workload_repository_raise_stub_error("процедура DBMS_WORKLOAD_REPOSITORY.GET_AWR_VIEW_NAME_BY_LOCATION не реализована.");
|
PG_RETURN_VOID();
|
}
|
|
Datum dbms_workload_repository_include_appmap_0(PG_FUNCTION_ARGS)
|
{
|
/*
|
* TODO: функция пока не реализована; чтение аргументов оставлено
|
* ниже как подсказка для разработчика. Раскомментируйте и
|
* адаптируйте эти строки при ручной реализации.
|
*/
|
// const int32 dbid = PG_GETARG_INT32(0);
|
// (void) dbid;
|
//
|
// const text* appmap_name = PG_GETARG_TEXT_PP(1);
|
// (void) appmap_name;
|
|
dbms_workload_repository_raise_stub_error("процедура DBMS_WORKLOAD_REPOSITORY.INCLUDE_APPMAP не реализована.");
|
PG_RETURN_VOID();
|
}
|
|
Datum dbms_workload_repository_include_appmap_1(PG_FUNCTION_ARGS)
|
{
|
dbms_workload_repository_raise_stub_error("процедура DBMS_WORKLOAD_REPOSITORY.INCLUDE_APPMAP не реализована.");
|
PG_RETURN_VOID();
|
}
|
|
Datum dbms_workload_repository_is_automatic_snapshot_enabled_0(PG_FUNCTION_ARGS)
|
{
|
/*
|
* TODO: функция пока не реализована; чтение аргументов оставлено
|
* ниже как подсказка для разработчика. Раскомментируйте и
|
* адаптируйте эти строки при ручной реализации.
|
*/
|
// const bool arg_1 = PG_GETARG_BOOL(0);
|
// (void) arg_1;
|
|
dbms_workload_repository_raise_stub_error("процедура DBMS_WORKLOAD_REPOSITORY.IS_AUTOMATIC_SNAPSHOT_ENABLED не реализована.");
|
PG_RETURN_VOID();
|
}
|
|
Datum dbms_workload_repository_is_automatic_snapshot_enabled_1(PG_FUNCTION_ARGS)
|
{
|
dbms_workload_repository_raise_stub_error("процедура DBMS_WORKLOAD_REPOSITORY.IS_AUTOMATIC_SNAPSHOT_ENABLED не реализована.");
|
PG_RETURN_VOID();
|
}
|
|
Datum dbms_workload_repository_load_0(PG_FUNCTION_ARGS)
|
{
|
/*
|
* TODO: функция пока не реализована; чтение аргументов оставлено
|
* ниже как подсказка для разработчика. Раскомментируйте и
|
* адаптируйте эти строки при ручной реализации.
|
*/
|
// const text* schname = PG_GETARG_TEXT_PP(0);
|
// (void) schname;
|
//
|
// const bool has_dmpfile = PG_NARGS() > 1 && !PG_ARGISNULL(1);
|
// const text* dmpfile_default = nullptr;
|
// if (!has_dmpfile) {
|
// /* default literal "awrdat" для dmpfile: awrdat (source CSV) */
|
// (void) dmpfile_default;
|
// } else {
|
// (void) PG_GETARG_TEXT_PP(1);
|
// }
|
//
|
// const bool has_dmpdir = PG_NARGS() > 2 && !PG_ARGISNULL(2);
|
// const text* dmpdir_default = nullptr;
|
// if (!has_dmpdir) {
|
// /* default literal "DATA_PUMP_DIR" для dmpdir: DATA_PUMP_DIR (source CSV) */
|
// (void) dmpdir_default;
|
// } else {
|
// (void) PG_GETARG_TEXT_PP(2);
|
// }
|
//
|
// const int32 new_dbid = PG_GETARG_INT32(3);
|
// (void) new_dbid;
|
//
|
// const bool has_dup_snapshot_ok = PG_NARGS() > 4 && !PG_ARGISNULL(4);
|
// const bool dup_snapshot_ok_default = true;
|
// if (!has_dup_snapshot_ok) {
|
// /* default literal true для dup_snapshot_ok: true (source CSV) */
|
// (void) dup_snapshot_ok_default;
|
// } else {
|
// (void) PG_GETARG_BOOL(4);
|
// }
|
//
|
// const bool has_gather_stats = PG_NARGS() > 5 && !PG_ARGISNULL(5);
|
// const bool gather_stats_default = false;
|
// if (!has_gather_stats) {
|
// /* default literal false для gather_stats: false (source CSV) */
|
// (void) gather_stats_default;
|
// } else {
|
// (void) PG_GETARG_BOOL(5);
|
// }
|
//
|
// const text* source_name = PG_GETARG_TEXT_PP(6);
|
// (void) source_name;
|
//
|
// const text* logfile = PG_GETARG_TEXT_PP(7);
|
// (void) logfile;
|
//
|
// const text* logdir = PG_GETARG_TEXT_PP(8);
|
// (void) logdir;
|
|
dbms_workload_repository_raise_stub_error("процедура DBMS_WORKLOAD_REPOSITORY.LOAD не реализована.");
|
PG_RETURN_VOID();
|
}
|
|
Datum dbms_workload_repository_load_1(PG_FUNCTION_ARGS)
|
{
|
dbms_workload_repository_raise_stub_error("процедура DBMS_WORKLOAD_REPOSITORY.LOAD не реализована.");
|
PG_RETURN_VOID();
|
}
|
|
Datum dbms_workload_repository_local_awr_dbid(PG_FUNCTION_ARGS)
|
{
|
ensure_workload_repository_service_ready();
|
PG_RETURN_NUMERIC(int64_to_numeric(rudb::awr::local_dbid()));
|
}
|
|
Datum dbms_workload_repository_modify_awrexp_settings_0(PG_FUNCTION_ARGS)
|
{
|
/*
|
* TODO: функция пока не реализована; чтение аргументов оставлено
|
* ниже как подсказка для разработчика. Раскомментируйте и
|
* адаптируйте эти строки при ручной реализации.
|
*/
|
// const int32 dbid = PG_GETARG_INT32(0);
|
// (void) dbid;
|
//
|
// const bool has_include_sqlmon_option = PG_NARGS() > 1 && !PG_ARGISNULL(1);
|
// const text* include_sqlmon_option_default = nullptr;
|
// if (!has_include_sqlmon_option) {
|
// /* default literal "NO" для include_sqlmon_option: NO (source CSV) */
|
// (void) include_sqlmon_option_default;
|
// } else {
|
// (void) PG_GETARG_TEXT_PP(1);
|
// }
|
|
dbms_workload_repository_raise_stub_error("процедура DBMS_WORKLOAD_REPOSITORY.MODIFY_AWREXP_SETTINGS не реализована.");
|
PG_RETURN_VOID();
|
}
|
|
Datum dbms_workload_repository_modify_awrexp_settings_1(PG_FUNCTION_ARGS)
|
{
|
dbms_workload_repository_raise_stub_error("процедура DBMS_WORKLOAD_REPOSITORY.MODIFY_AWREXP_SETTINGS не реализована.");
|
PG_RETURN_VOID();
|
}
|
|
Datum dbms_workload_repository_modify_baseline_window_size_0(PG_FUNCTION_ARGS)
|
{
|
/*
|
* TODO: функция пока не реализована; чтение аргументов оставлено
|
* ниже как подсказка для разработчика. Раскомментируйте и
|
* адаптируйте эти строки при ручной реализации.
|
*/
|
// const int32 window_size = PG_GETARG_INT32(0);
|
// (void) window_size;
|
//
|
// const int32 dbid = PG_GETARG_INT32(1);
|
// (void) dbid;
|
|
dbms_workload_repository_raise_stub_error("процедура DBMS_WORKLOAD_REPOSITORY.MODIFY_BASELINE_WINDOW_SIZE не реализована.");
|
PG_RETURN_VOID();
|
}
|
|
Datum dbms_workload_repository_modify_baseline_window_size_1(PG_FUNCTION_ARGS)
|
{
|
dbms_workload_repository_raise_stub_error("процедура DBMS_WORKLOAD_REPOSITORY.MODIFY_BASELINE_WINDOW_SIZE не реализована.");
|
PG_RETURN_VOID();
|
}
|
|
Datum dbms_workload_repository_modify_snapshot_settings_0(PG_FUNCTION_ARGS)
|
{
|
execute_repository_entrypoint([&]() {
|
const std::optional<int> retention = optional_minutes_arg(
|
fcinfo, 0, "DBMS_WORKLOAD_REPOSITORY.MODIFY_SNAPSHOT_SETTINGS", "retention");
|
const std::optional<int> interval = optional_minutes_arg(
|
fcinfo, 1, "DBMS_WORKLOAD_REPOSITORY.MODIFY_SNAPSHOT_SETTINGS", "interval");
|
if (!PG_ARGISNULL(2))
|
ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
|
errmsg("параметр TOPNSQL не поддерживается")));
|
const int64 dbid = rudb::awr::validate_local_dbid(optional_dbid_arg(fcinfo, 3));
|
if (!PG_ARGISNULL(4))
|
ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
|
errmsg("параметр TABLESPACE_NAME не поддерживается")));
|
if (!PG_ARGISNULL(5))
|
ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
|
errmsg("параметр AUTO_PURGE не поддерживается")));
|
if (!PG_ARGISNULL(6))
|
ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
|
errmsg("параметр EMERGENCY_SNAP не поддерживается")));
|
rudb::awr::modify_snapshot_settings(dbid, retention, interval);
|
}, "DBMS_WORKLOAD_REPOSITORY.MODIFY_SNAPSHOT_SETTINGS");
|
PG_RETURN_VOID();
|
}
|
|
Datum dbms_workload_repository_modify_snapshot_settings_1(PG_FUNCTION_ARGS)
|
{
|
execute_repository_entrypoint([&]() {
|
const std::optional<int> retention = optional_minutes_arg(
|
fcinfo, 1, "DBMS_WORKLOAD_REPOSITORY.MODIFY_SNAPSHOT_SETTINGS", "retention");
|
const std::optional<int> interval = optional_minutes_arg(
|
fcinfo, 2, "DBMS_WORKLOAD_REPOSITORY.MODIFY_SNAPSHOT_SETTINGS", "interval");
|
if (!PG_ARGISNULL(0))
|
ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
|
errmsg("параметр TOPNSQL не поддерживается")));
|
const int64 dbid = rudb::awr::validate_local_dbid(optional_dbid_arg(fcinfo, 3));
|
if (!PG_ARGISNULL(4))
|
ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
|
errmsg("параметр TABLESPACE_NAME не поддерживается")));
|
if (!PG_ARGISNULL(5))
|
ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
|
errmsg("параметр AUTO_PURGE не поддерживается")));
|
if (!PG_ARGISNULL(6))
|
ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
|
errmsg("параметр EMERGENCY_SNAP не поддерживается")));
|
rudb::awr::modify_snapshot_settings(dbid, retention, interval);
|
}, "DBMS_WORKLOAD_REPOSITORY.MODIFY_SNAPSHOT_SETTINGS");
|
PG_RETURN_VOID();
|
}
|
|
Datum dbms_workload_repository_modify_table_quota_0(PG_FUNCTION_ARGS)
|
{
|
/*
|
* TODO: функция пока не реализована; чтение аргументов оставлено
|
* ниже как подсказка для разработчика. Раскомментируйте и
|
* адаптируйте эти строки при ручной реализации.
|
*/
|
// const text* table_name = PG_GETARG_TEXT_PP(0);
|
// (void) table_name;
|
//
|
// const int32 limit = PG_GETARG_INT32(1);
|
// (void) limit;
|
//
|
// const int32 dbid = PG_GETARG_INT32(2);
|
// (void) dbid;
|
|
dbms_workload_repository_raise_stub_error("процедура DBMS_WORKLOAD_REPOSITORY.MODIFY_TABLE_QUOTA не реализована.");
|
PG_RETURN_VOID();
|
}
|
|
Datum dbms_workload_repository_modify_table_quota_1(PG_FUNCTION_ARGS)
|
{
|
dbms_workload_repository_raise_stub_error("процедура DBMS_WORKLOAD_REPOSITORY.MODIFY_TABLE_QUOTA не реализована.");
|
PG_RETURN_VOID();
|
}
|
|
Datum dbms_workload_repository_modify_table_settings_0(PG_FUNCTION_ARGS)
|
{
|
/*
|
* TODO: функция пока не реализована; чтение аргументов оставлено
|
* ниже как подсказка для разработчика. Раскомментируйте и
|
* адаптируйте эти строки при ручной реализации.
|
*/
|
// const text* table_name = PG_GETARG_TEXT_PP(0);
|
// (void) table_name;
|
//
|
// const int32 dbid = PG_GETARG_INT32(1);
|
// (void) dbid;
|
//
|
// const text* flush_level = PG_GETARG_TEXT_PP(2);
|
// (void) flush_level;
|
|
dbms_workload_repository_raise_stub_error("процедура DBMS_WORKLOAD_REPOSITORY.MODIFY_TABLE_SETTINGS не реализована.");
|
PG_RETURN_VOID();
|
}
|
|
Datum dbms_workload_repository_modify_table_settings_1(PG_FUNCTION_ARGS)
|
{
|
dbms_workload_repository_raise_stub_error("процедура DBMS_WORKLOAD_REPOSITORY.MODIFY_TABLE_SETTINGS не реализована.");
|
PG_RETURN_VOID();
|
}
|
|
Datum dbms_workload_repository_purge_sql_details_0(PG_FUNCTION_ARGS)
|
{
|
/*
|
* TODO: функция пока не реализована; чтение аргументов оставлено
|
* ниже как подсказка для разработчика. Раскомментируйте и
|
* адаптируйте эти строки при ручной реализации.
|
*/
|
// const int32 numrows = PG_GETARG_INT32(0);
|
// (void) numrows;
|
//
|
// const int32 dbid = PG_GETARG_INT32(1);
|
// (void) dbid;
|
|
dbms_workload_repository_raise_stub_error("процедура DBMS_WORKLOAD_REPOSITORY.PURGE_SQL_DETAILS не реализована.");
|
PG_RETURN_VOID();
|
}
|
|
Datum dbms_workload_repository_purge_sql_details_1(PG_FUNCTION_ARGS)
|
{
|
dbms_workload_repository_raise_stub_error("процедура DBMS_WORKLOAD_REPOSITORY.PURGE_SQL_DETAILS не реализована.");
|
PG_RETURN_VOID();
|
}
|
|
Datum dbms_workload_repository_register_database_0(PG_FUNCTION_ARGS)
|
{
|
/*
|
* TODO: функция пока не реализована; чтение аргументов оставлено
|
* ниже как подсказка для разработчика. Раскомментируйте и
|
* адаптируйте эти строки при ручной реализации.
|
*/
|
// const int32 dbid = PG_GETARG_INT32(0);
|
// (void) dbid;
|
//
|
// const text* tablespace_name = PG_GETARG_TEXT_PP(1);
|
// (void) tablespace_name;
|
|
dbms_workload_repository_raise_stub_error("процедура DBMS_WORKLOAD_REPOSITORY.REGISTER_DATABASE не реализована.");
|
PG_RETURN_VOID();
|
}
|
|
Datum dbms_workload_repository_register_database_1(PG_FUNCTION_ARGS)
|
{
|
dbms_workload_repository_raise_stub_error("процедура DBMS_WORKLOAD_REPOSITORY.REGISTER_DATABASE не реализована.");
|
PG_RETURN_VOID();
|
}
|
|
Datum dbms_workload_repository_register_remote_database_0(PG_FUNCTION_ARGS)
|
{
|
/*
|
* TODO: функция пока не реализована; чтение аргументов оставлено
|
* ниже как подсказка для разработчика. Раскомментируйте и
|
* адаптируйте эти строки при ручной реализации.
|
*/
|
// const int32 node_id = PG_GETARG_INT32(0);
|
// (void) node_id;
|
//
|
// const text* node_name = PG_GETARG_TEXT_PP(0);
|
// (void) node_name;
|
//
|
// const text* topology_name = PG_GETARG_TEXT_PP(1);
|
// (void) topology_name;
|
|
dbms_workload_repository_raise_stub_error("процедура DBMS_WORKLOAD_REPOSITORY.REGISTER_REMOTE_DATABASE не реализована.");
|
PG_RETURN_VOID();
|
}
|
|
Datum dbms_workload_repository_register_remote_database_1(PG_FUNCTION_ARGS)
|
{
|
dbms_workload_repository_raise_stub_error("процедура DBMS_WORKLOAD_REPOSITORY.REGISTER_REMOTE_DATABASE не реализована.");
|
PG_RETURN_VOID();
|
}
|
|
Datum dbms_workload_repository_remove_colored_sql_0(PG_FUNCTION_ARGS)
|
{
|
/*
|
* TODO: функция пока не реализована; чтение аргументов оставлено
|
* ниже как подсказка для разработчика. Раскомментируйте и
|
* адаптируйте эти строки при ручной реализации.
|
*/
|
// const text* sql_id = PG_GETARG_TEXT_PP(0);
|
// (void) sql_id;
|
//
|
// const int32 dbid = PG_GETARG_INT32(1);
|
// (void) dbid;
|
|
dbms_workload_repository_raise_stub_error("процедура DBMS_WORKLOAD_REPOSITORY.REMOVE_COLORED_SQL не реализована.");
|
PG_RETURN_VOID();
|
}
|
|
Datum dbms_workload_repository_remove_colored_sql_1(PG_FUNCTION_ARGS)
|
{
|
dbms_workload_repository_raise_stub_error("процедура DBMS_WORKLOAD_REPOSITORY.REMOVE_COLORED_SQL не реализована.");
|
PG_RETURN_VOID();
|
}
|
|
Datum dbms_workload_repository_rename_baseline_0(PG_FUNCTION_ARGS)
|
{
|
dbms_workload_repository_raise_stub_error("процедура DBMS_WORKLOAD_REPOSITORY.RENAME_BASELINE не реализована.");
|
PG_RETURN_VOID();
|
}
|
|
Datum dbms_workload_repository_rename_baseline_1(PG_FUNCTION_ARGS)
|
{
|
/*
|
* TODO: функция пока не реализована; чтение аргументов оставлено
|
* ниже как подсказка для разработчика. Раскомментируйте и
|
* адаптируйте эти строки при ручной реализации.
|
*/
|
// const text* old_baseline_name = PG_GETARG_TEXT_PP(0);
|
// (void) old_baseline_name;
|
//
|
// const text* new_baseline_name = PG_GETARG_TEXT_PP(1);
|
// (void) new_baseline_name;
|
//
|
// const int32 dbid = PG_GETARG_INT32(2);
|
// (void) dbid;
|
|
dbms_workload_repository_raise_stub_error("процедура DBMS_WORKLOAD_REPOSITORY.RENAME_BASELINE не реализована.");
|
PG_RETURN_VOID();
|
}
|
|
Datum dbms_workload_repository_select_baseline_details_0(PG_FUNCTION_ARGS)
|
{
|
/*
|
* ERROR: неподдерживаемый элемент сохранён как заглушка.
|
* ERROR: тип TABLE не поддерживается текущим каталогом rudb.
|
*/
|
dbms_workload_repository_raise_stub_error("процедура DBMS_WORKLOAD_REPOSITORY.SELECT_BASELINE_DETAILS не поддерживается: тип TABLE не поддерживается текущим каталогом rudb. Проверьте соответствующую запись в pg_proc.dat.");
|
PG_RETURN_VOID();
|
}
|
|
Datum dbms_workload_repository_select_baseline_details_1(PG_FUNCTION_ARGS)
|
{
|
/*
|
* ERROR: неподдерживаемый элемент сохранён как заглушка.
|
* ERROR: тип TABLE не поддерживается текущим каталогом rudb.
|
*/
|
/*
|
* TODO: функция пока не реализована; чтение аргументов оставлено
|
* ниже как подсказка для разработчика. Раскомментируйте и
|
* адаптируйте эти строки при ручной реализации.
|
*/
|
// const int32 arg_1 = PG_GETARG_INT32(0);
|
// (void) arg_1;
|
//
|
// const int32 l_baseline_id = PG_GETARG_INT32(1);
|
// (void) l_baseline_id;
|
//
|
// const int32 l_beg_snap = PG_GETARG_INT32(2);
|
// (void) l_beg_snap;
|
//
|
// const int32 l_end_snap = PG_GETARG_INT32(3);
|
// (void) l_end_snap;
|
//
|
// const int32 l_dbid = PG_GETARG_INT32(4);
|
// (void) l_dbid;
|
|
dbms_workload_repository_raise_stub_error("процедура DBMS_WORKLOAD_REPOSITORY.SELECT_BASELINE_DETAILS не поддерживается: тип TABLE не поддерживается текущим каталогом rudb. Проверьте соответствующую запись в pg_proc.dat.");
|
PG_RETURN_VOID();
|
}
|
|
Datum dbms_workload_repository_select_baseline_metric_0(PG_FUNCTION_ARGS)
|
{
|
/*
|
* ERROR: неподдерживаемый элемент сохранён как заглушка.
|
* ERROR: тип TABLE не поддерживается текущим каталогом rudb.
|
*/
|
dbms_workload_repository_raise_stub_error("процедура DBMS_WORKLOAD_REPOSITORY.SELECT_BASELINE_METRIC не поддерживается: тип TABLE не поддерживается текущим каталогом rudb. Проверьте соответствующую запись в pg_proc.dat.");
|
PG_RETURN_VOID();
|
}
|
|
Datum dbms_workload_repository_select_baseline_metric_1(PG_FUNCTION_ARGS)
|
{
|
/*
|
* ERROR: неподдерживаемый элемент сохранён как заглушка.
|
* ERROR: тип TABLE не поддерживается текущим каталогом rudb.
|
*/
|
/*
|
* TODO: функция пока не реализована; чтение аргументов оставлено
|
* ниже как подсказка для разработчика. Раскомментируйте и
|
* адаптируйте эти строки при ручной реализации.
|
*/
|
// const int32 arg_1 = PG_GETARG_INT32(0);
|
// (void) arg_1;
|
//
|
// const text* l_baseline_name = PG_GETARG_TEXT_PP(1);
|
// (void) l_baseline_name;
|
//
|
// const int32 l_dbid = PG_GETARG_INT32(2);
|
// (void) l_dbid;
|
//
|
// const int32 l_instance_num = PG_GETARG_INT32(3);
|
// (void) l_instance_num;
|
|
dbms_workload_repository_raise_stub_error("процедура DBMS_WORKLOAD_REPOSITORY.SELECT_BASELINE_METRIC не поддерживается: тип TABLE не поддерживается текущим каталогом rudb. Проверьте соответствующую запись в pg_proc.dat.");
|
PG_RETURN_VOID();
|
}
|
|
Datum dbms_workload_repository_select_opt_env_details_0(PG_FUNCTION_ARGS)
|
{
|
/*
|
* ERROR: неподдерживаемый элемент сохранён как заглушка.
|
* ERROR: тип TABLE не поддерживается текущим каталогом rudb.
|
*/
|
dbms_workload_repository_raise_stub_error("процедура DBMS_WORKLOAD_REPOSITORY.SELECT_OPT_ENV_DETAILS не поддерживается: тип TABLE не поддерживается текущим каталогом rudb. Проверьте соответствующую запись в pg_proc.dat.");
|
PG_RETURN_VOID();
|
}
|
|
Datum dbms_workload_repository_select_opt_env_details_1(PG_FUNCTION_ARGS)
|
{
|
/*
|
* ERROR: неподдерживаемый элемент сохранён как заглушка.
|
* ERROR: тип TABLE не поддерживается текущим каталогом rudb.
|
*/
|
/*
|
* TODO: функция пока не реализована; чтение аргументов оставлено
|
* ниже как подсказка для разработчика. Раскомментируйте и
|
* адаптируйте эти строки при ручной реализации.
|
*/
|
// const int32 arg_1 = PG_GETARG_INT32(0);
|
// (void) arg_1;
|
//
|
// const int32 l_dbid = PG_GETARG_INT32(1);
|
// (void) l_dbid;
|
//
|
// const int32 l_opt_env_hv = PG_GETARG_INT32(2);
|
// (void) l_opt_env_hv;
|
//
|
// const int32 l_con_dbid = PG_GETARG_INT32(3);
|
// (void) l_con_dbid;
|
//
|
// const int32 l_snap_id = PG_GETARG_INT32(4);
|
// (void) l_snap_id;
|
//
|
// const int32 l_opt_env = PG_GETARG_INT32(5);
|
// (void) l_opt_env;
|
|
dbms_workload_repository_raise_stub_error("процедура DBMS_WORKLOAD_REPOSITORY.SELECT_OPT_ENV_DETAILS не поддерживается: тип TABLE не поддерживается текущим каталогом rudb. Проверьте соответствующую запись в pg_proc.dat.");
|
PG_RETURN_VOID();
|
}
|
|
Datum dbms_workload_repository_set_report_sections_0(PG_FUNCTION_ARGS)
|
{
|
/*
|
* TODO: функция пока не реализована; чтение аргументов оставлено
|
* ниже как подсказка для разработчика. Раскомментируйте и
|
* адаптируйте эти строки при ручной реализации.
|
*/
|
// const text* sec_title = PG_GETARG_TEXT_PP(0);
|
// (void) sec_title;
|
//
|
// const int32 max_rows = PG_GETARG_INT32(1);
|
// (void) max_rows;
|
|
dbms_workload_repository_raise_stub_error("процедура DBMS_WORKLOAD_REPOSITORY.SET_REPORT_SECTIONS не реализована.");
|
PG_RETURN_VOID();
|
}
|
|
Datum dbms_workload_repository_set_report_sections_1(PG_FUNCTION_ARGS)
|
{
|
dbms_workload_repository_raise_stub_error("процедура DBMS_WORKLOAD_REPOSITORY.SET_REPORT_SECTIONS не реализована.");
|
PG_RETURN_VOID();
|
}
|
|
Datum dbms_workload_repository_unregister_database_0(PG_FUNCTION_ARGS)
|
{
|
/*
|
* TODO: функция пока не реализована; чтение аргументов оставлено
|
* ниже как подсказка для разработчика. Раскомментируйте и
|
* адаптируйте эти строки при ручной реализации.
|
*/
|
// const int32 dbid = PG_GETARG_INT32(0);
|
// (void) dbid;
|
//
|
// const bool has_remove_snapshot = PG_NARGS() > 1 && !PG_ARGISNULL(1);
|
// const bool remove_snapshot_default = false;
|
// if (!has_remove_snapshot) {
|
// /* default literal false для remove_snapshot: false (source CSV) */
|
// (void) remove_snapshot_default;
|
// } else {
|
// (void) PG_GETARG_BOOL(1);
|
// }
|
|
dbms_workload_repository_raise_stub_error("процедура DBMS_WORKLOAD_REPOSITORY.UNREGISTER_DATABASE не реализована.");
|
PG_RETURN_VOID();
|
}
|
|
Datum dbms_workload_repository_unregister_database_1(PG_FUNCTION_ARGS)
|
{
|
dbms_workload_repository_raise_stub_error("процедура DBMS_WORKLOAD_REPOSITORY.UNREGISTER_DATABASE не реализована.");
|
PG_RETURN_VOID();
|
}
|
|
Datum dbms_workload_repository_unregister_remote_database_0(PG_FUNCTION_ARGS)
|
{
|
/*
|
* TODO: функция пока не реализована; чтение аргументов оставлено
|
* ниже как подсказка для разработчика. Раскомментируйте и
|
* адаптируйте эти строки при ручной реализации.
|
*/
|
// const int32 node_id = PG_GETARG_INT32(0);
|
// (void) node_id;
|
//
|
// const bool has_remote_check = PG_NARGS() > 1 && !PG_ARGISNULL(1);
|
// const bool remote_check_default = true;
|
// if (!has_remote_check) {
|
// /* default literal true для remote_check: true (source CSV) */
|
// (void) remote_check_default;
|
// } else {
|
// (void) PG_GETARG_BOOL(1);
|
// }
|
//
|
// const text* node_name = PG_GETARG_TEXT_PP(0);
|
// (void) node_name;
|
//
|
// const text* topology_name = PG_GETARG_TEXT_PP(1);
|
// (void) topology_name;
|
//
|
// const bool has_remote_check = PG_NARGS() > 2 && !PG_ARGISNULL(2);
|
// const bool remote_check_default = true;
|
// if (!has_remote_check) {
|
// /* default literal true для remote_check: true (source CSV) */
|
// (void) remote_check_default;
|
// } else {
|
// (void) PG_GETARG_BOOL(2);
|
// }
|
|
dbms_workload_repository_raise_stub_error("процедура DBMS_WORKLOAD_REPOSITORY.UNREGISTER_REMOTE_DATABASE не реализована.");
|
PG_RETURN_VOID();
|
}
|
|
Datum dbms_workload_repository_unregister_remote_database_1(PG_FUNCTION_ARGS)
|
{
|
dbms_workload_repository_raise_stub_error("процедура DBMS_WORKLOAD_REPOSITORY.UNREGISTER_REMOTE_DATABASE не реализована.");
|
PG_RETURN_VOID();
|
}
|
|
Datum dbms_workload_repository_update_datafile_info(PG_FUNCTION_ARGS)
|
{
|
dbms_workload_repository_raise_stub_error("процедура DBMS_WORKLOAD_REPOSITORY.UPDATE_DATAFILE_INFO не реализована.");
|
PG_RETURN_VOID();
|
}
|
|
Datum dbms_workload_repository_update_object_info_0(PG_FUNCTION_ARGS)
|
{
|
/*
|
* TODO: функция пока не реализована; чтение аргументов оставлено
|
* ниже как подсказка для разработчика. Раскомментируйте и
|
* адаптируйте эти строки при ручной реализации.
|
*/
|
// const bool has_maxrows = PG_NARGS() > 0 && !PG_ARGISNULL(0);
|
// const int32 maxrows_default = 0;
|
// if (!has_maxrows) {
|
// /* default literal 0 для maxrows: 0 (source CSV) */
|
// (void) maxrows_default;
|
// } else {
|
// (void) PG_GETARG_INT32(0);
|
// }
|
|
dbms_workload_repository_raise_stub_error("процедура DBMS_WORKLOAD_REPOSITORY.UPDATE_OBJECT_INFO не реализована.");
|
PG_RETURN_VOID();
|
}
|
|
Datum dbms_workload_repository_update_object_info_1(PG_FUNCTION_ARGS)
|
{
|
dbms_workload_repository_raise_stub_error("процедура DBMS_WORKLOAD_REPOSITORY.UPDATE_OBJECT_INFO не реализована.");
|
PG_RETURN_VOID();
|
}
|