Skip to Main Content
  • Questions
  • How to re-open a closed database without shutdown DB ?

Breadcrumb

Question and Answer

Tom Kyte

Thanks for the question, Lisa.

Asked: November 05, 2001 - 11:44 am UTC

Last updated: October 07, 2009 - 7:42 am UTC

Version: 816

Viewed 10K+ times! This question is

You Asked

While in database, I did:
SQL> alter database close;

Database altered.

< change the init ora file to increase db_block_buffers from 3200 to 4000 >
SQL> alter database open;
alter database open
*
ORA-01531: a database already open by the instance
<message of 1531- Action: If you wish to open a new database on the instance, first shut down and then restart the instance and retry the operation >
In order to pickup the new DB_BLOCK_BUFFERS size,

1. How can I re-open the current database without shutdown and then startup the database?

2. In a 24X7 environment, if I want to change some parameter and make it available, do I
have to bounce the database? Is there any way not to shutdown and make the change in init ?

Thanks.

and Tom said...

1) You have to shutdown. You can issue an alter database OPEN once per instance. You can use "startup force" after making the modifications.

2) Many parameters are changable on line and every release adds more (eg: in 9i, you can resize the shared pool and buffer cache online). If you query v$parameter, you'll see which are modifiable online and which require a restart.

Rating

  (8 ratings)

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

Comments

No Sessions Connected.

Ganesh Raja, November 06, 2001 - 12:04 am UTC

Hi Tom,

I am using Oracle 817 on NT. when i Try to Close my Database using the alter Database Close it says it can do it only with no sessions conected.

I checked my v$session and i get Lot of Sessions with No Programs and Type as user Connected ...

What are these sessions and what are their uses.

Regards,
Ganesh R

Tom Kyte
November 06, 2001 - 7:37 am UTC

They are the job queues.

alter system set job_queue_processes=0;

and try again.

Please Clarify

A reader, November 06, 2001 - 11:02 am UTC

It seems that alter database close then ( do maintenance work here) ,shutdown the db and startup again is equal to use:
shutdown db then startup mount (do maintenance work here).
it is just the different option. Is my thinking right ?


Tom Kyte
November 06, 2001 - 12:46 pm UTC

alter database close
do work
startup force


is the same as

shutdown
startup mount
do work
alter database open


yes.

Shall we use "startup force" to restart the db which is in open state?

Sami, January 18, 2004 - 8:37 pm UTC

Dear Tom,

Thanks for your help.

The database(dev instance) is up and running.I made few changes in init.ora(non-dynamic parameters).

Shall I use startup force to restart the instance?

Is "startup force" equivalent to
1)shutdown immediate
2)startup

Correct me if I am wrong?

Tom Kyte
January 19, 2004 - 9:01 am UTC

startup force is more like shutdown abort, startup.

you can use it, but shutdown immediate/startup would be more "graceful" perhaps.

Shutdown followed by startup mount

Bob, November 01, 2006 - 7:29 pm UTC

Hi Tom,

I am trying to do a shutdown then a startup mount but I get the following:

> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
> startup mount;
ORA-03113: end-of-file on communication channel
> startup mount;
ORA-24324: service handle not initialized
ORA-01041: internal error. hostdef extension doesn't exist

In UNIX I "cat" the error log and tailed the last 40 lines and got the following:

Thu Nov 2 00:14:35 2006
Shutting down instance: further logons disabled
Shutting down instance (immediate)
License high water mark = 3
All dispatchers and shared servers shutdown
Thu Nov 2 00:14:39 2006
ALTER DATABASE CLOSE NORMAL
Thu Nov 2 00:14:39 2006
SMON: disabling tx recovery
SMON: disabling cache recovery
Thu Nov 2 00:14:40 2006
Shutting down archive processes
Archiving is disabled
Archive process shutdown avoided: 0 active
Thread 1 closed at log sequence 2863
Successful close of redo thread 1.
Thu Nov 2 00:14:41 2006
Completed: ALTER DATABASE CLOSE NORMAL
Thu Nov 2 00:14:41 2006
ALTER DATABASE DISMOUNT
Completed: ALTER DATABASE DISMOUNT
ARCH: Archiving is disabled
Shutting down archive processes
Archiving is disabled
Archive process shutdown avoided: 0 active
ARCH: Archiving is disabled
Shutting down archive processes
Archiving is disabled
Archive process shutdown avoided: 0 active
Thu Nov 2 00:14:51 2006
Starting ORACLE instance (normal)
Thu Nov 2 00:14:51 2006
WARNING: EINVAL creating segment of size 0x000000000f400000
fix shm parameters in /etc/system or equivalent

Any ideas why I can't do a startup mount?

Thanks



Tom Kyte
November 01, 2006 - 7:54 pm UTC

hmm, last bit looks useful?

looks like your SGA size you are trying to allocated exceeds the shared memory setup on your system.

Startup Question

Bob, November 02, 2006 - 4:53 pm UTC

Hi Tom,

Thanks for elucidating the warning in the alert log for me. I am trying the following, to reset the sga_max_size, logged on as "sys":

> show sga

Total System Global Area 235999352 bytes
Fixed Size 450680 bytes
Variable Size 201326592 bytes
Database Buffers 33554432 bytes
Redo Buffers 667648 bytes

> show parameter sga

NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
lock_sga boolean FALSE
pre_page_sga boolean FALSE
sga_max_size big integer 235999352

> alter system set sga_max_size=170M scope=spfile;

System altered.

> startup force;

ORA-03113: end-of-file on communication channel
> show sga
ORA-03114: not connected to ORACLE

Is this the correct way to re-size the SGA Memory? How do I find the limit of my system's memory (Red Hat Linux Advanced Server release 2.1AS (Pensacola) ) and size the sga accordingly.

This is the size of my sga currently:

1 select SUM(VALUE)+(1024*1024) from v$parameter where name in
2 ('db_16k_cache_size','db_2k_cache_size','db_32k_cache_size',
3 'db_4k_cache_size','db_8k_cache_size','db_cache_size',
4 'db_keep_cache_size','db_recycle_cache_size',
5 'java_pool_size','large_pool_size',
6* 'shared_pool_size','log_buffer')
> /

SUM(VALUE)+(1024*1024)
----------------------
219676672

Thanks

Tom Kyte
November 02, 2006 - 9:04 pm UTC

your sga settings (which override the sga_max_size) are about 178 meg (but each component is rounded up to 4/8/ or 16m sizes actually, so it'll be larger than that)

Now, you should have a script in /etc/rc3.d looking something like this:

[ora10gr2@dellpe rc3.d]$ cat S50kernel
echo 250 32000 100 128 > /proc/sys/kernel/sem
echo 2147483648 > /proc/sys/kernel/shmmax
echo 4096 > /proc/sys/kernel/shmmni
echo 2097152 > /proc/sys/kernel/shmall
echo 65536 > /proc/sys/fs/file-max
ulimit -n 65536
echo 1024 65000 > /proc/sys/net/ipv4/ip_local_port_range
ulimit -u 16384


that is one of the suggested settings in the install/user guide.

see
</code> http://docs.oracle.com/docs/cd/B19306_01/install.102/b15660/pre_install.htm#sthref264 <code>


Startup Mount

Bob, November 03, 2006 - 1:29 pm UTC

Hey Tom,

That's FANTASTIC! Thanks for the 10G installation link. I basically edited the /etc/sysctl.conf file.

I set the following up:

kernel.shmall = 2097152
kernel.shmmax = 2147483648
kernel.shmmni = 4096

And then did a /sbin/shutdown -r now

Then I did a database shutdown and mount startup and it worked!

I think my technical skills have increased a million-fold from using this site. Thanks so much :-)

Svetlana Polyanskiy

A reader, November 30, 2006 - 11:10 am UTC

Thank you Tom. It worked like a magic!

sga_max_size

vinod, September 29, 2009 - 11:47 pm UTC

hi tom,

in my database im not able to extend my sga_max_size to 2048m(i mean 2gb).my db_cache_size=300m,shared_pool_size=300m.now im trying to extend my sga max size but im unable extend it please tell why its happening and solution for it.
Tom Kyte
October 07, 2009 - 7:42 am UTC

my car won't start.

I won't tell you anything else - now please tell me why it's happening and the solution for it.

I won't tell you what errors I'm seeing on the dashboard.
I won't tell you what noise it is or is not making.
I won't tell you what version of car I'm using.
I won't tell you what roads I'm driving it on (think OS)


I guess you are 32bit - if so, think about it.