ORACLE/ADMIN2007. 4. 17. 23:29
반응형

1. TABLESPACE 을 MOVE 시키는 방법과
   exp/imp 로 작업 방법
   TABLESPACE 여부가 있다면 MOVE 방법 개인적으로 더 나아 보인다.

ex1)
ALTER TABLE 스키마.테이블 MOVE TABLESPACE 테이블 스패이스_임시;
ALTER TABLE 스키마.테이블 MOVE TABLESPACE 테이블 스패이스;

ex2)
  exp 유저/패스워드 buffer=8388608 recordlength=65535 feedback=100000 tables=테이블  file=덤프파일이름.dmp  LOG=로그파일이름.log

  truncate 작업

  imp 유저/패스워드 buffer=4194304 recordlength=8388608 feedback=100000 ignore=Y grants=N fromuser=catus_own touser=catus_own commit=Y tables=테이블     file=덤프파일이름.dmp 

ps. 테스트 해본 결과 ex1 과 ex2  는 약간의  차이을 보인다.
    TABLE 쪽 사이즈 영역은 같은 결과을  보이지만
    INDEX 쪽 사이즈 영역은 exp/imp 작업시 차이를 보인다.
    exp/imp작업을 하면서 인텍스 을 다시 만들기 때문에 INDEX REBUILD 작업 보다는 사이즈가 커지는 현상을 보여준다.
   
   
2.고수위마크(high water mark) 작업
위에 작업이 끝난후 돌려 보면 약간 줄어 든다.
위에 작업을 했다면 않 해도 무방하다.

ex1)
alter table 테이블 deallocate unused

 

 

oracle 단편화 처리(INDEX)


1.인텍스는  REBUILD 를 하면 된다.
   REBUILD online 은 사이즈가 큰 인덱스  BUILD시
   temp 사이즈가 커야 하고 작업 시간도 오래걸린다.
   online 작업은 별로 권장 하고 싶지 않다.  

   될수 있으면 야간에 시스템이 쓰지 않는 시간에 작업하길 바란다.
   REBUILD  는 작업 시간은 덜 거리나 데이타의 변경 작업을  할 수 없다.

 

ex1)

ALTER INDEX 스키마.인텍스명 REBUILD ;

반응형
Posted by [PineTree]
ORACLE/ADMIN2007. 4. 10. 00:55
반응형

1. Raw Device를 언제 사용하나?

Raw Device는 화일 시스템 운영에서와 달리 OS 버퍼를 통하지 않고도 직접 디스크
쓰기 수행이 가능하며, inode 등 자유 공간 정보 관리를 위한 부담이 없으므로,
일반적으로 화일 시스템보다 I/O 속도가 최고 40%까지 효과적인 성능을 보이므로
디스크 IO 속도가 시스템 성능 저하의 원인으로 판단되는 경우 사용할 수 있다.
또한 대부분의 OPS 환경에서 데이타 화일 등 공용 화일의 저장 장소로 Raw
Device의 사용이 요구된다.


2. Raw Device 파티션에 데이타 화일 생성하기

   - 한 파티션 전체 공간을 오라클 화일로 사용할 수 있나?
     불가능하며, 최소한 두 개의 오라클 블럭 크기를 남기고 사용할 수 있다.

     예를 들어, 100M 크기의 파티션에 4K 오라클 블럭 크기를 갖는 최대의
     데이타 화일을 생성하는 문장은 다음과 같다.

     SQL> create tablespace raw_tabspace datafile '/dev/raw1'
          size 102392K REUSE;

     여기서 102392K 값의 산출 근거는 {(100 * 1024K) - 8K} 공식에 의해
     구하여진다.

   - Raw Device의 첫 번째 파티션을 사용할 수 있나?
     사용하지 않을 것을 권고한다. 그 이유는 OS 종류나 버젼에 따라 디스크
     파티션 테이블이나 논리적 볼륨 제어 정보 등이 첫 번째 파티션을 관리될
     수 있기 때문이다. 따라서 OS 벤더의 자문을 받아야 한다.

   - 파티션의 오너쉽은 어떻게 지정하여야 하나?
     기본적으로 생성은 'root'로 수행하지만, 이후에 오너쉽 밑 그룹은 각각
     oracle 사용자와 dba 그룹으로 지정하여야 한다.


3. 데이타베이스 화일 백업에 관하여.

   화일 시스템과는 달리 Raw Device에서는 'tar'나 'cpio' 명령을 사용할 수
   없고, 반드시 아래처럼 'dd' 명령어를 사용하여야 한다.

   % dd if=/dev/raw1 of=/dev/rmt0 bs=16k

   하지만 'dd'로 백업된 화일에 대하여 'tar'나 'cpio' 명령을 사용하여 별도의
   관리 방법을 수행할 수 있다.


4. 화일 운영하기

   - Redo Log의 위치에 대하여?
     Redo Log는 가장 쓰기가 활발하며 특성상 순차적으로 쓰기 작업이 일어나는
     화일이므로 Raw Device 사용이 가장 권장된다. 특히 OPS 환경에서는 반드시
     Raw Device에 관리되어야 한다.

   - Archive Log의 위치에 대하여?
     Archive Log는 특성상 화일 시스템에 저장되어야 한다.

   - Raw Device 파티션에 두 개 이상의 화일을 저장할 수 있나?
     가능하지 않다.

   - 모든 파티션의 크기를 동일하게 지정할 필요가 있나?
     데이타베이스 화일에 대한 파티션 지정 변경이 용이하다는 장점 외에는
     일반적으로 권고되지 않는 방법이다.

반응형

'ORACLE > ADMIN' 카테고리의 다른 글

[Oracle] 권한 및 가능한 작업  (0) 2007.06.13
oracle 단편화 처리  (0) 2007.04.17
Oracle Partitioned Tables(테이블 파티셔닝 예제)  (0) 2007.03.30
오라클 윈도우에서 삭제하기  (0) 2007.03.15
오라클 사용자 관리  (0) 2007.03.10
Posted by [PineTree]
ORACLE/ADMIN2007. 3. 30. 01:14
반응형
Oracle Partitioned Tables
Version 10.2
 
General
Partition Related Data Dictionary Objects
indpart$ indsubpart$ partobj$ tabpart$
indpart_param$ partlob$ subpartcol$ tabsubpart$
 
DBA ALL USERS
dba_ind_partitions all_ind_partitions user_ind_partitions
dba_ind_subpartitions all_ind_subpartitions user_ind_subpartitions
dba_lob_partitions all_lob_partitions user_lob_partitions
dba_lob_subpartitions all_lob_subpartitions user_lob_subpartitions
dba_subpartition _templates all_subpartition _templates user_subpartition
_templates
dba_subpart_col _statistics all_subpart_col _statistics user_subpart_col
_statistics
dba_subpart_histograms all_subpart_histograms user_subpart_histograms
dba_subpart_key_columns all_subpart_key_columns user_subpart_key_columns
dba_tab_partitions all_tab_partitions user_tab_partitions
dba_tab_subpartitions all_tab_subpartitions user_tab_subpartitions
Note: Oracle supports partitioning only for tables, indexes on tables, materialized views, and indexes on materialized views. Oracle does not support partitioning of clustered tables or indexes on clustered tables.
 
Definitions
Partition Decompose a table or index into smaller, more manageable pieces, called partitions. Each partition of a table or index must have the same logical attributes, such as column names, datatypes, and constraints, but each partition can have separate physical attributes such as pctfree, pctused, and tablespaces.
Partition Key Each row in a partitioned table is unambiguously assigned to a single partition. The partition key is a set of from 1 to 16 columns that determines the partition for each row.
Subpartition Partitions created within partitions. They are just partitions themselves and there is nothing special about them.
Local Index Separate indexes for each partition. A local index can be unique. However, in order for a local index to be unique, the partitioning key of the table must be part of the index's key columns. Unique local indexes are useful for OLTP environments. You cannot explicitly add a partition to a local index. Instead, new partitions are added to local indexes only when you add a partition to the underlying table.
Global Index A single index covering all partitions.
Hash Partitioning Enables partitioning of data that does not lend itself to range or list partitioning.

To view the numbers Oracle uses for hashing:

select sql_hash_value, prev_hash_value from g v$session;
List Partitioning Explicitly controls how rows map to partitions. You do this by specifying a list of discrete values for the partitioning key in the description for each partition.
Range Partitioning Maps data to partitions based on ranges of partition key values that you establish for each partition.
Composite Partitioning Composite partitioning is a combination of other partitioning methods. Oracle currently supports range-hash and range-list composite partitioning.
Partitioning Pruning Oracle optimizes SQL statements to mark the partitions or subpartitions that need to be accessed and eliminates (prunes) unnecessary partitions or subpartitions from access by those SQL statements. In other words, partition pruning is the skipping of unnecessary index and data partitions or subpartitions in a query.
Invalidating Indexes By default, the following operations on partitions on a heap-organized table mark all global indexes as unusable:
  • ADD (HASH)
  • COALESCE (HASH)
  • DROP
  • EXCHANGE
  • MERGE
  • MOVE
  • SPLIT
  • TRUNCATE
 
DemoTablespaces
Create demo tablespaces CREATE TABLESPACE part1
DATAFILE 'c:\temp\part01.dbf' SIZE 10M
BLOCKSIZE 8192
EXTENT MANAGEMENT LOCAL UNIFORM SIZE 256K
SEGMENT SPACE MANAGEMENT AUTO
ONLINE;

CREATE TABLESPACE part2
DATAFILE 'c:\temp\part02.dbf' SIZE 10M
BLOCKSIZE 8192
EXTENT MANAGEMENT LOCAL UNIFORM SIZE 256K
SEGMENT SPACE MANAGEMENT AUTO
ONLINE;

CREATE TABLESPACE part3
DATAFILE 'c:\temp\part03.dbf' SIZE 10M
BLOCKSIZE 8192
EXTENT MANAGEMENT LOCAL UNIFORM SIZE 256K
SEGMENT SPACE MANAGEMENT AUTO
ONLINE;

ALTER USER uwclass QUOTA UNLIMITED ON part1;
ALTER USER uwclass QUOTA UNLIMITED ON part2;
ALTER USER uwclass QUOTA UNLIMITED ON part3;
Drop demo tablespaces DROP TABLESPACE part1 INCLUDING CONTENTS AND DATAFILES;
DROP TABLESPACE part2 INCLUDING CONTENTS AND DATAFILES;
DROP TABLESPACE part3 INCLUDING CONTENTS AND DATAFILES;
 
Table Partitions
Hash Partitioned
Table
CREATE TABLE professional_history (
prof_history_id  NUMBER(10),
person_id        NUMBER(10) NOT NULL,
organization_id  NUMBER(10) NOT NULL,
record_date      DATE NOT NULL,
prof_hist_comments VARCHAR2(2000))
PARTITION BY HASH (prof_history_id)
PARTITIONS 3
STORE IN (part1, part2, part3);
List Partitioned
Table (add tablespace names and change table name)
CREATE TABLE sales_by_region (
deptno           NUMBER(10),
deptname         VARCHAR2(20),
quarterly_sales  NUMBER(10,2),
state            VARCHAR2(2))
PARTITION BY LIST (state) (
PARTITION q1_northwest VALUES ('OR', 'WA')
 TABLESPACE north,
PARTITION q1_southwest VALUES ('AZ', 'CA', 'NM')
 TABLESPACE south,
PARTITION q1_northeast VALUES ('NY', 'VT', 'NJ')
 TABLESPACE north,
PARTITION q1_southeast VALUES ('FL', 'GA')
 TABLESPACE south,
PARTITION q1_northcent VALUES ('MN', 'WI')
 TABLESPACE north,
PARTITION q1_southcent VALUES ('OK', 'TX')
 TABLESPACE south);
Range Partitioned
Table - By Date
CREATE TABLE professional_history (
prof_history_id  NUMBER(10),
person_id        NUMBER(10) NOT NULL,
organization_id  NUMBER(10) NOT NULL,
record_date      DATE NOT NULL,
ph_comments      VARCHAR2(2000))
PARTITION BY RANGE (record_date) (
PARTITION yr0
VALUES LESS THAN (TO_DATE('01-JAN-2000','DD-MON-YYYY'))
TABLESPACE <tablespace_name>,
PARTITION yr1
VALUES LESS THAN (TO_DATE('01-JAN-2001','DD-MON-YYYY'))
TABLESPACE <tablespace_name>,
PARTITION yr2
VALUES LESS THAN (TO_DATE('01-JAN-2002','DD-MON-YYYY'))
TABLESPACE <tablespace_name>,
PARTITION yr9
VALUES LESS THAN (MAXVALUE)
TABLESPACE <tablespace_name>);
Range Partitioned
Table - By Alpha
CREATE TABLE students (
student_id  NUMBER(6),
student_fn  VARCHAR2(25),
student_ln  VARCHAR2(25),
primary key (student_id))
PARTITION BY RANGE (student_ln)
(PARTITION student_ae VALUES LESS THAN ('F%')
TABLESPACE <tablespace_name>,
PARTITION student_fl VALUES LESS THAN ('M%')
TABLESPACE <tablespace_name>,
PARTITION student_mr VALUES LESS THAN ('S%')
TABLESPACE <tablespace_name>,
PARTITION student_sz VALUES LESS THAN (MAXVALUE)
TABLESPACE <tablespace_name>);
Composite Partitioned
Table - By Range And Hash
CREATE TABLE sales_composite (
salesman_id   NUMBER(5),
salesman_name VARCHAR2(30),
sales_amount  NUMBER(10),
sales_date    DATE)
PARTITION BY RANGE(sales_date)
SUBPARTITION BY HASH(salesman_id)
SUBPARTITION TEMPLATE(
SUBPARTITION sp1 TABLESPACE uwdata,
SUBPARTITION sp2 TABLESPACE user_data,
SUBPARTITION sp3 TABLESPACE uwdata,
SUBPARTITION sp4 TABLESPACE uwdata)
(PARTITION sales_jan2000
VALUES LESS THAN(TO_DATE('02/01/2000','DD/MM/YYYY')),
PARTITION sales_feb2000
VALUES LESS THAN(TO_DATE('03/01/2000','DD/MM/YYYY')),
PARTITION sales_mar2000
VALUES LESS THAN(TO_DATE('04/01/2000','DD/MM/YYYY')),
PARTITION sales_apr2000
VALUES LESS THAN(TO_DATE('05/01/2000','DD/MM/YYYY')),
PARTITION sales_may2000
VALUES LESS THAN(TO_DATE('06/01/2000','DD/MM/YYYY')),
PARTITION sales_future
VALUES LESS THAN(MAXVALUE));

set linesize 140

SELECT table_name, partition_name, subpartition_name
FROM user_tab_subpartitions;
 
Alter Table For Partitions
Moving Partitions ALTER TABLE <table_name>
MOVE PARTITION <partition_name>
TABLESPACE <tablespace_name>;
ALTER TABLE parts
MOVE PARTITION depot2
TABLESPACE ts094 NOLOGGING;
Moving Subpartitions ALTER TABLE <table_name>
MOVE SUBPARTITION <subpartition_name>
TABLESPACE <tablespace_name>;
ALTER TABLE scuba_gear
MOVE SUBPARTITION bcd_types
TABLESPACE tbs23 PARALLEL (DEGREE 2);
Merging Subpartitions ALTER TABLE <table_name>
MERGE SUBPARTITIONS <subpartition_name>
INTO SUBPARTITION <subpartition_name
TABLESPACE <tablespace_name>;
ALTER TABLE quarterly_regional_sales
MERGE SUBPARTITIONS q1_1999_northwest, q1_1999_southwest
INTO SUBPARTITION q1_1999_west
TABLESPACE ts4;
Modify A Subpartition Template ALTER TABLE <table_name>
SET SUBPARTITION TEMPLATE (
SUBPARTITION <subpartition_name>, TABLESPACE <tablespace_name>,
SUBPARTITION <subpartition_name>, TABLESPACE <tablespace_name>);
ALTER TABLE emp_sub_template
SET SUBPARTITION TEMPLATE (
SUBPARTITION e, TABLESPACE ts1,
SUBPARTITION f, TABLESPACE ts2,
SUBPARTITION g, TABLESPACE ts3,
SUBPARTITION h, TABLESPACE ts4);
Change The Tablespace Name For A Future Partition ALTER TABLE <table_name>
MODIFY DEFAULT ATTRIBUTES FOR PARTITION <partition_name>
TABLESPACE <tablespace_name>;
ALTER TABLE emp
MODIFY DEFAULT ATTRIBUTES FOR PARTITION p1 TABLESPACE ts1;
Modify A List Partitioned List ALTER TABLE <table_name>
MODIFY PARTITION <partition_name>
ADD VALUES (<values_list>);
ALTER TABLE sales_by_region
MODIFY PARTITION region_south
ADD VALUES ('OK', 'KS');
Drop Values From A List Partitioned List ALTER TABLE <table_name>
MODIFY PARTITION <partition_name>
DROP VALUES (<values_list>);
ALTER TABLE sales_by_region
MODIFY PARTITION region_south
DROP VALUES ('OK', 'KS');
Convert A Partition Into A Stand-alone Table ALTER TABLE <table_name>
EXCHANGE PARTITION <partition_name>
WITH TABLE <new_table_name>
<including | excluding> INDEXES
<with | without> VALIDATION
EXCEPTIONS INTO <schema.table_name>;
ALTER TABLE sales
EXCHANGE PARTITION feb97 WITH TABLE sales_feb97
INCLUDING INDEXES
WITHOUT VALIDATION
EXCEPTIONS INTO uwclass.problems;
Renaming A Partition ALTER TABLE <table_name>
RENAME PARTITION <existing_partition_name>
TO <new_partition_name>;
ALTER TABLE employee RENAME PARTITION emp3 TO employee3;
Split Partition ALTER TABLE <table_name>
SPLIT PARTITION <partition_name>
AT <range_definition>
INTO (PARTITION <first_partition>, PARTITION <second_partition>)
UPDATE GLOBAL INDEXES;
ALTER TABLE sales
SPLIT PARTITION sales_q1_2000
AT (TO_DATE('16-FEB-2000','DD-MON-YYYY'))
INTO (PARTITION q1a_2000, PARTITION q1b_2000)
UPDATE GLOBAL INDEXES;
Truncate A Partition ALTER TABLE <table_name>
TRUNCATE PARTITION <partition_name>
DROP STORAGE;
ALTER TABLE employee
TRUNCATE PARTITION employee3
DROP STORAGE;
Split An LOB Partition ALTER TABLE <table_name>
SPLIT PARTITION <partition_name> AT <split location> INTO
(PARTITION <new_partition_name> TABLESPACE <tablespace_name>"
LOB <column_name> STORE AS (TABLESPACE <tablespace_name>),
PARTITION <new_partition_name>
LOB (<column_name>) STORE AS (TABLESPACE <tablespace_name>);
ALTER TABLE print_media_part
SPLIT PARTITION p2 AT (150) INTO
(PARTITION p2a TABLESPACE omf_ts1
LOB ad_photo, ad_composite) STORE AS (TABLESPACE omf_ts2),
PARTITION p2b
LOB (ad_photo, ad_composite) STORE AS (TABLESPACE omf_ts2));
Add Partition And Specify BLOB/LOB Storage ALTER TABLE <table_name>
ADD PARTITION <new_partition_name> VALUES LESS THAN (MAXVALUE)
LOB (<column_name>) STORE AS (TABLESPACE <tablespace_name);
ALTER TABLE print_media_part
ADD PARTITION p3 VALUES LESS THAN (MAXVALUE)
LOB (ad_photo, ad_composite) STORE AS (TABLESPACE omf_ts2)
LOB (ad_sourcetext, ad_finaltext) STORE AS (TABLESPACE omf_ts1);
 
Index Partitions
Table For Index Partitioning CREATE TABLE employees (
employee_id NUMBER(4) NOT NULL,
last_name VARCHAR2(10),
department_id NUMBER(2))
PARTITION BY RANGE (employee_id)
(
PARTITION employees_part1 VALUES LESS THAN (11) TABLESPACE pt1,
PARTITION employees_part2 VALUES LESS THAN (21) TABLESPACE pt2,
PARTITION employees_part3 VALUES LESS THAN (31) TABLESPACE pt3);
Local Index Creation CREATE INDEX <index_name>
ON <table_name> <column_name_list> LOCAL;
CREATE INDEX ixl_employees_employee_id
ON employees (employee_id) LOCAL;

CREATE INDEX ixl_uwhistory
ON uwhistory (transdate, hid, servid, begdate)
LOCAL (
PARTITION p1  TABLESPACE uwidx01,
PARTITION p2  TABLESPACE uwidx02,
PARTITION p3  TABLESPACE uwidx03,
PARTITION p4  TABLESPACE uwidx04,
PARTITION p5  TABLESPACE uwidx05,
PARTITION p6  TABLESPACE uwidx01,
PARTITION p7  TABLESPACE uwidx02,
PARTITION p8  TABLESPACE uwidx03,
PARTITION p9  TABLESPACE uwidx04,
PARTITION p10 TABLESPACE uwidx05,
PARTITION p11 TABLESPACE uwidx01,
PARTITION p12 TABLESPACE uwidx02,
PARTITION p13 TABLESPACE uwidx03,
PARTITION p14 TABLESPACE uwidx04,
PARTITION p15 TABLESPACE uwidx05,
PARTITION p16 TABLESPACE uwidx01,
PARTITION p17 TABLESPACE uwidx02,
PARTITION p18 TABLESPACE uwidx03,
PARTITION p19 TABLESPACE uwidx04,
PARTITION p20 TABLESPACE uwidx05;
Global Index Creation CREATE INDEX <index_name>
ON <table_name> <column_name_list>;
CREATE INDEX ix_employees_employee_id
ON employees(employee_id);
Global Partition Index Creation CREATE INDEX <index_name>
ON <table_name> <column_name_list>
GLOBAL PARTITION BY RANGE (partition_column_name_list)
(
PARTITION <partition_name> VALUES <condition>);
CREATE INDEX ixg_employees_employee_id
ON employees (employee_id)
GLOBAL PARTITION BY RANGE(department_id)
(
PARTITION p1 VALUES LESS THAN(5000)
TABLESPACE indx1,
PARTITION p2 VALUES LESS THAN(MAXVALUE)
TABLESPACE indx2);
 
Alter Index For Partitions
Rebuild Local All Local Indexes On A Table ALTER TABLE <table_name>
MODIFY PARTITION <partition_name>
REBUILD UNUSABLE LOCAL INDEXES;
ALTER TABLE dept
MODIFY PARTITION p1
REBUILD UNUSABLE LOCAL INDEXES;
Rebuild any unusable local index partitions associated with a hash partition at the specific composite partitioned table subpartition level ALTER TABLE <table_name>
MODIFY SUBPARTITION <subpartition_name>
REBUILD UNUSABLE LOCAL INDEXES;
ALTER TABLE emp
MODIFY SUBPARTITION p3_s1
REBUILD UNUSABLE LOCAL INDEXES;
 
Drop Partition
Drop Partition ALTER TABLE DROP PARTITION <partition_name>
UPDATE GLOBAL INDEXES;
ALTER TABLE DROP PARTITION p1 UPDATE GLOBAL INDEXES;
 
Demos

Partition Elimination
conn scott/tiger

-- Create a list partitioned table
CREATE TABLE partdemo (
empno    NUMBER(4) NOT NULL,
ename    VARCHAR2(10),
job      VARCHAR2(9),
mgr      NUMBER(4),
hiredate DATE,
sal      NUMBER(7, 2),
comm     NUMBER(7, 2),
deptno   NUMBER(2))
partition by list(deptno)(
partition p1 values (10,30) tablespace uwdata,
partition p2 values (20,40) tablespace example);

INSERT INTO partdemo SELECT * FROM scott.emp;

set linesize 121

SELECT * FROM partdemo;

SELECT * FROM partdemo PARTITION(p1);

SELECT * FROM partdemo PARTITION(p2);

-- Take the example tablespace OFFLINE to examine partition elimination
conn / as sysdba
ALTER TABLESPACE example OFFLINE;
conn scott/tiger

SELECT COUNT(*) FROM partdemo;
SELECT COUNT(*) FROM partdemo WHERE deptno = 10;
SELECT COUNT(*) FROM partdemo WHERE deptno BETWEEN 1 AND 19;
SELECT COUNT(*) FROM partdemo WHERE deptno BETWEEN 1 AND 20;
SELECT COUNT(*) FROM partdemo WHERE deptno IN(10,30);

conn / as sysdba
ALTER TABLESPACE example ONLINE;
반응형
Posted by [PineTree]
ORACLE/INSTALL2007. 3. 16. 19:23
반응형

oracle8i client를 XP에서는 설치되나


win2000/winxp/win2003에서 setup.exe를 실행해도 아무 것도 나타나지 않는 경우는
오라클 8i의 jre에 문제가 있기 때문.

 

오라클8i설치디렉토리\stage\Components\oracle.swd.jre\1.1.7.30\1\DataFiles\Expanded\jre\win32\bin\symcjit.dll


이 파일이 문제라는군요

오라클 9i에 들어있는 이 파일을 복사해서 사용하면 설치됨.

 

cpu가 pentium-4일 경우는 symcjit.dll 때문에 설치가 안됨.

오라클 9i에서 복사 또는 symcjit.dll을 삭제하시거나 이름을 바꿔서 설치해도됨.

반응형
Posted by [PineTree]
ORACLE/ADMIN2007. 3. 15. 18:21
반응형

오라클을 분명히 언인스톨 완료 까지 했는데 서비스 목록에 가보면 오라클 서비스가 지워지지 않고 계속 작동중인것을 볼 수 있을 것이다. 이런 상태에서 같은 버전, 혹은 다른 버전의 오라클을 설치했을 때 제대로 작동이 되지 않는다. (설치가 제대로 되지 않아 8i, 9i, 10g 버전을 골고루 깔아봤을 때 전 버전이 제대로 삭제되어있지 않으면 잘 설치가 되지 않았다) 이 것을 완전히 삭제 하려면 레지스트리에서 오라클에 관련된 항목을 모두 수동으로 삭제해 주어야 한다.  일단

 

1) 윈도우 서비스에 들어가서 오라클 관련 모든 서비스를 멈춘다.

 

regedit을 실행시킨 후

2) HKEY_LOCAL_MACHINE->SYSTEM->CurrentControlSet->Services

이 부분에서 Oracle로 시작되는 부분을 모두 지운다.

 

3) HKEY_LOCAL_MACHINE->SOFTWARE->ORACLE

이 부분 마찬가지 Oracle로 시작되는 부분을 모두 지운다.

 

4) 물리적인 하드 드라이브에 존재하는 오라클 관련 폴더들을 지워준다. 하드를 파티션을 나누었을 때 C드라이브에 설치를 안해도 설치한 드라이브, C드라이브에 모두 오라클 관련 폴더가 남는다.

 

5) 재부팅 후 서비스에 오라클 서비스가 남아있는지 확인 한다.

 

실질적인 방법은 매우 간단하다. 하지만 이 과정을 거치지 않으면 제대로 삭제가 되지 않기때문에 서비스 문제 발생의 원인이 될 수 있다.

반응형
Posted by [PineTree]
ORACLE/ADMIN2007. 3. 10. 21:36
반응형
* 사용자 비밀번호를 변경하는 방법.

        ALTER USER <username> IDENTIFIED BY <new_password>;

오라클 8 부터는 sqlplus 를 통해, 유닉스처럼 비밀번호를 변경한다.

         SQL> password
         Changing password for SCOTT
         Old password:
         New password:
         Retype new password:

만약 다른 사용자의 비밀번호를 변경하고 싶다면, 'password 사용자이름' 으로 한다.



* 사용자를 삭제하고, 만드는 방법.
생성)
  CREATE USER scott
  IDENTIFIED BY tiger  -- 비밀번호
  DEFAULT TABLESACE  tools -- 테이블스페이스 설정
  TEMPORARY TABLESPACE temp; -- 임시테이블 스페이스 설정 ( 임시테이블스페이스가 정렬시사용되므로 정렬공간확보 )
삭제)
        DROP USER scott CASCADE;

생성후 권한 주기)
        GRANT CONNECT, RESOURCE TO scott;
        GRANT DBA TO scott;  

사용자의 테이블 스페이스 사용량 지정하기)
        ALTER USER scott QUOTA UNLIMITED ON tools;



* 사용자 관리방법

DBA 는 특정사용자를 Lock, Unlock, 비밀번호를 바꾸도록 할 수 있다.
오라클 9i 는 디비를 만들때 dbca(DB Configuration Assistant) 를 사용해서, SYS, SYSTEM 을 제외한 모든 계정을 Lock 할 수 있다.
사용하려면, 각 계정들을 Unlock 해줘야 한다.

         ALTER USER scott ACCOUNT LOCK       -- lock a user account
         ALTER USER scott ACCOUNT UNLOCK;    -- unlocks a locked users account
         ALTER USER scott PASSWORD EXPIRE;   -- 새로운 비밀번호로 바꾸도록 한다.



* 비밀번호 관리 방법.
오라클은 한자리 비밀번호나, 사용자 계정 그대로 비밀번호를 만드는 것을 허용한다. 별로 좋지 않다.

오라클 8 부터는 profile 을 통해 비밀번호를 관리한다.

CREATE PROFILE my_profile LIMIT
  PASSWORD_LIFE_TIME 30;
ALTER USER scott PROFILE my_profile;

설정 가능한 값들)
  FAILED_LOGIN_ATTEMPTS - 로그인 몇번 실패시 Lock 할 것인지?
  PASSWORD_LIFE_TIME    - 패스워드 유효일수
  PASSWORD_REUSE_TIME   - 패스워드 재사용일수 (number of days before a password can be reused)
  PASSWORD_REUSE_MAX    - 현재 패스워드를 재사용한다면, 변경할때까지의 날수.
                         (number of password changes required before the current password can be reused )
  PASSWORD_LOCK_TIME    - 로그인 실패로 인한 Lock 일수
  PASSWORD_GRACE_TIME   - 로그인은 허용되고 경고가 주어지는 기간.
  PASSWORD_VERIFY_FUNCTION - 패스워드 변경 함수.


* administrative (privileged) 사용자란.
SYSOPER 혹은 SYSDBA 의 권한을 가진 사용자를 의미한다. 이런 권한이 있으면 디비가 꺼져있어도 디비에 접근해서 작업을 할 수 있다.
이 권한을 관리하는 것은 디비가 아닌 패스워드 파일을 사용해서 하는데, 패스워드 파일은 orapwd 유틸리티를 사용해서 만들어낸다.



* administrative user 로 연결하는 방법.
administrative user는 유닉스에서는 DBA 그룹이고, 윈도우즈 NT 계열에서는 ORA_DBA 그룹이다.
         connect / as sysdba

         connect sys/password as sysdba



* 패스워드파일을 만드는 방법.
패스워드 파일은 $ORACLE_HOME/dbs/orapw or orapwSID 에 있다.
원격의 접속자를 위해 패스워드 파일을 생성한다.

1) 로그인 해서
2) 다음 명령실행. :
orapwd file=$ORACLE_HOME/dbs/orapw$ORACLE_SID password=mypasswd
3) Shutdown the database (SQLPLUS> SHUTDOWN IMMEDIATE)
4) INIT.ORA file 을 열어 REMOTE_LOGIN_PASSWORDFILE=exclusive 라고 수정한다.
5) Startup the database (SQLPLUS> STARTUP)



* 패스워드파일에 사용자 추가하는 방법.
패스워드파일에 어떤 사용자가 있는지는 SYS.V_$PWFILE_USERS 에 쿼리해서 알아낸다.
sysdba 나 sysoper 권한을 주면 추가되고, 혹은 orapwd 유틸을 사용한다.
         GRANT SYSDBA TO scott;



* 다른 사용자로 바꾸고 싶다면.

        SQL> select password from dba_users where username='SCOTT';
        PASSWORD
         -----------------------------
         F894844C34402B67

        SQL> alter user scott identified by lion;
        User altered.

        SQL> connect scott/lion
        Connected.

        REM Do whatever you like...

        SQL> connect system/manager
        Connected.

        SQL> alter user scott identified by values 'F894844C34402B67';
        User altered.

        SQL> connect scott/tiger
        Connected.



* 원격 로그인시에 반드시 비밀번호를 입력하도록 한다.

REMOTE_OS_AUTHENT = FALSE 로 한다.



* 오라클 생성시 만들어지는 유저들... (이렇게나 많았나????)



SYS/CHANGE_ON_INSTALL or INTERNAL
Oracle Data Dictionary/ Catalog
생성 스크립트: ?/rdbms/admin/sql.bsq and various cat*.sql scripts
패스워드수정가능(디비만든 직후)
삭제불가



SYSTEM/MANAGER
The default DBA user name (please do not use SYS)
생성 스크립트: ?/rdbms/admin/sql.bsq
패스워드수정가능(디비만든 직후)
삭제불가


OUTLN/OUTLN
Stored outlines for optimizer plan stability
생성 스크립트: ?/rdbms/admin/sql.bsq
패스워드수정가능(디비만든 직후)
삭제불가


SCOTT/TIGER, ADAMS/WOOD, JONES/STEEL, CLARK/CLOTH and BLAKE/PAPER.
Training/ demonstration users containing the popular EMP and DEPT tables
생성 스크립트: ?/rdbms/admin/utlsampl.sql
패스워드수정가능(디비만든 직후)
삭제가능


HR/HR (Human Resources), OE/OE (Order Entry), SH/SH (Sales History).
Training/ demonstration users containing the popular EMPLOYEES and DEPARTMENTS tables
생성 스크립트: ?/demo/schema/mksample.sql
패스워드수정가능
삭제가능


CTXSYS/CTXSYS
Oracle interMedia (ConText Cartridge) administrator user
생성 스크립트: ?/ctx/admin/dr0csys.sql


TRACESVR/TRACE
Oracle Trace server
생성 스크립트: ?/rdbms/admin/otrcsvr.sql


DBSNMP/DBSNMP
Oracle Intelligent agent
생성 스크립트: ?/rdbms/admin/catsnmp.sql, called from catalog.sql
패스워드수정가능 - snmp_rw.ora 파일에 새로운 비밀번호를 넣는다
삭제가능 - Only if you do not use the Intelligent Agents


ORDPLUGINS/ORDPLUGINS
Object Relational Data (ORD) User used by Time Series, etc.
생성 스크립트: ?/ord/admin/ordinst.sql


ORDSYS/ORDSYS
Object Relational Data (ORD) User used by Time Series, etc
생성 스크립트: ?/ord/admin/ordinst.sql


DSSYS/DSSYS
Oracle Dynamic Services and Syndication Server
생성 스크립트: ?/ds/sql/dssys_init.sql


MDSYS/MDSYS
Oracle Spatial administrator user
생성 스크립트: ?/ord/admin/ordinst.sql


AURORA$ORB$UNAUTHENTICATED/INVALID
Used for users who do not authenticate in Aurora/ORB
생성 스크립트: ?/javavm/install/init_orb.sql called from ?/javavm/install/initjvm.sql


PERFSTAT/PERFSTAT
Oracle Statistics Package (STATSPACK) that supersedes UTLBSTAT/UTLESTAT
생성 스크립트: ?/rdbms/admin/statscre.sql


* 의심가는 테이블 감시하는 법.
DBMS_FGA 를 통해 의심가는 테이블에 대한 감시 정책을 생성한다.
DBA_AUDIT_POLICIES 에서 감시정책의 리스트를 볼 수 있고,
감시 기록은 DBA_FGA_AUDIT_TRAIL 에 남는다.
DBMS_FGA PL/SQL패키지는 테이블이나 뷰에 대한 정책을 적용하기 위한 패키지 안의 프로시져 즉 인터페이스이다.

-- Add policy on table with auditing condition...
execute dbms_fga.add_policy('HR', 'EMP', 'policy1', 'deptno > 10');
-- Must ANALYZE, this feature works with CBO (Cost Based Optimizer)
analyze table EMP compute statistics;

select * from EMP where c1 = 11;  -- Will trigger auditing
select * from EMP where c1 = 09;  -- No auditing

-- Now we can see the statments that triggered the auditing condition...
select sqltext from sys.fga_log$
delete from sys.fga_log$;
반응형
Posted by [PineTree]
ORACLE/INSTALL2007. 2. 26. 00:47
반응형

Installing Oracle Database 10g Release 2 on Linux x86

by John Smiley

Learn the basics of installing Oracle Database 10g Release 2 on Red Hat Enterprise Linux or Novell SUSE Enterprise Linux, from the bare metal up (for evaluation purposes only).

Contents
Overview
Part I: Installing Linux
    RHEL4
    SLES9
Part II: Configuring Linux for Oracle
    Verify System Requirements
    Create Directories
    Create the Oracle Groups and User Account
    Configure Linux Kernel Parameters
    Set Shell Limits for the oracle User
Part III: Installing Oracle
    Install the Software
Part IV: Configuring Storage
    Filesystems
    Automatic Storage Management
Conclusion
Appendix

Updated March 2006


Overview

The guide provides a walkthrough of installing an Oracle Database 10g Release 2 database on commodity hardware for the purpose of evaluation.  If you are new to Linux and/or Oracle, this guide is for you. It starts with the basics and walks you through an installation of Oracle Database 10g Release 2 from the bare metal up.

This guide will take the approach of offering the easiest paths, with the fewest number of steps for accomplishing a task.  This approach often means making configuration choices that would be inappropriate for anything other than an evaluation.  For that reason, this guide is not appropriate for building production-quality environments, nor does it reflect best practices.

The  Linux distributions certified for Oracle Database 10g Release 2 are:

  • Red Hat Enterprise Linux  4 (RHEL4)
  • Red Hat Enterprise Linux 3 (RHEL3)
  • Novell SUSE Linux Enterprise Server 9 (SLES9)

We will cover both of the Linux 2.6 kernel-based distributions: RHEL4 and SLES9.  RHEL3 is not covered here.  

Please note that as an alternative Novell offers the orarun package for installation of SLES9 and Oracle. To use that method instead of the one described here, refer to this Novell-supplied install guide.

This guide is divided into four parts: Part I covers the installation of the Linux operating system, Part II covers configuring Linux for Oracle, Part III discusses the essentials of installing the Oracle Database, and Part IV covers creating additional filesystems and  Automatic Storage Management (ASM)—a new storage option in Oracle Database 10g that greatly simplifies storage administration and management.  The Appendix provides information to help you get started using your new database including how to access the database interactively and how to stop and start the database and related services.


Part I: Installing Linux

This guide assumes a server with the following hardware:

  • 800MHz Pentium III CPU
  • 1024MB of RAM
  • SCSI host adapter (Ultra SCSI 160)
  • Four SCSI disk drives (1 x 9GB + 3 x 36GB)
  • One 100Base-T Ethernet adapter

Your hardware does not have to match this in order to use this guide.  All that is necessary for a basic database install is a single CPU, 1024MB of RAM, and one disk drive (IDE, SCSI, or FireWire) with at least 7GB of free space.

Now, let's walk through the process of installing the Linux operating system on a server. The instructions assume a fresh install of Linux (as opposed to an upgrade), that the server will be dedicated to Oracle, and that no other operating systems or data are on the server.


RHEL4

Oracle Database 10g Release 2 is certified to run the base release of RHEL4 (Advanced Server and Enterprise Server) without updates. (Free evaluation copies of RHEL4 are available for download.) If you have update CDs, you can use the boot CD from the update instead of the boot CD from the base release to automatically apply all updates during the installation. All updates from Red Hat are supported by Oracle.

The easiest and fastest way to apply the updates for a fresh install of Linux is to perform the install by using the update CDs. If Linux is already installed or you don't have the updates on CDs, they can be applied through RHN. Because this guide is designed for a fresh Linux install, you'll use the update CDs.

  1. Boot the server using the first CD.
    • You may need to change your BIOS settings to allow booting from the CD.
  2. The boot screen appears with the boot: prompt at the bottom of the screen.
    • Select Enter to continue with a graphical install on the console. (For other installation methods and options, refer to the Red Hat Installation Guide.)
    • The installer scans your hardware, briefly displays the Red Hat splash screen, and then begins a series of screen prompts.
  3. Language Selection
    • Accept the default.
  4. Keyboard Configuration
    • Accept the default.
  5. Welcome Screen
    • Click on Next.
  6. Disk Partitioning Setup
    • A thorough treatment of disk partitioning is beyond the scope of this guide, which assumes that you are familiar with disk partitioning methods.

      (WARNING: Improperly partitioning a disk is one of the surest and fastest ways to wipe out everything on your hard disk. If you are unsure how to proceed, stop and get help, or you will risk losing data!)

      This guide uses the following partitioning scheme, with ext3 for each filesystem:

      The 9GB disk on the first controller (/dev/sda) will hold all Linux and Oracle software and contains the following partitions:
      - 100MB /boot partition
      -1,500MB swap partition—Set this to at least twice the amount of RAM in the system but to no more than 2GB. (Thirty-two-bit systems do not support swap files larger than 2GB.) If you need more than 2GB of swap space, create multiple swap partitions.
      -7,150MB root partition—This partition will be used for everything, including /usr, /tmp, /var, /opt, /home, and more. This approach is purely to simplify installation for the purposes of this guide. A more robust partitioning scheme would separate these directories onto separate filesystems.

  7. Boot Loader Configuration
    • Accept the default.
  8. Network Configuration
    • It is usually best to configure database servers with a static IP address. To do so, click on Edit .
    • A pop-up window appears. Uncheck the Configure using DHCP box, and enter the IP Address and Netmask for the server. Be sure that Activate on boot is checked, and click on OK .
    • In the Hostname box, select manually and enter the hostname.
    • In the Miscellaneous Settings box, enter the remaining network settings.
  9. Firewall Configuration
    • For the purposes of this walk-through, no firewall is configured. Select No firewall
    • Select Disabled on the "Enable SELinux" drop down list. 
    • Click on Proceed when the "Warning - No Firewall" window appears.
  10. Additional Language Support
    • Accept the default.
  11. Time Zone Selection
    • Choose the time settings that are appropriate for your area. Setting the system clock to UTC is usually a good practice for servers. To do so, click on System clock uses UTC.
  12. Set Root Password
    • Enter a password for root, and enter it again to confirm.
  13. Package Installation Defaults
    • Select Customize software packages to be installed.
  14. Package Group Selection
    • Select only the package sets shown here and leave all others unselected. 
    • Desktop
      • X Window System
      • Gnome
    • Applications
      • Graphical Internet (optional)
    • Servers
      • Do not select anything in this group.
    • Development
      • Development Tools
    • System
      • Administration Tools
      • System Tools
        • Add the package 'sysstat' by clicking on the Details link and selecting "sysstat - The sar an iostat system monitoring commands." from the Optional Packages list.
    • Miscellaneous
      • Do not select anything in this group.
    • Click on Next to proceed.
  15. Installing Packages
    • Software will be copied to the hard disk and installed. Change disks as prompted.
  16. Congratulations
    • Remove the installation media from the system, and click on Reboot .
  17. The system automatically reboots and presents a new welcome screen.
    • Click on Next.
  18. License Agreement
    • Read the license agreement. If you agree to the terms, select Yes, I agree to the License Agreement and click on Next.
  19. Date and Time
    • Set the Date and Time.
    • If you want to use an NTP server (recommended), select Enable Network Time Protocol and enter the name of the NTP server.
  20. Display
    • Accept the defaults or change as required.
  21. Red Hat Login
    • Enter your Red Hat Network login and password or create a new one.
  22. System User
    • Create an account for yourself.
    • Do not create an account for oracle at this time. Creating the oracle account is covered later in this section.
  23. Additional CDs
    • Click on Next.
  24. Finish Setup
    • Click on Next.
  25. A graphical login screen appears.
  26. Congratulations! Your RHEL4 software is now installed.

Verifying Your Installation

Required kernel version: 2.6.9-5.0.5.EL  This kernel, or any of the kernels supplied in updates, works with Oracle Database 10g Release 2 .

Check your kernel version by running the following command:

uname -r

Ex:
# uname -r
2.6.9-22.ELsmp

Once you've completed the steps above, all of the packages required for Oracle Database 10g Release 2 will have been installed.  Verify this using the example below.

Required package versions (or later):
    • binutils-2.15.92.0.2-10.EL4
    • compat-db-4.1.25-9
    • control-center-2.8.0-12
    • gcc-3.4.3-9.EL4
    • gcc-c++-3.4.3-9.EL4
    • glibc-2.3.4-2
    • glibc-common-2.3.4-2
    • gnome-libs-1.4.1.2.90-44.1
    • libstdc++-3.4.3-9.EL4
    • libstdc++-devel-3.4.3-9.EL4
    • make-3.80-5
    • pdksh-5.2.14-30
    • sysstat-5.0.5-1
    • xscreensaver-4.18-5.rhel4.2
    • libaio-0.3.96
    • openmotif21-2.1.30-11.RHEL4.2  (Required only to install Oracle demos.  Installation of Oracle demos is not covered by this guide.)
      To see which versions of these packages are installed on your system, run the following command:
      rpm -q binutils compat-db control-center gcc gcc-c++ glibc glibc-common \
      gnome-libs libstdc++ libstdc++-devel make pdksh sysstat xscreensaver libaio openmotif21
      Ex: 
      # rpm -q binutils compat-db control-center gcc gcc-c++ glibc glibc-common \
      > gnome-libs libstdc++ libstdc++-devel make pdksh sysstat xscreensaver libaio openmotif21
      binutils-2.15.92.0.2-15
      compat-db-4.1.25-9
      control-center-2.8.0-12.rhel4.2
      gcc-3.4.4-2
      gcc-c++-3.4.4-2
      glibc-2.3.4-2.13
      glibc-common-2.3.4-2.13
      gnome-libs-1.4.1.2.90-44.1
      libstdc++-3.4.4-2
      libstdc++-devel-3.4.4-2
      make-3.80-5
      pdksh-5.2.14-30.3
      sysstat-5.0.5-1
      xscreensaver-4.18-5.rhel4.9
      libaio-0.3.103-3
      openmotif21-2.1.30-11.RHEL4.4



      SLES9

      Oracle Database 10g Release 2 is certified to run on the base release of SLES9. Service Packs and package updates are available from Novell, either on CDs or online via its support portal. In this guide, we will install on the SLES9 base release.

      1. Boot the server, using the SLES9 CD.
        • You may need to change your BIOS settings to allow booting from the CD.
      2. The Novell SLES installation screen appears.
        • Select Installation.
        • The installer scans your hardware and presents the YaST interface.
      3. Language Selection
        • Accept the license agreement.
        • Accept the default, English (US).
      4. Installation Settings
        • Select New Installation.
      5. Partitioning
        • A thorough treatment of disk partitioning is beyond the scope of this guide, which assumes that you are familiar with disk partitioning methods.

          (WARNING: Improperly partitioning a disk is one of the surest and fastest ways to wipe out everything on your hard disk. If you are unsure how to proceed, stop and get help, or you will risk losing data!)

          This guide uses the following partitioning scheme, with ext3 for each filesystem:

          The 9GB disk on the first controller (/dev/sda) will hold all Linux and Oracle software and contains the following partitions:
          - 100MB /boot partition
          -1,500MB swap partition—Set this to at least twice the amount of RAM in the system but to no more than 2GB. (Thirty-two-bit systems do not support swap files larger than 2GB.) If you need more than 2GB of swap space, create multiple swap partitions.
          -7,150MB root partition—this partition will be used for everything, including /usr, /tmp, /var, /opt, /home, and more. This approach is purely to simplify installation for the purposes of this guide. A more robust partitioning scheme would separate these directories onto separate filesystems.

      6. Software
        • Click on the link for Software.
        • The Software Selection screen appears.
        • Click on Detailed Selection.
        • The left-hand window displays a list of software selections. Click on the box next to each selection to select/deselect it.
        • Select the following software (this is the recommended set; all others should be deselected):
          - Basis Runtime System
          - YaST
          - Linux Tools
          - Help & Support Documentation
          - Graphical Base System
          - GNOME System
          - C/C++ Compiler and Tools
          - Analyzing Tools
        • It is recommended that the following items not be installed, as they may conflict with Oracle products providing the same service:
          - Simple Webserver
          - Authentication Server (NIS, LDAP, Kerberos)
      7. Time Zone
        • Set your time zone.
      8. Click on Accept.
      9. A warning box appears. Click on Yes, install when ready to proceed.
      10. Change CDs as prompted by the installer.
      11. Confirm Hardware Detection
        • Network Cards – Click on OK.
      12. Password for "root." the system administrator.
        • Enter the root password and repeat to confirm.
      13. Configure your network interface(s), and click on Next when ready to proceed.
        • Static IP addresses are recommended for servers.
        • There is no need to configure printers, modems, ISDN adapters, or sound in order to build a database.
      14. Test Internet Connection
        • There is no need to connect to the Internet to download release notes or Linux updates. Select No, Skip This Test.
      15. Service Configuration
        • There is no need to configure CA Management or OpenLDAP Server. Select Skip Configuration.
      16. User Authentication Method
        • Select Local(/etc/passwd).
      17. Add a New Local User
        • Create an account for yourself. Do not create the oracle account at this time; we'll do that later.
      18. Release Notes
        • Click on Next
      19. Hardware Configuration
        • Confirm Hardware Detection – Graphics Cards – click on Continue.
        • There is no need to configure sound cards for a database – click on Skip.
        • If the graphics card and monitor have been successfully detected, click on Next. Otherwise, click on the Graphics Cards link and enter the correct information.
      20. Installation Completed
        • Click on Finish.
      21. Congratulations! Your SLES9 software is now installed.
      Verifying Your Installation

      If you've completed the steps above, you should have all the packages and updates required for Oracle Database 10g Release 2. However, you can take the steps below to verify your installation.

      Required kernel version: 2.6.5-7.97 (or later)

      Check your kernel version by running the following command:

      uname -r

      Ex:
      # uname -r
      2.6.5-7.97-smp
      Other required package versions (or later):
        • binutils-2.15.90.0.1.1-32.5
        • gcc-3.3.3-43.24
        • gcc-c++-3.3.3-43.24
        • glibc-2.3.3-98.28
        • gnome-libs-1.4.1.7-671.1
        • libstdc++-3.3.3-43.24
        • libstdc++-devel-3.3.3-43.24
        • make-3.80-184.1
        • pdksh-5.2.14-780.1
        • sysstat-5.0.1-35.1
        • xscreensaver-4.16-2.6
        • libaio-0.3.98
          To see which versions of these packages are installed on your system, run the following command as root:
          rpm -q binutils gcc gcc-c++ glibc gnome-libs libstdc++ libstdc++-devel make \
          pdksh sysstat xscreensaver libaio

          Ex:
          # rpm -q binutils gcc gcc-c++ glibc gnome-libs libstdc++ libstdc++-devel make \
          > pdksh sysstat xscreensaver libaio
          binutils-2.15.90.0.1.1-32.10
          gcc-3.3.3-43.34
          gcc-c++-3.3.3-43.34
          glibc-2.3.3-98.47
          gnome-libs-1.4.1.7-671.1
          libstdc++-3.3.3-43.34
          libstdc++-devel-3.3.3-43.34
          make-3.80-184.1
          pdksh-5.2.14-780.7
          sysstat-5.0.1-35.4
          xscreensaver-4.16-2.6
          libaio-0.3.102-1.2

          If any of the package versions on your system are missing or the versions are earlier than those specified above, you can download and install the updates from the Novell SUSE Linux Portal.

          Part II: Configuring Linux for Oracle

          Now that the Linux software is installed, you need to configure it for Oracle. This section walks through the steps required to configure Linux for Oracle Database 10g Release 2.

          Verifying System Requirements

          To verify that your system meets the minimum requirements for an Oracle Database 10g Release 2 database, log in as root and run the commands below.

          To check the amount of RAM and swap space available, run this:
          grep MemTotal /proc/meminfo
          grep SwapTotal /proc/meminfo

          Ex:
          # grep MemTotal /proc/meminfo
          MemTotal: 1034680 kB
          # grep SwapTotal /proc/meminfo
          SwapTotal: 1534196 kB

          The minimum RAM required is 1024MB, and the minimum required swap space is 1GB. Swap space should be twice the amount of RAM for systems with 2GB of RAM or less and between one and two times the amount of RAM for systems with more than 2GB.

          You also need 2.5GB of available disk space for the Oracle Database 10g Release 2 software and another 1.2GB for the database. The /tmp directory needs at least 400MB of free space. To check the available disk space on your system, run the following command:

          df -h

          Ex:
          # df -h
          Filesystem Size Used Avail Use% Mounted on
          /dev/sda3 6.8G 1.3G 5.2G 20% /
          /dev/sda1 99M 17M 77M 18% /boot

          The example shows that the /tmp directory does not have its own filesystem. (It's part of the root filesystem for this guide.) With 5.2 GB available, the root filesystem has just enough space for the installation (2.5 + 1.2 + 0.4 = 4.1GB) with a little room left over.

          Create the Oracle Groups and User Account

          Next, create the Linux groups and user account that will be used to install and maintain the Oracle Database 10g Release 2 software. The user account will be called oracle, and the groups will be oinstall and dba. Execute the following commands as root:

          /usr/sbin/groupadd oinstall
          /usr/sbin/groupadd dba
          /usr/sbin/useradd -m -g oinstall -G dba oracle
          id oracle

          Ex:
          # /usr/sbin/groupadd oinstall
          # /usr/sbin/groupadd dba
          # /usr/sbin/useradd -m -g oinstall -G dba oracle
          # id oracle
          uid=501(oracle) gid=502(oinstall) groups=502(oinstall),503(dba)

          Set the password on the oracle account:

          passwd oracle

          Ex:
          # passwd oracle
          Changing password for user oracle.
          New password:
          Retype new password:
          passwd: all authentication tokens updated successfully.

          Create Directories

          Now create directories to store the Oracle Database 10g Release 2 software and the database files. This guide adheres to the Optimal Flexible Architecture (OFA) for the naming conventions used in creating the directory structure. For more information on OFA standards, see Appendix C of the Oracle Database Installation Guide 10g Release 2 (10.2) for Linux x86.

          The following assumes that the directories are being created in the root filesystem. This is done for the sake of simplicity and is not recommended as a general practice. These directories would normally be created as separate filesystems.

          Issue the following commands as root:

          mkdir -p /u01/app/oracle
          chown -R oracle:oinstall /u01/app/oracle
          chmod -R 775 /u01/app/oracle

          Ex:
          # mkdir -p /u01/app/oracle
          # chown -R oracle:oinstall /u01/app/oracle
          # chmod -R 775 /u01/app/oracle

          Configuring the Linux Kernel Parameters

          The Linux kernel is a wonderful thing. Unlike most other *NIX systems, Linux allows modification of most kernel parameters while the system is up and running. There's no need to reboot the system after making kernel parameter changes. Oracle Database 10g Release 2 requires the kernel parameter settings shown below. The values given are minimums, so if your system uses a larger value, don't change it.

          kernel.shmall = 2097152
          kernel.shmmax = 536870912
          kernel.shmmni = 4096
          kernel.sem = 250 32000 100 128
          fs.file-max = 65536
          net.ipv4.ip_local_port_range = 1024 65000
          net.core.rmem_default=262144
          net.core.wmem_default=262144
          net.core.rmem_max=262144
          net.core.wmem_max=262144

          If you're following along and have just installed Linux, the kernel parameters will all be at their default values and you can just cut and paste the following commands while logged in as root.

          cat >> /etc/sysctl.conf <<EOF
          kernel.shmall = 2097152
          kernel.shmmax = 536870912
          kernel.shmmni = 4096
          kernel.sem = 250 32000 100 128
          fs.file-max = 65536
          net.ipv4.ip_local_port_range = 1024 65000
          net.core.rmem_default=262144
          net.core.wmem_default=262144
          net.core.rmem_max=262144
          net.core.wmem_max=262144
          EOF
          /sbin/sysctl -p

          Ex:
          # cat >> /etc/sysctl.conf <<EOF
          > kernel.shmall = 2097152
          > kernel.shmmax = 536870912
          > kernel.shmmni = 4096
          > kernel.sem = 250 32000 100 128
          > fs.file-max = 65536
          > net.ipv4.ip_local_port_range = 1024 65000
          > EOF
          # /sbin/sysctl -p
          net.ipv4.ip_forward = 0
          net.ipv4.conf.default.rp_filter = 1
          net.ipv4.conf.default.accept_source_route = 0
          kernel.sysrq = 0
          kernel.core_uses_pid = 1
          kernel.shmall = 2097152
          kernel.shmmax = 536870912
          kernel.shmmni = 4096
          kernel.sem = 250 32000 100 128
          fs.file-max = 65536
          net.ipv4.ip_local_port_range = 1024 65000
          net.core.rmem_default = 262144
          net.core.wmem_default = 262144
          net.core.rmem_max = 262144
          net.core.wmem_max = 262144

          Run the following commands as root to verify your settings:

          /sbin/sysctl -a | grep shm
          /sbin/sysctl -a | grep sem
          /sbin/sysctl -a | grep file-max
          /sbin/sysctl -a | grep ip_local_port_range
          /sbin/sysctl -a | grep rmem_default
          /sbin/sysctl -a | grep rmem_max
          /sbin/sysctl -a | grep wmem_default
          /sbin/sysctl -a | grep wmem_max

          Ex:
          # /sbin/sysctl -a | grep shm
          kernel.shmmni = 4096
          kernel.shmall = 2097152
          kernel.shmmax = 536870912
          kernel.shm-use-bigpages = 0
          # /sbin/sysctl -a | grep sem
          kernel.sem = 250 32000 100 128
          # /sbin/sysctl -a | grep file-max
          fs.file-max = 65536
          # /sbin/sysctl -a | grep ip_local_port_range
          net.ipv4.ip_local_port_range = 1024 65000
          # /sbin/sysctl -a | grep rmem_default
          net.core.rmem_default = 262144
          # /sbin/sysctl -a | grep rmem_max
          net.core.rmem_max = 262144
          # /sbin/sysctl -a | grep wmem_default
          net.core.wmem_default = 262144
          # /sbin/sysctl -a | grep wmem_max
          net.core.wmem_max = 262144

          For Novell SUSE Linux releases, use the following to ensure that the system reads the /etc/sysctl.conf file at boot time:

          /sbin/chkconfig boot.sysctl on

          Setting Shell Limits for the oracle User

          Oracle recommends setting limits on the number of processes and open files each Linux account may use. To make these changes, cut and paste the following commands as root:

          cat >> /etc/security/limits.conf <<EOF
          oracle soft nproc 2047
          oracle hard nproc 16384
          oracle soft nofile 1024
          oracle hard nofile 65536
          EOF

          cat >> /etc/pam.d/login <<EOF
          session required /lib/security/pam_limits.so
          EOF

          For RHEL4, use the following:

          cat >> /etc/profile <<EOF
          if [ \$USER = "oracle" ]; then
          if [ \$SHELL = "/bin/ksh" ]; then
          ulimit -p 16384
          ulimit -n 65536
          else
          ulimit -u 16384 -n 65536
          fi
          umask 022
          fi
          EOF

          cat >> /etc/csh.login <<EOF
          if ( \$USER == "oracle" ) then
          limit maxproc 16384
          limit descriptors 65536
          umask 022
          endif
          EOF

          For SLES 9, use the following:

          cat >> /etc/profile.local <<EOF
          if [ \$USER = "oracle" ]; then
          if [ \$SHELL = "/bin/ksh" ]; then
          ulimit -p 16384
          ulimit -n 65536
          else
          ulimit -u 16384 -n 65536
          fi
          umask 022
          fi
          EOF

          cat >> /etc/csh.login.local <<EOF
          if ( \$USER == "oracle" ) then
          limit maxproc 16384
          limit descriptors 65536
          umask 022
          endif
          EOF


          Part III: Installing Oracle

          Oracle Database 10g Release 2 can be downloaded from OTN. Oracle offers a development and testing license free of charge. However, no support is provided and the license does not permit production use. A full description of the license agreement is available on OTN.

          The easiest way to make the Oracle Database 10g Release 2 distribution media available on your server is to download them directly to the server.

          Use the graphical login to log in as oracle.

          Create a directory to contain the Oracle Database 10g Release 2 distribution:

          mkdir 10gR2_db

          To download Oracle Database 10g Release 2 from OTN, point your browser (Firefox works well) to http://www.oracle.com/technology/software/products/database/oracle10g/htdocs/10201linuxsoft.html. Fill out the Eligibility Export Restrictions page, and read the OTN License agreement. If you agree with the restrictions and the license agreement, click on I Accept.

          Click on the 10201_database_linux32.zip  link, and save the file in the directory you created for this purpose (10gR2_db)—if you have not already logged in to OTN, you may be prompted to do so at this point.

          Unzip and extract the file:

          cd 10gR2_db
          unzip 10201_database_linux32.zip

          Install the Software and Create a Database

          Log in using the oracle account.

          Change directory to the location where you extracted the Oracle Database 10g Release 2 software.
          Ex:
          $ cd $HOME/10gR2_db

          Change directory to Disk1.

          Ex:
          $ cd database

          Start the Oracle Universal Installer.

          $ ./runInstaller
          1. Select Installation Method
            • Select Basic Installation
            • Oracle Home Location: /u01/app/oracle/product/10.2.0/db_1
            • Installation Type: Enterprise Edition (1.3GB)
            • UNIX DBA Group:  oinstall
            • Make sure Create Starter Database is checked
            • Global Database Name: demo1
            • Enter the Database Password and Confirm Password
            • Click on Next
          2. Specify Inventory Directory and Credentials
            • Inventory Directory: /u01/app/oracle/oraInventory
            • Operating System group name:  oinstall
            • Click on Next
          3. Product-specific Prerequisite Checks
            • If you've been following the steps in this guide, all the checks should pass without difficulty. If one or more checks fail, correct the problem before proceeding. 
            • Click on Next
          4. Summary
            • A summary of the products being installed is presented.
            • Click on Install.
          5. Configuration Assistants
            • The Oracle Net, Oracle Database, and iSQL*Plus configuration assistants will run automatically
          6. Execute Configuration Scripts
            • At the end of the installation, a pop up window will appear indicating scripts that need to be run as root.  Login as root and run the indicated scripts.
            • Click on OK when finished.
          7. End of Installation
            • Make note of the URLs presented in the summary, and click on Exit when ready.
          8. Congratulations! Your new Oracle Database 10g Release 2 database is up and ready for use.


          Part IV: Configuring Storage

          The database we created in Part III used a single filesystem for disk storage. However, there are several other ways to configure storage for an Oracle database.

          Part IV explores other methods of configuring disk storage for a database. In particular, it describes creating additional filesystems and using Automatic Storage Management (ASM). Use of raw devices and Oracle Cluster File System (OCFS) is covered in the next article in this series which walks through installing Oracle RAC Database 10g Release 2 on Linux x86.

          Partition the Disks

          In order to use either file systems or ASM, you must have unused disk partitions available.  This section describes how to create the partitions that will be used for new file systems and for ASM.

          WARNING: Improperly partitioning a disk is one of the surest and fastest ways to wipe out everything on your hard disk. If you are unsure how to proceed, stop and get help, or you will risk losing data.

          This example uses /dev/sdb (an empty SCSI disk with no existing partitions) to create a single partition for the entire disk (36 GB).

          Ex:
          # fdisk /dev/sdb
          Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
          Building a new DOS disklabel. Changes will remain in memory only,
          until you decide to write them. After that, of course, the previous
          content won't be recoverable.


          The number of cylinders for this disk is set to 4427.
          There is nothing wrong with that, but this is larger than 1024,
          and could in certain setups cause problems with:
          1) software that runs at boot time (e.g., old versions of LILO)
          2) booting and partitioning software from other OSs
          (e.g., DOS FDISK, OS/2 FDISK)

          Command (m for help): p

          Disk /dev/sdb: 255 heads, 63 sectors, 4427 cylinders
          Units = cylinders of 16065 * 512 bytes

          Device Boot Start End Blocks Id System

          Command (m for help): n
          Command action
          e extended
          p primary partition (1-4)
          p
          Partition number (1-4): 1
          First cylinder (1-4427, default 1):
          Using default value 1
          Last cylinder or +size or +sizeM or +sizeK (1-4427, default 4427):
          Using default value 4427

          Command (m for help): w
          The partition table has been altered!

          Calling ioctl() to re-read partition table.

          WARNING: If you have created or modified any DOS 6.x
          partitions, please see the fdisk manual page for additional
          information.
          Syncing disks.

          Now verify the new partition:

          Ex:
          # fdisk -l /dev/sdb

          Disk /dev/sdb: 36.4 GB, 36420075008 bytes
          255 heads, 63 sectors/track, 4427 cylinders
          Units = cylinders of 16065 * 512 = 8225280 bytes

          Device Boot Start End Blocks Id System
          /dev/sdb1 * 1 4427 35559846 83 Linux

          Repeat the above steps for each disk to be partitioned.  The following section on Filesystems uses a single disk partition, /dev/sdb1.  The ASM example uses three partitions on three disks: /dev/sdb1, /dev/sdc1, and /dev/sdd1


          Filesystems

          Filesystems are the most widely used means of storing data file, redo logs, and control files for Oracle databases. Filesystems are easy to implement and require no third-party software to administer.

          In most cases, filesystems are created during the initial installation of Linux. However, there are times when a new filesystem must be created after the initial installation, such as when a new disk drive is being installed.

          This section describes building a new filesystem and using it in an Oracle database. Unless otherwise noted, all commands must be run as root.

          Create the Filesystem

          Use ext3 to create this new filesystem. Other filesystems work just as well, but ext3 offers the fastest recovery time in the event of a system crash.

          Ex:
          # mke2fs -j /dev/sdb1
          mke2fs 1.26 (3-Feb-2002)
          Filesystem label=
          OS type: Linux
          Block size=4096 (log=2)
          Fragment size=4096 (log=2)
          4447744 inodes, 8889961 blocks
          444498 blocks (5.00%) reserved for the super user
          First data block=0
          272 block groups
          32768 blocks per group, 32768 fragments per group
          16352 inodes per group
          Superblock backups stored on blocks:
          32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632,
          2654208, 4096000, 7962624

          Writing inode tables: done
          Creating journal (8192 blocks): done
          Writing superblocks and filesystem accounting information: done

          This filesystem will be automatically checked every 23 mounts or
          180 days, whichever comes first. Use tune2fs -c or -i to override.

          Create the Mount Point

          A filesystem must have a mount point, which is simply an empty directory where the new filesystem "attaches" to the system's directory tree. Mount points should be given names consistent with the Oracle Flexible Architecture (OFA) standard. For more information on OFA standards, see Appendix C of the Oracle Database Installation Guide 10g Release 2 (10.2) for Linux x86.

          Because you have already created the /u01 directory in Part I, use /u02 for this example.

          Ex:
          # mkdir /u02

          Add the New Filesystem to /etc/fstab

          So that the new filesystem will be mounted automatically when the system boots, you need to add a line to the /etc/fstab file that describes the new filesystem and where to mount it. Add a line similar to the one below to /etc/fstab, using a text editor.

          /dev/sdb1 /u02 ext3 defaults 1 1

          Mount the New Filesystem

          Mounting the filesystem makes it available for use. Until the filesystem is mounted, files cannot be stored in it. Use the following commands to mount the filesystem and verify that it is available.

          mount /u02
          df -h /u02

          Ex:
          # mount /u02
          # df -h /u02
          Filesystem Size Used Avail Use% Mounted on
          /dev/sdb1 33G 33M 31G 1% /u02

          Create Oracle Directories and Set Permissions

          Now you create a directory to store your Oracle files. The directory name used in the example follows the OFA standard naming convention for a database with ORACLE_SID=demo1.

          mkdir -p /u02/oradata/demo1
          chown -R oracle:oinstall /u02/oradata
          chmod -R 775 /u02/oradata

          Create a New Tablespace in the New Filesystem

          The new filesystem is ready for use. Next you create a new tablespace in the filesystem to store your database objects. Connect to the database as the SYSTEM user, and execute the CREATE TABLESPACE statement, specifying the data file in the new filesystem.

          Ex:
          $ sqlplus

          SQL*Plus: Release 10.2.0.1.0 - Production on Sun Nov 27 15:50:50 2005

          Copyright (c) 1982, 2005, Oracle. All rights reserved.

          Enter user-name: system
          Enter password:

          Connected to:
          Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
          With the Partitioning, OLAP and Data Mining options

          SQL> create tablespace data1
          2 datafile '/u02/oradata/demo1/data1_01.dbf' size 100m
          3 extent management local
          4 segment space management auto;

          Tablespace created.


          Now you can use the new tablespace to store database objects such as tables and indexes.

          Ex:
          SQL> create table demotab (id number(5) not null primary key,
          2 name varchar2(50) not null,
          3 amount number(9,2))
          4 tablespace data1;

          Table created.

          Automatic Storage Management (ASM)

          ASM was a new storage option introduced with Oracle Database 10gR1 that provides the services of a filesystem, logical volume manager, and software RAID in a platform-independent manner. ASM can stripe and mirror your disks, allow disks to be added or removed while the database is under load, and automatically balance I/O to remove "hot spots." It also supports direct and asynchronous I/O and implements the Oracle Data Manager API (simplified I/O system call interface) introduced in Oracle9i.

          ASM is not a general-purpose filesystem and can be used only for Oracle data files, redo logs, and control files. Files in ASM can be created and named automatically by the database (by use of the Oracle Managed Files feature) or manually by the DBA. Because the files stored in ASM are not accessible to the operating system, the only way to perform backup and recovery operations on databases that use ASM files is through Recovery Manager (RMAN).

          ASM is implemented as a separate Oracle instance that must be up if other databases are to be able to access it. Memory requirements for ASM are light: only 64 MB for most systems.

          Installing ASM

          On Linux platforms, ASM can use raw devices or devices managed via the ASMLib interface. Oracle recommends ASMLib over raw devices for ease-of-use and performance reasons. ASMLib 2.0 is available for free download from OTN. This section walks through the process of configuring a simple ASM instance by using ASMLib 2.0 and building a database that uses ASM for disk storage.

          Determine Which Version of ASMLib You Need

          ASMLib 2.0 is delivered as a set of three Linux packages:

          • oracleasmlib-2.0 - the ASM libraries
          • oracleasm-support-2.0 - utilities needed to administer ASMLib
          • oracleasm - a kernel module for the ASM library
          Each Linux distribution has its own set of ASMLib 2.0 packages, and within each distribution, each kernel version has a corresponding oracleasm package. The following paragraphs describe how to determine which set of packages you need.

          First, determine which kernel you are using by logging in as root and running the following command:

          uname -rm

          Ex:
          # uname -rm
          2.6.9-22.ELsmp i686

          The example shows that this is a 2.6.9-22 kernel for an SMP (multiprocessor) box using Intel i686 CPUs.

          Use this information to find the correct ASMLib packages on OTN:

          1. Point your Web browser to http://www.oracle.com/technology/tech/linux/asmlib/index.html
          2. Select the link for your version of Linux.
          3. Download the oracleasmlib and oracleasm-support packages for your version of Linux
          4. Download the oracleasm package corresponding to your kernel. In the example above, the oracleasm-2.6.9-22.ELsmp-2.0.0-1.i686.rpm package was used.

            Next, install the packages by executing the following command as root:

            rpm -Uvh oracleasm-kernel_version-asmlib_version.cpu_type.rpm \
            oracleasmlib-asmlib_version.cpu_type.rpm \
            oracleasm-support-asmlib_version.cpu_type.rpm

            Ex:
            # rpm -Uvh \
            > oracleasm-2.6.9-22.ELsmp-2.0.0-1.i686.rpm \
            > oracleasmlib-2.0.1-1.i386.rpm \
            > oracleasm-support-2.0.1-1.i386.rpm
            Preparing... ########################################### [100%]
            1:oracleasm-support ########################################### [ 33%]
            2:oracleasm-2.6.9-22.ELsm########################################### [ 67%]
            3:oracleasmlib ########################################### [100%]

          Configuring ASMLib

          Before using ASMLib, you must run a configuration script to prepare the driver. Run the following command as root, and answer the prompts as shown in the example below.

          # /etc/init.d/oracleasm configure
          Configuring the Oracle ASM library driver.

          This will configure the on-boot properties of the Oracle ASM library
          driver. The following questions will determine whether the driver is
          loaded on boot and what permissions it will have. The current values
          will be shown in brackets ('[]'). Hitting <ENTER> without typing an
          answer will keep that current value. Ctrl-C will abort.

          Default user to own the driver interface []: oracle
          Default group to own the driver interface []: dba
          Start Oracle ASM library driver on boot (y/n) [n]: y
          Fix permissions of Oracle ASM disks on boot (y/n) [y]: y
          Writing Oracle ASM library driver configuration: [ OK ]
          Creating /dev/oracleasm mount point: [ OK ]
          Loading module "oracleasm": [ OK ]
          Mounting ASMlib driver filesystem: [ OK ]
          Scanning system for ASM disks: [ OK ]

          Next you tell the ASM driver which disks you want it to use. Oracle recommends that each disk contain a single partition for the entire disk.  See Partitioning the Disks at the beginning of this section for an example of creating disk partitions.

          You mark disks for use by ASMLib by running the following command as root:

          /etc/init.d/oracleasm createdisk DISK_NAME device_name

          Tip: Enter the DISK_NAME in UPPERCASE letters.

          Ex:
          # /etc/init.d/oracleasm createdisk VOL1 /dev/sdb1
          Marking disk "/dev/sdb1" as an ASM disk: [ OK ]
          # /etc/init.d/oracleasm createdisk VOL1 /dev/sdc1
          Marking disk "/dev/sdc1" as an ASM disk: [ OK ]
          # /etc/init.d/oracleasm createdisk VOL1 /dev/sdd1
          Marking disk "/dev/sdd1" as an ASM disk: [ OK ]

          Verify that ASMLib has marked the disks:

          # /etc/init.d/oracleasm listdisks
          VOL1
          VOL2
          VOL3

          Create the ASM Instance

          ASM runs as a separate Oracle instance which can be created and configured using the Oracle Universal Installer.  Now that ASMLib is installed and the disks are marked for use, you can create an ASM instance.

          Log in as oracle and start runInstaller:

          $ ./runInstaller
          1. Select Installation Method
            • Select Advanced Installation
            • Click on Next
          2. Specify Inventory Directory and Credentials
            • Inventory Directory: /u01/app/oracle/oraInventory
            • Operating System group name:  oinstall
            • Click on Next
          3. Select Installation Type
            • Select Enterprise Edition
            • Click on Next
          4. Specify Home Details
            • Name:   OraDB10gASM
            • Path:      /u01/app/oracle/product/10.2.0/asm
              Note:Oracle recommends using a different ORACLE_HOME for ASM than the ORACLE_HOME used for the database for ease of administration.
            • Click on Next
          5. Product-specific Prerequisite Checks
            • If you've been following the steps in this guide, all the checks should pass without difficulty. If one or more checks fail, correct the problem before proceeding. 
            • Click on Next
          6. Select Configuration Option
            • Select Configure Automatic Storage Management (ASM)
            • Enter the ASM SYS password and confirm
            • Click on Next
          7. Configure Automatic Storage Management
            • Disk Group Name:  DATA
            • Redundancy
              - High mirrors data twice.
              - Normal mirrors data once.  This is the default.
              - External does not mirror data within ASM. This is typically used if an external RAID array is providing redundancy.
            • Add Disks
              The disks you configured for use with ASMLib are listed as Candidate Disks.  Select each disk you wish to include in the disk group.
            • Click on Next
          8. Summary
            • A summary of the products being installed is presented.
            • Click on Install.
          9. Execute Configuration Scripts
            • At the end of the installation, a pop up window will appear indicating scripts that need to be run as root.  Login as root and run the indicated scripts.
            • Click on OK when finished.
          10. Configuration Assistants
            • The Oracle Net, Oracle Database, and iSQL*Plus configuration assistants will run automatically
          11. End of Installation
            • Make note of the URLs presented in the summary, and click on Exit when ready.
          12. Congratulations! Your new Oracle ASM Instance is up and ready for use.


          Create the Database

          Once the ASM instance has been created, create a database that uses ASM for storage:

          Log in as oracle and start runInstaller:

          $ ./runInstaller
          1. Select Installation Method
            • Select Advanced Installation
            • Click on Next
          2. Select Installation Type
            • Select Enterprise Edition
            • Click on Next
          3. Specify Home Details
            • Name:   OraDb10g_home1
            • Path:      /u01/app/oracle/product/10.2.0/db_1
              Note:Oracle recommends using a different ORACLE_HOME for the database than the ORACLE_HOME used for ASM.
            • Click on Next
          4. Product-specific Prerequisite Checks
            • If you've been following the steps in this guide, all the checks should pass without difficulty. If one or more checks fail, correct the problem before proceeding. 
            • Click on Next
          5. Select Configuration Option
            • Select Create a Database
            • Click on Next
          6. Select Database Configuration
            • Select General Purpose
            • Click on Next
          7. Specify Database Configuration Options
            • Database Naming:  Enter the Global Database Name and SID
            • Database Character Set:  Accept the default
            • Database Examples:  Select Create database with sample schemas
            • Click on Next
          8. Select Database Management Option
            • Select Use Database Control for Database Management
            • Click on Next
          9. Specify Database Storage Option
            • Select Automatic Storage Management (ASM)
            • Click on Next
          10. Specify Backup and Recovery Options
            • Select Do not enable Automated backups
            • Click on Next
          11. Select ASM Disk Group
            • Select the DATA disk group created in the previous section
            • Click on Next
          12. Specify Database Schema Passwords
            • Select Use the same password for all the accounts
            • Enter the password and confirm
            • Click on Next
          13. Summary
            • A summary of the products being installed is presented.
            • Click on Install.
          14. Configuration Assistants
            • The Oracle Net, Oracle Database, and iSQL*Plus configuration assistants will run automatically
          15. Execute Configuration Scripts
            • At the end of the installation, a pop up window will appear indicating scripts that need to be run as root.  Login as root and run the indicated scripts.
            • Click on OK when finished.
          16. End of Installation
            • Make note of the URLs presented in the summary, and click on Exit when ready.
          17. Congratulations! Your new Oracle Database is up and ready for use.

          Conclusion

          Now that your database is up and running, you can begin exploring the many new features offered in Oracle Database 10g Release 2. A great place to start is Oracle Enterprise Manager, which has been completely re-written with a crisp new Web-based interface. If you're unsure where to begin, the Oracle Database Concepts 10g Release 2 and the 2-Day DBA Guide will help familiarize you with your new database. OTN also has a number of guides designed to help you get the most out of Oracle Database 10g Release 2. 


          Appendix

          Accessing the Database with SQL*Plus

          Log into Linux as oracle. Set the environment.

          Set the Oracle environment variables:

          $ . oraenv
          ORACLE_SID = [oracle] ? demo1

          Run SQL*Plus:

          $ sqlplus

          SQL*Plus: Release 10.2.0.1.0 - Production on Sun Nov 27 15:40:29 2005

          Copyright (c) 1982, 2005, Oracle. All rights reserved.

          Enter user-name: / as sysdba

          Connected to:
          Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
          With the Partitioning, OLAP and Data Mining options

          SQL>

          Using Oracle Enterprise Manager 10g Database Control

          In a Web browser, connect to the URL provided during the installation.

          Ex:
          http://ds1.orademo.org:1158/em (You may have to use the IP address instead of the host name if your database server isn’t in your DNS.)

          User Name: SYS
          Password: <The password you chose during installation>
          Connect As: SYSDBA

          Click on <Login>


          Welcome to the world of Oracle Enterprise Manager 10g Database Control!

          Starting and Stopping Oracle Enterprise Manager Database Control:

          $ emctl start dbconsole
          $ emctl stop dbconsole

          Accessing the Database Using iSQL*Plus

          iSQL*Plus is a Web-based version of the venerable SQL*Plus interactive tool for accessing databases. To use iSQL*Plus, click on the iSQL*Plus link in the Related Links section of the OEM console or point your browser to the iSQL*Plus URL provided during installation.

          Ex:
          http://ds1.orademo.org:5560/isqlplus (You may have to use the IP address instead of the host name if your database server isn’t in your DNS.)

          User Name: SYSTEM
          Password: <The password you chose during installation>

          Click on <Login>.

          Enter SQL commands in the Workspace box, and click on Execute.


          Starting and Stopping iSQL*Plus:

          $ isqlplusctl start
          $ isqlplusctl stop

          Starting and Stopping the Listener:

          The listener accepts connection requests from clients and creates connections to the database once the credentials have been authenticated. Before you can use OEM or iSQL*Plus, the listener must be up.

          $ lsnrctl start
          $ lsnrctl stop

          Starting and Stopping the Database:

          The easiest way to start and stop the database is from the OEM Console. To do that from the command line, use SQL*Plus while logged in as oracle, as follows:

          Startup:

          $ sqlplus

          SQL*Plus: Release 10.2.0.1.0 - Production on Sun Nov 27 15:39:27 2005

          Copyright (c) 1982, 2005, Oracle. All rights reserved.

          Enter user-name: / as sysdba
          Connected to an idle instance.

          SQL> startup
          ORACLE instance started.

          Total System Global Area 285212672 bytes
          Fixed Size 1218968 bytes
          Variable Size 96470632 bytes
          Database Buffers 180355072 bytes
          Redo Buffers 7168000 bytes
          Database mounted.
          Database opened.

          SQL> exit

          Shutdown:

          $ sqlplus

          SQL*Plus: Release 10.2.0.1.0 - Production on Sun Nov 27 15:40:29 2005

          Copyright (c) 1982, 2005, Oracle. All rights reserved.

          Enter user-name: / as sysdba

          Connected to:
          Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
          With the Partitioning, OLAP and Data Mining options

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

          SQL> exit
          반응형
          Posted by [PineTree]
          ORACLE/ADMIN2007. 2. 24. 05:55
          반응형

          DB10g 아카이브 로그 파일관리
          ==========================

          현상> 갑자기 db가 멈추는 현상 발생 abort로 죽이고 다시 살리면 다음과 같은 에러 발생

          SQL> alter database open;
          alter database open
          *
          ERROR at line 1:
          ORA-16038: log 2 sequence# 618 cannot be archived
          ORA-19809: limit exceeded for recovery files
          ORA-00312: online log 2 thread 1:
          '/home01/oracle/ocs/oradata/OCSD/onlinelog/o1_mf_2_1k7xomh4_.log'
          ORA-00312: online log 2 thread 1:
          '/home02/oracle/ocs/infra/flash_recovery_area/OCSD/onlinelog/o1_mf_2_1k7xormv_.log'

           

          ========================================================================


          #### 조치하는 법


          1) db_recovery_file_dest_size를 증가시켜 주면 된다. 바로 반영됩니다.

              SQL> alter system set db_recovery_file_dest_size=xG;

           

          2) Stop using the db_recovery_file_dest by unsetting the parameter.
             ( This assumes you never really wanted to use this option )

           

          3)  rman repository/Controlfile 에서 엔트리들을 삭제한다.

          SQL> conn / as sysdba
          SQL> SELECT * FROM V$RECOVERY_FILE_DEST;

                   위의 명령으로 조회해 보면 최대치 까지 로그가 쌓인것을 알 수 있음.

           

          다음과 같이 조치한다.

          RMAN 사용해서 ARCHIVE LOG 삭제

          #$ORACLE_HOME/bin/rman

           

          RMAN> connect target /

          RMAN> LIST ARCHIVELOG LIKE '%.arc';

          RMAN> DELETE ARCHIVELOG LIKE '%.arc';

          3일치 아카이브로그 남겨두고 지우기

          RMAN> delete archivelog all completed before 'sysdate -3';

           

          하나씩 지우는게 번거러울 경우 아래와 같이 한번에 지우는 방법도 있음.

          1. os 상에서 우선 파일을 삭제한다.

             # cd $ORACLE_BASE/flash_recovery_area/$ORACLE_SID/archivelog/yyyy_mm_dd

             # rm -r $ORACLE_BASE/flash_recovery_area/$ORACLE_SID/archivelog/'삭제할 디렉토리명'

          2. RMAN을 실행한다.

            # $ORACLE_HOME/bin/rman

            RMAN>connect target /

            RMAN>crosscheck archivelog all; -> marks the controlfile that the archives have been deleted

            RMAN>delete expired archivelog all; -> deletes the log entries identified above

          반응형
          Posted by [PineTree]
          ORACLE/ADMIN2007. 2. 13. 00:56
          반응형

          캐릭터셋 변경의 실제

          ALTER DATABASE 명령을 이용한 딕셔너리 변경

          앞서 살펴본 "변경 케이스 1"에 해당하는 것으로 데이타에 대한 어떠한 검토나 수정은 없이 딕셔너리의 캐릭터셋 정보만을 교체하는 작업이다. KO16KSC5601을 KO16MSWIN949로 변경할 때 유용하다. 그리고 한글만을 저장해 온 US7ASCII 데이타베이스 또한 이 방식으로 KO16MSWIN949로 변경할 수 있다.

          절차

           SQL> SHUTDOWN IMMEDIATE;
          <do a full backup>
          SQL> STARTUP MOUNT;
          SQL> ALTER SYSTEM ENABLE RESTRICTED SESSION;
          SQL> ALTER SYSTEM SET JOB_QUEUE_PROCESSES=0;
          SQL> ALTER SYSTEM SET AQ_TM_PROCESSES=0;
          SQL> ALTER DATABASE OPEN;
          SQL> ALTER DATABASE CHARACTER SET KO16MSWIN949;
          SQL> SHUTDOWN IMMEDIATE;
          SQL> STARTUP;

          SQL> SHUTDOWN IMMEDIATE;
          Database closed.
          Database dismounted.
          ORACLE instance shut down.
          SQL> startup mount
          ORACLE instance started.

          Total System Global Area  171966464 bytes
          Fixed Size                   777956 bytes
          Variable Size             145760540 bytes
          Database Buffers           25165824 bytes
          Redo Buffers                 262144 bytes
          Database mounted.
          SQL> ALTER SYSTEM ENABLE RESTRICTED SESSION;

          System altered.

          SQL> ALTER SYSTEM SET JOB_QUEUE_PROCESSES=0
            2  ;

          System altered.

          SQL> ALTER SYSTEM SET AQ_TM_PROCESSES=0;

          System altered.

          SQL> ALTER DATABASE OPEN
            2  ;

          Database altered.

          SQL> ALTER DATABASE CHARACTER SET KO16MSWIN949;

          Database altered.

          -- 한편 현재 캐릭터셋의 Superset이 아닌 캐릭터셋으로는 변경이 불가능하다.

          SQL> ALTER DATABASE CHARACTER SET WE8DEC;
          ALTER DATABASE CHARACTER SET WE8DEC
          *
          ERROR at line 1:
          ORA-12712: new character set must be a superset of old character set

          -- 다시 데이타베이스를 재구동하면 이제 어엿한 KO16MSWIN949 데이타베이스가 되어 있다.

          C:\Documents and Settings\jwryoo>set NLS_LANG=.KO16MSWIN949

          C:\Documents and Settings\jwryoo>sqlplus scott/tiger@KSC5601

          SQL> select sval from t;

          SVAL
          ---------------
          커피숖

          변경 후에는 이제 exp/imp를 이용하여 UTF8 데이타베이스로 마이그레이션하는 것도 가능해진다.

          이 방식을 사용하려면 반드시 새로운 캐릭터셋은 기존 캐릭터셋의 Superset이어야 한다. 그렇지 않으면 기존 데이타의 안전이 보장될 수 없기 때문이다.

          기존 캐릭터셋
          새로운 캐릭터셋
          변경 가능 여부
          US7ASCII
          KO16KSC5601/KO16MSWIN949/UTF8/AL32UTF8
          가능
          KO16KSC5601
          KO16MSWIN949
          가능
          KO16MSWIN949
          UTF8
          불가능
          UTF8
          AL32UTF8
          가능

          강제로 캐릭터셋을 변경하는 옵션 또한 알려져 있으나, 이 지면에 소개할 수 없는 점 양해 바란다. 간단하지만 극히 위험한 작업이다. 이미 강조했지만, 반드시 오라클 엔지니어나 오라클과 지원계약을 맺은 고객의 담당자가 충분히 그 위험성과 방법에 대해 숙지한 후에 작업할 수 있따는 것을 명심하기 바란다.
          반응형
          Posted by [PineTree]
          ORACLE/Migration2007. 2. 12. 20:32
          반응형
          2G 넘는 파일의 export/import(Unix)

          대부분의 오라클 버전에서 파일을 export할 때 default file open API를 사용하므로 2G가 넘는 파일에 대해서는 export가 불가능 하게 되며 다음과 같은 오류를 보실 것입니다.


          . . exporting table                   BIGEXPORT
                    EXP-00015: error on row 10660 of table BIGEXPORT, 
                            column MYCOL, datatype 96
                    EXP-00002: error in writing to export file
                    EXP-00002: error in writing to export file
                    EXP-00000: Export terminated unsuccessfully


          환경에서 export시 2G의 한계를 극복하기 위한 여러 옵션이 있는데 다음과 같습니다.

          -        raw device인 경우 2G의 한계를 극복할 수 있습니다. 물론 raw device는 그안에 export가 가능하도록 충분히 크게 구성되어야 합니다. (raw device에 관해서는 Oracle Tip에 구현 방법이 나와 있습니다.)
          -        named pipe를 통해 export, DBA는 compress, zip, split를 이용하여 export/import가 가능 합니다.
          -        Tape 장치에 export 합니다.
          -        Oracle 8i에서는 multi export file을 지원 합니다. (큰것 하나 보다는 잘게 쪼갠 여러 파일)

          아래에 unix 환경에서는 split, compress, named pipe등을 이용하여 2G의 export/import한 예가 있으니 참고 바랍니다.

          =====================================================

          Example Export/Import using Compress and Split Export
          #!/bin/ksh

          # +---------------------------------------+
          # | Change directory to the EXPORT_DIR.   |
          # +---------------------------------------+
          cd /u03/app/oradata/RCVCATDB/export
          pwd

          # +---------------------------------------+
          # | Remove previous pipes (if any)        |
          # +---------------------------------------+
          rm -f compress_pipe
          rm -f export_pipe

          # +---------------------------------------+
          # | Make two new pipes (Compress / Split) |
          # +---------------------------------------+
          mknod compress_pipe p
          mknod export_pipe p
          chmod 666 export_pipe compress_pipe

          # +---------------------------------------+
          # | Start both the Split and Compress     |
          # | backgroud processes.                  |
          # +---------------------------------------+
          nohup split -b 1024m < export_pipe &
          nohup compress < compress_pipe > export_pipe &

          # +---------------------------------------+
          # | Finally, start the export to both     |
          # | pipes.                                |
          # +---------------------------------------+
          exp userid=/ file=compress_pipe full=yes log=exportRCVCATDB.log

          # +---------------------------------------+
          # | Remove the pipes.                     |
          # +---------------------------------------+
          rm -f compress_pipe
          rm -f export_pipe
          Import
          #!/bin/ksh
          # +---------------------------------------+
          # | Change directory to the EXPORT_DIR.   |
          # +---------------------------------------+
          cd /u03/app/oradata/RCVCATDB/export
          pwd

          # +---------------------------------------+
          # | Remove previous pipe (if any)         |
          # +---------------------------------------+
          rm -f import_pipe

          # +---------------------------------------+
          # | Make two new pipes (Compress / Split) |
          # +---------------------------------------+
          mknod import_pipe p
          chmod 666 import_pipe

          # +---------------------------------------+
          # | Start both the Uncompress             |
          # | backgroud processes.                  |
          # | This example assumes the export script|
          # | (above) created three dump files xaa, |
          # | xab and xac.                          |
          # +---------------------------------------+
          nohup cat xaa xab xac | uncompress - > import_pipe &

          imp userid=/ file=import_pipe full=yes ignore=yes log=importRCVCATDB.log

          # +---------------------------------------+
          # | Remove the pipe.                      |
          # +---------------------------------------+
          rm -f import_pipe
          Example Export/Import using only Split
          Export
          #!/bin/ksh

          # +---------------------------------------+
          # | Change directory to the EXPORT_DIR.   |
          # +---------------------------------------+
          cd /u03/app/oradata/RCVCATDB/export
          pwd

          # +---------------------------------------+
          # | Remove previous pipes (if any)        |
          # +---------------------------------------+
          rm -f export_pipe

          # +---------------------------------------+
          # | Make new pipe (Split)                 |
          # +---------------------------------------+
          mknod export_pipe p
          chmod 666 export_pipe

          # +---------------------------------------+
          # | Start the Split backgroud process.    |
          # +---------------------------------------+
          nohup split -b 1024m < export_pipe &

          # +---------------------------------------+
          # | Finally, start the export to both     |
          # | pipes.                                |
          # +---------------------------------------+
          exp userid=/ file=export_pipe full=yes log=exportRCVCATDB.log

          # +---------------------------------------+
          # | Remove the pipe.                      |
          # +---------------------------------------+
          rm -f export_pipe
          Import
          #!/bin/ksh
          # +---------------------------------------+
          # | Change directory to the EXPORT_DIR.   |
          # +---------------------------------------+
          cd /u03/app/oradata/RCVCATDB/export
          pwd

          # +---------------------------------------+
          # | Remove previous pipe (if any)         |
          # +---------------------------------------+
          rm -f import_pipe

          # +---------------------------------------+
          # | Make new pipe (Split)                 |
          # +---------------------------------------+
          mknod import_pipe p
          chmod 666 import_pipe

          # +---------------------------------------+
          # | Start the Split backgroud processes.  |
          # | This example assumes the export script|
          # | (above) created three dump files xaa, |
          # | xab and xac.                          |
          # +---------------------------------------+
          nohup cat xaa xab xac > import_pipe &

          imp userid=/ file=import_pipe full=yes ignore=yes log=importRCVCATDB.log

          # +---------------------------------------+
          # | Remove the pipe.                      |
          # +---------------------------------------+
          rm -f import_pipe

          출처 : Tong - 泫盛님의 Oracle통

          반응형
          Posted by [PineTree]