oraclesqlplusflashback

Oracle flashback database remotely


I often have to flashback my database to a certain restore point. On the machine where the database is running I log in with sqlplus and issue the following commands.

shutdown immediate;
startup mount;
flashback database to restore point bettertimes;
alter database open resetlogs;

I don't always have access to the machine (Windows XP) where the database is running so I want to do the flashback remotely. I have put the above commands in the file flashback.sql and do:

sqlplus "sys/passwd as sysdba" @sql\flashback.sql

That works great but when I have to do it remotely I have to specify the SID and the command is:

sqlplus "sys/passwd@orcl as sysdba" @sql\flashback.sql

This doesn't work, neither on the machine where the database is running nor remotely. The problem is that after the shutdown immediate the connection is lost and I can't reconnect without mounting and opening the database manually.

I'm no windows administrator on the server, just sysdba.

Is there a way to flashback the database remotely?


Solution

  • You cannot shut down the database via SQL*Plus remotely and then continue to work with it (because it has been shut down and will not accept remote connections anymore).

    You need to use something like SSH or Windows Remote Terminal and use SQL*Plus locally in there.