It's under your control.

OCP license.E07.130702 본문


OCP license.E07.130702

H4ru 2013. 7. 6. 11:37
Initialization Parameter Files
When you start the instance, an initialization parameter file is read. There are two types of parameter files:
• Server parameter file: This is the preferred type of initialization parameter file. It is a binary file that can be written to and read by the database server and must not be edited manually. It resides in the server that the Oracle database is executing on, and is persistent across shutdown and startup. This is often referred to as a server parameter file (SPFILE). The default name of this file, which is automatically sought at startup, is spfile<SID>.ora.
• Text initialization parameter file: This type of initialization parameter file can be read by the database server, but it is not written to by the server. The initialization parameter settings must be set and changed manually by using a text editor so that they are persistent across shutdown and startup. The default name of this file, which is automatically sought at startup if an SPFILE is not found, is init<SID>.ora. 
It is recommended that you create an SPFILE as a dynamic means of maintaining initialization parameters. By using an SPFILE, you can store and manage your initialization parameters persistently in a server-side disk file.

SQL> alter system set p_name=value scope=(both|memory|spfile);  // both: 파일과 현재 모두 , memory: 현 시점만, spfile: 재부팅 이후

Database Startup and Shutdown (EM version)

. oracle database shutdown 
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.

. nomount startup
  - database를 create하거나 control files을 re-creation 하거나 backup and recovery scenarios 상태일 때 이 단계까지 startup
  - 현재 단계에서 가능,불가능한 SQL 문
SQL> select name from v$datafile; (x)
SQL> select member from v$logfile; (x)
SQL> select table_name from user_tables; (x)
SQL> select instance_name, status from v$instance; (o)
SQL> startup nomount
ORACLE instance started.

Total System Global Area  285212672 bytes
Fixed Size              1218992 bytes
Variable Size            100664912 bytes
Database Buffers       180355072 bytes
Redo Buffers              2973696 bytes

SQL> select instance_name, status from v$instance;

----------------         ------------
orcl                        STARTED

. mount startup
  - Control file을 instance에서 open 하는 단계
  - For example, the database must be mounted but must not be opened during the following tasks:
• Renaming data files (Data files for an offline tablespace can be renamed when the database is open.)
• Enabling and disabling online redo
  - 현재 단계에서 가능,불가능한 SQL 문
SQL> show parameter control_files
SQL> select instance_name, status from v$instance; (o)
SQL> select name from v$datafile; (o)
SQL> select member from v$logfile; (o)
SQL> select table_name from user_tables; (x)
  - nomount 단계에서 mount 하는 방법
SQL>  alter database mount;

Database altered.

-- Renaming or Relocating data files & redo logfiles;
eg. /u01/system01.dbf -> /u02/system01.dbf
1) os file copy
cp /u01/system01.dbf  /u02/system01.dbf
2) controlfile 내용 변경
SQL> alter database rename file 'old name' to 'new name';
SQL> alter database rename file '/u01/system01.dbf' to '/u02/system01.dbf';
3) os file 삭제
rm /u01/system01.dbf

.open startup
  - 전체 oracle database 를 사용하는 단계
  - mount 단계에서 open 하는 방법
SQL> alter database open;

Database altered.

shutdown mode
Shutdonw ModeAITN
Allows new connectionsXXXX
Waits until current ssions endXXXO
Waits until current transactions endXXOO
Forces a checkpoint and close filesXOOO

1) shutdown nomal (= shutdown )   :: allow new connections(X)
2) shutdown transactional :: user's statu = connection, 아무 것도 하고 있지 않으면 shutdown 진행
3) shutdown immediate
4) shutdown abort :: 비정상 종료 ; 현재 미완성중인 데이터베이스 commit, roolback 하지 않고 정지, 재부팅시 Instance Recovery를 이용해 작업

Restrict Database (DBA를 제외한 다른 user 의 access를 막음(recovery, modify 등의 작업을 할 때))
 - 처음 데이터베이스를 부팅할때 접근을 막으려면 startup할때 restrict를 하면 됨.
 - 만약 현재 접속중인 사람이 있다면 restircted session은 enable 의 방해가 받을 수 있으므로 session kill을 해줘야 함
SQL> conn / as sysdba
SQL> shutdown immediate
SQL> startup restrict 
SQL> alter system enable restricted session;
SQL> alter system disable restricted session;
SQL> select sid, serial#, username from v$session where username='HR';
       SID       SERIAL#    USERNAME
----------      ----------     -----------------------
       148                80    HR
SQL> alter system kill session '148, 3';
SQL> alter system disable restricted session;

Space Management in Tablespaces
• Locally managed tablespace:  // 관리차원에서 편해서 지금 많이 사용 됨
– Free extents are managed in the tablespace.
– A bitmap is used to record free extents.
– Each bit corresponds to a block or group of blocks.
– The bit value indicates free or used extents.
– The use of locally managed tablespaces is recommended.
• Dictionary-managed tablespace:
– Free extents are managed by the data dictionary.
– Appropriate tables are updated when extents are allocated or unallocated.
– These tablespaces are supported only for backward compatibility.

Administrator Authentication
Operating System Security
  • DBAs must have the OS privileges to create and delete files.
  • Typical database users should not have the OS privileges to create or delete database files.
Administrator Security
  • SYSBA and SYSOPER connections are authorized via password file or OS.
    – Password file authentication records the DBA user by name.
    – OS authentication does not record the specific user.
    – OS authentication takes precedence over password file authentication for SYSDBA and SYSOPER.

'Works > OCP' 카테고리의 다른 글

OCP license.E06.130701  (0) 2013.07.06
OCP license.E05.130628  (0) 2013.07.06
OCP license.E04.130627  (0) 2013.07.06
OCP license.E03.130626  (0) 2013.07.06
OCP license.E02.130625  (0) 2013.07.06