Logging in to your RDS Custom for Oracle database as SYS (original) (raw)
After you create your RDS Custom DB instance, you can log in to your Oracle database as userSYS
, which gives you SYSDBA
privileges. You have the following login options:
- Get the
SYS
password from Secrets Manager, and specify this password in your SQL client. - Use OS authentication to log in to your database. In this case, you don't need a password.
Finding the SYS password for your RDS Custom for Oracle database
Your can log in to your Oracle database as SYS
or SYSTEM
or by specifying the master user name in an API call. The password for SYS
andSYSTEM
is stored in Secrets Manager.
The secret uses the naming formatdo-not-delete-rds-custom-`resource_id`-`uuid`
orrds-custom!oracle-do-not-delete-`resource_id`-`uuid`
. You can find the password using the AWS Management Console.
To find the SYS password for your database in Secrets Manager
- Sign in to the AWS Management Console and open the Amazon RDS console athttps://console.aws.amazon.com/rds/.
- In the RDS console, complete the following steps:
- In the navigation pane, chooseDatabases.
- Choose the name of your RDS Custom for Oracle DB instance.
- Choose Configuration.
- Copy the value underneath Resource ID. For example, you resource ID might bedb-ABC12CDE3FGH4I5JKLMNO6PQR7.
- Open the Secrets Manager console at https://console.aws.amazon.com/secretsmanager/.
- In the Secrets Manager console, complete the following steps:
- In the left navigation pane, chooseSecrets.
- Filter the secrets by the resource ID that you copied in step 2.d.
- Choose the secret that uses the naming formatdo-not-delete-rds-custom-
resource_id
-uuid
orrds-custom!oracle-do-not-delete-resource_id
-uuid
. Theresource_id
is the resource ID that you copied in step 2.d.
For example, if your resource ID isdb-ABC12CDE3FGH4I5JKLMNO6PQR7 and your UUID is 1234ab, your secret is nameddo-not-delete-rds-custom-db-ABC12CDE3FGH4I5JKLMNO6PQR7-1234ab orrds-custom!oracle-do-not-delete-db-ABC12CDE3FGH4I5JKLMNO6PQR7-1234ab. - In Secret value, chooseRetrieve secret value.
- In Key/value, copy the value forpassword.
- Install SQL*Plus on your DB instance and log in to your database as
SYS
. For more information, see Step 3: Connect your SQL client to an Oracle DB instance.
Logging in to your RDS Custom for Oracle database using OS authentication
The OS user rdsdb
owns the Oracle database binaries. You can switch to the rdsdb
user and log in to your RDS Custom for Oracle database without a password.
- Connect to your DB instance with AWS Systems Manager. For more information, see Connecting to your RDS Custom DB instance using Session Manager.
- In a web browser, go to https://www.oracle.com/database/technologies/instant-client/linux-x86-64-downloads.html.
- For the latest database version that appears on the web page, copy the .rpm links (not the .zip links) for the Instant Client Basic Package and SQL*Plus Package. For example, the following links are for Oracle Database version 21.9:
- In your SSH session, run the
wget
command to the download the .rpm files from the links that you obtained in the previous step. The following example downloads the .rpm files for Oracle Database version 21.9:
wget https://download.oracle.com/otn_software/linux/instantclient/219000/oracle-instantclient-basic-21.9.0.0.0-1.el8.x86_64.rpm
wget https://download.oracle.com/otn_software/linux/instantclient/219000/oracle-instantclient-sqlplus-21.9.0.0.0-1.el8.x86_64.rpm
- Install the packages by running the
yum
command as follows:
sudo yum install oracle-instantclient-*.rpm
- Switch to the
rdsdb
user.
sudo su - rdsdb
- Log in to your database using OS authentication.
$ sqlplus / as sysdba
SQL*Plus: Release 21.0.0.0.0 - Production on Wed Apr 12 20:11:08 2023
Version 21.9.0.0.0
Copyright (c) 1982, 2020, Oracle. All rights reserved.
Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.10.0.0.0