Ben Kitchens asks:
"I am just starting out as a DBA. I have a question about Oracle 8i. I'm not sure how exactly to have two or more Databases on the instance and then move between them? If you could help that would be wonderful."
Sure. You can only have one database active on one instance, although you can select which database gets attached to an instance when you start the instance up.
For example, you create a database from scratch, either through the CREATE DATABASE command, or using the DBCA utility. You then set the ORACLE_HOME and ORACLE_SID environment variables to this database, and issue the 'startup' command from either SQL*Plus (oracle 9i upwards) or svrmgrl (oracle 8i and below). This will then start the instance using the database specified in the two environment variables.
If at a later date, you want to deattach that database from the instance and start another one, issue a 'shutdown immediate' from sql*plus / svrmrgl, change the environment variables to point to the new database, then issue a 'startup' to bring the new database up.
Alternatively, if you want both databases to be active at the same time, start each one under it's own instance.
The key thing here to remember is the different between an instance and a database. A database is a set of files (data, redo, ctl and so on) whilst an instance is a set of processes (SMON, PMON, DBWR, etc) and a shared memory segment (SGA). An instance may mount and open any database -- however it may only open a single database at any time.
Therefore, in summary, if you want to have an instance switch between different databases, then shutdown the instance, change the ORACLE_HOME and ORACLE_SID environment variables to point to the new database, then startup the instance again.
4:43:57 PM
|