Logging in to a test database
I have a test database that I am trying to refresh from another database. When attempting to import the data, I forgot to truncate the tables. I ran the import command from a batch job and killed it before it finished because I realized that I had forgotten to truncate the tables.
I am now trying to log in to the database as both SYS and SYSTEM and I am getting a 1031 error, "invalid username or password." Is there another way for me to log in to the database? What happened to my SYS and SYSTEM usernames?
I am not sure why your SYS and SYSTEM accounts had their password changed. The import utility should not have done this. But to fix it, simply sign on to the database server as an Administrator (Windows) or a member of the DBA group (UNIX/Linux). Then type the following:
connect / as sysdba
You will now be able to change your SYS and SYSTEM passwords using the ALTER USER command:
ALTER USER sys IDENTIFIED BY foobar;
This was first published in July 2005