Controlling the Database - WordPress.com · Controlling the Database This practice covers the...

21
Copyright © 2004, Oracle. All rights reserved. Controlling the Database

Transcript of Controlling the Database - WordPress.com · Controlling the Database This practice covers the...

Page 1: Controlling the Database - WordPress.com · Controlling the Database This practice covers the following topics: • Connecting to the database using SQL*Plus and iSQL*Plus • Stopping

Copyright © 2004, Oracle. All rights reserved.

Controlling the Database

Page 2: Controlling the Database - WordPress.com · Controlling the Database This practice covers the following topics: • Connecting to the database using SQL*Plus and iSQL*Plus • Stopping

Copyright © 2004, Oracle. All rights reserved.

Objectives

After completing this lesson, you should be able to do the following:• Start and stop iSQL*Plus• Start and stop Enterprise Manager Database

Control• Start and stop the Oracle Listener• Start up and shut down Oracle Database 10g

Page 3: Controlling the Database - WordPress.com · Controlling the Database This practice covers the following topics: • Connecting to the database using SQL*Plus and iSQL*Plus • Stopping

Copyright © 2004, Oracle. All rights reserved.

Starting and Stopping iSQL*Plus

$ isqlplusctl startiSQL*Plus 10.1.0.2.0Copyright (c) 2004 Oracle. All rights reserved.Starting iSQL*Plus ...iSQL*Plus started.

$ isqlplusctl stopiSQL*Plus 10.1.0.2.0Copyright (c) 2004 Oracle. All rights reserved.Stopping iSQL*Plus ...iSQL*Plus stopped.

Page 4: Controlling the Database - WordPress.com · Controlling the Database This practice covers the following topics: • Connecting to the database using SQL*Plus and iSQL*Plus • Stopping

Copyright © 2004, Oracle. All rights reserved.

Management Framework

The three components of the Oracle Database 10gmanagement framework are:• Database instance • Listener• Management interface

– Database Control– Management agent (when using Grid Control)

ListenerDatabase Control

Managementagent

Management interface

-or-

Page 5: Controlling the Database - WordPress.com · Controlling the Database This practice covers the following topics: • Connecting to the database using SQL*Plus and iSQL*Plus • Stopping

Copyright © 2004, Oracle. All rights reserved.

Starting and Stopping Database Control

$ emctl start dbconsoleTZ set to US/PacificOracle Enterprise Manager 10g Database Control Release 10.1.0.2. 0Copyright (c) 1996, 2004 Oracle Corporation. All rights reserve d.http://edrsr9p1.us.oracle.com:5500/em/console/aboutApplicationStarting Oracle Enterprise Manager 10g Database Control ...................... started.---------------------------------------------------------------- --Logs are generated in directory /u01/app/oracle/product/10.1.0/db_1/edrsr9p1.us.oracle.com_orcl/ sysman/log

$ emctl stop dbconsoleTZ set to US/PacificOracle Enterprise Manager 10g Database Control Release 10.1.0.2. 0Copyright (c) 1996, 2004 Oracle Corporation. All rights reserve d.http://edrsr9p1.us.oracle.com:5500/em/console/aboutApplicationStopping Oracle Enterprise Manager 10g Database Control ...... Stopped.

Page 6: Controlling the Database - WordPress.com · Controlling the Database This practice covers the following topics: • Connecting to the database using SQL*Plus and iSQL*Plus • Stopping

Copyright © 2004, Oracle. All rights reserved.

Accessing Database Control

Page 7: Controlling the Database - WordPress.com · Controlling the Database This practice covers the following topics: • Connecting to the database using SQL*Plus and iSQL*Plus • Stopping

Copyright © 2004, Oracle. All rights reserved.

SYSOPER and SYSDBA

Page 8: Controlling the Database - WordPress.com · Controlling the Database This practice covers the following topics: • Connecting to the database using SQL*Plus and iSQL*Plus • Stopping

Copyright © 2004, Oracle. All rights reserved.

Database Home Page

Page 9: Controlling the Database - WordPress.com · Controlling the Database This practice covers the following topics: • Connecting to the database using SQL*Plus and iSQL*Plus • Stopping

Copyright © 2004, Oracle. All rights reserved.

Changing the Listener Status

Page 10: Controlling the Database - WordPress.com · Controlling the Database This practice covers the following topics: • Connecting to the database using SQL*Plus and iSQL*Plus • Stopping

Copyright © 2004, Oracle. All rights reserved.

Startup and Shutdown

Click Advanced Options to select startup options

and shutdown mode

Page 11: Controlling the Database - WordPress.com · Controlling the Database This practice covers the following topics: • Connecting to the database using SQL*Plus and iSQL*Plus • Stopping

Copyright © 2004, Oracle. All rights reserved.

Starting Up a DatabaseNOMOUNT

OPEN

MOUNT

NOMOUNT

SHUTDOWN

Instance started

STARTUP

Page 12: Controlling the Database - WordPress.com · Controlling the Database This practice covers the following topics: • Connecting to the database using SQL*Plus and iSQL*Plus • Stopping

Copyright © 2004, Oracle. All rights reserved.

Starting Up a DatabaseMOUNT

OPEN

MOUNT

NOMOUNT

SHUTDOWN

Control file opened for this instance

Instance started

STARTUP

SHUTDOWN

Page 13: Controlling the Database - WordPress.com · Controlling the Database This practice covers the following topics: • Connecting to the database using SQL*Plus and iSQL*Plus • Stopping

Copyright © 2004, Oracle. All rights reserved.

Starting Up a DatabaseOPEN

OPEN

MOUNT

NOMOUNT

SHUTDOWN

All files opened as described by the control file for this instance

Control file opened for this instance

Instance started

STARTUP

SHUTDOWN

Page 14: Controlling the Database - WordPress.com · Controlling the Database This practice covers the following topics: • Connecting to the database using SQL*Plus and iSQL*Plus • Stopping

Copyright © 2004, Oracle. All rights reserved.

Shutting Down the Database

Shutdown mode:• A = ABORT• I = IMMEDIATE• T = TRANSACTIONAL• N = NORMAL

A

No

No

No

No

T

No

No

Yes

Yes

I

No

No

No

Yes

Shutdown Mode

Allow new connections

Wait until current sessions end

Wait until current transactions end

Force a checkpoint and close files

N

No

Yes

Yes

Yes

Page 15: Controlling the Database - WordPress.com · Controlling the Database This practice covers the following topics: • Connecting to the database using SQL*Plus and iSQL*Plus • Stopping

Copyright © 2004, Oracle. All rights reserved.

SHUTDOWN Options

On the way down:• Database

buffer cache written tothe data files

• Uncommitted changes rolledback

• Resources released

On the way up:• No

instance recovery

During

SHUTDOWN NORMAL

orSHUTDOWN

TRANSACTIONALor

SHUTDOWN IMMEDIATE

Consistent database(clean database)

Page 16: Controlling the Database - WordPress.com · Controlling the Database This practice covers the following topics: • Connecting to the database using SQL*Plus and iSQL*Plus • Stopping

Copyright © 2004, Oracle. All rights reserved.

SHUTDOWN Options

On the way down:• Modified

buffersare not written to the data files

• Uncommitted changes are not rolled back

On the way up:• Online redo

log files used to reapply changes

• Undo segments used to roll back uncommitted changes

• Resources released

During

SHUTDOWN ABORTor

Instance Failureor

STARTUP FORCE

Inconsistent database(dirty database)

Page 17: Controlling the Database - WordPress.com · Controlling the Database This practice covers the following topics: • Connecting to the database using SQL*Plus and iSQL*Plus • Stopping

Copyright © 2004, Oracle. All rights reserved.

spfiledb01.ora

Initialization Parameter Files

Page 18: Controlling the Database - WordPress.com · Controlling the Database This practice covers the following topics: • Connecting to the database using SQL*Plus and iSQL*Plus • Stopping

Copyright © 2004, Oracle. All rights reserved.

Viewing Initialization Parameters

Page 19: Controlling the Database - WordPress.com · Controlling the Database This practice covers the following topics: • Connecting to the database using SQL*Plus and iSQL*Plus • Stopping

Copyright © 2004, Oracle. All rights reserved.

Viewing the Alert Log

Page 20: Controlling the Database - WordPress.com · Controlling the Database This practice covers the following topics: • Connecting to the database using SQL*Plus and iSQL*Plus • Stopping

Copyright © 2004, Oracle. All rights reserved.

Summary

In this lesson, you should have learned how to:• Start and stop iSQL*Plus• Start and stop Enterprise Manager Database

Console• Start and stop the listener• Start up and shut down the database

Page 21: Controlling the Database - WordPress.com · Controlling the Database This practice covers the following topics: • Connecting to the database using SQL*Plus and iSQL*Plus • Stopping

Copyright © 2004, Oracle. All rights reserved.

Practice 5: Controlling the Database

This practice covers the following topics:• Connecting to the database using SQL*Plus and

iSQL*Plus• Stopping and starting Enterprise Manager

Database Control • Stopping and starting the database • Stopping and starting iSQL*Plus