| Lesson 4 | Starting an instance |
| Objective | Start the new COIN instance. |
SET ORACLE_SID = COIN
ORACLE_SID=COIN
export ORACLE_SID
If you don't create a database during installation, the installer never sets ORACLE_SID for you — Windows won't have it in the registry, and a Linux/UNIX shell profile won't have it exported. You're expected to set it yourself once you're ready to work with a specific instance, exactly as shown above.
C:\Oracle\ADMIN\COIN\create>set oracle_sid=coin
C:\Oracle\ADMIN\COIN\create>sqlplus /nolog
SQL*Plus: Release 26.0.0.0.0 - Production
SQL> connect / as sysdba
Connected to an idle instance.
SQL> startup nomount
ORACLE instance started.
Total System Global Area 2147483648 bytes
Fixed Size 9123456 bytes
Variable Size 419430400 bytes
Database Buffers 1660944384 bytes
Redo Buffers 58028032 bytes
Note the connection message this time: connect / as sysdba, not the old connect internal syntax you may still see in outdated tutorials. CONNECT INTERNAL hasn't existed in any supported Oracle release since Oracle 9i — it produces nothing but a syntax error today. The modern equivalents are:
CONNECT / AS SYSDBA — operating system authentication. This works if your OS account is a member of the OSDBA group (on Windows, typically the ORA_DBA group; on Linux, typically the dba group).CONNECT SYS AS SYSDBA — prompts for the SYS password, authenticated against the password file rather than the (nonexistent, at this point) database.Either form works before the database exists, which is exactly why it's the correct way to connect for this step — SYSDBA authentication doesn't depend on the database being open, since it's handled by the OS or the password file, not by a database-level user check.
export command, not SET, to set the value of the ORACLE_SID environment variable. Give this a try now. Set ORACLE_SID=COIN, start SQL*Plus, and issue a STARTUP NOMOUNT command. If you have done everything right so far, the COIN instance should start. Once you've started it, issue the SHUTDOWN command to shut it back down again.
One thing worth being precise about, since every database you create from this point forward is a CDB: STARTUP and STARTUP NOMOUNT operate on the CDB root, not on any individual pluggable database. Once the CDB is open, its PDBs are not automatically open unless you previously ran ALTER PLUGGABLE DATABASE ... SAVE STATE against them — the technique introduced in the previous lesson's CREATE PLUGGABLE DATABASE example. Without that, you open each PDB explicitly after the CDB itself is up:
STARTUP;
ALTER PLUGGABLE DATABASE pdb_custom OPEN;
For a database you're creating for the first time, none of this matters yet — there's no PDB to open until Lesson 2's CREATE PLUGGABLE DATABASE step has actually run. It matters the next time you restart the CDB, which is why SAVE STATE is worth setting once your PDBs exist and you don't want to reopen them by hand every time.
lsnrctl status to confirm database availability.
ORA-01081: cannot start already-running ORACLE - shut it down first. Check the instance's state with ps -ef | grep pmon on Linux/UNIX, or with SELECT status FROM v$instance; in SQL*Plus.
SYSDBA or SYSOPER privilege can start or stop an instance. Attempting to start an instance without the required privileges results in ORA-01031: insufficient privileges — see below.
ORACLE_HOME, ORACLE_SID, and optionally PATH). Misconfiguration leads to errors when starting an instance.
dbv) can help identify integrity problems.
tnsnames.ora or an Easy Connect string) and that the listener is running (lsnrctl start).
ORA-00205: error in identifying controlfile,
check alert log for more info
AS SYSDBA when connecting, and try to start an instance as an ordinary user instead.
SQL> startup nomount
ORA-01031: insufficient privileges
CONNECT / AS SYSDBA (operating system authentication) or CONNECT SYS AS SYSDBA (password file authentication), and then try the STARTUP command again. There's no CONNECT INTERNAL command to fall back on — that syntax was removed from Oracle Database entirely back in the 9i era, and every current reference to it is describing a command that no longer exists.
SET ORACLE_SID=COIN command,
C:\Oracle\ADMIN\COIN\pfile>sqlplus /nolog
SQL*Plus: Release 26.0.0.0.0 - Production
SQL> connect / as sysdba
ORA-12560: TNS:protocol adapter error
SQL>
-startmode MANUAL first, not AUTO, since the database doesn't exist yet.dbs directory under Oracle Home. If the software doesn't find the initialization file where it expects it to be, you will get an error message that looks like this:
SQL> startup nomount
LRM-00109: could not open parameter file
'C:\Oracle\product\26.0.0\dbhome_1\DATABASE\initcoin.ora'
ORA-01078: failure in processing system parameters
The useful part about this error message is that Oracle tells you exactly which file it is trying to find and where it is looking. One solution is to move your initialization file to that directory and name it accordingly. Another solution is to use the PFILE option with the STARTUP command, so you can explicitly point to your initialization file. For example:
STARTUP PFILE=C:\coin\initcoin.ora NOMOUNT
I try to avoid using the PFILE option because it's just one more thing that I have to remember. In an environment with multiple DBAs and multiple databases, it can quickly become a struggle for everyone to remember where the initialization files are for each database. It's easier to just place them in the default locations, so that Oracle can find them on its own — or, better still in a modern environment, use an SPFILE, which Oracle locates automatically without any of this path-guessing in the first place.
CREATE DATABASE statement produces. This allows for efficient resource utilization and simplified management by consolidating many databases into one while maintaining isolation and security between PDBs.