-1

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?

bbuser
  • 918
  • 11
  • 33

1 Answers1

2

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.

Thilo
  • 257,207
  • 101
  • 511
  • 656
  • When it's shutdown i can't connect obviously but as far as I understand it needs to be mounted and closed for a flashback. I researched for closing it without shutting it down but to no avail. – bbuser Sep 05 '11 at 07:58
  • As for "out of band" solutions: I'm open for that, but I have no admin rights on the server, so I don't see a way to go that route. Maybe I'm wrong? – bbuser Sep 05 '11 at 08:00
  • 1
    If it is closed, you cannot connect remotely either (even if not shutdown). – Thilo Sep 05 '11 at 08:02
  • You are right, can't connect when mounted closed. What about putting the commands on the server somehow (procedure, function, package?) and then just start that? Is there anything that survives a shutdown? – bbuser Sep 05 '11 at 08:12
  • Ask your system admin for remote terminal sessions... All the Oracle remote tools need to database to be open and accepting connections. Maybe there is something in Enterprise Manager, but I somehow doubt it. – Thilo Sep 05 '11 at 08:17