This page describes how to view the database information for an Autonomous Database.
Before you begin
-
Enable the Oracle Database@Google Cloud API for the project.
-
Confirm that you have the required roles necessary to create an instance:
autonomousDatabaseAdmin
.For more information on how to assign roles, see Apply IAM roles .
View database information
Console
-
Go to the Autonomous Database Servicepage in the Google Cloud console.
-
In the Autonomous Databasesection, click the display name of a database to view its database information.
You're redirected to the database's details page.
gcloud
Use the gcloud oracle-database autonomous-databases describe
command to view database information for your Autonomous Database.
gcloud oracle-database cloud-autonomous-databases describe DATABASE_ID
--location= REGION_ID
Replace the following:
- DATABASE_ID : the identifier for the database that you want to view information for.
- REGION_ID : the region for the instance that you want to view information for.
C#
using
Google.Cloud.OracleDatabase.V1
;
using
System.Threading.Tasks
;
public
sealed
partial
class
GeneratedOracleDatabaseClientSnippets
{
/// <summary>Snippet for GetAutonomousDatabaseAsync</summary>
/// <remarks>
/// This snippet has been automatically generated and should be regarded as a code template only.
/// It will require modifications to work:
/// - It may require correct/in-range values for request initialization.
/// - It may require specifying regional endpoints when creating the service client as shown in
/// https://cloud.google.com/dotnet/docs/reference/help/client-configuration#endpoint.
/// </remarks>
public
async
Task
GetAutonomousDatabaseAsync
()
{
// Create client
OracleDatabaseClient
oracleDatabaseClient
=
await
OracleDatabaseClient
.
CreateAsync
();
// Initialize request argument(s)
string
name
=
"projects/[PROJECT]/locations/[LOCATION]/autonomousDatabases/[AUTONOMOUS_DATABASE]"
;
// Make the request
AutonomousDatabase
response
=
await
oracleDatabaseClient
.
GetAutonomousDatabaseAsync
(
name
);
}
}
Go
package
main
import
(
"context"
oracledatabase
"cloud.google.com/go/oracledatabase/apiv1"
oracledatabasepb
"cloud.google.com/go/oracledatabase/apiv1/oracledatabasepb"
)
func
main
()
{
ctx
:=
context
.
Background
()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c
,
err
:=
oracledatabase
.
NewClient
(
ctx
)
if
err
!=
nil
{
// TODO: Handle error.
}
defer
c
.
Close
()
req
:=
& oracledatabasepb
.
GetAutonomousDatabaseRequest
{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/oracledatabase/apiv1/oracledatabasepb#GetAutonomousDatabaseRequest.
}
resp
,
err
:=
c
.
GetAutonomousDatabase
(
ctx
,
req
)
if
err
!=
nil
{
// TODO: Handle error.
}
// TODO: Use resp.
_
=
resp
}
Java
import
com.google.api.core. ApiFuture
;
import
com.google.cloud.oracledatabase.v1. AutonomousDatabase
;
import
com.google.cloud.oracledatabase.v1. AutonomousDatabaseName
;
import
com.google.cloud.oracledatabase.v1. GetAutonomousDatabaseRequest
;
import
com.google.cloud.oracledatabase.v1. OracleDatabaseClient
;
public
class
AsyncGetAutonomousDatabase
{
public
static
void
main
(
String
[]
args
)
throws
Exception
{
asyncGetAutonomousDatabase
();
}
public
static
void
asyncGetAutonomousDatabase
()
throws
Exception
{
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try
(
OracleDatabaseClient
oracleDatabaseClient
=
OracleDatabaseClient
.
create
())
{
GetAutonomousDatabaseRequest
request
=
GetAutonomousDatabaseRequest
.
newBuilder
()
.
setName
(
AutonomousDatabaseName
.
of
(
"[PROJECT]"
,
"[LOCATION]"
,
"[AUTONOMOUS_DATABASE]"
)
.
toString
())
.
build
();
ApiFuture<AutonomousDatabase>
future
=
oracleDatabaseClient
.
getAutonomousDatabaseCallable
().
futureCall
(
request
);
// Do something.
AutonomousDatabase
response
=
future
.
get
();
}
}
}
Node.js
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The name of the Autonomous Database in the following format:
* projects/{project}/locations/{location}/autonomousDatabases/{autonomous_database}.
*/
// const name = 'abc123'
// Imports the Oracledatabase library
const
{
OracleDatabaseClient
}
=
require
(
' @google-cloud/oracledatabase
'
).
v1
;
// Instantiates a client
const
oracledatabaseClient
=
new
OracleDatabaseClient
();
async
function
callGetAutonomousDatabase
()
{
// Construct request
const
request
=
{
name
,
};
// Run request
const
response
=
await
oracledatabaseClient
.
getAutonomousDatabase
(
request
);
console
.
log
(
response
);
}
callGetAutonomousDatabase
();
PHP
use Google\ApiCore\ApiException;
use Google\Cloud\OracleDatabase\V1\AutonomousDatabase;
use Google\Cloud\OracleDatabase\V1\Client\OracleDatabaseClient;
use Google\Cloud\OracleDatabase\V1\GetAutonomousDatabaseRequest;
/**
* Gets the details of a single Autonomous Database.
*
* @param string $formattedName The name of the Autonomous Database in the following format:
* projects/{project}/locations/{location}/autonomousDatabases/{autonomous_database}. Please see
* {@see OracleDatabaseClient::autonomousDatabaseName()} for help formatting this field.
*/
function get_autonomous_database_sample(string $formattedName): void
{
// Create a client.
$oracleDatabaseClient = new OracleDatabaseClient();
// Prepare the request message.
$request = (new GetAutonomousDatabaseRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var AutonomousDatabase $response */
$response = $oracleDatabaseClient->getAutonomousDatabase($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedName = OracleDatabaseClient::autonomousDatabaseName(
'[PROJECT]',
'[LOCATION]',
'[AUTONOMOUS_DATABASE]'
);
get_autonomous_database_sample($formattedName);
}
Python
# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
# client as shown in:
# https://googleapis.dev/python/google-api-core/latest/client_options.html
from
google.cloud
import
oracledatabase_v1
def
sample_get_autonomous_database
():
# Create a client
client
=
oracledatabase_v1
.
OracleDatabaseClient
()
# Initialize request argument(s)
request
=
oracledatabase_v1
.
GetAutonomousDatabaseRequest
(
name
=
"name_value"
,
)
# Make the request
response
=
client
.
get_autonomous_database
(
request
=
request
)
# Handle the response
print
(
response
)
Ruby
require
"google/cloud/oracle_database/v1"
##
# Snippet for the get_autonomous_database call in the OracleDatabase service
#
# This snippet has been automatically generated and should be regarded as a code
# template only. It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
# client as shown in https://cloud.google.com/ruby/docs/reference.
#
# This is an auto-generated example demonstrating basic usage of
# Google::Cloud::OracleDatabase::V1::OracleDatabase::Client#get_autonomous_database.
#
def
get_autonomous_database
# Create a client object. The client can be reused for multiple calls.
client
=
Google
::
Cloud
::
OracleDatabase
::
V1
::
OracleDatabase
::
Client
.
new
# Create a request. To set request fields, pass in keyword arguments.
request
=
Google
::
Cloud
::
OracleDatabase
::
V1
::
GetAutonomousDatabaseRequest
.
new
# Call the get_autonomous_database method.
result
=
client
.
get_autonomous_database
request
# The returned object is of type Google::Cloud::OracleDatabase::V1::AutonomousDatabase.
p
result
end
What's next
- Learn how to create or manage an Autonomous Database.
- Configure Identity and Access Management roles for a database.
- Use monitoring metrics to monitor your databases.