Oracle Cloud Infrastructure v2.33.0 published on Thursday, May 1, 2025 by Pulumi
oci.DatabaseManagement.getManagedDatabaseSqlTuningAdvisorTasks
Explore with Pulumi AI
This data source provides the list of Managed Database Sql Tuning Advisor Tasks in Oracle Cloud Infrastructure Database Management service.
Lists the SQL Tuning Advisor tasks for the specified Managed Database.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as oci from "@pulumi/oci";
const testManagedDatabaseSqlTuningAdvisorTasks = oci.DatabaseManagement.getManagedDatabaseSqlTuningAdvisorTasks({
    managedDatabaseId: testManagedDatabase.id,
    name: managedDatabaseSqlTuningAdvisorTaskName,
    opcNamedCredentialId: managedDatabaseSqlTuningAdvisorTaskOpcNamedCredentialId,
    status: managedDatabaseSqlTuningAdvisorTaskStatus,
    timeGreaterThanOrEqualTo: managedDatabaseSqlTuningAdvisorTaskTimeGreaterThanOrEqualTo,
    timeLessThanOrEqualTo: managedDatabaseSqlTuningAdvisorTaskTimeLessThanOrEqualTo,
});
import pulumi
import pulumi_oci as oci
test_managed_database_sql_tuning_advisor_tasks = oci.DatabaseManagement.get_managed_database_sql_tuning_advisor_tasks(managed_database_id=test_managed_database["id"],
    name=managed_database_sql_tuning_advisor_task_name,
    opc_named_credential_id=managed_database_sql_tuning_advisor_task_opc_named_credential_id,
    status=managed_database_sql_tuning_advisor_task_status,
    time_greater_than_or_equal_to=managed_database_sql_tuning_advisor_task_time_greater_than_or_equal_to,
    time_less_than_or_equal_to=managed_database_sql_tuning_advisor_task_time_less_than_or_equal_to)
package main
import (
	"github.com/pulumi/pulumi-oci/sdk/v2/go/oci/databasemanagement"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := databasemanagement.GetManagedDatabaseSqlTuningAdvisorTasks(ctx, &databasemanagement.GetManagedDatabaseSqlTuningAdvisorTasksArgs{
			ManagedDatabaseId:        testManagedDatabase.Id,
			Name:                     pulumi.StringRef(managedDatabaseSqlTuningAdvisorTaskName),
			OpcNamedCredentialId:     pulumi.StringRef(managedDatabaseSqlTuningAdvisorTaskOpcNamedCredentialId),
			Status:                   pulumi.StringRef(managedDatabaseSqlTuningAdvisorTaskStatus),
			TimeGreaterThanOrEqualTo: pulumi.StringRef(managedDatabaseSqlTuningAdvisorTaskTimeGreaterThanOrEqualTo),
			TimeLessThanOrEqualTo:    pulumi.StringRef(managedDatabaseSqlTuningAdvisorTaskTimeLessThanOrEqualTo),
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Oci = Pulumi.Oci;
return await Deployment.RunAsync(() => 
{
    var testManagedDatabaseSqlTuningAdvisorTasks = Oci.DatabaseManagement.GetManagedDatabaseSqlTuningAdvisorTasks.Invoke(new()
    {
        ManagedDatabaseId = testManagedDatabase.Id,
        Name = managedDatabaseSqlTuningAdvisorTaskName,
        OpcNamedCredentialId = managedDatabaseSqlTuningAdvisorTaskOpcNamedCredentialId,
        Status = managedDatabaseSqlTuningAdvisorTaskStatus,
        TimeGreaterThanOrEqualTo = managedDatabaseSqlTuningAdvisorTaskTimeGreaterThanOrEqualTo,
        TimeLessThanOrEqualTo = managedDatabaseSqlTuningAdvisorTaskTimeLessThanOrEqualTo,
    });
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.oci.DatabaseManagement.DatabaseManagementFunctions;
import com.pulumi.oci.DatabaseManagement.inputs.GetManagedDatabaseSqlTuningAdvisorTasksArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }
    public static void stack(Context ctx) {
        final var testManagedDatabaseSqlTuningAdvisorTasks = DatabaseManagementFunctions.getManagedDatabaseSqlTuningAdvisorTasks(GetManagedDatabaseSqlTuningAdvisorTasksArgs.builder()
            .managedDatabaseId(testManagedDatabase.id())
            .name(managedDatabaseSqlTuningAdvisorTaskName)
            .opcNamedCredentialId(managedDatabaseSqlTuningAdvisorTaskOpcNamedCredentialId)
            .status(managedDatabaseSqlTuningAdvisorTaskStatus)
            .timeGreaterThanOrEqualTo(managedDatabaseSqlTuningAdvisorTaskTimeGreaterThanOrEqualTo)
            .timeLessThanOrEqualTo(managedDatabaseSqlTuningAdvisorTaskTimeLessThanOrEqualTo)
            .build());
    }
}
variables:
  testManagedDatabaseSqlTuningAdvisorTasks:
    fn::invoke:
      function: oci:DatabaseManagement:getManagedDatabaseSqlTuningAdvisorTasks
      arguments:
        managedDatabaseId: ${testManagedDatabase.id}
        name: ${managedDatabaseSqlTuningAdvisorTaskName}
        opcNamedCredentialId: ${managedDatabaseSqlTuningAdvisorTaskOpcNamedCredentialId}
        status: ${managedDatabaseSqlTuningAdvisorTaskStatus}
        timeGreaterThanOrEqualTo: ${managedDatabaseSqlTuningAdvisorTaskTimeGreaterThanOrEqualTo}
        timeLessThanOrEqualTo: ${managedDatabaseSqlTuningAdvisorTaskTimeLessThanOrEqualTo}
Using getManagedDatabaseSqlTuningAdvisorTasks
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getManagedDatabaseSqlTuningAdvisorTasks(args: GetManagedDatabaseSqlTuningAdvisorTasksArgs, opts?: InvokeOptions): Promise<GetManagedDatabaseSqlTuningAdvisorTasksResult>
function getManagedDatabaseSqlTuningAdvisorTasksOutput(args: GetManagedDatabaseSqlTuningAdvisorTasksOutputArgs, opts?: InvokeOptions): Output<GetManagedDatabaseSqlTuningAdvisorTasksResult>def get_managed_database_sql_tuning_advisor_tasks(filters: Optional[Sequence[GetManagedDatabaseSqlTuningAdvisorTasksFilter]] = None,
                                                  managed_database_id: Optional[str] = None,
                                                  name: Optional[str] = None,
                                                  opc_named_credential_id: Optional[str] = None,
                                                  status: Optional[str] = None,
                                                  time_greater_than_or_equal_to: Optional[str] = None,
                                                  time_less_than_or_equal_to: Optional[str] = None,
                                                  opts: Optional[InvokeOptions] = None) -> GetManagedDatabaseSqlTuningAdvisorTasksResult
def get_managed_database_sql_tuning_advisor_tasks_output(filters: Optional[pulumi.Input[Sequence[pulumi.Input[GetManagedDatabaseSqlTuningAdvisorTasksFilterArgs]]]] = None,
                                                  managed_database_id: Optional[pulumi.Input[str]] = None,
                                                  name: Optional[pulumi.Input[str]] = None,
                                                  opc_named_credential_id: Optional[pulumi.Input[str]] = None,
                                                  status: Optional[pulumi.Input[str]] = None,
                                                  time_greater_than_or_equal_to: Optional[pulumi.Input[str]] = None,
                                                  time_less_than_or_equal_to: Optional[pulumi.Input[str]] = None,
                                                  opts: Optional[InvokeOptions] = None) -> Output[GetManagedDatabaseSqlTuningAdvisorTasksResult]func GetManagedDatabaseSqlTuningAdvisorTasks(ctx *Context, args *GetManagedDatabaseSqlTuningAdvisorTasksArgs, opts ...InvokeOption) (*GetManagedDatabaseSqlTuningAdvisorTasksResult, error)
func GetManagedDatabaseSqlTuningAdvisorTasksOutput(ctx *Context, args *GetManagedDatabaseSqlTuningAdvisorTasksOutputArgs, opts ...InvokeOption) GetManagedDatabaseSqlTuningAdvisorTasksResultOutput> Note: This function is named GetManagedDatabaseSqlTuningAdvisorTasks in the Go SDK.
public static class GetManagedDatabaseSqlTuningAdvisorTasks 
{
    public static Task<GetManagedDatabaseSqlTuningAdvisorTasksResult> InvokeAsync(GetManagedDatabaseSqlTuningAdvisorTasksArgs args, InvokeOptions? opts = null)
    public static Output<GetManagedDatabaseSqlTuningAdvisorTasksResult> Invoke(GetManagedDatabaseSqlTuningAdvisorTasksInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetManagedDatabaseSqlTuningAdvisorTasksResult> getManagedDatabaseSqlTuningAdvisorTasks(GetManagedDatabaseSqlTuningAdvisorTasksArgs args, InvokeOptions options)
public static Output<GetManagedDatabaseSqlTuningAdvisorTasksResult> getManagedDatabaseSqlTuningAdvisorTasks(GetManagedDatabaseSqlTuningAdvisorTasksArgs args, InvokeOptions options)
fn::invoke:
  function: oci:DatabaseManagement/getManagedDatabaseSqlTuningAdvisorTasks:getManagedDatabaseSqlTuningAdvisorTasks
  arguments:
    # arguments dictionaryThe following arguments are supported:
- ManagedDatabase stringId 
- The OCID of the Managed Database.
- Filters
List<GetManaged Database Sql Tuning Advisor Tasks Filter> 
- Name string
- The optional query parameter to filter the SQL Tuning Advisor task list by name.
- OpcNamed stringCredential Id 
- The OCID of the Named Credential.
- Status string
- The optional query parameter to filter the SQL Tuning Advisor task list by status.
- TimeGreater stringThan Or Equal To 
- The optional greater than or equal to query parameter to filter the timestamp.
- TimeLess stringThan Or Equal To 
- The optional less than or equal to query parameter to filter the timestamp.
- ManagedDatabase stringId 
- The OCID of the Managed Database.
- Filters
[]GetManaged Database Sql Tuning Advisor Tasks Filter 
- Name string
- The optional query parameter to filter the SQL Tuning Advisor task list by name.
- OpcNamed stringCredential Id 
- The OCID of the Named Credential.
- Status string
- The optional query parameter to filter the SQL Tuning Advisor task list by status.
- TimeGreater stringThan Or Equal To 
- The optional greater than or equal to query parameter to filter the timestamp.
- TimeLess stringThan Or Equal To 
- The optional less than or equal to query parameter to filter the timestamp.
- managedDatabase StringId 
- The OCID of the Managed Database.
- filters
List<GetManaged Database Sql Tuning Advisor Tasks Filter> 
- name String
- The optional query parameter to filter the SQL Tuning Advisor task list by name.
- opcNamed StringCredential Id 
- The OCID of the Named Credential.
- status String
- The optional query parameter to filter the SQL Tuning Advisor task list by status.
- timeGreater StringThan Or Equal To 
- The optional greater than or equal to query parameter to filter the timestamp.
- timeLess StringThan Or Equal To 
- The optional less than or equal to query parameter to filter the timestamp.
- managedDatabase stringId 
- The OCID of the Managed Database.
- filters
GetManaged Database Sql Tuning Advisor Tasks Filter[] 
- name string
- The optional query parameter to filter the SQL Tuning Advisor task list by name.
- opcNamed stringCredential Id 
- The OCID of the Named Credential.
- status string
- The optional query parameter to filter the SQL Tuning Advisor task list by status.
- timeGreater stringThan Or Equal To 
- The optional greater than or equal to query parameter to filter the timestamp.
- timeLess stringThan Or Equal To 
- The optional less than or equal to query parameter to filter the timestamp.
- managed_database_ strid 
- The OCID of the Managed Database.
- filters
Sequence[GetManaged Database Sql Tuning Advisor Tasks Filter] 
- name str
- The optional query parameter to filter the SQL Tuning Advisor task list by name.
- opc_named_ strcredential_ id 
- The OCID of the Named Credential.
- status str
- The optional query parameter to filter the SQL Tuning Advisor task list by status.
- time_greater_ strthan_ or_ equal_ to 
- The optional greater than or equal to query parameter to filter the timestamp.
- time_less_ strthan_ or_ equal_ to 
- The optional less than or equal to query parameter to filter the timestamp.
- managedDatabase StringId 
- The OCID of the Managed Database.
- filters List<Property Map>
- name String
- The optional query parameter to filter the SQL Tuning Advisor task list by name.
- opcNamed StringCredential Id 
- The OCID of the Named Credential.
- status String
- The optional query parameter to filter the SQL Tuning Advisor task list by status.
- timeGreater StringThan Or Equal To 
- The optional greater than or equal to query parameter to filter the timestamp.
- timeLess StringThan Or Equal To 
- The optional less than or equal to query parameter to filter the timestamp.
getManagedDatabaseSqlTuningAdvisorTasks Result
The following output properties are available:
- Id string
- The provider-assigned unique ID for this managed resource.
- ManagedDatabase stringId 
- SqlTuning List<GetAdvisor Task Collections Managed Database Sql Tuning Advisor Tasks Sql Tuning Advisor Task Collection> 
- The list of sql_tuning_advisor_task_collection.
- Filters
List<GetManaged Database Sql Tuning Advisor Tasks Filter> 
- Name string
- The name of the SQL Tuning Advisor task.
- OpcNamed stringCredential Id 
- Status string
- TimeGreater stringThan Or Equal To 
- TimeLess stringThan Or Equal To 
- Id string
- The provider-assigned unique ID for this managed resource.
- ManagedDatabase stringId 
- SqlTuning []GetAdvisor Task Collections Managed Database Sql Tuning Advisor Tasks Sql Tuning Advisor Task Collection 
- The list of sql_tuning_advisor_task_collection.
- Filters
[]GetManaged Database Sql Tuning Advisor Tasks Filter 
- Name string
- The name of the SQL Tuning Advisor task.
- OpcNamed stringCredential Id 
- Status string
- TimeGreater stringThan Or Equal To 
- TimeLess stringThan Or Equal To 
- id String
- The provider-assigned unique ID for this managed resource.
- managedDatabase StringId 
- sqlTuning List<GetAdvisor Task Collections Managed Database Sql Tuning Advisor Tasks Sql Tuning Advisor Task Collection> 
- The list of sql_tuning_advisor_task_collection.
- filters
List<GetManaged Database Sql Tuning Advisor Tasks Filter> 
- name String
- The name of the SQL Tuning Advisor task.
- opcNamed StringCredential Id 
- status String
- timeGreater StringThan Or Equal To 
- timeLess StringThan Or Equal To 
- id string
- The provider-assigned unique ID for this managed resource.
- managedDatabase stringId 
- sqlTuning GetAdvisor Task Collections Managed Database Sql Tuning Advisor Tasks Sql Tuning Advisor Task Collection[] 
- The list of sql_tuning_advisor_task_collection.
- filters
GetManaged Database Sql Tuning Advisor Tasks Filter[] 
- name string
- The name of the SQL Tuning Advisor task.
- opcNamed stringCredential Id 
- status string
- timeGreater stringThan Or Equal To 
- timeLess stringThan Or Equal To 
- id str
- The provider-assigned unique ID for this managed resource.
- managed_database_ strid 
- sql_tuning_ Sequence[Getadvisor_ task_ collections Managed Database Sql Tuning Advisor Tasks Sql Tuning Advisor Task Collection] 
- The list of sql_tuning_advisor_task_collection.
- filters
Sequence[GetManaged Database Sql Tuning Advisor Tasks Filter] 
- name str
- The name of the SQL Tuning Advisor task.
- opc_named_ strcredential_ id 
- status str
- time_greater_ strthan_ or_ equal_ to 
- time_less_ strthan_ or_ equal_ to 
- id String
- The provider-assigned unique ID for this managed resource.
- managedDatabase StringId 
- sqlTuning List<Property Map>Advisor Task Collections 
- The list of sql_tuning_advisor_task_collection.
- filters List<Property Map>
- name String
- The name of the SQL Tuning Advisor task.
- opcNamed StringCredential Id 
- status String
- timeGreater StringThan Or Equal To 
- timeLess StringThan Or Equal To 
Supporting Types
GetManagedDatabaseSqlTuningAdvisorTasksFilter       
GetManagedDatabaseSqlTuningAdvisorTasksSqlTuningAdvisorTaskCollection           
- Items
List<GetManaged Database Sql Tuning Advisor Tasks Sql Tuning Advisor Task Collection Item> 
- A list of SQL Tuning Advisor tasks.
- Items
[]GetManaged Database Sql Tuning Advisor Tasks Sql Tuning Advisor Task Collection Item 
- A list of SQL Tuning Advisor tasks.
- items
List<GetManaged Database Sql Tuning Advisor Tasks Sql Tuning Advisor Task Collection Item> 
- A list of SQL Tuning Advisor tasks.
- items
GetManaged Database Sql Tuning Advisor Tasks Sql Tuning Advisor Task Collection Item[] 
- A list of SQL Tuning Advisor tasks.
- items
Sequence[GetManaged Database Sql Tuning Advisor Tasks Sql Tuning Advisor Task Collection Item] 
- A list of SQL Tuning Advisor tasks.
- items List<Property Map>
- A list of SQL Tuning Advisor tasks.
GetManagedDatabaseSqlTuningAdvisorTasksSqlTuningAdvisorTaskCollectionItem            
- DaysTo intExpire 
- The number of days left before the task expires. If the value equals -1, then the task has no expiration time (UNLIMITED).
- Description string
- The description of the SQL Tuning Advisor task.
- InstanceId int
- The instance ID of the SQL Tuning Advisor task. This is not the OCID.
- Name string
- The optional query parameter to filter the SQL Tuning Advisor task list by name.
- Owner string
- The owner of the SQL Tuning Advisor task.
- RecommendationCount int
- The number of recommendations provided for the SQL Tuning Advisor task.
- SqlTuning stringAdvisor Task Id 
- The unique identifier of the SQL Tuning Advisor task. This is not the OCID.
- TaskStatus string
- The status of the SQL Tuning Advisor task.
- TimeCreated string
- The Creation date of the SQL Tuning Advisor task.
- TimeExecution stringEnded 
- The end time of the task execution.
- TimeExecution stringStarted 
- The start time of the task execution.
- TotalSql intStatements 
- The total number of SQL statements related to the SQL Tuning Advisor task.
- DaysTo intExpire 
- The number of days left before the task expires. If the value equals -1, then the task has no expiration time (UNLIMITED).
- Description string
- The description of the SQL Tuning Advisor task.
- InstanceId int
- The instance ID of the SQL Tuning Advisor task. This is not the OCID.
- Name string
- The optional query parameter to filter the SQL Tuning Advisor task list by name.
- Owner string
- The owner of the SQL Tuning Advisor task.
- RecommendationCount int
- The number of recommendations provided for the SQL Tuning Advisor task.
- SqlTuning stringAdvisor Task Id 
- The unique identifier of the SQL Tuning Advisor task. This is not the OCID.
- TaskStatus string
- The status of the SQL Tuning Advisor task.
- TimeCreated string
- The Creation date of the SQL Tuning Advisor task.
- TimeExecution stringEnded 
- The end time of the task execution.
- TimeExecution stringStarted 
- The start time of the task execution.
- TotalSql intStatements 
- The total number of SQL statements related to the SQL Tuning Advisor task.
- daysTo IntegerExpire 
- The number of days left before the task expires. If the value equals -1, then the task has no expiration time (UNLIMITED).
- description String
- The description of the SQL Tuning Advisor task.
- instanceId Integer
- The instance ID of the SQL Tuning Advisor task. This is not the OCID.
- name String
- The optional query parameter to filter the SQL Tuning Advisor task list by name.
- owner String
- The owner of the SQL Tuning Advisor task.
- recommendationCount Integer
- The number of recommendations provided for the SQL Tuning Advisor task.
- sqlTuning StringAdvisor Task Id 
- The unique identifier of the SQL Tuning Advisor task. This is not the OCID.
- taskStatus String
- The status of the SQL Tuning Advisor task.
- timeCreated String
- The Creation date of the SQL Tuning Advisor task.
- timeExecution StringEnded 
- The end time of the task execution.
- timeExecution StringStarted 
- The start time of the task execution.
- totalSql IntegerStatements 
- The total number of SQL statements related to the SQL Tuning Advisor task.
- daysTo numberExpire 
- The number of days left before the task expires. If the value equals -1, then the task has no expiration time (UNLIMITED).
- description string
- The description of the SQL Tuning Advisor task.
- instanceId number
- The instance ID of the SQL Tuning Advisor task. This is not the OCID.
- name string
- The optional query parameter to filter the SQL Tuning Advisor task list by name.
- owner string
- The owner of the SQL Tuning Advisor task.
- recommendationCount number
- The number of recommendations provided for the SQL Tuning Advisor task.
- sqlTuning stringAdvisor Task Id 
- The unique identifier of the SQL Tuning Advisor task. This is not the OCID.
- taskStatus string
- The status of the SQL Tuning Advisor task.
- timeCreated string
- The Creation date of the SQL Tuning Advisor task.
- timeExecution stringEnded 
- The end time of the task execution.
- timeExecution stringStarted 
- The start time of the task execution.
- totalSql numberStatements 
- The total number of SQL statements related to the SQL Tuning Advisor task.
- days_to_ intexpire 
- The number of days left before the task expires. If the value equals -1, then the task has no expiration time (UNLIMITED).
- description str
- The description of the SQL Tuning Advisor task.
- instance_id int
- The instance ID of the SQL Tuning Advisor task. This is not the OCID.
- name str
- The optional query parameter to filter the SQL Tuning Advisor task list by name.
- owner str
- The owner of the SQL Tuning Advisor task.
- recommendation_count int
- The number of recommendations provided for the SQL Tuning Advisor task.
- sql_tuning_ stradvisor_ task_ id 
- The unique identifier of the SQL Tuning Advisor task. This is not the OCID.
- task_status str
- The status of the SQL Tuning Advisor task.
- time_created str
- The Creation date of the SQL Tuning Advisor task.
- time_execution_ strended 
- The end time of the task execution.
- time_execution_ strstarted 
- The start time of the task execution.
- total_sql_ intstatements 
- The total number of SQL statements related to the SQL Tuning Advisor task.
- daysTo NumberExpire 
- The number of days left before the task expires. If the value equals -1, then the task has no expiration time (UNLIMITED).
- description String
- The description of the SQL Tuning Advisor task.
- instanceId Number
- The instance ID of the SQL Tuning Advisor task. This is not the OCID.
- name String
- The optional query parameter to filter the SQL Tuning Advisor task list by name.
- owner String
- The owner of the SQL Tuning Advisor task.
- recommendationCount Number
- The number of recommendations provided for the SQL Tuning Advisor task.
- sqlTuning StringAdvisor Task Id 
- The unique identifier of the SQL Tuning Advisor task. This is not the OCID.
- taskStatus String
- The status of the SQL Tuning Advisor task.
- timeCreated String
- The Creation date of the SQL Tuning Advisor task.
- timeExecution StringEnded 
- The end time of the task execution.
- timeExecution StringStarted 
- The start time of the task execution.
- totalSql NumberStatements 
- The total number of SQL statements related to the SQL Tuning Advisor task.
Package Details
- Repository
- oci pulumi/pulumi-oci
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the ociTerraform Provider.