The reasons why I always avoid to shutdown abort
It is a common practice to always shutdown abort the database before restarting and shutting in down immediate. This is because sometimes SHUTDOWN IMMEDIATE takes ages. For instance due to a huge transaction to be rollback.
I do not like it. At all.
First, chance exists that you won’t be able to start the database anymore. I have not heard or meet anyone who had this issue since Oracle7, but I still believe it.
Second, shutdown abort is very useful if something goes seriously wrong. But if something goes wrong, you may want to find out what it is.
Third, you may hit more bugs than if you do close normal. And you may get less help from support if this is due to an abusive shutdown abort. YMMV
Ok, small demo to preach to the converted
disclaimer: this demo is not innocent, do not try this on your database
SQL> create flashback archive fa tablespace ts retention 1 day;
Flashback archive created.
SQL> create table t(x number primary key);
Table created.
SQL> alter table t flashback archive fa;
Table altered.
SQL> insert into t values (1);
1 row created.
SQL> commit;
Commit complete.
SQL> select * from DBA_SEGMENTS where tablespace_name='TS';
no rows selected
I have created a flashback archive table, and the committed transaction is not written down to the flashback tablespace yet.
SQL> shutdown abort
ORACLE instance shut down.
SQL> startup
ORACLE instance started.
Total System Global Area 417546240 bytes
Fixed Size 2227072 bytes
Variable Size 234882176 bytes
Database Buffers 171966464 bytes
Redo Buffers 8470528 bytes
Database mounted.
Database opened.
SQL> sho parameter undo_tablespace
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
undo_tablespace string UNDO1
SQL> create undo tablespace undo2 datafile '/u02/oradata/@/undo2_01.dbf' size 10m reuse;
Tablespace created.
SQL> alter system set undo_tablespace=undo2;
System altered.
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.
Total System Global Area 417546240 bytes
Fixed Size 2227072 bytes
Variable Size 234882176 bytes
Database Buffers 171966464 bytes
Redo Buffers 8470528 bytes
Database mounted.
Database opened.
I have switched undo tablespace. So far so good. But remember the flashback archive did not write to the flashback tablespace before shutdown abort.
SQL> drop tablespace undo1 including contents and datafiles;
drop tablespace undo1 including contents and datafiles
*
ERROR at line 1:
ORA-01548: active rollback segment '_SYSSMU1_3544069484$' found, terminate dropping tablespace
You see… I cannot drop my old undo tablespace.
Q.E.D.