`
yunchow
  • 浏览: 317805 次
  • 性别: Icon_minigender_1
  • 来自: 南京
社区版块
存档分类
最新评论

Oracle之DBA入门一

阅读更多
Oracle Install
interactive: ./runInstaller

SQL*Plus
sqlplus /nolog
connect / as sysdba
startup
------------------
Review:
select * from dual;

Managing an Oracle Instance
Objectives:
Create and manage initialization parameter files
Start up and shut down an instance
Monitor and use diagnostic files

Initialization Parameter Files
connect / as sysdba
startup

Two types of parameters:
Explicit: Having an entry in the file
Implicit:

sqlplus /nolog
conn / as sysdba
startup
!
ps -ef | grep oracle
desc v$parameter;
col name format a20
col value format a30
-- 查参数
show paramter pga_ag;
env | grep ORACL

------------------------------------
Chapter 3
Managing an oracle Instance

SID : Site Identifier

create spfile from pfile;

Strings xx | more xx

Modify Parameters in SPFILE
alter system set parameter=value
<comment="text"> <deferred>
<scope="memery|spfile|both">
<sid='sid|*'>

SPFILE vs PFILE
SPFILE is better than PFILE!

Startup Command Behavior
Order of precedence:
spfileSID.ora
Default SPFILE -> spfile.ora
initSID.ora ( is a PFILE)
Default PFILE -> ???
startup pfile = $oracle_home/dbs/initDBA1.ora

Who can start the DB?
SYSDBA, SYSOPER

Starting Up a Database
shutdown -> nomount -> mount -> open

startup nomount;
alter database db01 mount;
alter database db01 open;

startup [formce] [restrict] [pfile=<file_name>]
open <read {only|write[recover]} | recover> <database_name>]

alter database db01 open read only;

sqlplus /nolog
conn / as sysdba
startup mount;
alter database nomount; // error
alter database open;

Restricted Model
startup restrict
alter system enable restricted session;

conn / as sysdba
create user boobooke identified by bbk;
grant connect, resource to boobooke;
sqlplus boobooke/bbk@oracle9ivm
quit
alter system enable restricted session;
sqlplus boobooke/bbk@oracle9ivm // error
desc v$session;
select saddr,sid,serial# from v$session;
select sid, serial#, username from v$session;
alter system kill session '15,6';

Read-Only Model
startup mount
alter database open read only;

shutdown imediate
startup mount;
alter database open read only;
sqlplus boobooke/bbk@oracle9ivm

Shutting Down the Database
Close a Database -> Unmount a Database -> shut down an instance
Shutdown mode:
abort, immediate, transactional, normal
----------------------
Diagnostic Files

alertSID.log
show parameter dump


17:37 2009-9-8



分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics