Oracle start and close is the basic knowledge for Software engineers and DBAs. However when I was asked to interview developers. most of them answer this very ambiguously ,which make me very concern. So this article , I will discuss this so that others can know it more;
Oracle start sequence :
- Load spfileSID.ora
- Load spfile.ora
- Load initSID.ora
- Load init.ora
Oralce's 4 startup states :
- SHUTDOWN - Instances & Database all shutdown ,you can run "startup nomount"
- NOMOUNT - Instance is started & memory is allocated to this instance, however the Database is still closed, you can run commands below to check and mount Database:
select * from v$instance;
alter database mount;
- MOUNT - Control file is open, however user tables still can't be read, you can run command below to open the Database:
- OPEN - the whole database is loaded and open
Shutdown immediate //close the database, back to shutdown status Startup nomount //enter into nomount state,memory is allocated.show sga. Startup [nomount | mount | open | force | restrict] [pfile = filename] Startup restrict; //only user with restrict session right can use the database Pfile static file :create pfile=’D:/pfileOrcl.ora’ from spfile;
4 ways to close Oracle :
- Shutdown [normal|transactional|immediate|abort]
- Normal - disallow new user to connect, unless disconnect first myself
- Transactional - disallow new user to connect, current user will disconnect once all transactions commited
- Immediate - disallow new user to connect,rollback all transactions and then disconnect
- Abort - forcely disconnect all user connections. if the 3 above don't work or hang there, use this!
No comments:
Post a Comment