Oracle 10g 安裝及單例項遷移到RAC

tolywang發表於2009-08-06

 

1. 首先準備安裝RAC的軟體:

Red Hat Enterprise Linux Server release 5.3 (Tikanga) X86_64Bit    
Kernel:  2.6.18-128.el5 #1 SMP 
      

ocfs2-2.6.18-128.el5-1.4.1-1.el5.x86_64.rpm      
ocfs2-tools-1.4.1-1.el5.x86_64.rpm       
ocfs2console-1.4.1-1.el5.x86_64.rpm 

      
10201_clusterware_linux_x86_64.cpio         
10201_database_linux_x86_64.cpio       
p6810189_10204_Linux-x86-64.zip    (Including  10204_clusterware) 
升級的時候先升級CRS然後是DB .
 

glibc-2.5-24.x86_64.rpm (rpm -q glibc)  
glibc-common-2.5-24.x86_64 (rpm -q glibc-common)   
glibc-devel-2.5-24.i386.rpm (rpm -q glibc-devel) (此32bit rpm 必須安裝) 
glibc-devel-2.5-24.x86_64.rpm (rpm -q glibc-devel)  
libXp-1.0.0-8.1.el5.i386.rpm (rpm -q libXp)(32bit rpm 必須安裝) 
libXp-1.0.0-8.1.el5.x86_64.rpm (rpm -q libXp) 
binutils-2.17.50.0.6-6.el5.x86_64.rpm (rpm -q binutils)  
compat-db-4.2.52-5.1.x86_64.rpm (rpm -q compat-db)   
control-center-2.16.0-16.el5.x86_64.rpm (rpm -q control-center)   
gcc-4.1.2-42.el5.x86_64.rpm (rpm -q gcc)   
gcc-c++-4.1.2-42.el5.x86_64.rpm (rpm -q gcc-c++)     
libstdc++-4.1.2-42.el5.x86_64.rpm (rpm -q libstdc++) 
libstdc++-devel-4.1.2-42.el5.x86_64.rpm (rpm -q libstdc++-devel)  
make-3.81-3.el5.x86_64.rpm (rpm -q make)     
ksh-20080202-2.el5.x86_64.rpm (rpm -q ksh)   
sysstat-7.0.2-1.el5.x86_64.rpm (rpm -q sysstat)    
gnome-screensaver-2.16.1-8.el5.x86_64.rpm (rpm -q gnome-screensaver)   
libaio-devel-0.3.106-3.2.x86_64.rpm (rpm -q libaio-devel)  
libaio-0.3.106-3.2.x86_64.rpm (rpm -q libaio)   

 

準備安裝前配置引數:


/etc/sysctl.conf 

# Added for Oracle 10g RAC 
kernel.shmall = 16777216      
kernel.shmmax = 68719476736     
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.rmem_max = 262144
net.core.wmem_default = 262144
net.core.wmem_max = 262144

備註: 
Physical Mem = 64G
shmall = shmmax/4K
set   shmmax > sga_max_size 
Note :    4K is linux memory page size

 


2. 安裝完成CRS, Oracle 10.2.0.1 資料庫,開始升級CRS到10.2.0.4,然後升級資料庫到10.2.0.4 ;然後執行NETCA 配置監聽,最後DBCA建庫 。

 

3. 建立使用者使用的Tablespace, 根據不同的靜態及動態表劃分不同的tablespace . 使用者表空間採用LMT本地管理,
使用ASSM 自動管理方式(SEGMENT SPACE MANAGEMENT AUTO),並開啟FLASHBACK . 類似:

CREATE TABLESPACE LOG_DATA DATAFILE
  '/ocfs_data1/mxdell/log_data01.dbf' SIZE 2048064K AUTOEXTEND OFF,
  '/ocfs_data1/mxdell/log_data02.dbf' SIZE 2048064K AUTOEXTEND OFF,
  '/ocfs_data1/mxdell/log_data03.dbf' SIZE 2048064K AUTOEXTEND OFF,
  '/ocfs_data1/mxdell/log_data04.dbf' SIZE 2048064K AUTOEXTEND OFF
LOGGING
ONLINE
PERMANENT
EXTENT MANAGEMENT LOCAL UNIFORM. SIZE 20M
BLOCKSIZE 16K
SEGMENT SPACE MANAGEMENT AUTO
FLASHBACK ON;

 

4.  如果有大資料量Table需要從普通錶轉化為分割槽表,遷移是一個機會。給分割槽表及分割槽索引單獨的表空間。

CREATE TABLESPACE  PART_D_TS1  DATAFILE
  '/ocfs_data1/mxdell/part_d_ts1_1.dbf' SIZE 2048064K AUTOEXTEND OFF,
  '/ocfs_data1/mxdell/part_d_ts1_2.dbf' SIZE 2048064K AUTOEXTEND OFF,
  '/ocfs_data1/mxdell/part_d_ts1_3.dbf' SIZE 2048064K AUTOEXTEND OFF,
  '/ocfs_data1/mxdell/part_d_ts1_4.dbf' SIZE 2048064K AUTOEXTEND OFF
LOGGING
ONLINE
PERMANENT
EXTENT MANAGEMENT LOCAL UNIFORM. SIZE  50M
BLOCKSIZE 16K
SEGMENT SPACE MANAGEMENT AUTO
FLASHBACK ON;


CREATE TABLESPACE  PART_D_TS2  DATAFILE
  '/ocfs_data1/mxdell/part_d_ts2_1.dbf' SIZE 2048064K AUTOEXTEND OFF,
  '/ocfs_data1/mxdell/part_d_ts2_2.dbf' SIZE 2048064K AUTOEXTEND OFF,
  '/ocfs_data1/mxdell/part_d_ts2_3.dbf' SIZE 2048064K AUTOEXTEND OFF,
  '/ocfs_data1/mxdell/part_d_ts2_4.dbf' SIZE 2048064K AUTOEXTEND OFF
LOGGING
ONLINE
PERMANENT
EXTENT MANAGEMENT LOCAL UNIFORM. SIZE  50M
BLOCKSIZE 16K
SEGMENT SPACE MANAGEMENT AUTO
FLASHBACK ON;


5.  建立使用者。

CREATE USER DFMS
  IDENTIFIED BY VALUES 'A52A32FF1E905156'        -- DFMS$MX 
  DEFAULT TABLESPACE LOG_DATA
  TEMPORARY TABLESPACE TEMP
  PROFILE DEFAULT
  ACCOUNT UNLOCK;
  -- 3 Roles for DFMS
  GRANT DBA TO DFMS;
  GRANT CONNECT TO DFMS;
  GRANT RESOURCE TO DFMS;
  ALTER USER DFMS DEFAULT ROLE ALL;
  -- 1 System Privilege for DFMS
  GRANT UNLIMITED TABLESPACE TO DFMS;
  -- 8 Tablespace Quotas for DFMS
  ALTER USER DFMS QUOTA UNLIMITED ON SN_IDX;
  ALTER USER DFMS QUOTA UNLIMITED ON BASE_IDX;
  ALTER USER DFMS QUOTA UNLIMITED ON SN_DATA;
  ALTER USER DFMS QUOTA UNLIMITED ON LOG_IDX;
  ALTER USER DFMS QUOTA UNLIMITED ON WIP_DATA;
  ALTER USER DFMS QUOTA UNLIMITED ON LOG_DATA;
  ALTER USER DFMS QUOTA UNLIMITED ON BASE_DATA;
  ALTER USER DFMS QUOTA UNLIMITED ON WIP_IDX;

  ALTER USER DFMS QUOTA UNLIMITED ON PART_D_TS1;
  ALTER USER DFMS QUOTA UNLIMITED ON PART_I_TS1;
  ALTER USER DFMS QUOTA UNLIMITED ON PART_D_TS2;
  ALTER USER DFMS QUOTA UNLIMITED ON PART_I_TS2;


CREATE USER MES_MX
  IDENTIFIED BY VALUES '65A5BAC4F618E0A3'      --  jrzsfc$pcebg  
  DEFAULT TABLESPACE LOG_DATA
  TEMPORARY TABLESPACE TEMP
  PROFILE DEFAULT
  ACCOUNT UNLOCK;
  -- 1 Role for MES_MX
  GRANT SELECT_CATALOG_ROLE TO MES_MX;
  ALTER USER MES_MX DEFAULT ROLE ALL;
  -- 3 System Privileges for MES_MX
  GRANT DEBUG ANY PROCEDURE TO MES_MX;
  GRANT DEBUG CONNECT SESSION TO MES_MX;
  GRANT CREATE SESSION TO MES_MX;

 


6.  配置spfile重要引數以及修改system , sysaux等表空間屬性 。

db_block_size = 16384
db_files  =  300
db_recovery_file_dest_size = 4G
job_queue_processes  = 50
sga_target  =55G
sga_max_size = 55G
timed_statistics = TRUE
processes = 1500
pga_aggregate_target = 3G
optimizer_mode = ALL_ROWS
optimizer_index_cost_adj  = 100
open_cursors = 600
log_buffer  = 5M
workarea_size_policy = AUTO

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/35489/viewspace-620976/,如需轉載,請註明出處,否則將追究法律責任。

相關文章