Note_Tech

All technological notes.


Project maintained by simonangel-fong Hosted on GitHub Pages — Theme by mattgraham

DBA Lab: Startup

Back


Lab: Default Startup

Lab01


Lab: Explore Startup Phases

######## Instance is down ########
# Get the instance info before startup
SELECT INSTANCE_NAME, HOST_NAME, STATUS, DATABASE_STATUS FROM V$instance;
# Return error, due to instance is down.
/* SELECT INSTANCE_NAME, HOST_NAME, STATUS, DATABASE_STATUS FROM V$instance
*
ERROR at line 1:
ORA-01034: ORACLE not available
Process ID: 0
Session ID: 0 Serial number: 0 */


######## nomount ########
startup nomount
# Startup instance but not is associated to database.
/* ORACLE instance started.

Total System Global Area 2432695832 bytes
Fixed Size		    9137688 bytes
Variable Size		  536870912 bytes
Database Buffers	 1879048192 bytes
Redo Buffers		    7639040 bytes */


# Get info of the instance
SELECT INSTANCE_NAME, HOST_NAME, STATUS, DATABASE_STATUS FROM V$instance;
/* INSTANCE_N HOST_NAME	   STATUS     DATABASE_STATUS
---------- --------------- ---------- ---------------
orcl	   test.com	   STARTED    ACTIVE */


# Count the number of tables in the Oracle Database.
SELECT count(1) FROM dba_tables;
# Error due to no database is associated.
/* SELECT count(1) FROM dba_tables
                     *
ERROR at line 1:
ORA-01219: database or pluggable database not open: queries allowed on fixed
tables or views only */

lab

lab




######## mount ########
# Mount database, associated to database
ALTER DATABASE mount;

# Get info of the instance
SELECT INSTANCE_NAME, HOST_NAME, STATUS, DATABASE_STATUS FROM V$instance;
# Count the number of tables in the Oracle Database.
SELECT count(1) FROM dba_tables;
# Error due to data file not accessible.
/* SELECT count(1) FROM dba_tables
                     *
ERROR at line 1:
ORA-01219: database or pluggable database not open: queries allowed on fixed
tables or views only */

lab


######## open ########
# Open database, open data file
ALTER DATABASE open;

# Get info of the instance
SELECT INSTANCE_NAME, HOST_NAME, STATUS, DATABASE_STATUS FROM V$instance;

# Count the number of tables in the Oracle Database.
SELECT count(1) FROM dba_tables;
# Error due to data file not accessible.

lab


Lab: FORCE

startup
-- ORA-01081: cannot start already-running ORACLE - shut it down first

startup force
--ORACLE instance started.
--
--Total System Global Area 2432695832 bytes
--Fixed Size		    9137688 bytes
--Variable Size		  536870912 bytes
--Database Buffers	 1879048192 bytes
--Redo Buffers		    7639040 bytes
--Database mounted.
--Database opened.

lab


TOP