Skip to Main Content
  • Questions
  • Scheduling Oracle 8i database shutdown in Windows 2000 Server

Breadcrumb

Question and Answer

Tom Kyte

Thanks for the question, ramesh babu.

Asked: December 26, 2005 - 11:43 pm UTC

Last updated: December 27, 2005 - 2:20 pm UTC

Version: 8.1.5

Viewed 1000+ times

You Asked

1)How to schedule a Oracle8i databse shutdown on Windows 2000 Server.( It has to shutdown the database automatically at a specified time)

2)How to identify Idle sessions on Oracle 8i database? Is there any script to kill sessions automatically, if the session is idle for a particular amount of time?


and Tom said...

1) if you are using enterprise manager, there is a job facility in there that can be used to schedule recurring jobs like this.


if not, you'll ask your Windows System Admins for help setting up a recurring job.

But - prepare to get paged when the database doesn't want to shutdown or subsequently startup. It'll happen, it'll definitely happen. Unattended shutdown/startups - man oh man.

see
</code> http://asktom.oracle.com/pls/asktom/f?p=100:11:::::P11_QUESTION_ID:53864427041072 <code>

we were just talking about this very topic.

2) you can set the profile for users (see the admin guide or the sql reference for CREATE PROFILE) and set an idle timeout.

It'll kill the sessions (release their resources like locks and such) but the row in v$session will persist until the client application tries to "touch" the database - then and only then will the process entirely go away.

Rating

  (3 ratings)

Is this answer out of date? If it is, please let us know via a Comment

Comments

Now you are making nervous!

Gleisson Henrique, December 27, 2005 - 11:16 am UTC

At work, we have a backup routine in which we kill all sessions and then take down the database and backup the system files and then we put it up running again. It is all done trough .cmd files and windows scheduled task manager. We never had a problem for shutting the db down or bringing it up. However I never attempted to recover with those backup.

Babu, if you want to I can either post here or send the files to you. Posting here, we might get Tom's opinion on it.

Tom, is there a recommended way to back up ? recommended meaning effective.

Tom Kyte
December 27, 2005 - 2:09 pm UTC

shutting down we can "usually do" (shutdown abort *usually works*, doesn't have to - I can make it "not shutdown" easily).

starting up unattended however is something entirely different ;) add an init.ora, change something that doesn't take effect till next restart, change something at the OS level (that "couldn't" possibly affect the database - meaning it almost surely will), anything at all - something a human can fixed in 5 seconds - but the software will just sit there and wait patiently.


It is all about HOT backup and ARCHIVE LOG mode - and then testing your ability to recover every way you want to be able to recover - restore to a new machine, restore just a tablespace, how to recover just a table, just some rows of some table, a schema, some code - etc - all of the things you want to recover from, practice them.

Scheduling Oracle 8i database shutdown in Windows 2000 Server

Tim, December 27, 2005 - 12:56 pm UTC

Gleisson,
You said, "However I never attempted to recover with those backup."

As I see it - that is only a very minor step removed from not backing up at all.

If you are not routinely performing recovery - how do you know you can recover? After all - the point of this is not to "backup" - the point is to "recover". The only reason to backup in the first place is to allow you to recover.

Trusting the results of a script that say you have a "successful" backup - is like believing those internet email chain letters - just hearsay.

Recover for yourself - believe it for yourself.

Unfortunately - the system you are following is not unique to your orgination. Many people operate in production using the same technique.


Tom Kyte
December 27, 2005 - 2:20 pm UTC

So many people perform a restore.....

for the very first time.....

on the day they need to be able to have the restore actually work....



ouch is all I can say. I would have failed that test miserably myself since I totally messed up what I should have been backing up - and only be testing it out did I realize that.

very fair

Gleisson Henrique, December 27, 2005 - 1:29 pm UTC

Tim, you are right indeed ! I hope I never have to backup. However I should be prepered to do it. I try to stay on the developer side of "the force", backing up and other related admin issues are not my area. I know ignorance is no excuse when the db crashes the whole it department is responsible. I will try to recover sometime and let this forum know.