亚洲免费在线-亚洲免费在线播放-亚洲免费在线观看-亚洲免费在线观看视频-亚洲免费在线看-亚洲免费在线视频

在 Rhel Linux 5.1 (32 位)上安裝 Oracle ASM

系統 1826 0

第 4 部分:配置存儲
為了使用文件系統或 ASM,您必須有未分配的磁盤分區。該部分將介紹如何創建新文件系統或 ASM 使用的分區。
使用 /dev/sda(/dev/sdb,/dev/sdc)(一個沒有分區的空磁盤)為整個磁盤創建一個分區。
Oracle 建議每個磁盤僅包含一個分區
[root@db ~]# fdisk /dev/sdb

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

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

Calling ioctl() to re-read partition table.
Syncing disks.
[root@db ~]# fdisk /dev/sdc

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

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

Calling ioctl() to re-read partition table.
Syncing disks.
[root@db ~]# fdisk /dev/sdd

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

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

Calling ioctl() to re-read partition table.
Syncing disks.
現在驗證新分區:
Ex:
[root@db ~]# fdisk -l /dev/sdc
Disk /dev/sdc: 2147 MB, 2147483648 bytes
255 heads, 63 sectors/track, 261 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot????? Start???????? End????? Blocks?? Id System
/dev/sdc1?????????????? 1???????? 261???? 2096451?? 83 Linux
對每個要分區的磁盤重復上述步驟。


第 5 部分: 安裝Oracle ASMLib
安裝:
$su –
# rpm -Uvh oracleasm-support-2.0.4-1.el5.i386.rpm
# rpm -Uvh oracleasm-2.6.18-53.el5xen-2.0.4-1.el5.i686.rpm
# rpm -Uvh oracleasmlib-2.0.3-1.el5.i386.rpm
配置ASMLib:
[root@db Server]# /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) [y]:
Fix permissions of Oracle ASM disks on boot (y/n) [y]:
Writing Oracle ASM library driver configuration: [ OK ]
Scanning system for ASM disks: [ OK ]
以上操作將加載oracleasm.o 驅動,并且mount 上ASM 文件系統,同時我們可以通過以
下命令來手工的卸載和加載ASMLib
[root@db Server]# /etc/init.d/oracleasm disable
Writing Oracle ASM library driver configuration: [ OK ]
Unmounting ASMlib driver filesystem: [ OK ]
Unloading module "oracleasm": [ OK ]
[root@db Server]# /etc/init.d/oracleasm enable
Writing Oracle ASM library driver configuration: [ OK ]
Loading module "oracleasm": [ OK ]
Mounting ASMlib driver filesystem: [ OK ]
Scanning system for ASM disks: [ OK ]
[root@db Server]#

添加init 文件使系統啟動時自動加載ASMLib
$ su –
# cd /etc/rc3.d
# ln -s ../init.d/oracleasm S99oracleasm
# ln -s ../init.d/oracleasm K01oracleasm
注意:如果系統啟動是自動進入圖形界面,也就是系統的init level 是5,那么上面生成鏈
接的命令應該在/etc/rc5.d 目錄中操作。
重新啟動系統,確認ASMLib 已經可以自動加載
#lsmod | grep oracleasm
oracleasm 14224 1
#dmesg | grep oracleasm
ASM: oracleasmfs mounted with options: <defaults>

通過以 root 用戶身份運行以下命令來標記 ASMLib 使用的磁盤:
/etc/init.d/oracleasm createdisk DISK_NAME device_name
提示:DISK_NAME 應由大寫字母組成。
[root@db ~]# /etc/init.d/oracleasm createdisk VOL1 /dev/sdc1
Marking disk "/dev/sdc1" as an ASM disk: [ OK ]
[root@db ~]# /etc/init.d/oracleasm createdisk VOL2 /dev/sdd1
Marking disk "/dev/sdd1" as an ASM disk: [ OK ]
[root@db ~]# /etc/init.d/oracleasm listdisks
VOL1
VOL2
如果要刪除ASM 磁盤通過以下命令:
# /etc/init.d/oracleasm deletedisk VOL4
注意:如果是在RAC 環境中的某一個節點中添加了ASM 磁盤,那么需要在其它的節點上
運行scandisk 來獲取這種變化。
[root@db ~]# /etc/init.d/oracleasm scandisks
Scanning system for ASM disks: [ OK ]


第 6 部分:安裝 Oracle
配置ORACLE環境變量
雙擊打開 .bash_profile添加以下行,將 ORACLE_BASE 添加到登錄配置文件:
#su - oracle
$vi .bash_profile

ORACLE_BASE=/u01/app/oracle;
export ORACLE_BASE
ORACLE_SID=oradb;
export ORACLE_SID
ORACLE_HOME=$ORACLE_BASE/product/11.1.0/db_1;
export ORACLE_HOME
PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin;
export PATH
umask 022

安裝Oracle10g
在安裝Oracle10g 的時候,我們選擇不創建數據庫,只安裝軟件的方式,在軟件安裝結束
以后再通過dbca 來創建ASM 實例和數據庫。

以 oracle 身份登錄并啟動 runInstaller:
$ ./runInstaller
1. 選擇安裝方式
選擇 Advanced Installation。
單擊 Next
2. 指定清單目錄和憑證
清單目錄:/u01/app/oraInventory
操作系統組名:oinstall
單擊 Next
3. 選擇安裝類型
選擇 Enterprise Edition
單擊 Next
4. 安裝位置
Oracle Base:/u01/app/oracle
名稱: OraDB11gASM
路徑:/u01/app/oracle/product/11.1.0/asm
注意:為了便于管理,Oracle 建議 ASM 使用與數據庫不同的 ORACLE_HOME。
單擊 Next
5. 產品特定的前提條件檢查
如果您一直在依循本指南中的步驟,則所有檢查都應順利通過。如果一個或多個檢查失敗,應在繼續操作前糾正該問題。
單擊 Next
6. 選擇配置選項
選擇 Install Software Only
單擊 Next
7. 特權操作系統組
數據庫操作員 (OSDBA) 組:dba
數據庫操作員 (OSOPER) 組:dba
ASM 管理員 (OSASM) 組:dba
單擊 Next
8. 總結
顯示已安裝產品的摘要。
單擊 Install。
9. 安裝
將顯示安裝進度
10. 執行配置腳本
在安裝的結尾,將彈出一個窗口,提示需要以 root 用戶身份運行腳本。以 root 用戶身份登錄,運行提示的腳本。
[root@db /]# /u01/app/oraInventory/orainstRoot.sh
[root@db /]# /u01/app/oracle/product/11.1.0/db_1/root.sh
完成后單擊 OK。
11. 安裝結束
單擊 Exit

創建ASM 實例
1. 創建初始化文件
$ su – oracle
$ cd $ORACLE_HOME/dbs
$ vi init+ASM.ora
創建asm 實例的初始化腳本,腳本內容如下所示:
說明 /u01/app/oracle?? 是$ORACLE_BASE目錄
# ******Below is init script for asm instance******
*.asm_diskstring='ORCL:VOL*'
*.background_dump_dest='/u01/app/oracle/admin/+ASM/bdump'
*.core_dump_dest='/u01/app/oracle/admin/+ASM/cdump'
*.instance_type='asm'
*.large_pool_size=12M
*.remote_login_passwordfile='SHARED'
*.user_dump_dest='/u01/app/oracle/admin/+ASM/udump'

# ******Above is init script for asm instance******
說明:
1. dump 目錄指向$ORACLE_BASE/<sid>,本文中ASM 實例的SID 是+ASM。最好
不要修改這個實例名,否則在下一步用dbca 創建數據庫的時候,dbca 將找不到可用的磁
盤組,我想這應該是dbca 的一個bug,手工創建ASM 類型的數據庫就應該沒有這個限制
了。
2. asm_diskstring 用于實例啟動的時候檢查可用的ASM 磁盤,由于我們前面創建ASM
磁盤的名稱是VOL1 到VOL4,所以我們此處使用*通配符,前面的’ORCL:’不可以省略,
否則ASM 實例將無法檢查到磁盤。
2. 創建密碼文件
$ su – oracle
$ cd $ORACLE_HOME/dbs
[oracle@db dbs]$ orapwd file=orapw+ASM password=dba
[oracle@db dbs]$ ls -l
total 36
-rw-r--r-- 1 oracle oinstall?? 272 Apr 18 21:04 init+ASM.ora
-rw-r--r-- 1 oracle oinstall 12920 May 3 2001 initdw.ora
-rw-r--r-- 1 oracle oinstall 8385 Sep 11 1998 init.ora
-rw-r----- 1 oracle oinstall 1536 Apr 18 21:08 orapw+ASM

3. 創建目錄結構
$ su – oracle
$ cd $ORACLE_HOME/dbs
[oracle@db dbs]$ mkdir -p $ORACLE_BASE/admin/+ASM/udump
[oracle@db dbs]$ mkdir -p $ORACLE_BASE/admin/+ASM/bdump
[oracle@db dbs]$ mkdir -p $ORACLE_BASE/admin/+ASM/cdump
4. 啟動實例
$ export ORACLE_SID=+ASM
$ sqlplus / as sysdba
SQL> startup
ASM instance started
Total System Global Area 100663296 bytes
Fixed Size 777616 bytes
Variable Size 99885680 bytes
Database Buffers 0 bytes
Redo Buffers 0 bytes

--說明下面的解決辦法是10G里面有效
--如果啟動實例的時候碰到如下報錯:
--ORA-29701: unable to connect to Cluster Manager
--那么請檢查/etc/inittab 文件,看看是否有下面這行
--h1:35:respawn:/etc/init.d/init.cssd run >/dev/null 2>&1 </dev/null
--如果沒有請添加,如果被注釋了請取消注釋。

ORA-32004: obsolete and/or deprecated parameter(s) specified
ORA-29701: unable to connect to Cluster Manager
你先用dbca創建asm類型的數據庫,做到第六步是生成init.cssd的,你生成后退出
[root@db etc]# /u01/app/oracle/product/11.1.0/db_1/bin/localconfig add
/etc/oracle does not exist. Creating it now.
Successfully accumulated necessary OCR keys.
Creating OCR keys for user 'root', privgrp 'root'..
Operation successful.
Configuration for local CSS has been initialized
Cleaning up Network socket directories
Setting up Network socket directories
Adding to inittab
Startup will be queued to init within 30 seconds.
Checking the status of new Oracle init process...
Expecting the CRS daemons to be up within 600 seconds.
Cluster Synchronization Services is active on these nodes.
db
Cluster Synchronization Services is active on all the nodes.
Oracle CSS service is installed and running under init(1M)

11g中ASM SYS應該用sqlplus / as sysasm進行連接
[oracle@db ~]$ sqlplus / as sysdba
Connected to an idle instance.
SQL> startup
ORA-32004: obsolete and/or deprecated parameter(s) specified
ASM instance started

Total System Global Area 284565504 bytes
Fixed Size????????????????? 1299428 bytes
Variable Size???????????? 258100252 bytes
ASM Cache????????????????? 25165824 bytes
ORA-15110: no diskgroups mounted
解決錯誤ORA-32004: obsolete and/or deprecated parameter(s) specified
SQL> shutdown
ORA-15100: invalid or missing diskgroup name


ASM instance shutdown
SQL> startup pfile=$ORACLE_HOME/dbs/init+ASM.ora
ORA-32006: BACKGROUND_DUMP_DEST initialization parameter has been deprecated
ORA-32006: USER_DUMP_DEST initialization parameter has been deprecated
ASM instance started
Total System Global Area 284565504 bytes
Fixed Size????????????????? 1299428 bytes
Variable Size???????????? 258100252 bytes
ASM Cache????????????????? 25165824 bytes
ORA-15110: no diskgroups mounted
修改參數文件
[oracle@db ~]$ cd $ORACLE_HOME/dbs
[oracle@db dbs]$ vi init+ASM.ora

*.asm_diskstring='ORCL:VOL*'
#*.background_dump_dest='/u01/app/oracle/admin/+ASM/bdump'
*.core_dump_dest='/u01/app/oracle/admin/+ASM/cdump'
*.instance_type='asm'
*.large_pool_size=12M
*.remote_login_passwordfile='SHARED'
#*.user_dump_dest='/u01/app/oracle/admin/+ASM/udump'
關閉數據庫后再啟動
SQL> shutdown
ORA-15100: invalid or missing diskgroup name
ASM instance shutdown
SQL> startup
ASM instance started
Total System Global Area 284565504 bytes
Fixed Size????????????????? 1299428 bytes
Variable Size???????????? 258100252 bytes
ASM Cache????????????????? 25165824 bytes
ORA-15110: no diskgroups mounted
因為我們是首次啟動asm 實例,還沒有創建diskgroup,所以顯示15110 錯誤是正常的。

5. 創建spfile,重新啟動
SQL> create spfile from pfile;
File created.
SQL> shutdown immediate;
ORA-15100: invalid or missing diskgroup name
ASM instance shutdown
SQL> startup
ASM instance started
Total System Global Area 284565504 bytes
Fixed Size????????????????? 1299428 bytes
Variable Size???????????? 258100252 bytes
ASM Cache????????????????? 25165824 bytes
ORA-15110: no diskgroups mounted

6. 創建diskgroup
--這里第一次我創建不成功重啟動系統
[root@db ~]# su - oracle
[oracle@db ~]$ lsnrctl start
[oracle@db ~]$ export ORACLE_SID=+ASM
[oracle@db ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.1.0.6.0 - Production on Fri Apr 18 23:50:09 2008

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

Connected to an idle instance.

SQL> startup
ORA-29701: unable to connect to Cluster Manager
SQL> conn / as sysasm
Connected to an idle instance.
SQL> startup
ASM instance started

Total System Global Area 284565504 bytes
Fixed Size????????????????? 1299428 bytes
Variable Size???????????? 258100252 bytes
ASM Cache????????????????? 25165824 bytes
ORA-15110: no diskgroups mounted


SQL> create diskgroup dgroup1 normal redundancy
2?? failgroup fgroup1 disk 'ORCL:VOL1','ORCL:VOL2'
3?? failgroup fgroup2 disk 'ORCL:VOL3','ORCL:VOL4';

Diskgroup created.

SQL>

SQL> col name for a10
SQL> select name,state from v$asm_diskgroup;

NAME?????????????????????????? STATE
------------------------------ -----------
DGROUP1??????????????????????? MOUNTED
如果上述命令返回的state 是DISMOUNTED,那么我們需要手工將掛載diskgroup
SQL> ALTER DISKGROUP dgroup1 MOUNT;
Diskgroup altered.
此時檢查數據庫初始化參數,發現asm_diskgroups 參數值已經自動設置為DGROUP1,
這表明在下次啟動asm 實例的時候,這個diskgroup 會被自動掛載。
SQL> col name for a10
SQL> col type for a10
SQL> col value for a20

SQL> show parameter asm_diskgroups

NAME???????????????????????????????? TYPE??????? VALUE
------------------------------------ ----------- ------------------------------
asm_diskgroups?????????????????????? string????? DGROUP1
SQL>
如果要卸載diskgroup,使用下面的命令:
ALTER DISKGROUP ALL DISMOUNT;


創建ASM 數據庫
用dbca 創建數據庫,一直到選擇數據類型的畫面以前都跟創建普通數據庫沒有區別。
1. 選擇配置選項
選擇 Create a Database
單擊 Next
2. 選擇數據庫配置
選擇 General Purpose or Transaction Processing
單擊 Next
3. 指定數據庫配置選項
輸入全局數據庫名稱和 SID (asmdemo)
單擊 Next
4. 選擇數據庫管理選項
選擇 configure enterprise manager
選擇 Use Database Control for Database Management
單擊 Next
5. 指定數據庫模式口令
選擇 Use the same password for all the accounts
輸入口令并確認
單擊 Next
6. 指定數據庫存儲選項
選擇 Automatic Storage Management (ASM)
單擊 Next
7. 指定 ASM的SYS密碼(sys)
單擊 Next
單擊 OK
這里要把數據庫關閉狀態。才可以進行下一步。
SQL> shutdown
ORA-15100: invalid or missing diskgroup name
ASM instance shutdown
SQL> conn / as sysasm
Connected.
SQL> ALTER DISKGROUP dgroup1 MOUNT;

7. 選擇 ASM 磁盤組
選擇在前一部分中創建的 DATA 磁盤組
如果沒有MOUNTED磁盤組,這點擊mount按鈕
單擊 Next

在數據文件的位置管理設定界面,通常應該使用OMF,由oracle 自己管理數據文件的命名,
這樣才算是進一步解放了DBA 對于物理存儲方面的繁瑣工作。
繼續往下的步驟,基本是默認值。跟創建普通數據庫已經沒有什么區別了

8。 選擇Use Oracle-Managed Files +DGROUP1
9. 選擇Specify flash recovery area 和enable archiving 其他的默認。
10. 選擇 sample schemas
11. 在character sets里面選擇 use unicode(AL32UTF8)
12. 選擇keep the enhanced 11g default security settings
13. 選擇enable automatic maintenance tasks
14. 缺省
15. 選擇create database
選擇finish 安裝

啟動ASM 數據庫的步驟
由于啟動ASM 數據庫必須要先啟動ASM 實例,所以基本上啟動步驟如下。
1. 以oracle 用戶進入操作系統
2. $ export ORACLE_SID=+ASM
3. SQL> sqlplus / as sysdba
4. SQL> startup
5. SQL> exit
6. $ export ORACLE_SID=<your_real_db_sid>
7. SQL> sqlplus / as sysdba
8. SQL> startup

在 Rhel Linux 5.1 (32 位)上安裝 Oracle ASM數據庫 11g (第二部分)


更多文章、技術交流、商務合作、聯系博主

微信掃碼或搜索:z360901061

微信掃一掃加我為好友

QQ號聯系: 360901061

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點擊下面給點支持吧,站長非常感激您!手機微信長按不能支付解決辦法:請將微信支付二維碼保存到相冊,切換到微信,然后點擊微信右上角掃一掃功能,選擇支付二維碼完成支付。

【本文對您有幫助就好】

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描上面二維碼支持博主2元、5元、10元、自定義金額等您想捐的金額吧,站長會非常 感謝您的哦?。?!

發表我的評論
最新評論 總共0條評論
主站蜘蛛池模板: 色在线播放 | 精品视频一区在线观看 | 久久不见久久见免费影院 | 久久综合97色综合网 | 91在线看| 久久精品国产乱子伦多人 | 国产亚洲精aa在线观看不卡 | 亚洲欧美精品日韩欧美 | 亚洲一区二区中文 | 波多野结衣二区 | 国内精品日本久久久久影院 | 91精品国产高清久久久久 | 操穴影院| 久久综合九色综合网站 | 老司机激情影院 | 欧美一区二区在线观看视频 | 欧美亚洲一二三区 | 中文字幕视频免费 | 国内主播大秀福利视频在线看 | 一级特黄特黄毛片欧美的 | 亚洲国产综合视频 | 高清在线一区 | 五月亭亭免费高清在线 | 天天射天天搞 | 久久青草免费91观看 | 国产玖玖视频 | 久久久性 | 伊人久久久久久久久香港 | 97精品久久天干天天蜜 | 九九精品久久 | 99久久精品一区二区三区 | 精品视频香蕉尹人在线 | 久久久国产精品免费 | 成年女人免费看一级人体片 | 欧美精品99久久久久久人 | 91糖心 | 久久久久久久久久福利 | 老司机午夜精品视频播放 | 欧美日韩免费大片 | 国产一区二区久久 | 成年女人视频在线观看免费 |