使用AWS Schema Conversion Tool连接本地Oracle数据库报错ORA-28009
That error is super straightforward—Oracle's SYS user is a special, elevated account, and it requires you to explicitly specify a role (either SYSDBA or SYSOPER) when connecting. Here's how to fix it in a few practical ways:
Option 1: Update your JDBC URL
Modify your connection string to include the role parameter at the end. For your existing URL, it would look like this:
jdbc:oracle:thin:@localhost:1521:orcl?as=SYSDBA
Or if you prefer using SYSOPER (though SYSDBA is more likely what you need for migration tasks):
jdbc:oracle:thin:@localhost:1521:orcl?as=SYSOPER
Option 2: Use a regular, non-SYS user (recommended)
Using SYS for migration is overkill and risky—you don't need that level of access for schema conversion. Instead, create a dedicated migration user with the right permissions:
-- Run this in your local Oracle database CREATE USER migration_user IDENTIFIED BY your_secure_password; GRANT CONNECT, RESOURCE, SELECT_CATALOG_ROLE TO migration_user;
Then use migration_user in AWS SCT to establish the connection. This is the safer, more best-practice approach long-term.
Option 3: Specify the role directly in AWS SCT
Some versions of AWS SCT have a built-in field for selecting the connection role when setting up an Oracle source. Look for a dropdown labeled "Role" or "Connection Role" in the connection setup window, and select SYSDBA from the options. No need to tweak the URL if you use this method.
Quick checks to rule out other potential issues
- Make sure your local Oracle listener is running (verify with
lsnrctl statusin your command line) - Confirm port 1521 is open and not blocked by a firewall on your local machine
- Double-check that your Oracle service name (
orcl) is correct (you can verify withSELECT name FROM v$database;)
内容的提问来源于stack exchange,提问作者Yuva

