11G ASM磁盤組不能自動(dòng)MOUNT處理_2

背景:


閱讀新聞

11G ASM磁盤組不能自動(dòng)MOUNT處理

[日期:2016-01-12]

來源:Linux社區(qū)

作者:Linux

[字體:大 中 小]

今天啟動(dòng)了一下ASM,發(fā)現(xiàn)只掛載了一個(gè)SYS_DG磁盤組(用于存放OCR和VOTING DISK信息),另外兩個(gè)磁盤組DATA_DG,DG_FRA都沒有mount。

環(huán)境:OS=RHEL 6 DB=Oracle11GR2

[grid@myrac1 ~]$ crs_stat -t

Name Type Target State Host

------------------------------------------------------------

ora.DATA_DG.dg ora....up.type OFFLINE OFFLINE

ora.DG_FRA.dg ora....up.type OFFLINE OFFLINE

ora....ER.lsnr ora....er.type ONLINE ONLINE myrac1

ora.SYS_DG.dg ora....up.type ONLINE ONLINE myrac1

ora.asm ora.asm.type ONLINE ONLINE myrac1

ora.cssd ora.cssd.type ONLINE ONLINE myrac1

ora.diskmon ora....on.type ONLINE ONLINE myrac1

ora.hjj.db ora....se.type OFFLINE OFFLINE

查看參數(shù)disk_groups發(fā)現(xiàn)沒有值,按理來說應(yīng)該是這三個(gè)磁盤組。

SQL> show parameter disk

NAME TYPE VALUE

------------------------------------ ----------- ------------------------------

asm_diskgroups string

asm_diskstring string

進(jìn)行修改

[grid@myrac1 ~]$ sqlplus / as sysasm

SQL> startup nomount

ASM instance started

Total System Global Area 284565504 bytes

Fixed Size 1336036 bytes

Variable Size 258063644 bytes

ASM Cache 25165824 bytes

SQL> alter system set asm_diskgroups=sys_dg,data_dg,dg_fra scope=spfile;

alter system set asm_diskgroups=sys_dg,data_dg,dg_fra scope=spfile

*

ERROR at line 1:

ORA-32000: write to SPFILE requested but SPFILE is not modifiable

SQL> !oerr ora 32000

32000, 00000, "write to SPFILE requested but SPFILE is not modifiable"

// *Cause: An ALTER SYSTEM command or an internal self-tuning mechanism

// requested a write to the SPFILE but the SPFILE was not modifiable.

// *Action: Perform an in-memory parameter update only.

提示只能在memory中進(jìn)行修改,嘗試修改

SQL> alter system set asm_diskgroups=sys_dg,data_dg,dg_fra scope=memory;

System altered.

是可以修改,但是沒辦法永久保存,要修改的是spfile中的disk_groups參數(shù),讓ASM實(shí)例每次啟動(dòng)都能加載所有的diskgroup。

那問題就是如何修改spfile中的asm_diskgroups參數(shù)

通過create pfile 然后修改pfile,再通過pfile創(chuàng)建spfile,重啟實(shí)例即可。

SQL> show parameter pfile

NAME TYPE VALUE

------------------------------------ ----------- ------------------------------

spfile string +SYS_DG/asm/asmparameterfile/registry.253.837910359

SQL> select instance_name,host_name,version,status from v$instance;

INSTANCE_NAME HOST_NAME VERSION STATUS

---------------- ---------------------------------------------------------------- ----------------- ------------

+ASM myrac1.oracle.com 11.2.0.1.0 STARTED

SQL> create pfile='/g01/app/grid/product/11.2.0/grid/dbs/asmpfile.ora' from spfile;

File created.

[grid@myrac1 dbs]$ vi asmpfile.ora

+ASM.__oracle_base='/g01/app/grid'#ORACLE_BASE set from in memory value

+ASM.asm_diskgroups='SYS_DG,DATA_DG,DG_FRA'#Manual Mount 不能在這里直接修改

*.asm_power_limit=1

*.diagnostic_dest='/g01/app/grid'

*.instance_type='asm'

*.large_pool_size=12M

*.remote_login_passwordfile='EXCLUSIVE'

~

SQL> create spfile from pfile='/g01/app/grid/product/11.2.0/grid/dbs/asmpfile.ora';

File created.

SQL> startup

ORA-01078: failure in processing system parameters

ORA-62001: value for parameter cannot contain a comma

SQL> startup pfile='/g01/app/grid/product/11.2.0/grid/dbs/asmpfile.ora';

ORA-62001: value for parameter cannot contain a comma

SQL> startup

ASM instance started

Total System Global Area 284565504 bytes

Fixed Size 1336036 bytes

Variable Size 258063644 bytes

ASM Cache 25165824 bytes

ASM diskgroups mounted

發(fā)現(xiàn)磁盤組DATA_DG,DG_FRA還是沒有Mount

[grid@myrac1 ~]$ crs_stat -t

Name Type Target State Host

------------------------------------------------------------

ora.DATA_DG.dg ora....up.type OFFLINE OFFLINE

ora.DG_FRA.dg ora....up.type OFFLINE OFFLINE

ora....ER.lsnr ora....er.type ONLINE ONLINE myrac1

ora.SYS_DG.dg ora....up.type ONLINE ONLINE myrac1

ora.asm ora.asm.type ONLINE ONLINE myrac1

ora.cssd ora.cssd.type ONLINE ONLINE myrac1

ora.diskmon ora....on.type ONLINE ONLINE myrac1

ora.hjj.db ora....se.type OFFLINE OFFLINE

只能以這種方式進(jìn)行asm_diskgroups參數(shù)的修改

SQL> alter system set asm_diskgroups=sys_dg,data_dg,dg_fra scope=spfile sid='+ASM';

System altered.

SQL> select status from v$instance;

STATUS

------------

STARTED

SQL> shutdown immediate

ASM diskgroups dism九度快排系統(tǒng) https://www.190seo.comounted

ASM instance shutdown

SQL> startup

ASM instance started

Total System Global Area 284565504 bytes

Fixed Size 1336036 bytes

Variable Size 258063644 bytes

ASM Cache 25165824 bytes

ASM diskgroups mounted

SQL> !

[grid@myrac1 ~]$ crs_stat -t

Name Type Target State Host

------------------------------------------------------------

ora.DATA_DG.dg ora....up.type ONLINE ONLINE myrac1

ora.DG_FRA.dg ora....up.type ONLINE ONLINE myrac1

ora....ER.lsnr ora....er.type ONLINE ONLINE myrac1

ora.SYS_DG.dg ora....up.type ONLINE ONLINE myrac1

ora.asm ora.asm.type ONLINE ONLINE myrac1

ora.cssd ora.cssd.type ONLINE ONLINE myrac1

ora.diskmon ora....on.type ONLINE ONLINE myrac1

ora.hjj.db ora....se.type OFFLINE OFFLINE

SQL> show parameter pfile

NAME TYPE VALUE

------------------------------------ ----------- ------------------------------

spfile string /g01/app/grid/product/11.2.0/grid/dbs/spfile+ASM.ora

[grid@myrac1 dbs]$ mv spfile+ASM.ora spfile+ASM.ora.bak

[grid@myrac1 dbs]$ ls

20140219 ab_+ASM.dat asmpfile.ora hc_+ASM.dat init.ora orapw+ASM peshm_+ASM_1 spfile+ASM.ora.bak

SQL> shutdown immediate

ASM diskgroups dismounted

ASM instance shutdown

SQL> startup

ORA-00099: warning: no parameter file specified for ASM instance

ASM instance started

Total System Global Area 284565504 bytes

Fixed Size 1336036 bytes

Variable Size 258063644 bytes

ASM Cache 25165824 bytes

ORA-15110: no diskgroups mounted

發(fā)現(xiàn)使用的$CRS_HOME/dbs/spfile+ASM.ora參數(shù)文件,而不是磁盤組SYS_DG上的參數(shù)文件。

可以讓asm實(shí)例啟動(dòng)的時(shí)候讀取磁盤組上的spfile,步驟如下:

SQL> show parameter spfile

NAME TYPE VALUE

------------------------------------ ----------- ------------------------------

spfile string /g01/app/grid/product/11.2.0/grid/dbs/spfile+ASM.ora

SQL> startup

ASM instance started

Total System Global Area 284565504 bytes

Fixed Size 1336036 bytes

Variable Size 258063644 bytes

ASM Cache 25165824 bytes

ASM diskgroups mounted

SQL> !crs_stat -t

Name Type Target State Host

------------------------------------------------------------

ora.DATA_DG.dg ora....up.type OFFLINE OFFLINE

ora.DG_FRA.dg ora....up.type OFFLINE OFFLINE

ora....ER.lsnr ora....er.type ONLINE ONLINE myrac1

ora.SYS_DG.dg ora....up.type ONLINE ONLINE myrac1

ora.asm ora.asm.type ONLINE ONLINE myrac1

ora.cssd ora.cssd.type ONLINE ONLINE myrac1

ora.diskmon ora....on.type ONLINE ONLINE myrac1

ora.hjj.db ora....se.type OFFLINE OFFLINE

SQL> create spfile='+SYS_DG' from pfile='/g01/app/grid/product/11.2.0/grid/dbs/asmpfile.ora';

File created.

SQL> shutdown immediate

ASM diskgroups dismounted

ASM instance shutdown

SQL> startup

ASM instance started

Total System Global Area 284565504 bytes

Fixed Size 1336036 bytes

Variable Size 258063644 bytes

ASM Cache 25165824 bytes

ASM diskgroups mounted

SQL> !crs_stat -t

Name Type Target State Host

------------------------------------------------------------

ora.DATA_DG.dg ora....up.type OFFLINE OFFLINE

ora.DG_FRA.dg ora....up.type OFFLINE OFFLINE

ora....ER.lsnr ora....er.type ONLINE ONLINE myrac1

ora.SYS_DG.dg ora....up.type ONLINE ONLINE myrac1

ora.asm ora.asm.type ONLINE ONLINE myrac1

ora.cssd ora.cssd.type ONLINE ONLINE myrac1

ora.diskmon ora....on.type ONLINE ONLINE myrac1

ora.hjj.db ora....se.type OFFLINE OFFLINE

SQL> alter system set asm_diskgroups=sys_dg,data_dg,dg_fra scope=spfile sid='+ASM';

System altered.

文件如下:

ASMCMD> ls

DATA_DG/

DG_FRA/

SYS_DG/

ASMCMD> cd sys_dg

ASMCMD> ls

ASM/

ASMCMD> cd asm

ASMCMD> ls

ASMPARAMETERFILE/

ASMCMD> cd asmparameterfile

ASMCMD> ls

REGISTRY.253.840236163

ASMCMD> pwd

+sys_dg/asm/asmparameterfile

SQL> show parameter spfile

NAME TYPE VALUE

------------------------------------ ----------- ------------------------------

spfile string +SYS_DG/asm/asmparameterfile/r

egistry.253.840236163

SQL> shutdown immediate

ASM diskgroups dismounted

ASM instance shutdown

SQL> startup

ASM instance started

Total System Global Area 284565504 bytes

Fixed Size 1336036 bytes

Variable Size 258063644 bytes

ASM Cache 25165824 bytes

ASM diskgroups mounted

SQL> show parameter spfile

NAME TYPE VALUE

------------------------------------ ----------- ------------------------------

spfile string +SYS_DG/asm/asmparameterfile/registry.253.840236163

SQL> show parameter diskgroups

NAME TYPE VALUE

------------------------------------ ----------- ------------------------------

asm_diskgroups string SYS_DG, DATA_DG, DG_FRA

SQL> !crs_stat -t

Name Type Target State Host

------------------------------------------------------------

ora.DATA_DG.dg ora....up.type ONLINE ONLINE myrac1

ora.DG_FRA.dg ora....up.type ONLINE ONLINE myrac1

ora....ER.lsnr ora....er.type ONLINE ONLINE myrac1

ora.SYS_DG.dg ora....up.type ONLINE ONLINE myrac1

ora.asm ora.asm.type ONLINE ONLINE myrac1

ora.cssd ora.cssd.type ONLINE ONLINE myrac1

ora.diskmon ora....on.type ONLINE ONLINE myrac1

ora.hjj.db ora....se.type OFFLINE OFFLINE

注意:asmpfile.ora中的+ASM.asm_diskgroups='SYS_DG' #Manual Mount,不能添加DATA_DG,DG_FRA進(jìn)去,否則創(chuàng)建spfile報(bào)錯(cuò)。只能再通過alter system進(jìn)行修改。

總結(jié):在NOMOUNT階段oracle根據(jù)參數(shù)文件來分配內(nèi)存空間及啟動(dòng)后臺(tái)進(jìn)程,這個(gè)時(shí)候磁盤組都沒有加載,但是oracle的spfile是直接從磁盤讀取的,與SYS_DG是否MOUNT沒關(guān)系。

更多Oracle相關(guān)信息見Oracle 專題頁面 http://www.linuxidc.com/topicnews.aspx?tid=12

本文永久更新鏈接地址:http://www.linuxidc.com/Linux/2016-01/127330.htm

linux

Oracle Bug ORA-04043

ORA-01012: not logged on處理

相關(guān)資訊

ASM

定位數(shù)據(jù)在ASM中的位置 (今 20:49)

RAC 11G ASM磁盤損壞恢復(fù) (10/15/2016 16:56:55)

Oracle Linux6.7下使用udev做ASM (07/04/2016 20:02:26)

ASM磁盤組擴(kuò)容流程 (12/01/2016 08:19:16)

Oracle 11g RAC 啟動(dòng)時(shí)無法識(shí)別ASM (10/06/2016 15:36:51)

監(jiān)控ASM磁盤組IO吞吐量 (04/10/2016 07:10:10)

本文評(píng)論

查看全部評(píng)論 (0)

表情: 表情

姓名:

匿名

字?jǐn)?shù)

同意評(píng)論聲明

評(píng)論聲明

尊重網(wǎng)上道德,遵守中華人民共和國的各項(xiàng)有關(guān)法律法規(guī)

承擔(dān)一切因您的行為而直接或間接導(dǎo)致的民事或刑事法律責(zé)任

本站管理人員有權(quán)保留或刪除其管轄留言中的任意內(nèi)容

本站有權(quán)在網(wǎng)站內(nèi)轉(zhuǎn)載或引用您的評(píng)論

參與本評(píng)論即表明您已經(jīng)閱讀并接受上述條款

最新資訊

定位數(shù)據(jù)在ASM中的位置

Oracle ASM spfile in a disk group

Oracle ASM ACFS disk group rebalance

Windows 10升級(jí)bug導(dǎo)致Bash的 Ctrl-C失效

學(xué)生黑客因銷售間諜軟件面臨10年徒刑

Debian GNU/Linux 8.7 正式發(fā)布:超 85 項(xiàng)

徹底消失,Linux下用命令行徹底刪除文件

Facebook計(jì)劃將假新聞過濾工具引進(jìn)德國

蓋茨基金會(huì)的研究無法在頂尖期刊上發(fā)表

配置VMware掛載新加入的磁盤

背景:

閱讀新聞

ORA-01012: not logged on處理

[日期:2016-01-12]

來源:Linux社區(qū)

作者:Linux

[字體:大 中 小]

SQL> startup nomount

ORA-01012: not logged on

SQL> startup

ORA-01012: not logged on

SQL> shutdown immediate

ORA-24324: service handle not initialized

ORA-24323: value not allowed

ORA-01089: immediate shutdown in progress - no operations are permitted

查看alert日志:

NOTE: Instance updated compatible.asm to 11.2.0.0.0 for grp 3

SUCCESS: diskgroup SYS_DG was mounted

SUCCESS: ALTER DISKGROUP ALL MOUNT

NOTE: diskgroup resource ora.DATA_DG.dg is online

NOTE: diskgroup resource ora.DG_FRA.dg is online

NOTE: diskgroup resource ora.SYS_DG.dg is online

Sat Feb 22 19:38:59 2014

Shutting down instance (immediate)

Shutting down instance: further logons disabled

Stopping background process MMNL

Stopping background process MMON

License high water mark=4

Sat Feb 22 19:44:02 2014

SHUTDOWN: Active processes prevent shutdown operation

Sat Feb 22 19:49:04 2014

SHUTDOWN: Active processes prevent shutdown operation

[grid@myrac1 trace]$ date

Sat Feb 22 21:07:46 PST 2014

[grid@myrac1 trace]$ tail -f alert_+ASM.log

Sat Feb 22 19:38:59 2014

Shutting down instance (immediate)

Shutting down instance: further logons disabled

Stopping background process MMNL

Stopping background process MMON

License high water mark=4

Sat Feb 22 19:44:02 2014

SHUTDOWN: Active processes prevent shutdown operation

Sat Feb 22 19:49:04 2014

SHUTDOWN: Active processes prevent shutdown operation

Sat Feb 22 21:09:49 2014

License high water mark=4

從日志可以發(fā)現(xiàn)是實(shí)例出現(xiàn)異常,導(dǎo)致無法啟動(dòng)shutdown,嘗試強(qiáng)行停止

SQL> shutdown abort

ASM instance shutdown

SQL> startup

ASM instance started

Total System Global Area 284565504 bytes

Fixed Size 1336036 bytes

Variable Size 258063644 bytes

ASM Cache 25165824 bytes

ASM diskgroups mounted

更多Oracle相關(guān)信息見Oracle 專題頁面 http://www.linuxidc.com/topicnews.aspx?tid=12

本文永久更新鏈接地址:http://www.linuxidc.com/Linux/2016-01/127331.htm

linux

11G ASM磁盤組不能自動(dòng)MOUNT處理

Win遠(yuǎn)程Linux下的ASM實(shí)例

相關(guān)資訊

ORA-01012

ORA-01012:not logged on的解決辦 (04/26/2013 20:22:42)

本文評(píng)論

查看全部評(píng)論 (0)

表情: 表情

姓名:

匿名

字?jǐn)?shù)

同意評(píng)論聲明

評(píng)論聲明

尊重網(wǎng)上道德,遵守中華人民共和國的各項(xiàng)有關(guān)法律法規(guī)

承擔(dān)一切因您的行為而直接或間接導(dǎo)致的民事或刑事法律責(zé)任

本站管理人員有權(quán)保留或刪除其管轄留言中的任意內(nèi)容

本站有權(quán)在網(wǎng)站內(nèi)轉(zhuǎn)載或引用您的評(píng)論

參與本評(píng)論即表明您已經(jīng)閱讀并接受上述條款

最新資訊

MySQL 5.6 XtraBackup 全量和增量的備份和

基于XtraBackup 2.3.5 的 MySQL全量備份與

Chrome OS 現(xiàn)可支持簡易密碼解鎖

NSA的代碼遭到教授的嘲笑

Fedora 25將默認(rèn)使用Wayland

Nagios 監(jiān)控 SNMP 溫度計(jì)

JavaScript函數(shù)定義與函數(shù)作用域詳解

Java培訓(xùn):對象和類

Java培訓(xùn):基本數(shù)據(jù)類型

Java培訓(xùn):變量類型

背景:

閱讀新聞

Win遠(yuǎn)程Linux下的ASM實(shí)例

[日期:2016-01-12]

來源:Linux社區(qū)

作者:Linux

[字體:大 中 小]

一、Win遠(yuǎn)程Linux下的ASM實(shí)例

1.Linux下的監(jiān)聽文件

[grid@myrac1 admin]$ cat listener.ora

# listener.ora Network Configuration File: /g01/app/grid/product/11.2.0/grid/network/admin/listener.ora

# Generated by Oracle configuration tools.

LISTENER=

(DESCRIPTION_LIST=

(DESCRIPTION=

(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521))

(ADDRESS=(PROTOCOL=TCP)(HOST=myrac1)(PORT=1521))

)

)

ADR_BASE_LISTENER=/g01/app/grid

ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER=ON # line added by Agent

2.監(jiān)聽狀態(tài)

[grid@myrac1 admin]$ lsnrctl status

LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 23-FEB-2014 05:48:20

Copyright (c) 1991, 2009, Oracle. All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))

STATUS of the LISTENER

------------------------

Alias LISTENER

Version TNSLSNR for Linux: Version 11.2.0.1.0 - Production

Start Date 23-FEB-2014 05:37:13

Uptime 0 days 0 hr. 11 min. 7 sec

Trace Level off

Security ON: Local OS Authentication

SNMP OFF

Listener Parameter File /g01/app/grid/product/11.2.0/grid/network/admin/listener.ora

Listener Log File /g01/app/grid/diag/tnslsnr/myrac1/listener/alert/log.xml

Listening Endpoints Summary...

(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))

(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=myrac1)(PORT=1521)))

Services Summary...

Service "+ASM" has 1 instance(s).

Instance "+ASM", status READY, has 1 handler(s) for this service...

Service "hjj" has 1 instance(s).

Instance "hjj", status READY, has 1 handler(s) for this service...

Service "hjjXDB" has 1 instance(s).

Instance "hjj", status READY, has 1 handler(s) for this service...

The command completed successfully

3.在win客戶端tns文件中添加如下內(nèi)容

LIN_ASM=

(DESCRIPTION=

(ADDRESS_LIST=

(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.1.171)(PORT=1521))

)

(CONNECT_DATA=

(SERVER=DEDICATED)

(SERVICE_NAME=+ASM)

(INSTANCE_NAME=+ASM)

)

)

4.在win下測試

C:\Users\Administrator>tnsping lin_asm

TNS Ping Utility for 64-bit Windows: Version 11.2.0.1.0 - Production on 23-FEB-2014 21:52:49

Copyright (c) 1997, 2010, Oracle. All rights reserved.

Used parameter files:

C:\app\Administrator\product\11.2.0\dbhome_1\network\admin\sqlnet.ora

Used TNSNAMES adapter to resolve the alias

Attempting to contact (DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.1.171)(PORT=1521))) (CONNECT_DATA=(SERVER=DEDICATED) (SERVICE_NAME=+ASM) (INSTANCE_NAME=+ASM)))

OK (360 msec)

C:\>sqlplus sys/oracle@lin_asm as sysdba

SQL*Plus: Release 11.2.0.1.0 Production on Sun Feb 23 21:55:11 2014

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

Connected to:

Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production

With the Automatic Storage Management option

SQL> select instance_name,host_name,version,status from v$instance;

INSTANCE_NAME HOST_NAME VERSION STATUS

-------------------------------- -------------------------------------------------- ---------------------------------- --

+ASM myrac1.oracle.com 11.2.0.1.0 STARTED

另外飛總的博客中提到UR=A,用于asm遠(yuǎn)程訪問使用的參數(shù),我的win和linux都安裝的是oracle11gR2,測試中發(fā)現(xiàn)在動(dòng)態(tài)監(jiān)聽加不加UR=A都可以遠(yuǎn)程訪問。

更多Oracle相關(guān)信息見Oracle 專題頁面 http://www.linuxidc.com/topicnews.aspx?tid=12

本文永久更新鏈接地址:http://www.linuxidc.com/Linux/2016-01/127332.htm

linux

ORA-01012: not logged on處理

ORA-12154 TNS不能解析指定的標(biāo)識(shí)符

相關(guān)資訊

ASM ASM實(shí)例

定位數(shù)據(jù)在ASM中的位置 (今 20:49)

RAC 11G ASM磁盤損壞恢復(fù) (10/15/2016 16:56:55)

Oracle Linux6.7下使用udev做ASM (07/04/2016 20:02:26)

ASM磁盤組擴(kuò)容流程 (12/01/2016 08:19:16)

Oracle 11g RAC 啟動(dòng)時(shí)無法識(shí)別ASM (10/06/2016 15:36:51)

監(jiān)控ASM磁盤組IO吞吐量 (04/10/2016 07:10:10)

本文評(píng)論

查看全部評(píng)論 (0)

表情: 表情

姓名:

匿名

字?jǐn)?shù)

同意評(píng)論聲明

評(píng)論聲明

尊重網(wǎng)上道德,遵守中華人民共和國的各項(xiàng)有關(guān)法律法規(guī)

承擔(dān)一切因您的行為而直接或間接導(dǎo)致的民事或刑事法律責(zé)任

本站管理人員有權(quán)保留或刪除其管轄留言中的任意內(nèi)容

本站有權(quán)在網(wǎng)站內(nèi)轉(zhuǎn)載或引用您的評(píng)論

參與本評(píng)論即表明您已經(jīng)閱讀并接受上述條款

最新資訊

定位數(shù)據(jù)在ASM中的位置

Oracle ASM spfile in a disk group

Oracle ASM ACFS disk group rebalance

Windows 10升級(jí)bug導(dǎo)致Bash的 Ctrl-C失效

學(xué)生黑客因銷售間諜軟件面臨10年徒刑

Debian GNU/Linux 8.7 正式發(fā)布:超 85 項(xiàng)

徹底消失,Linux下用命令行徹底刪除文件

Facebook計(jì)劃將假新聞過濾工具引進(jìn)德國

蓋茨基金會(huì)的研究無法在頂尖期刊上發(fā)表

配置VMware掛載新加入的磁盤

背景:

閱讀新聞

ORA-12154 TNS不能解析指定的標(biāo)識(shí)符

[日期:2016-01-12]

來源:Linux社區(qū)

作者:Linux

[字體:大 中 小]

在Win下用pl/sql developer訪問遠(yuǎn)程Linux的DB報(bào)

ORA-12154 TNS不能解析標(biāo)示符,但是在Win下SQLPLUS都是正常的

C:\>tnsping lin_hjj

TNS Ping Utility for 64-bit Windows: Version 11.2.0.1.0 - Production on 23-FEB-2014 22:56:32

Copyright (c) 1997, 2010, Oracle. All rights reserved.

Used parameter files:

C:\app\Administrator\product\11.2.0\dbhome_1\network\admin\sqlnet.ora

Used TNSNAMES adapter to resolve the alias

Attempting to contact (DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.1.171)(PORT=1521))) (CONNECT_DATA=(SERVER=DEDICATED) (SERVICE_NAME=hjj) (INSTANCE_NAME=hjj)))

OK (60 msec)

C:\>sqlplus sys/oracle@lin_hjj as sysdba

SQL*Plus: Release 11.2.0.1.0 Production on Sun Feb 23 22:56:57 2014

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

Connected to:

Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production

With the Partitioning, Automatic Storage Management, OLAP, Data Mining

and Real Application Testing options

在網(wǎng)上找了一會(huì)兒也沒解決,因?yàn)橛龅降那闆r都不一樣。

突然想到Oracle11g在創(chuàng)建完數(shù)據(jù)庫以后,是不能使用PL/SQL連接的,必須在oracle官網(wǎng)下載instantclient-basic-win32-11.2.0.1.0.zip(注意:與DB版本對應(yīng))

解壓之后為instantclient_11_2目錄,需要做的就是把ORACLE_HOME下的NETWORK/ADMIN拷貝到解壓之后的instantclient_11_2目錄下。

然后打開PL/SQL DEV-->工具-->首選項(xiàng)-->左側(cè)Oracle-->連接中的ORACLE主目錄(instantclient_11_2的全目錄,比如D:\instantclient_11_2),OCI庫會(huì)自動(dòng)檢測的。

之后再進(jìn)行測試,連接成功。

更多Oracle相關(guān)信息見Oracle 專題頁面 http://www.linuxidc.com/topicnews.aspx?tid=12

本文永久更新鏈接地址:http://www.linuxidc.com/Linux/2016-01/127333.htm

linux

Win遠(yuǎn)程Linux下的ASM實(shí)例

ASM學(xué)習(xí)之概述

相關(guān)資訊

ORA-12154

Oracle客戶端PL/SQL Developer連接 (今 08:02)

ORA-12154: TNS: 無法解析指定的連 (08/04/2015 08:45:24)

exp/imp導(dǎo)出導(dǎo)入數(shù)據(jù)時(shí)報(bào)錯(cuò)ORA- (01/03/2014 21:30:40)

ORA-12154,ORA-12560解決過程 (03/01/2016 10:02:33)

Oracle客戶端簡易連接報(bào)錯(cuò)ORA- (07/21/2015 14:50:56)

EasyConnect出現(xiàn)ORA-12154(無法解 (10/26/2013 07:35:33)

本文評(píng)論

查看全部評(píng)論 (0)

表情: 表情

姓名:

匿名

字?jǐn)?shù)

同意評(píng)論聲明

評(píng)論聲明

尊重網(wǎng)上道德,遵守中華人民共和國的各項(xiàng)有關(guān)法律法規(guī)

承擔(dān)一切因您的行為而直接或間接導(dǎo)致的民事或刑事法律責(zé)任

本站管理人員有權(quán)保留或刪除其管轄留言中的任意內(nèi)容

本站有權(quán)在網(wǎng)站內(nèi)轉(zhuǎn)載或引用您的評(píng)論

參與本評(píng)論即表明您已經(jīng)閱讀并接受上述條款

最新資訊

Oracle客戶端PL/SQL Developer連接不上報(bào)錯(cuò)

Linux下全自動(dòng)編譯安裝MySQL

Linux中rpm命令誤卸載了的恢復(fù)

IBM QRadar SIEM安全限制繞過漏洞(CVE-

研究稱智能手機(jī)的存在能降低人的認(rèn)知能力

NASA 否認(rèn)發(fā)現(xiàn)外星生命

cURL 作者被拒絕入境美國

任天堂將在 9 月發(fā)布 Super Nintendo

Google 回應(yīng)歐盟對其比較購物服務(wù)開出的巨

Microsoft Skype棧緩沖區(qū)溢出漏洞(CVE-

背景:

閱讀新聞

ASM學(xué)習(xí)之概述

[日期:2016-01-12]

來源:Linux社區(qū)

作者:Linux

[字體:大 中 小]

Oracle ASM(Oracle Automatic Storage Management)

Oracle ASM is a volume manager and a file system for Oracle database files that supports single-instance Oracle Database

and Oracle Real Application Clusters (Oracle RAC) configurations. Oracle ASM is Oracle's recommended storage management solution

that provides an alternative to conventional volume managers, file systems, and raw devices.

ORACLE ASM是一個(gè)卷管理器,Oracle數(shù)據(jù)庫文件的一個(gè)文件系統(tǒng),ASM支持單實(shí)例和集群配置,它是oracle推薦的存儲(chǔ)方案,為傳統(tǒng)卷管理器,文件系統(tǒng),裸設(shè)備提供一個(gè)選擇。

Oracle ASM uses disk groups to store data files; an Oracle ASM disk group is a collection of disks that Oracle ASM manages as a unit.

Within a disk group, Oracle ASM exposes a file system interface for Oracle database files. The content of files that are stored in a disk group is evenly distributed

to eliminate hot spots and to provide uniform performance across the disks. The performance is comparable to the performance of raw devices.

Oracle ASM使用磁盤組存儲(chǔ)數(shù)據(jù)文件,磁盤組是是磁盤的集合,ASM以AU(allocate unit分配單元,默認(rèn)是1M,但是可以修改)來管理磁盤的,在磁盤中,ASM給數(shù)據(jù)庫文件提供了一個(gè)系統(tǒng)接口,存儲(chǔ)在磁盤組的文件內(nèi)容被均勻的分布以避免熱點(diǎn),為方位磁盤提供均衡的性能。ASM性能跟裸設(shè)備的性能是相當(dāng)?shù)摹?/p>

You can add or remove disks from a disk group while a database continues to access files from the disk group. When you add or remove disks from a disk group,

Oracle ASM automatically redistributes the file contents and eliminates the need for downtime when redistributing the content.

可以在磁盤組使用的情況下添加和刪除磁盤,而且ASM會(huì)自動(dòng)重新分布文件內(nèi)容,同時(shí)在重分布期間會(huì)減少停機(jī)時(shí)間。

Oracle ASM also uses the Oracle Managed Files (OMF) feature to simplify database file management. OMF automatically creates files in designated locations.

OMF also names files and removes them while relinquishing space when tablespaces or files are deleted.

ASM也是用OMF來簡化數(shù)據(jù)庫文件管理,OMF在指定的位置自動(dòng)創(chuàng)建文件,當(dāng)表空間或文件被刪除時(shí),在釋放空間的同事,OMF也可以命名文件,刪除文件。

Oracle ASM reduces the administrative overhead for managing database storage by consolidating data storage into a small number of disk groups.

The smaller number of disk groups consolidates the storage for multiple databases and provides for improved I/O performance.

ASM通過合并數(shù)據(jù)存儲(chǔ)到少量的磁盤組來減少管理費(fèi)用,少量的磁盤組整合多數(shù)據(jù)庫的存儲(chǔ),并提供更高的I/O性能。

Oracle ASM files can coexist with other storage management options such as raw disks and third-party file systems.

This capability simplifies the integration of Oracle ASM into pre-existing environments.

ASM實(shí)例文件能與其他的存儲(chǔ)管理設(shè)備(裸設(shè)備,第三方文件系統(tǒng))并存。容量可以簡化ASM到已存在環(huán)境的整合。

Oracle Automatic Storage Management Cluster File System (Oracle ACFS) is a multi-platform, scalable file system, and storage management technology

that extends Oracle ASM functionality to support customer files maintained outside of Oracle Database.

The Oracle ASM Dynamic Volume Manager (Oracle ADVM) provides volume management services and a standard disk device driver interface to clients

ACFS是一個(gè)多平臺(tái),可擴(kuò)展性的文件系統(tǒng),存儲(chǔ)管理技術(shù),擴(kuò)展ASM功能以支持維護(hù)Oracle數(shù)據(jù)庫外面的客戶文件。ADVM為客戶端提供卷管理服務(wù)和標(biāo)準(zhǔn)的磁盤設(shè)備驅(qū)動(dòng)接口

Oracle Enterprise Manager includes a wizard that enables you to migrate non-Oracle ASM database files to Oracle ASM.

Oracle ASM also has easy to use management interfaces such as SQL*Plus, the Oracle ASM Command Line Utility (ASMCMD) command-line interface,

Oracle ASM Configuration Assistant, and Oracle Enterprise Manager

EM中的向?qū)Э梢詭椭氵w移非ASM數(shù)據(jù)庫文件到ASM,也可以使用SQLPLUS,ASMCMD,ASMCA,OEM.

ASM實(shí)例

An Oracle ASM instance has a System Global Area (SGA) and background processes that are similar to those of Oracle Database. However,

because Oracle ASM performs fewer tasks than a database, an Oracle ASM SGA is much smaller than a database SGA. In addition,

Oracle ASM has a minimal performance effect on a server. Oracle ASM instances mount disk groups to make Oracle ASM files available to database instances;

Oracle ASM instances do not mount databases

ASM instance包括SGA和一些后臺(tái)進(jìn)程,然而,ASM比DB執(zhí)行更少的任務(wù),SGA要比DB的小得多,另外,ASM在server上對性能的影響很小,數(shù)據(jù)庫實(shí)例啟動(dòng)之前,必須先啟動(dòng)ASM實(shí)例掛載磁盤組。它不會(huì)掛載數(shù)據(jù)庫。

Oracle ASM is installed in the Oracle Grid Infrastructure home before Oracle Database is installed in a separate Oracle home.

Oracle ASM and database instances require shared access to the disks in a disk group.

Oracle ASM instances manage the metadata of the disk group and provide file layout information to the database instances.

11g ASM安裝在GI home中,之前是安裝在獨(dú)立的ORACLE HOME下。ASM實(shí)例和數(shù)據(jù)庫實(shí)例共同訪問磁盤中的磁盤。 ASM實(shí)例管理磁盤組中的metadata,為數(shù)據(jù)庫實(shí)例提供文件布局信息。Oracle ASM metadata包含以下信息:

The disks that belong to a disk group 磁盤組中的磁盤

The amount of space that is available in a disk group 磁盤組中可用的空間

The filenames of the files in a disk group 文件名

The location of disk group data file extents 數(shù)據(jù)文件擴(kuò)展區(qū)的位置

A redo log that records information about atomically changing metadata blocks 改變元始據(jù)塊的redo

Oracle ADVM volume information

ORACLE ASM實(shí)例可以使用clusteware集群,每個(gè)節(jié)點(diǎn)都有一個(gè)ASM instance,如果幾個(gè)不同的數(shù)據(jù)庫實(shí)例在同一個(gè)節(jié)點(diǎn)上,那么這些數(shù)據(jù)庫實(shí)例共享這個(gè)單一ASM INSTANCE。如果ASM實(shí)例在一個(gè)節(jié)點(diǎn)上故障,那么所有的數(shù)據(jù)庫實(shí)例在這個(gè)節(jié)點(diǎn)上也故障,它不像文件系統(tǒng)驅(qū)動(dòng)發(fā)生故障那樣,ASM instance故障不要求重啟OS,在RAC下,ASM和DB instance在正常的節(jié)點(diǎn)上自動(dòng)恢復(fù)ASM instance故障。

在單實(shí)例環(huán)境下,多個(gè)數(shù)據(jù)庫instance共享一個(gè)asm instance;在RAC下,Oracle ASM提供了一個(gè)集群存儲(chǔ)池,每個(gè)節(jié)點(diǎn)ASM instance為多個(gè)ORACLE RAC或single-instance DB服務(wù),所有的數(shù)據(jù)庫被合并,而且共享ASM磁盤組。

集群存儲(chǔ)池被多個(gè)單實(shí)例數(shù)據(jù)庫共享,多個(gè)數(shù)據(jù)庫instance可以共享共同的磁盤組。clustered storage pool是用Oracle clusterware完成的。

Oracle ASM Disk Groups

磁盤組包含多個(gè)磁盤,而且是ASM實(shí)例管理的基本對象。每個(gè)磁盤組包含用于空間管理的元數(shù)據(jù),磁盤組組件包括磁盤,文件,分配單元AU.

文件是從磁盤中分配,任何ASM文件完全包含在一個(gè)單獨(dú)的磁盤組中,然而,一個(gè)磁盤組可能多個(gè)數(shù)據(jù)庫的文件,一個(gè)數(shù)據(jù)庫可能從多個(gè)磁盤組讀取文件,對于大多數(shù)安裝來說,只需要很少磁盤組,通常2個(gè),不多于3個(gè)。

磁盤鏡像(Mirroring)和故障組(Failure Groups)

鏡像有三種方式,也是三種冗余級(jí)別:

Normal for 2-way mirroring

High for 3-way mirroring

External to not use Oracle ASM mirroring, such as when you configure hardware RAID for redundancy

冗余級(jí)別允許多少個(gè)磁盤故障,而不是卸載磁盤或丟失數(shù)據(jù)。磁盤組類型決定鏡像級(jí)別。ORACLE ASM鏡像比附加RAID鏡像更加靈活。

當(dāng)ASM分配給一個(gè)鏡像文件分配一個(gè)extent時(shí),ORACLE ASM分配一個(gè)primary copy和一個(gè)mirror copy。ASM選擇磁盤在不同的故障組去存儲(chǔ)mirror copy而不是primary copy。

故障組用于存放mirror copy以便每個(gè)copy在不同的故障組磁盤上。

ASM磁盤

主要包括以下信息:

A disk or partition from a storage array

An entire disk or the partitions of a disk

Logical volumes

Network-attached files (NFS)

對磁盤命名的解釋:

When you add a disk to a disk group, you can assign an Oracle ASM disk name or Oracle ASM assigns the Oracle ASM disk name automatically.

This name is different from the path name used by the operating system. In a cluster, a disk may be assigned different operating system device names on different nodes,but the disk has the same Oracle ASM disk name on all of the nodes. In a cluster, an Oracle ASM disk must be accessible from all of the instances that share the disk group。

Oracle ASM spreads the files proportionally across all of the disks in the disk group. This allocation pattern maintains every disk at the same capacity level and ensures that all of the disks in a disk group have the same I/O load. Because Oracle ASM load balances among all of the disks in a disk group, different Oracle ASM disks should not share the same physical drive.

Allocation Units(AU)

Every Oracle ASM disk is divided into allocation units (AU). An allocation unit is the fundamental unit of allocation within a disk group.A file extent consists of one or more allocation units. An Oracle ASM file consists of one or more file extents.

When you create a disk group, you can set the Oracle ASM allocation unit size with the AU_SIZE disk group attribute.

The values can be 1, 2, 4, 8, 16, 32, or 64 MB, depending on the specific disk group compatibility level.

Larger AU sizes typically provide performance advantages for data warehouse applications that use large sequential reads.

Oracle ASM Files

Files that are stored in Oracle ASM disk groups are called Oracle ASM files. Each Oracle ASM file is contained within a single Oracle ASM disk group.

Oracle Database communicates with Oracle ASM in terms of files. This is similar to the way Oracle Database uses files on any file system.

You can store the various file types in Oracle ASM disk groups, including:

Control files 控制文件

Data files, temporary data files, and data file copies 數(shù)據(jù)文件,臨時(shí)數(shù)據(jù)文件,數(shù)據(jù)文件拷貝

SPFILEs 服務(wù)器參數(shù)文件

Online redo logs, archive logs, and Flashback logs 聯(lián)機(jī)日志,歸檔日志以及閃回日志

RMAN backups RMAN備份集

Disaster recovery configurations 災(zāi)難恢復(fù)配置

Change tracking bitmaps 改變跟蹤位圖

Data Pump dumpsets 數(shù)據(jù)泵文件

擴(kuò)展區(qū)EXTENTS

ASM文件作為一個(gè)extents的集合存儲(chǔ)在磁盤組中,extents存儲(chǔ)在不同的磁盤上。extent包含一個(gè)或多個(gè)AU,為了容納越來越大的文件,ORACLE ASM使用不同大小的extent。不同大小的extent可以支持更大的ASM數(shù)據(jù)文件,減少大數(shù)據(jù)庫SGA內(nèi)存需求,改善文件創(chuàng)建打開操作的性能。初始化extent大小等于磁盤組AU大小,它以4或16的倍數(shù)增長。

ASM條帶化(Striping)

條帶化的目的:

To balance loads across all of the disks in a disk group 負(fù)載均衡

To reduce I/O latency 減少IO延時(shí)。

為了條帶化數(shù)據(jù),ASM將文件條帶化,將數(shù)據(jù)均勻的分散在磁盤中的各個(gè)磁盤中,精細(xì)條帶化大小在任何配置中總是等于128KB,提供了更小的IO延遲。

File Templates文件模板

模板是屬性值的集合,用于確定磁盤范圍,文件鏡像以及條帶化屬性。默認(rèn)模板提供給每個(gè)oracle文件類型,但是你可以定制模板滿足獨(dú)特的需求,每個(gè)磁盤組有一個(gè)與文件類型相關(guān)聯(lián)的模板。

ASM_DISKSTRING初始化參數(shù)

用于確定發(fā)現(xiàn)磁盤組,例如可以將ASM_DISKSTRING 設(shè)置為具有三個(gè)磁盤組的字符串

ALTER SYSTEM SET ASM_DISKSTRING='SYS_DG,DATA_DG,FRA_DG' SCOPE=SPFILE SID='+ASM';

掛載和卸載磁盤

ALTER DISKGROUP DATA_DG MOUNT;

ALTER DISKGROUP DATA_DG DISMOUNT;

Online Storage Reconfigurations and Dynamic Rebalancing聯(lián)機(jī)存儲(chǔ)重配置以及動(dòng)態(tài)重平衡

Rebalancing a disk group moves data between disks to ensure that every file is evenly spread across all of the disks in a disk group.

When all of the files are evenly dispersed, all of the disks are evenly filled to the same percentage; this ensures load balancing.

Rebalancing does not relocate data based on I/O statistics nor is rebalancing started based on I/O statistics. Oracle ASM rebalancing operations are controlled by the size of the disks in a disk group.

ASM_POWER_LIMIT參數(shù)

Oracle ASM automatically initiates a rebalance after storage configuration changes, such as when you add, drop, or resize disks.

The power setting parameter determines the speed with which rebalancing operations occur.

更多Oracle相關(guān)信息見Oracle 專題頁面 http://www.linuxidc.com/topicnews.aspx?tid=12

本文永久更新鏈接地址:http://www.linuxidc.com/Linux/2016-01/127334.htm

linux

ORA-12154 TNS不能解析指定的標(biāo)識(shí)符

使用 IBM Data Studio 創(chuàng)建和管理 DB2 聯(lián)邦數(shù)據(jù)庫對象

相關(guān)資訊

ASM ASM學(xué)習(xí)

定位數(shù)據(jù)在ASM中的位置 (今 20:49)

RAC 11G ASM磁盤損壞恢復(fù) (10/15/2016 16:56:55)

Oracle Linux6.7下使用udev做ASM (07/04/2016 20:02:26)

ASM磁盤組擴(kuò)容流程 (12/01/2016 08:19:16)

Oracle 11g RAC 啟動(dòng)時(shí)無法識(shí)別ASM (10/06/2016 15:36:51)

監(jiān)控ASM磁盤組IO吞吐量 (04/10/2016 07:10:10)

本文評(píng)論

查看全部評(píng)論 (0)

表情: 表情

姓名:

匿名

字?jǐn)?shù)

同意評(píng)論聲明

評(píng)論聲明

尊重網(wǎng)上道德,遵守中華人民共和國的各項(xiàng)有關(guān)法律法規(guī)

承擔(dān)一切因您的行為而直接或間接導(dǎo)致的民事或刑事法律責(zé)任

本站管理人員有權(quán)保留或刪除其管轄留言中的任意內(nèi)容

本站有權(quán)在網(wǎng)站內(nèi)轉(zhuǎn)載或引用您的評(píng)論

參與本評(píng)論即表明您已經(jīng)閱讀并接受上述條款

最新資訊

定位數(shù)據(jù)在ASM中的位置

Oracle ASM spfile in a disk group

Oracle ASM ACFS disk group rebalance

Windows 10升級(jí)bug導(dǎo)致Bash的 Ctrl-C失效

學(xué)生黑客因銷售間諜軟件面臨10年徒刑

Debian GNU/Linux 8.7 正式發(fā)布:超 85 項(xiàng)

徹底消失,Linux下用命令行徹底刪除文件

Facebook計(jì)劃將假新聞過濾工具引進(jìn)德國

蓋茨基金會(huì)的研究無法在頂尖期刊上發(fā)表

配置VMware掛載新加入的磁盤

背景:

閱讀新聞

使用 IBM Data Studio 創(chuàng)建和管理 DB2 聯(lián)邦數(shù)據(jù)庫對象

[日期:2016-01-12]

來源:IBM

作者:聶 睿, 軟件工程師, IBM

[字體:大 中 小]

IBM Data Studio(文中簡稱 DS)在當(dāng)前最新的 4.1 版本中,相較于之前的 DS3.x 的版本,對聯(lián)邦數(shù)據(jù)庫提供了更加全面的支持。本文將介紹如何在 DS 中創(chuàng)建和管理聯(lián)邦數(shù)據(jù)庫對象。

概述

在當(dāng)今大型的企業(yè)和機(jī)構(gòu)中,海量和復(fù)雜的數(shù)據(jù)及眾多的組織部門,業(yè)務(wù)的不斷發(fā)展及企業(yè)間的競爭和合并,使得這些企業(yè)和機(jī)構(gòu)幾乎不可避免地使用不同數(shù)據(jù)庫管理系統(tǒng)來存儲(chǔ)和管理其重要的數(shù)據(jù)。IBM 提供的 DB2 和其它各類主流數(shù)據(jù)庫的聯(lián)邦功能對企業(yè)和機(jī)構(gòu)的此類信息整合的需求提供了強(qiáng)大的支持。 同時(shí),自 DB2V10 開始,隨著 DB2 一起發(fā)布的集數(shù)據(jù)庫管理,開發(fā),SQL 調(diào)優(yōu)與一體的集成工具 IBM DataStudio 在它的 4.1 的版本中,也提供了對聯(lián)邦數(shù)據(jù)庫對象創(chuàng)建和管理的全面支持,DS4.1 支持對以下 8 種遠(yuǎn)程數(shù)據(jù)源創(chuàng)建和管理聯(lián)邦數(shù)據(jù)庫對象: SQL Server,Oracle,Teradata,Informix,JDBC,ODBC,DB2,SYBASE。在之前的 DS3.x 版本,僅支持遠(yuǎn)程的 DB2 和 Oracle 這兩種數(shù)據(jù)源。并且 DS4.1 在創(chuàng)建 Nickname 時(shí),新增加了對遠(yuǎn)程數(shù)據(jù)源上的表的自動(dòng)發(fā)現(xiàn)的功能,本文將使用實(shí)例介紹如何使用 DS4.1 創(chuàng)建和管理聯(lián)邦數(shù)據(jù)庫對象。

DB2 聯(lián)邦數(shù)據(jù)庫環(huán)境的簡介

在使用 DataStudio 為不同的數(shù)據(jù)源創(chuàng)建聯(lián)邦數(shù)據(jù)庫對象之前,假設(shè)您已經(jīng)配置好了 DB2 聯(lián)邦服務(wù)器。DB2 聯(lián)邦服務(wù)器的配置是操作系統(tǒng)層面的操作,而 DataStudio 是操作數(shù)據(jù)庫的工具,因此你需要事先在您的 DB2 聯(lián)邦服務(wù)器上配置好各種數(shù)據(jù)源的支持,通常 DB2 聯(lián)邦服務(wù)器對各類數(shù)據(jù)源支持的配置包含以下步驟:

1. 把 DB2 聯(lián)邦服務(wù)器上實(shí)例參數(shù) federated 設(shè)為 YES。

2. 在 DB2 聯(lián)邦服務(wù)器上安裝配置好所支持?jǐn)?shù)據(jù)源的客戶端 , 其中 DB2 和 informix 的不需要額外安裝,DB2 聯(lián)邦服務(wù)器自帶這兩種數(shù)據(jù)源的支持。

3. 安裝 DB2 聯(lián)邦服務(wù)器的對各種數(shù)據(jù)源支持的 Wrapper,Wrapper 提供 DB2 聯(lián)邦服務(wù)器和其它類型數(shù)據(jù)源交互的功能,在安裝向?qū)е?您可以配置 Wrapper 和對應(yīng)數(shù)據(jù)源庫文件的關(guān)聯(lián)。 這些配置將被寫入 DB2 聯(lián)邦服務(wù)器的 db2dj.ini 文件中。

4. 如果您是先安裝的 DB2 聯(lián)邦服務(wù)器的 Wrapper,后安裝的各類數(shù)據(jù)源的客戶端,你也可以手動(dòng)編輯 db2dj.ini 文件,添加各個(gè) Wrapper 和對應(yīng)數(shù)據(jù)源的關(guān)聯(lián)。從 DB2V10.1 開始,提供了一個(gè)圖形化的 Wrapper 配置工具 rwcfg,你也可以用它來配置 Wrapper,配置的結(jié)果將保存在 db2dj.ini 文件中。

當(dāng)聯(lián)邦服務(wù)器的設(shè)置完成,您就可以連接到 DB2 聯(lián)邦服務(wù)器而對其它各種數(shù)據(jù)源上的表和存儲(chǔ)過程進(jìn)行操作了。接下來將介紹如何使用 DS4.1 來管理聯(lián)邦數(shù)據(jù)庫對象。

DB2 聯(lián)邦數(shù)據(jù)庫對象的創(chuàng)建

本節(jié)將以 DB2 和 Oracle 聯(lián)邦為例,用實(shí)例講解使用 DS 創(chuàng)建 Wrapper,Remote Server,User Mapping 和 Nickname。

1. 為 DB2 聯(lián)邦數(shù)據(jù)庫創(chuàng)建一個(gè)數(shù)據(jù)庫連接。

啟動(dòng) DS, 在 Administration Explorer( 文中簡稱 AE) 視圖中點(diǎn)擊“向下箭頭”的圖標(biāo),選擇 New connection to a database,如下圖 1:

注:如果 AE 視圖沒在 DS 中打開,請點(diǎn)擊 DS 菜單條上的 Windows->ShowView->Other, 在彈出的向?qū)е姓归_文件夾 Data Management, 選擇 Administration Explorer,點(diǎn)擊 OK 按鈕就可以打開此視圖。

圖 1:選擇創(chuàng)建數(shù)據(jù)庫連接

選擇創(chuàng)建數(shù)據(jù)庫連接

之后將會(huì)打開創(chuàng)建數(shù)據(jù)庫連接的向?qū)?在向?qū)е羞x擇數(shù)據(jù)庫管理器的類型,本例中是 DB2 for Linux, Unix, and Windows,然后在向?qū)е休斎霐?shù)據(jù)庫的連接信息,如下圖 2:

圖 2:創(chuàng)建數(shù)據(jù)庫連接向?qū)?/p>

創(chuàng)建數(shù)據(jù)庫連接向?qū)?></p><p></p><p>  在圖 2 中點(diǎn)擊 Test Connection 按鈕,確認(rèn)可以連接成功,然后點(diǎn)擊 Finish 按鈕,就可以在 Administration Explorer 視圖中創(chuàng)建一個(gè)數(shù)據(jù)庫連接。</p><p></p><p>  2. 創(chuàng)建一個(gè)更改計(jì)劃</p><p></p><p>  在 DS 中創(chuàng)建一個(gè)更改計(jì)劃 (Change Plan),然后在這個(gè)更改計(jì)劃中加入創(chuàng)建 Wrapper,Remote Server 和 User Mapping 的操作。 在 DS 的 AE 視圖中,展開剛創(chuàng)建的數(shù)據(jù)庫連接下的聯(lián)邦數(shù)據(jù)庫節(jié)點(diǎn),右鍵點(diǎn)擊 Change Plans,選擇 Create Change Plan,如下圖 3:</p><p></p><p>  圖 3. 選擇創(chuàng)建一個(gè)更改計(jì)劃</p><p></p><p>  <img src=

接下來,會(huì)彈出一個(gè)對話框提示輸入更改計(jì)劃的名字,指定名字為 testplan1,如下圖 4.

圖 4. 指定更改計(jì)劃的名字

指定更改計(jì)劃的名字

點(diǎn)擊上圖中的確定按鈕,新創(chuàng)建的更改計(jì)劃會(huì)顯示在 DS 的對象列表視圖 (Object List Editor 簡稱 OLE) 中,如下圖 5.

圖 5. 新創(chuàng)建更改計(jì)劃的狀態(tài)

新創(chuàng)建更改計(jì)劃的狀態(tài)

圖 5. 新創(chuàng)建更改計(jì)劃的狀態(tài)

新創(chuàng)建更改計(jì)劃的狀態(tài)

從圖 5 中可以看出,這個(gè)更改計(jì)劃處于 pending 的狀態(tài),等待被執(zhí)行,但是其中包含 0 個(gè) User change,需要加入一些操作才能被執(zhí)行。接下來把創(chuàng)建聯(lián)邦數(shù)據(jù)庫對象的操作加入其中。

3. 在更改計(jì)劃中加入創(chuàng)建 Wrapper,RemoteServer 和 UserMapping 的操作

從 DS 的 AE 視圖中,展開文件夾 Federated Database Objects, 右鍵點(diǎn)擊文件夾 Wrappers,選擇 Create Wrapper, 您將會(huì)看到在 DS 的 OLE 中會(huì)列出當(dāng)前聯(lián)邦數(shù)據(jù)庫所有的 Wrapper, 其中包含您正準(zhǔn)備創(chuàng)建的 Wrapper, 并且這個(gè) Wrapper 的屬性視圖 (Properties View) 會(huì)被打開。在屬性視圖中的 name 文本框中輸入 Wrapper 的名字 TESTORAWRA1, 在 Data Source 下拉列表中選擇 ORACLE, 其中 Data Source 下拉列表中包含 8 種數(shù)據(jù)源選項(xiàng) , 在 Library name 下拉列表中選擇 libdb2net8.a(Aix), 其中 Library name 下拉列表包含 3 個(gè)平臺(tái)文件選項(xiàng),本例中的 DB2 聯(lián)邦數(shù)據(jù)庫安裝在 Aix 機(jī)器上。細(xì)節(jié)請參考下圖 6.

圖 6. 為 ORACLE 數(shù)據(jù)源創(chuàng)建 Wrapper

為 ORACLE 數(shù)據(jù)源創(chuàng)建 Wrapper

點(diǎn)擊查看大圖

關(guān)閉 [x]

圖 6. 為 ORACLE 數(shù)據(jù)源創(chuàng)建 Wrapper

為 ORACLE 數(shù)據(jù)源創(chuàng)建 Wrapper

接下來,基于以上 Wrapper 創(chuàng)建一個(gè) Remote Server,在 DS 的 AE 視圖中,右鍵點(diǎn)擊文件夾 Remote Servers, 選擇 Create RemoteServer, 在彈出的對話框中選擇以上剛創(chuàng)建的 Wrapper. 如下圖 7.

圖 7. 創(chuàng)建 Remote Server 時(shí)選擇 Wrapper

創(chuàng)建 Remote Server 時(shí)選擇 Wrapper

在上圖中點(diǎn)擊確定按鈕,此時(shí)在 DS 的 OLE 中列出當(dāng)前聯(lián)邦數(shù)據(jù)庫中所有的 Remote Server, 其中包含您正準(zhǔn)備創(chuàng)建的 Remote Server, 并且這個(gè) Remote Server 的屬性視圖會(huì)被打開。在屬性視圖中選擇 General 頁面,然后在 name 文本框中為 Remote Server 指定名字為 TESTORASVR1, 在 TYPE 下拉列表中選擇 ORACLE, 在 Version 下拉列表中選擇 ORACLE 的版本,本例中使用的 ORACLE 版本是 11,在 Wrapper 下拉列表中選擇上面剛創(chuàng)建的 Wrapper TESTORAWRA1, 然后輸入連接 ORACLE 的用戶名和密碼,如下圖 8.

圖 8. 為 ORACLE 數(shù)據(jù)源創(chuàng)建 Remote Server 的屬性視圖

為 ORACLE 數(shù)據(jù)源創(chuàng)建 Remote Server 的屬性視圖

再在圖 8 中所示的屬性視圖中,選擇 Options 頁面,然后勾選 NODE 屬性,為 NODE 指定值,本例為 ORACLE 事先配置好的節(jié)點(diǎn)名為 ora11gcsdl1,其它選項(xiàng)都是可選的,如下圖 9.

圖 9. 為 ORACLE 數(shù)據(jù)源創(chuàng)建 Remoete Server 的選項(xiàng)設(shè)置

為 ORACLE 數(shù)據(jù)源創(chuàng)建 Remoete Server 的選項(xiàng)設(shè)置

然后,為上述新建的 Remote Server 創(chuàng)建 User Mapping。在 DS 的 AE 視圖中,右鍵點(diǎn)擊文件夾 User Mappings, 選擇 Create User Mapping,在彈出的對話框中選擇剛創(chuàng)建的 Remot Server. 如下圖 10.

圖 10. 為 ORACLE 數(shù)據(jù)源的 User Mapping 選擇 Remote Server

為 ORACLE 數(shù)據(jù)源的 User Mapping 選擇 Remote Server

在上圖中點(diǎn)擊確定按鈕,此時(shí)在 DS 的 OLE 中列出當(dāng)前聯(lián)邦數(shù)據(jù)庫中所有的 User Mapping, 其中包含您正準(zhǔn)備創(chuàng)建的 User Mapping。在這個(gè) User Mapping 的屬性視圖中選擇 General 頁面 , 在 Local user ID 文本框中輸入 DB2 聯(lián)邦數(shù)據(jù)庫的用戶名,在 Local Server name 下拉列表中選擇剛創(chuàng)建的 Remote Server, 然后在 Remote User ID 和 Remote password 文本框分別輸入遠(yuǎn)程 ORACLE 的用戶名和密碼,如下圖 11.

圖 11. 創(chuàng)建 User Mapping

創(chuàng)建 User Mapping

點(diǎn)擊查看大圖

關(guān)閉 [x]

圖 11. 創(chuàng)建 User Mapping

創(chuàng)建 User Mapping

此時(shí),我們可以看到在 OLE 上邊的更改計(jì)劃的工具欄上,更改計(jì)劃 testplan1 右邊的數(shù)字從最初的 0 變成了 3,代表目前 testplan1 中包含 3 個(gè)操作,分別是創(chuàng)建 Wrapper,創(chuàng)建 RemoteServer 和創(chuàng)建 UserMapping。點(diǎn)擊更改計(jì)劃工具欄右邊綠色的運(yùn)行按鈕 (Review and Deploy Changes),會(huì)彈出預(yù)覽部署 (Review and Deploy) 的對話框并產(chǎn)生所有操作的 DDL, 如下圖 12.

圖 12. 預(yù)覽和部署當(dāng)前的更改計(jì)劃

預(yù)覽和部署當(dāng)前的更改計(jì)劃

圖 12. 預(yù)覽和部署當(dāng)前的更改計(jì)劃

預(yù)覽和部署當(dāng)前的更改計(jì)劃

在上圖中點(diǎn)擊運(yùn)行按鈕,在 DS 的 SQL Results 視圖中可以看到 DDL 運(yùn)行的結(jié)果,如下圖 13.

圖 13. 運(yùn)行更改計(jì)劃的結(jié)果

運(yùn)行更改計(jì)劃的結(jié)果

圖 13. 運(yùn)行更改計(jì)劃的結(jié)果

運(yùn)行更改計(jì)劃的結(jié)果

從運(yùn)行結(jié)果中我們可以看到,所有的 SQL 都被成功執(zhí)行,指定的 Wraper,RemoteServer 和 UserMapping 被成功創(chuàng)建。

4. 在遠(yuǎn)程 ORACLE 數(shù)據(jù)源上創(chuàng)建表

本例中我們在遠(yuǎn)程的 ORACLE 服務(wù)器上創(chuàng)建一個(gè)表,然后在 DS 中為這個(gè)表在創(chuàng)建 Nickname.

1) 首先登錄到 DB2 聯(lián)邦數(shù)據(jù)庫的機(jī)器,連接到測試的數(shù)據(jù)庫。

清單 1. 連接到 DB2 聯(lián)邦數(shù)據(jù)庫

db2 connect to testdb

Database Connection Information

Database server=DB2/AIX64 9.7.7

SQL authorization ID=IIFVT66

Local database alias=TESTDB

2) 打開一個(gè) session 連接到 ORACLE 服務(wù)器端。

清單 2. 打開一個(gè) session 連接到 ORACLE 數(shù)據(jù)源

db2 set passthru TESTORASVR1

DB20000I The SQL command completed successfully.

3) 在遠(yuǎn)程 ORACLE 服務(wù)器上創(chuàng)建一個(gè)表。

清單 3. 創(chuàng)建遠(yuǎn)程表

db2 "create table J15USER1.TESTTAB01(C1 integer, C2 varchar(12))"

DB20000I The SQL command completed successfully.

5. 為遠(yuǎn)程 ORACLE 數(shù)據(jù)庫上的表創(chuàng)建 Nickname

在 DS 的 AE 視圖中,右鍵點(diǎn)擊文件夾 Nicknames, 選擇 Create Nickname, 在彈出的對話框中選擇一個(gè) Schema. 如下圖 14.

圖 14. 為 Nickname 選擇一個(gè) Schema

為 Nickname 選擇一個(gè) Schema

選擇一個(gè) schema 后點(diǎn)擊確認(rèn)按鈕,此時(shí)在 DS 的 OLE 中列出當(dāng)前聯(lián)邦數(shù)據(jù)庫中所有的 Nickname, 其中包含您正準(zhǔn)備創(chuàng)建的 Nickname。在這個(gè) Nickname 的屬性視圖中選擇 General 頁面 , 在 Name 文本框中為 Nickname 指定一個(gè)名字,在 Server 下拉列表中選擇剛創(chuàng)建的 TESTORASVR1, 然后在 Remote Schema 文本框中輸入遠(yuǎn)程 ORACLE 上的 schema, 在 Remote table 文本框中輸入我們剛才創(chuàng)建的表 TESTTAB01。請參考下圖 15.

圖 15. 為遠(yuǎn)程 ORACLE 服務(wù)器上的表創(chuàng)建 Nickname

為遠(yuǎn)程 ORACLE 服務(wù)器上的表創(chuàng)建 Nickname

在此強(qiáng)調(diào)一下,如果在做數(shù)據(jù)庫對象操作之前沒有創(chuàng)建更改計(jì)劃,DS 會(huì)為用戶的操作默認(rèn)創(chuàng)建一個(gè)更改計(jì)劃。如上圖,一個(gè)名為 Default Change Plan2013-04-11 13-44-19 的更改計(jì)劃被默認(rèn)創(chuàng)建,此更改計(jì)劃包含一個(gè)操作,也就是我們創(chuàng)建 Nickname 的操作,點(diǎn)擊更改計(jì)劃菜單欄右邊綠色的預(yù)覽和部署 (Review and Deploy Changplan) 按鈕。在彈出的預(yù)覽和部署對話框中會(huì)包含創(chuàng)建 Nickname 的 DDL,如下圖 16.

圖 16. 預(yù)覽和部署創(chuàng)建 Nickname 的 DDL.

預(yù)覽和部署創(chuàng)建 Nickname 的 DDL.

在上圖中點(diǎn)擊運(yùn)行按鈕,從 SQL Result 視圖中我們可以看到 Nickname 被成功的創(chuàng)建。新創(chuàng)建的 Nickname 也顯示在 OLE 中,如下圖 17.

圖 17. 成功為遠(yuǎn)程 ORACLE 數(shù)據(jù)庫上的表創(chuàng)建 Nickname.

成功為遠(yuǎn)程 ORACLE 數(shù)據(jù)庫上的表創(chuàng)建 Nickname.

為其它數(shù)據(jù)源創(chuàng)建聯(lián)邦數(shù)據(jù)庫對象的操作和以上步驟類似,都是在 DS 的 AE 視圖,OLE 視圖,和屬性視圖中操作,然后部署所對應(yīng)的更改計(jì)劃。 至此,讀者可能發(fā)現(xiàn)當(dāng)創(chuàng)建 Nickname 時(shí),需要手動(dòng)地輸入遠(yuǎn)程數(shù)據(jù)源上的表,如果要?jiǎng)?chuàng)建多個(gè) Nickname 時(shí),需要一個(gè)一個(gè)地去創(chuàng)建,這確實(shí)不太方便。為了更加方便用戶的操作,在 DS4.1 中加入了 Nickname 的自動(dòng)發(fā)現(xiàn)功能,此功能允許用戶同時(shí)為多個(gè)遠(yuǎn)程數(shù)據(jù)源上的多個(gè)表創(chuàng)建 Nickname。下面將做詳細(xì)介紹。

更多詳情見請繼續(xù)閱讀下一頁的精彩內(nèi)容: http://www.linuxidc.com/Linux/2016-01/127335p2.htm

linux

123下一頁

ASM學(xué)習(xí)之概述

SQLite數(shù)據(jù)庫常用語句及MAC上的SQLite可視化工具M(jìn)easSQLlite使用

相關(guān)資訊

DB2

IBM DB2本地緩沖區(qū)溢出漏洞(CVE- (今 19:28)

DB2安裝部署以及應(yīng)用部署配置操作 (02月23日)

DB2中REVERSE函數(shù)的實(shí)現(xiàn) (01/19/2016 15:54:23)

IBM DB2 信息泄露漏洞(CVE-2017- (03月09日)

RHEL5 下安裝 DB2 V9.7 數(shù)據(jù)庫 (09/28/2016 09:39:08)

DB2常用腳本整理 (01/19/2016 15:00:44)

本文評(píng)論

查看全部評(píng)論 (0)

表情: 表情

姓名:

匿名

字?jǐn)?shù)

同意評(píng)論聲明

評(píng)論聲明

尊重網(wǎng)上道德,遵守中華人民共和國的各項(xiàng)有關(guān)法律法規(guī)

承擔(dān)一切因您的行為而直接或間接導(dǎo)致的民事或刑事法律責(zé)任

本站管理人員有權(quán)保留或刪除其管轄留言中的任意內(nèi)容

本站有權(quán)在網(wǎng)站內(nèi)轉(zhuǎn)載或引用您的評(píng)論

參與本評(píng)論即表明您已經(jīng)閱讀并接受上述條款

最新資訊

IBM DB2本地緩沖區(qū)溢出漏洞(CVE-2017-1297

英國最新航母仍然運(yùn)行 Windows XP

Facebook 月活躍用戶突破 20 億

NVIDIA 將發(fā)布專為挖掘數(shù)字貨幣設(shè)計(jì)的顯卡

三星將在 7 月 7 日發(fā)布翻修過的 Galaxy

研究證實(shí)存在互相環(huán)繞的超大質(zhì)量黑洞

MIT 的汽油引擎無人機(jī)能在空中停留五天

蘋果 tvOS 11 與 macOS High Sierra 也開放

Adobe 授權(quán)微店在中國賣 Creative Cloud

天文學(xué)家拍下目前為止最清晰的參宿四照片

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容