在 Linux x86 上安裝 Oracle 資料庫 10g_3

來源:互聯網
上載者:User
 

啟動 Oracle 通用安裝程式。

$ ./runInstaller

1.      歡迎

o        單擊 Next

2.      指定清單目錄和認證

o        如果您一直在依循本指南中的步驟,則使用預設值即可。否則,編輯清單目錄的路徑,以指向正確目錄。

o        作業系統組名稱應為 oinstall

3.      如果這是首次在此機器上安裝 Oracle,則您將收到一個快顯視窗,提示需要以 root 使用者身份運行 orainstRoot.sh 指令碼。以 root 使用者身份登入,更改到視窗中指定的目錄,執行該指令碼,然後繼續操作。

4.      指定檔案位置

o        如果您一直在依循本指南中的步驟,則使用預設值即可。否則,在繼續操作前確保源路徑和目標路徑正確。

5.      選擇安裝類型

o        接受預設值 Enterprise Edition

6.      與特定產品相關的先決條件的檢查

o        如果您一直在依循本指南中的步驟,則所有檢查都應順利通過。如果一個或多個檢查失敗,則在繼續操作前糾正該問題。

7.      選擇資料庫配置

o        接受預設值 Create a starter databaseGeneral Purpose

8.      指定資料庫配置選項

o        輸入資料庫的全域資料庫名稱。該名稱應包含 ORACLE_SID 和伺服器網域名稱(例如,demo1.orademo.org,其中 demo1 是 ORACLE_SID,orademo.org 是網域名稱)。

o        輸入全域資料庫名稱時,SID 框將自動填滿。

o        接受預設的資料庫字元集。

o        選擇 Create database with sample schemas

9.      選擇資料庫管理選項

o        選擇 Use Database Control for Database Management

10.   指定資料庫檔案儲存選項

o        選擇 File System,然後輸入資料庫檔案要使用的路徑名(在本例中為 /u02/oradata)。

11.   指定備份和復原選項

o        選擇 Do not enable Automated backups

12.   指定資料庫模式口令

o        選擇 Use the same password for all the accounts

o        選擇一個口令,然後輸入兩次進行確認。

13.   摘要

o        顯示已安裝產品的摘要。

o        單擊 Install

14.   安裝

o        此螢幕曆經安裝和連結 Oracle 軟體的幾個階段。

o        安裝過程結束時彈出一個視窗顯示配置資訊。記下 Enterprise Manager URL,然後單擊 OK 關閉該視窗。

o        彈出一個“Setup Privileges”視窗,提示需要以 root 使用者身份回合組態指令碼。以 root 使用者身份登入,切換到該視窗中指示的目錄,然後執行 root.sh 指令碼。該指令碼提示輸入本地 bin 目錄的位置。按 Enter 鍵接受預設值。當指令碼完成時,返回到 Setup Privileges 視窗並單擊 OK。(如下所示。)

15.   安裝結束

o        記下摘要中顯示的 URL,並在準備好時單擊 Exit

16.   恭喜!您的新 Oracle 10g 資料庫已經啟動並可以使用。

第 4 部分:配置儲存

我們在第 3 部分中建立的資料庫使用單一檔案系統 (/u02/oradata) 進行磁碟儲存。但為 Oracle 資料庫配置儲存的方式有多種。

第 4 部分介紹了為此資料庫配置磁碟儲存的其他方法。尤其是,它描述了如何建立其他檔案系統以及如何使用自動儲存管理 (ASM)。如何使用原始裝置和 Oracle 叢集檔案系統 (OCFS) 將在本系列的另一篇文章中介紹,該篇文章介紹了如何使用 Oracle 真正應用叢集 (RAC) 建立叢集資料庫。

檔案系統

檔案系統是為 Oracle 資料庫儲存資料檔案、重做日誌和控制檔案最常用的方法。檔案系統易於實施,並且無需第三方軟體來管理。

大多數情況下,檔案系統在 Linux 的初始安裝過程中建立。但有時必須在初始安裝後(如安裝新磁碟機後)建立新檔案系統。

本部分介紹了如何構建新檔案系統以及如何在 Oracle 資料庫中使用它。除非另有說明,否則必須以 root 使用者身份運行所有命令。

對磁碟進行分區

必須使用空磁碟分割來建立檔案系統。如果已經有一個空的可用的磁碟分區,則跳到下一步。

以下是一個為 Linux 檔案系統建立新分區的樣本。(警告:對磁碟進行錯誤分區是刪除硬碟上所有內容的最可靠、最快捷的方法之一。如果不確定如何分區,請先停下來,找人幫幫您,否則您將冒遺失資料的危險。)

此樣本使用 /dev/sdb(一個沒有分區的空 SCSI 磁碟)為整個磁碟 (36 GB) 建立單個分區。

例如:

# 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 otherOSs

(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.

現在驗證新分區:

例如:

# fdisk /dev/sdb

 

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 otherOSs

(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

/dev/sdb1             1      4427 35559846   83 Linux

 

Command (m for help):q

建立檔案系統

使用 ext3 建立這個新的檔案系統。也可以使用其他檔案系統,但 ext3 在系統崩潰時可提供最快的恢複。

例如:

# 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.

建立掛載點

檔案系統必須有一個掛載點,它只是一個空的目錄,新檔案系統在這裡與系統分類樹“相連”。掛載點的命名應遵循 Oracle 靈活結構 (OFA) 標準。有關 OFA 標準的更多資訊,請參閱 Oracle 10g 資料庫安裝指南 的附錄 D。

由於您已經在第 1 部分中使用了 /u01 和 /u02 目錄名稱,因此在本樣本中使用 /u03。

例如:

# mkdir /u03

將新檔案系統添加到 /etc/fstab

因此新檔案系統將在系統啟動時自動掛載,您需要向描述新檔案系統及其安裝位置的 /etc/fstab 檔案中添加一行。使用文字編輯器向 /etc/fstab 中添加如下所示的一行。

/dev/sdb1         /u03           ext3    defaults       1 1

掛載新檔案系統

檔案系統掛載後就可以使用了。只有掛載了檔案系統,才能在其中隱藏檔。使用以下命令掛載檔案系統並驗證它是否可用。

mount /u03

df -h /u03

 

例如:

# mount /u03

# df -h /u03

Filesystem            Size Used Avail Use% Mounted on

/dev/sdb1             33G   33M 31G   1%   /u03

建立 Oracle 目錄並設定許可權

現在,建立一個用於存放 Oracle 檔案的目錄。該樣本中使用的目錄名遵循資料庫的 OFA 標準命名慣例,即 ORACLE_SID=demo1。

mkdir -p /u03/oradata/demo1

chown -R oracle:oinstall /u03/oradata

chmod -R 775 /u03/oradata

在新檔案系統中建立一個新資料表空間

新檔案系統已可以使用。接下來,在檔案系統中建立一個用於儲存資料庫物件的新資料表空間。以 SYSTEM 使用者身份串連到資料庫,然後執行 CREATE TABLESPACE 語句,並在新檔案系統中指定資料檔案。

例如:

$ sqlplus

 

SQL*Plus:Release 10.1.0.2.0 - Production on Sun Jun 13 15:01:08 2004

 

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

 

Enter user-name:system

Enter password:

 

Connected to:

Oracle Database 10gEnterprise Edition Release 10.1.0.2.0 - Production

With the Partitioning, OLAP and Data Mining options

 

SQL> create tablespace data1

2 datafile '/u03/oradata/demo1/data1_01.dbf' size 100M

3 extent management local

4 segment space management auto;

 

Tablespace created.

現在,可以使用此新資料表空間儲存資料庫物件,如表和索引。

例如:

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.

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.