建立ASM例項和資料庫
由於ASM例項是工作在Oracle instance上面,因此建立ASM的instance就是我們工作的第一步。
共分六步驟
1.create initial parameter files
2.create orapwd files
3.create the directory structure
4.startup the instance
5.create the spfile and restart the database
6.create the diskgroup
第一步:
建立pfile檔案init_asm.ora
*.asm_diskstring='ORCL:MYVOL*'
*.user_dump_dest='/opt/oracle/admin/ASM/udump'
*.background_dump_dest='/opt/oracle/admin/ASM/bdump'
*.core_dump_dest='/opt/oracle/admin/ASM/cdump'
*.instance_type='asm'
*.large_pool_size=12M
*.remote_login_passwordfile='SHARED'
第二步:
建立密碼檔案:
[oracle@orahost01 dbs]$ orapwd file=orapwdASM password=passsw0rd entries=15
第三步:
建立目錄
[oracle@orahost01 dbs]$ mkdir -p /opt/oracle/admin/ASM/udump
[oracle@orahost01 dbs]$ mkdir -p /opt/oracle/admin/ASM/bdump
[oracle@orahost01 dbs]$ mkdir -p /opt/oracle/admin/ASM/cdump
第四步:
啟動例項
[oracle@orahost01 10g]$ export ORACLE_SID=ASM
[oracle@orahost01 10g]$ sqlplus /nolog
SQL*Plus: Release 10.2.0.1.0 - Production on Mon Dec 31 18:56:24 2007
Copyright (c) 1982, 2005, Oracle. All rights reserved.
SQL> conn / as sysdba;
Connected to an idle instance.
SQL> startup nomount
ORA-29701: unable to connect to Cluster Manager
******************
如果遇到這樣的問題
******************
編輯vi /etc/inittab檔案
新增或取消註釋這一樣
hi:35:respawn:/etc/init.d/init.cssd run > /dev/null 2>&1 < /dev/null
同時我們要保證有css服務的存在,如果沒有的話,需要自己新增:
[oracle@orahost01 10g]$ cd $ORACLE_HOME
[oracle@orahost01 10g]$ cd bin
[oracle@orahost01 bin]$ ./localconfig add
You must be logged in as root to run ./localconfig.
Log in as root and restart ./localconfig execution.
[oracle@orahost01 bin]$ exit
[root@orahost01 bin]# pwd
/opt/oracle/product/10g/bin
[root@orahost01 bin]# ./localconfig add
Successfully accumulated necessary OCR keys.
Creating OCR keys for user 'root', privgrp 'root'..
Operation successful.
Configuration for local CSS has been initialized
Adding to inittab
Startup will be queued to init within 90 seconds.
Checking the status of new Oracle init process...
Expecting the CRS daemons to be up within 600 seconds.
CSS is active on these nodes.
orahost01
CSS is active on all nodes.
Oracle CSS service is installed and running under init(1M)
然後重新啟動,我們再來:
[oracle@orahost01 ~]$ export ORACLE_SID=ASM
[oracle@orahost01 ~]$ sqlplus /nolog
SQL*Plus: Release 10.2.0.1.0 - Production on Mon Dec 31 19:15:58 2007
Copyright (c) 1982, 2005, Oracle. All rights reserved.
SQL> conn / as sysdba;
Connected to an idle instance.
SQL> startup
ASM instance started
Total System Global Area 83886080 bytes
Fixed Size 1217836 bytes
Variable Size 57502420 bytes
ASM Cache 25165824 bytes
ORA-15110: no diskgroups mounted
SQL> select name,state from v$asm_diskgroup;
no rows selected
SQL> quit
第五步:建立spfile
SQL> create spfile from pfile;
File created.
SQL> startup force
ASM instance started
Total System Global Area 83886080 bytes
Fixed Size 1217836 bytes
Variable Size 57502420 bytes
ASM Cache 25165824 bytes
ORA-15110: no diskgroups mounted
第六步:建立磁碟組
[oracle@orahost01 ~]$ export ORACLE_SID=ASM
[oracle@orahost01 ~]$ sqlplus /nolog
SQL*Plus: Release 10.2.0.1.0 - Production on Mon Dec 31 19:29:21 2007
Copyright (c) 1982, 2005, Oracle. All rights reserved.
SQL> conn / as sysdba;
Connected to an idle instance.
SQL> startup
ASM instance started
Total System Global Area 83886080 bytes
Fixed Size 1217836 bytes
Variable Size 57502420 bytes
ASM Cache 25165824 bytes
ORA-15110: no diskgroups mounted
SQL> create diskgroup dgroup1 normal redundancy
2 failgroup fgroup1 disk 'ORCL:MYVOL1','ORCL:MYVOL2'
3 failgroup fgroup2 disk 'ORCL:MYVOL3','ORCL:MYVOL4';
Diskgroup created.
SQL> select disk_number,total_mb,free_mb from v$asm_disk;
DISK_NUMBER TOTAL_MB FREE_MB
----------- ---------- ----------
0 392 362
1 392 369
2 392 364
3 392 367
SQL> select name,state from v$asm_diskgroup;
NAME STATE
------------------------------ -----------
DGROUP1 MOUNTED
當然也可以通過手動方式來mount
SQL> quit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
[oracle@orahost01 dbs]$ sqlplus /nolog
SQL*Plus: Release 10.2.0.1.0 - Production on Mon Dec 31 19:31:46 2007
Copyright (c) 1982, 2005, Oracle. All rights reserved.
SQL> conn / as sysdba;
Connected.
SQL> shutdown abort
ASM instance shutdown
SQL> startup
ASM instance started
Total System Global Area 83886080 bytes
Fixed Size 1217836 bytes
Variable Size 57502420 bytes
ASM Cache 25165824 bytes
ORA-15110: no diskgroups mounted
SQL> alter diskgroup dgroup1 mount;
Diskgroup altered.
SQL> select name,state from v$asm_diskgroup;
NAME STATE
------------------------------ -----------
DGROUP1 MOUNTED
SQL> select instance_name from v$instance;
INSTANCE_NAME
----------------
ASM
SQL> show parameter instance_name;
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
instance_name string ASM
之後我們就可以建立ASM資料庫了。
那麼建立完畢後如何啟動ASM資料庫,則按照如下步驟進行就可以了:
1.啟動ASM例項
2.啟動ASM資料庫的例項
下面是自己另外做的一個小測試,很簡單,備忘吧
[oracle@orahost01 dbs]$ sqlplus /nolog
SQL*Plus: Release 10.2.0.1.0 - Production on Mon Dec 31 20:10:01 2007
Copyright (c) 1982, 2005, Oracle. All rights reserved.
SQL> conn / as sysdba;
Connected to an idle instance.
SQL> startup
ASM instance started
Total System Global Area 83886080 bytes
Fixed Size 1217836 bytes
Variable Size 57502420 bytes
ASM Cache 25165824 bytes
ORA-15110: no diskgroups mounted
SQL> show parameter spfile;
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
spfile string /opt/oracle/product/10g/dbs/sp
fileASM.ora
SQL> show parameter asm_
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
asm_diskgroups string
asm_diskstring string ORCL:MYDISK*
asm_power_limit integer 1
SQL> select name,state from v$asm_diskgroup;
NAME STATE
------------------------------ -----------
ALANGROUP DISMOUNTED
SQL> alter diskgroup alangroup mount;
Diskgroup altered.
SQL> show parameter asm_
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
asm_diskgroups string ALANGROUP
asm_diskstring string ORCL:MYDISK*
asm_power_limit integer 1
SQL>
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/12361284/viewspace-68258/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- oracle資料庫建立資料庫例項-九五小龐Oracle資料庫
- 【資料庫資料恢復】ASM例項不能掛載的Oracle資料庫資料恢復案例資料庫資料恢復ASMOracle
- 【ASK_ORACLE】Relink ASM單例項資料庫詳細步驟OracleASM單例資料庫
- 【資料庫資料恢復】Oracle ASM例項無法掛載的資料恢復案例資料庫資料恢復OracleASM
- JDBC連線MySQL資料庫的方法和例項JDBCMySql資料庫
- 達夢資料庫例項的狀態和模式資料庫模式
- mongodb關閉資料庫例項MongoDB資料庫
- oracle資料庫與oracle例項Oracle資料庫
- RAC+DG(asm單例項)ASM單例
- 資料庫正規化與例項資料庫
- ajax讀取資料庫資料程式碼例項資料庫
- 【Oracle】ASM例項安裝入門OracleASM
- 3.1.5.4 啟動例項並mount 資料庫資料庫
- 3.1.5.1 關於啟動資料庫例項資料庫
- oracle11g單例項透過命令列dbca靜默建立資料庫Oracle單例命令列資料庫
- 2.9 資料庫建立後的狐疑事項資料庫
- 2 建立和配置資料庫資料庫
- SQL建立資料庫和表SQL資料庫
- python中類的建立和例項化Python
- 資料庫例項效能調優利器:Performance Insights資料庫ORM
- 19C 單例項資料庫安裝單例資料庫
- 如何將Azure SQL 資料庫還原到本地資料庫例項中SQL資料庫
- Oracle 例項和RAC叢集下資料庫日誌目錄合集Oracle資料庫
- 呀!ASM例項起不來可咋整ASM
- Python中類建立和例項化過程Python
- 設計模式使用例項(5)——建造者模式例項之資料庫連線管理設計模式資料庫
- Oracle 11G資料庫單例項安裝Oracle資料庫單例
- 列舉資料庫快取使用場景例項和命令速查表資料庫快取
- 關於PHP往mysql資料庫中批次插入資料例項教程PHPMySql資料庫
- 建立資料庫資料庫
- Laravel 2.2 建立 Application 例項LaravelAPP
- java反射方式建立例項Java反射
- 一條SQL完成跨資料庫例項Join查詢SQL資料庫
- oracle 11g 單例項資料庫的安裝Oracle單例資料庫
- ASM單例項安裝後,需要手動設定ASM的引數檔案ASM單例
- Oracle 11gR2 ASM例項記憶體管理OracleASM記憶體
- [20191128]11GR2 asm例項audit檔案.txtASM
- 【資料庫資料恢復】Oracle資料庫ASM磁碟組掉線如何恢復資料?資料庫資料恢復OracleASM
- Oracle資料庫 ASM磁碟線上擴容Oracle資料庫ASM