I've been working on some issues using Oracle XE (the free express desktop edition of Oracle).
I've tackled the issue
SP2-0640: Unknown log mode that some users have encountered. I've read a few articles with some fairly complex solutions. The solution is to read the batch files Backup.bat and Restore.bat. The first clue is in the comments:
This script assumes you can log in to Oracle using the statement CONNECT / AS SYSDBA;
The following steps show you how to test this assumption:
- Open a cmd window
- Enter the command: sqlplus /nolog
- From the oracle prompt, enter the command CONNECT / AS SYSDBA;
If the last item does not work, then your backup and restore script will not work! I'll cover some changes you have to implement in order for the backup and restore script to work properly.
You may have figured out that the error you are receiving, SP2-0640 is actually a problem with logging in to Oracle XE, not a problem with your installation. For some reason, Oracle may not be able to use integrated security to allow accounts to log in. I have this problem at work on one of our domains. Even though our Admin has not implemented any strange authentication policies, Oracle is unable to use NTS for authentication. We are forced to use NONE on some machines.
(If you do not know what I am talking about, please look for the file sqlnet.ora. The line SQLNET.AUTHENTICATION_SERVICES = (NTS) tells you that Oracle is using Windows to authenticate users. Next, you must make sure your user name is a member of the ora_dba group. You should be able to log in as / as sysdba. If you cannot, then you need to read the rest of this posting.)
If this is the case, then the only solution is to modify Backup.bat and Restore.bat. The best hint I was able to dig up came from the comments located in the batch file:
REM
REM The script assumes that user can connect using "/ as sysdba"
REM Recovery Area is enabled.
REM
This gave me a place to start looking, because I knew the command
connect / as sysdba did not work for me. On my test installation, these files are located in
c:\oraclexe\app\oracle\product\10.2.0\server\BIN. In my test installation, I specified
admin as the password for the SYS and SYSTEM accounts.
- Make a copy of Backup.bat in case you need to restore the script.
- Open Backup.bat using notepad.
- For testing, I like to remove the very first line of the file,
@echo off. This allows me to see any errors in the script as they occur.
- Look for occurrences of
connect / as sysdba;
- Replace the above occurrences with
connect sys/admin as sysdba; (Your password may be different. There are multiple lines that need to be replaced.)
- Look for occurrences of
rman target /
- Replace the occurrences with
rman target sys/admin (Your password may be different. There are multiple lines that need to be replaced.)
- Save the file and exit notepad.
- Attempt to use Backup item in the Oracle menu.
- Repeat the above with Restore.bat
If all goes well, you should be able to successfully backup and restore your database. Always a good idea while you are developing code.
Happy Oracle Coding...