11G ASM磁盘组不能自动MOUNT处理_2

背景:


阅读新闻

11G ASM磁盘组不能自动MOUNT处理

[日期:2016-01-12]

来源:Linux社区

作者:Linux

[字体:大 中 小]

今天启动了一下ASM,发现只挂载了一个SYS_DG磁盘组(用于存放OCR和VOTING DISK信息),另外两个磁盘组DATA_DG,DG_FRA都没有mount。

环境: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

查看参数disk_groups发现没有值,按理来说应该是这三个磁盘组。

SQL> show parameter disk

NAME TYPE VALUE

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

asm_diskgroups string

asm_diskstring string

进行修改

[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中进行修改,尝试修改

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

System altered.

是可以修改,但是没办法永久保存,要修改的是spfile中的disk_groups参数,让ASM实例每次启动都能加载所有的diskgroup。

那问题就是如何修改spfile中的asm_diskgroups参数

通过create pfile 然后修改pfile,再通过pfile创建spfile,重启实例即可。

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

发现磁盘组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

只能以这种方式进行asm_diskgroups参数的修改

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九度快排系统 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

发现使用的$CRS_HOME/dbs/spfile+ASM.ora参数文件,而不是磁盘组SYS_DG上的参数文件。

可以让asm实例启动的时候读取磁盘组上的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进去,否则创建spfile报错。只能再通过alter system进行修改。

总结:在NOMOUNT阶段oracle根据参数文件来分配内存空间及启动后台进程,这个时候磁盘组都没有加载,但是oracle的spfile是直接从磁盘读取的,与SYS_DG是否MOUNT没关系。

更多Oracle相关信息见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处理

相关资讯

ASM

定位数据在ASM中的位置 (今 20:49)

RAC 11G ASM磁盘损坏恢复 (10/15/2016 16:56:55)

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

ASM磁盘组扩容流程 (12/01/2016 08:19:16)

Oracle 11g RAC 启动时无法识别ASM (10/06/2016 15:36:51)

监控ASM磁盘组IO吞吐量 (04/10/2016 07:10:10)

本文评论

查看全部评论 (0)

表情: 表情

姓名:

匿名

字数

同意评论声明

评论声明

尊重网上道德,遵守中华人民共和国的各项有关法律法规

承担一切因您的行为而直接或间接导致的民事或刑事法律责任

本站管理人员有权保留或删除其管辖留言中的任意内容

本站有权在网站内转载或引用您的评论

参与本评论即表明您已经阅读并接受上述条款

最新资讯

定位数据在ASM中的位置

Oracle ASM spfile in a disk group

Oracle ASM ACFS disk group rebalance

Windows 10升级bug导致Bash的 Ctrl-C失效

学生黑客因销售间谍软件面临10年徒刑

Debian GNU/Linux 8.7 正式发布:超 85 项

彻底消失,Linux下用命令行彻底删除文件

Facebook计划将假新闻过滤工具引进德国

盖茨基金会的研究无法在顶尖期刊上发表

配置VMware挂载新加入的磁盘

背景:

阅读新闻

ORA-01012: not logged on处理

[日期:2016-01-12]

来源:Linux社区

作者: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

从日志可以发现是实例出现异常,导致无法启动shutdown,尝试强行停止

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相关信息见Oracle 专题页面 http://www.linuxidc.com/topicnews.aspx?tid=12

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

linux

11G ASM磁盘组不能自动MOUNT处理

Win远程Linux下的ASM实例

相关资讯

ORA-01012

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

本文评论

查看全部评论 (0)

表情: 表情

姓名:

匿名

字数

同意评论声明

评论声明

尊重网上道德,遵守中华人民共和国的各项有关法律法规

承担一切因您的行为而直接或间接导致的民事或刑事法律责任

本站管理人员有权保留或删除其管辖留言中的任意内容

本站有权在网站内转载或引用您的评论

参与本评论即表明您已经阅读并接受上述条款

最新资讯

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

基于XtraBackup 2.3.5 的 MySQL全量备份与

Chrome OS 现可支持简易密码解锁

NSA的代码遭到教授的嘲笑

Fedora 25将默认使用Wayland

Nagios 监控 SNMP 温度计

JavaScript函数定义与函数作用域详解

Java培训:对象和类

Java培训:基本数据类型

Java培训:变量类型

背景:

阅读新闻

Win远程Linux下的ASM实例

[日期:2016-01-12]

来源:Linux社区

作者:Linux

[字体:大 中 小]

一、Win远程Linux下的ASM实例

1.Linux下的监听文件

[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.监听状态

[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文件中添加如下内容

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远程访问使用的参数,我的win和linux都安装的是oracle11gR2,测试中发现在动态监听加不加UR=A都可以远程访问。

更多Oracle相关信息见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不能解析指定的标识符

相关资讯

ASM ASM实例

定位数据在ASM中的位置 (今 20:49)

RAC 11G ASM磁盘损坏恢复 (10/15/2016 16:56:55)

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

ASM磁盘组扩容流程 (12/01/2016 08:19:16)

Oracle 11g RAC 启动时无法识别ASM (10/06/2016 15:36:51)

监控ASM磁盘组IO吞吐量 (04/10/2016 07:10:10)

本文评论

查看全部评论 (0)

表情: 表情

姓名:

匿名

字数

同意评论声明

评论声明

尊重网上道德,遵守中华人民共和国的各项有关法律法规

承担一切因您的行为而直接或间接导致的民事或刑事法律责任

本站管理人员有权保留或删除其管辖留言中的任意内容

本站有权在网站内转载或引用您的评论

参与本评论即表明您已经阅读并接受上述条款

最新资讯

定位数据在ASM中的位置

Oracle ASM spfile in a disk group

Oracle ASM ACFS disk group rebalance

Windows 10升级bug导致Bash的 Ctrl-C失效

学生黑客因销售间谍软件面临10年徒刑

Debian GNU/Linux 8.7 正式发布:超 85 项

彻底消失,Linux下用命令行彻底删除文件

Facebook计划将假新闻过滤工具引进德国

盖茨基金会的研究无法在顶尖期刊上发表

配置VMware挂载新加入的磁盘

背景:

阅读新闻

ORA-12154 TNS不能解析指定的标识符

[日期:2016-01-12]

来源:Linux社区

作者:Linux

[字体:大 中 小]

在Win下用pl/sql developer访问远程Linux的DB报

ORA-12154 TNS不能解析标示符,但是在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

在网上找了一会儿也没解决,因为遇到的情况都不一样。

突然想到Oracle11g在创建完数据库以后,是不能使用PL/SQL连接的,必须在oracle官网下载instantclient-basic-win32-11.2.0.1.0.zip(注意:与DB版本对应)

解压之后为instantclient_11_2目录,需要做的就是把ORACLE_HOME下的NETWORK/ADMIN拷贝到解压之后的instantclient_11_2目录下。

然后打开PL/SQL DEV-->工具-->首选项-->左侧Oracle-->连接中的ORACLE主目录(instantclient_11_2的全目录,比如D:\instantclient_11_2),OCI库会自动检测的。

之后再进行测试,连接成功。

更多Oracle相关信息见Oracle 专题页面 http://www.linuxidc.com/topicnews.aspx?tid=12

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

linux

Win远程Linux下的ASM实例

ASM学习之概述

相关资讯

ORA-12154

Oracle客户端PL/SQL Developer连接 (今 08:02)

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

exp/imp导出导入数据时报错ORA- (01/03/2014 21:30:40)

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

Oracle客户端简易连接报错ORA- (07/21/2015 14:50:56)

EasyConnect出现ORA-12154(无法解 (10/26/2013 07:35:33)

本文评论

查看全部评论 (0)

表情: 表情

姓名:

匿名

字数

同意评论声明

评论声明

尊重网上道德,遵守中华人民共和国的各项有关法律法规

承担一切因您的行为而直接或间接导致的民事或刑事法律责任

本站管理人员有权保留或删除其管辖留言中的任意内容

本站有权在网站内转载或引用您的评论

参与本评论即表明您已经阅读并接受上述条款

最新资讯

Oracle客户端PL/SQL Developer连接不上报错

Linux下全自动编译安装MySQL

Linux中rpm命令误卸载了的恢复

IBM QRadar SIEM安全限制绕过漏洞(CVE-

研究称智能手机的存在能降低人的认知能力

NASA 否认发现外星生命

cURL 作者被拒绝入境美国

任天堂将在 9 月发布 Super Nintendo

Google 回应欧盟对其比较购物服务开出的巨

Microsoft Skype栈缓冲区溢出漏洞(CVE-

背景:

阅读新闻

ASM学习之概述

[日期:2016-01-12]

来源:Linux社区

作者: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是一个卷管理器,Oracle数据库文件的一个文件系统,ASM支持单实例和集群配置,它是oracle推荐的存储方案,为传统卷管理器,文件系统,裸设备提供一个选择。

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使用磁盘组存储数据文件,磁盘组是是磁盘的集合,ASM以AU(allocate unit分配单元,默认是1M,但是可以修改)来管理磁盘的,在磁盘中,ASM给数据库文件提供了一个系统接口,存储在磁盘组的文件内容被均匀的分布以避免热点,为方位磁盘提供均衡的性能。ASM性能跟裸设备的性能是相当的。

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会自动重新分布文件内容,同时在重分布期间会减少停机时间。

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来简化数据库文件管理,OMF在指定的位置自动创建文件,当表空间或文件被删除时,在释放空间的同事,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通过合并数据存储到少量的磁盘组来减少管理费用,少量的磁盘组整合多数据库的存储,并提供更高的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实例文件能与其他的存储管理设备(裸设备,第三方文件系统)并存。容量可以简化ASM到已存在环境的整合。

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是一个多平台,可扩展性的文件系统,存储管理技术,扩展ASM功能以支持维护Oracle数据库外面的客户文件。ADVM为客户端提供卷管理服务和标准的磁盘设备驱动接口

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中的向导可以帮助你迁移非ASM数据库文件到ASM,也可以使用SQLPLUS,ASMCMD,ASMCA,OEM.

ASM实例

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和一些后台进程,然而,ASM比DB执行更少的任务,SGA要比DB的小得多,另外,ASM在server上对性能的影响很小,数据库实例启动之前,必须先启动ASM实例挂载磁盘组。它不会挂载数据库。

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中,之前是安装在独立的ORACLE HOME下。ASM实例和数据库实例共同访问磁盘中的磁盘。 ASM实例管理磁盘组中的metadata,为数据库实例提供文件布局信息。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 数据文件扩展区的位置

A redo log that records information about atomically changing metadata blocks 改变元始据块的redo

Oracle ADVM volume information

ORACLE ASM实例可以使用clusteware集群,每个节点都有一个ASM instance,如果几个不同的数据库实例在同一个节点上,那么这些数据库实例共享这个单一ASM INSTANCE。如果ASM实例在一个节点上故障,那么所有的数据库实例在这个节点上也故障,它不像文件系统驱动发生故障那样,ASM instance故障不要求重启OS,在RAC下,ASM和DB instance在正常的节点上自动恢复ASM instance故障。

在单实例环境下,多个数据库instance共享一个asm instance;在RAC下,Oracle ASM提供了一个集群存储池,每个节点ASM instance为多个ORACLE RAC或single-instance DB服务,所有的数据库被合并,而且共享ASM磁盘组。

集群存储池被多个单实例数据库共享,多个数据库instance可以共享共同的磁盘组。clustered storage pool是用Oracle clusterware完成的。

Oracle ASM Disk Groups

磁盘组包含多个磁盘,而且是ASM实例管理的基本对象。每个磁盘组包含用于空间管理的元数据,磁盘组组件包括磁盘,文件,分配单元AU.

文件是从磁盘中分配,任何ASM文件完全包含在一个单独的磁盘组中,然而,一个磁盘组可能多个数据库的文件,一个数据库可能从多个磁盘组读取文件,对于大多数安装来说,只需要很少磁盘组,通常2个,不多于3个。

磁盘镜像(Mirroring)和故障组(Failure Groups)

镜像有三种方式,也是三种冗余级别:

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

冗余级别允许多少个磁盘故障,而不是卸载磁盘或丢失数据。磁盘组类型决定镜像级别。ORACLE ASM镜像比附加RAID镜像更加灵活。

当ASM分配给一个镜像文件分配一个extent时,ORACLE ASM分配一个primary copy和一个mirror copy。ASM选择磁盘在不同的故障组去存储mirror copy而不是primary copy。

故障组用于存放mirror copy以便每个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 数据文件,临时数据文件,数据文件拷贝

SPFILEs 服务器参数文件

Online redo logs, archive logs, and Flashback logs 联机日志,归档日志以及闪回日志

RMAN backups RMAN备份集

Disaster recovery configurations 灾难恢复配置

Change tracking bitmaps 改变跟踪位图

Data Pump dumpsets 数据泵文件

扩展区EXTENTS

ASM文件作为一个extents的集合存储在磁盘组中,extents存储在不同的磁盘上。extent包含一个或多个AU,为了容纳越来越大的文件,ORACLE ASM使用不同大小的extent。不同大小的extent可以支持更大的ASM数据文件,减少大数据库SGA内存需求,改善文件创建打开操作的性能。初始化extent大小等于磁盘组AU大小,它以4或16的倍数增长。

ASM条带化(Striping)

条带化的目的:

To balance loads across all of the disks in a disk group 负载均衡

To reduce I/O latency 减少IO延时。

为了条带化数据,ASM将文件条带化,将数据均匀的分散在磁盘中的各个磁盘中,精细条带化大小在任何配置中总是等于128KB,提供了更小的IO延迟。

File Templates文件模板

模板是属性值的集合,用于确定磁盘范围,文件镜像以及条带化属性。默认模板提供给每个oracle文件类型,但是你可以定制模板满足独特的需求,每个磁盘组有一个与文件类型相关联的模板。

ASM_DISKSTRING初始化参数

用于确定发现磁盘组,例如可以将ASM_DISKSTRING 设置为具有三个磁盘组的字符串

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联机存储重配置以及动态重平衡

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参数

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相关信息见Oracle 专题页面 http://www.linuxidc.com/topicnews.aspx?tid=12

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

linux

ORA-12154 TNS不能解析指定的标识符

使用 IBM Data Studio 创建和管理 DB2 联邦数据库对象

相关资讯

ASM ASM学习

定位数据在ASM中的位置 (今 20:49)

RAC 11G ASM磁盘损坏恢复 (10/15/2016 16:56:55)

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

ASM磁盘组扩容流程 (12/01/2016 08:19:16)

Oracle 11g RAC 启动时无法识别ASM (10/06/2016 15:36:51)

监控ASM磁盘组IO吞吐量 (04/10/2016 07:10:10)

本文评论

查看全部评论 (0)

表情: 表情

姓名:

匿名

字数

同意评论声明

评论声明

尊重网上道德,遵守中华人民共和国的各项有关法律法规

承担一切因您的行为而直接或间接导致的民事或刑事法律责任

本站管理人员有权保留或删除其管辖留言中的任意内容

本站有权在网站内转载或引用您的评论

参与本评论即表明您已经阅读并接受上述条款

最新资讯

定位数据在ASM中的位置

Oracle ASM spfile in a disk group

Oracle ASM ACFS disk group rebalance

Windows 10升级bug导致Bash的 Ctrl-C失效

学生黑客因销售间谍软件面临10年徒刑

Debian GNU/Linux 8.7 正式发布:超 85 项

彻底消失,Linux下用命令行彻底删除文件

Facebook计划将假新闻过滤工具引进德国

盖茨基金会的研究无法在顶尖期刊上发表

配置VMware挂载新加入的磁盘

背景:

阅读新闻

使用 IBM Data Studio 创建和管理 DB2 联邦数据库对象

[日期:2016-01-12]

来源:IBM

作者:聂 睿, 软件工程师, IBM

[字体:大 中 小]

IBM Data Studio(文中简称 DS)在当前最新的 4.1 版本中,相较于之前的 DS3.x 的版本,对联邦数据库提供了更加全面的支持。本文将介绍如何在 DS 中创建和管理联邦数据库对象。

概述

在当今大型的企业和机构中,海量和复杂的数据及众多的组织部门,业务的不断发展及企业间的竞争和合并,使得这些企业和机构几乎不可避免地使用不同数据库管理系统来存储和管理其重要的数据。IBM 提供的 DB2 和其它各类主流数据库的联邦功能对企业和机构的此类信息整合的需求提供了强大的支持。 同时,自 DB2V10 开始,随着 DB2 一起发布的集数据库管理,开发,SQL 调优与一体的集成工具 IBM DataStudio 在它的 4.1 的版本中,也提供了对联邦数据库对象创建和管理的全面支持,DS4.1 支持对以下 8 种远程数据源创建和管理联邦数据库对象: SQL Server,Oracle,Teradata,Informix,JDBC,ODBC,DB2,SYBASE。在之前的 DS3.x 版本,仅支持远程的 DB2 和 Oracle 这两种数据源。并且 DS4.1 在创建 Nickname 时,新增加了对远程数据源上的表的自动发现的功能,本文将使用实例介绍如何使用 DS4.1 创建和管理联邦数据库对象。

DB2 联邦数据库环境的简介

在使用 DataStudio 为不同的数据源创建联邦数据库对象之前,假设您已经配置好了 DB2 联邦服务器。DB2 联邦服务器的配置是操作系统层面的操作,而 DataStudio 是操作数据库的工具,因此你需要事先在您的 DB2 联邦服务器上配置好各种数据源的支持,通常 DB2 联邦服务器对各类数据源支持的配置包含以下步骤:

1. 把 DB2 联邦服务器上实例参数 federated 设为 YES。

2. 在 DB2 联邦服务器上安装配置好所支持数据源的客户端 , 其中 DB2 和 informix 的不需要额外安装,DB2 联邦服务器自带这两种数据源的支持。

3. 安装 DB2 联邦服务器的对各种数据源支持的 Wrapper,Wrapper 提供 DB2 联邦服务器和其它类型数据源交互的功能,在安装向导中,您可以配置 Wrapper 和对应数据源库文件的关联。 这些配置将被写入 DB2 联邦服务器的 db2dj.ini 文件中。

4. 如果您是先安装的 DB2 联邦服务器的 Wrapper,后安装的各类数据源的客户端,你也可以手动编辑 db2dj.ini 文件,添加各个 Wrapper 和对应数据源的关联。从 DB2V10.1 开始,提供了一个图形化的 Wrapper 配置工具 rwcfg,你也可以用它来配置 Wrapper,配置的结果将保存在 db2dj.ini 文件中。

当联邦服务器的设置完成,您就可以连接到 DB2 联邦服务器而对其它各种数据源上的表和存储过程进行操作了。接下来将介绍如何使用 DS4.1 来管理联邦数据库对象。

DB2 联邦数据库对象的创建

本节将以 DB2 和 Oracle 联邦为例,用实例讲解使用 DS 创建 Wrapper,Remote Server,User Mapping 和 Nickname。

1. 为 DB2 联邦数据库创建一个数据库连接。

启动 DS, 在 Administration Explorer( 文中简称 AE) 视图中点击“向下箭头”的图标,选择 New connection to a database,如下图 1:

注:如果 AE 视图没在 DS 中打开,请点击 DS 菜单条上的 Windows->ShowView->Other, 在弹出的向导中展开文件夹 Data Management, 选择 Administration Explorer,点击 OK 按钮就可以打开此视图。

图 1:选择创建数据库连接

选择创建数据库连接

之后将会打开创建数据库连接的向导,在向导中选择数据库管理器的类型,本例中是 DB2 for Linux, Unix, and Windows,然后在向导中输入数据库的连接信息,如下图 2:

图 2:创建数据库连接向导

创建数据库连接向导

在图 2 中点击 Test Connection 按钮,确认可以连接成功,然后点击 Finish 按钮,就可以在 Administration Explorer 视图中创建一个数据库连接。

2. 创建一个更改计划

在 DS 中创建一个更改计划 (Change Plan),然后在这个更改计划中加入创建 Wrapper,Remote Server 和 User Mapping 的操作。 在 DS 的 AE 视图中,展开刚创建的数据库连接下的联邦数据库节点,右键点击 Change Plans,选择 Create Change Plan,如下图 3:

图 3. 选择创建一个更改计划

选择创建一个更改计划导

接下来,会弹出一个对话框提示输入更改计划的名字,指定名字为 testplan1,如下图 4.

图 4. 指定更改计划的名字

指定更改计划的名字

点击上图中的确定按钮,新创建的更改计划会显示在 DS 的对象列表视图 (Object List Editor 简称 OLE) 中,如下图 5.

图 5. 新创建更改计划的状态

新创建更改计划的状态

图 5. 新创建更改计划的状态

新创建更改计划的状态

从图 5 中可以看出,这个更改计划处于 pending 的状态,等待被执行,但是其中包含 0 个 User change,需要加入一些操作才能被执行。接下来把创建联邦数据库对象的操作加入其中。

3. 在更改计划中加入创建 Wrapper,RemoteServer 和 UserMapping 的操作

从 DS 的 AE 视图中,展开文件夹 Federated Database Objects, 右键点击文件夹 Wrappers,选择 Create Wrapper, 您将会看到在 DS 的 OLE 中会列出当前联邦数据库所有的 Wrapper, 其中包含您正准备创建的 Wrapper, 并且这个 Wrapper 的属性视图 (Properties View) 会被打开。在属性视图中的 name 文本框中输入 Wrapper 的名字 TESTORAWRA1, 在 Data Source 下拉列表中选择 ORACLE, 其中 Data Source 下拉列表中包含 8 种数据源选项 , 在 Library name 下拉列表中选择 libdb2net8.a(Aix), 其中 Library name 下拉列表包含 3 个平台文件选项,本例中的 DB2 联邦数据库安装在 Aix 机器上。细节请参考下图 6.

图 6. 为 ORACLE 数据源创建 Wrapper

为 ORACLE 数据源创建 Wrapper

点击查看大图

关闭 [x]

图 6. 为 ORACLE 数据源创建 Wrapper

为 ORACLE 数据源创建 Wrapper

接下来,基于以上 Wrapper 创建一个 Remote Server,在 DS 的 AE 视图中,右键点击文件夹 Remote Servers, 选择 Create RemoteServer, 在弹出的对话框中选择以上刚创建的 Wrapper. 如下图 7.

图 7. 创建 Remote Server 时选择 Wrapper

创建 Remote Server 时选择 Wrapper

在上图中点击确定按钮,此时在 DS 的 OLE 中列出当前联邦数据库中所有的 Remote Server, 其中包含您正准备创建的 Remote Server, 并且这个 Remote Server 的属性视图会被打开。在属性视图中选择 General 页面,然后在 name 文本框中为 Remote Server 指定名字为 TESTORASVR1, 在 TYPE 下拉列表中选择 ORACLE, 在 Version 下拉列表中选择 ORACLE 的版本,本例中使用的 ORACLE 版本是 11,在 Wrapper 下拉列表中选择上面刚创建的 Wrapper TESTORAWRA1, 然后输入连接 ORACLE 的用户名和密码,如下图 8.

图 8. 为 ORACLE 数据源创建 Remote Server 的属性视图

为 ORACLE 数据源创建 Remote Server 的属性视图

再在图 8 中所示的属性视图中,选择 Options 页面,然后勾选 NODE 属性,为 NODE 指定值,本例为 ORACLE 事先配置好的节点名为 ora11gcsdl1,其它选项都是可选的,如下图 9.

图 9. 为 ORACLE 数据源创建 Remoete Server 的选项设置

为 ORACLE 数据源创建 Remoete Server 的选项设置

然后,为上述新建的 Remote Server 创建 User Mapping。在 DS 的 AE 视图中,右键点击文件夹 User Mappings, 选择 Create User Mapping,在弹出的对话框中选择刚创建的 Remot Server. 如下图 10.

图 10. 为 ORACLE 数据源的 User Mapping 选择 Remote Server

为 ORACLE 数据源的 User Mapping 选择 Remote Server

在上图中点击确定按钮,此时在 DS 的 OLE 中列出当前联邦数据库中所有的 User Mapping, 其中包含您正准备创建的 User Mapping。在这个 User Mapping 的属性视图中选择 General 页面 , 在 Local user ID 文本框中输入 DB2 联邦数据库的用户名,在 Local Server name 下拉列表中选择刚创建的 Remote Server, 然后在 Remote User ID 和 Remote password 文本框分别输入远程 ORACLE 的用户名和密码,如下图 11.

图 11. 创建 User Mapping

创建 User Mapping

点击查看大图

关闭 [x]

图 11. 创建 User Mapping

创建 User Mapping

此时,我们可以看到在 OLE 上边的更改计划的工具栏上,更改计划 testplan1 右边的数字从最初的 0 变成了 3,代表目前 testplan1 中包含 3 个操作,分别是创建 Wrapper,创建 RemoteServer 和创建 UserMapping。点击更改计划工具栏右边绿色的运行按钮 (Review and Deploy Changes),会弹出预览部署 (Review and Deploy) 的对话框并产生所有操作的 DDL, 如下图 12.

图 12. 预览和部署当前的更改计划

预览和部署当前的更改计划

图 12. 预览和部署当前的更改计划

预览和部署当前的更改计划

在上图中点击运行按钮,在 DS 的 SQL Results 视图中可以看到 DDL 运行的结果,如下图 13.

图 13. 运行更改计划的结果

运行更改计划的结果

图 13. 运行更改计划的结果

运行更改计划的结果

从运行结果中我们可以看到,所有的 SQL 都被成功执行,指定的 Wraper,RemoteServer 和 UserMapping 被成功创建。

4. 在远程 ORACLE 数据源上创建表

本例中我们在远程的 ORACLE 服务器上创建一个表,然后在 DS 中为这个表在创建 Nickname.

1) 首先登录到 DB2 联邦数据库的机器,连接到测试的数据库。

清单 1. 连接到 DB2 联邦数据库

db2 connect to testdb

Database Connection Information

Database server=DB2/AIX64 9.7.7

SQL authorization ID=IIFVT66

Local database alias=TESTDB

2) 打开一个 session 连接到 ORACLE 服务器端。

清单 2. 打开一个 session 连接到 ORACLE 数据源

db2 set passthru TESTORASVR1

DB20000I The SQL command completed successfully.

3) 在远程 ORACLE 服务器上创建一个表。

清单 3. 创建远程表

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

DB20000I The SQL command completed successfully.

5. 为远程 ORACLE 数据库上的表创建 Nickname

在 DS 的 AE 视图中,右键点击文件夹 Nicknames, 选择 Create Nickname, 在弹出的对话框中选择一个 Schema. 如下图 14.

图 14. 为 Nickname 选择一个 Schema

为 Nickname 选择一个 Schema

选择一个 schema 后点击确认按钮,此时在 DS 的 OLE 中列出当前联邦数据库中所有的 Nickname, 其中包含您正准备创建的 Nickname。在这个 Nickname 的属性视图中选择 General 页面 , 在 Name 文本框中为 Nickname 指定一个名字,在 Server 下拉列表中选择刚创建的 TESTORASVR1, 然后在 Remote Schema 文本框中输入远程 ORACLE 上的 schema, 在 Remote table 文本框中输入我们刚才创建的表 TESTTAB01。请参考下图 15.

图 15. 为远程 ORACLE 服务器上的表创建 Nickname

为远程 ORACLE 服务器上的表创建 Nickname

在此强调一下,如果在做数据库对象操作之前没有创建更改计划,DS 会为用户的操作默认创建一个更改计划。如上图,一个名为 Default Change Plan2013-04-11 13-44-19 的更改计划被默认创建,此更改计划包含一个操作,也就是我们创建 Nickname 的操作,点击更改计划菜单栏右边绿色的预览和部署 (Review and Deploy Changplan) 按钮。在弹出的预览和部署对话框中会包含创建 Nickname 的 DDL,如下图 16.

图 16. 预览和部署创建 Nickname 的 DDL.

预览和部署创建 Nickname 的 DDL.

在上图中点击运行按钮,从 SQL Result 视图中我们可以看到 Nickname 被成功的创建。新创建的 Nickname 也显示在 OLE 中,如下图 17.

图 17. 成功为远程 ORACLE 数据库上的表创建 Nickname.

成功为远程 ORACLE 数据库上的表创建 Nickname.

为其它数据源创建联邦数据库对象的操作和以上步骤类似,都是在 DS 的 AE 视图,OLE 视图,和属性视图中操作,然后部署所对应的更改计划。 至此,读者可能发现当创建 Nickname 时,需要手动地输入远程数据源上的表,如果要创建多个 Nickname 时,需要一个一个地去创建,这确实不太方便。为了更加方便用户的操作,在 DS4.1 中加入了 Nickname 的自动发现功能,此功能允许用户同时为多个远程数据源上的多个表创建 Nickname。下面将做详细介绍。

更多详情见请继续阅读下一页的精彩内容: http://www.linuxidc.com/Linux/2016-01/127335p2.htm

linux

123下一页

ASM学习之概述

SQLite数据库常用语句及MAC上的SQLite可视化工具MeasSQLlite使用

相关资讯

DB2

IBM DB2本地缓冲区溢出漏洞(CVE- (今 19:28)

DB2安装部署以及应用部署配置操作 (02月23日)

DB2中REVERSE函数的实现 (01/19/2016 15:54:23)

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

RHEL5 下安装 DB2 V9.7 数据库 (09/28/2016 09:39:08)

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

本文评论

查看全部评论 (0)

表情: 表情

姓名:

匿名

字数

同意评论声明

评论声明

尊重网上道德,遵守中华人民共和国的各项有关法律法规

承担一切因您的行为而直接或间接导致的民事或刑事法律责任

本站管理人员有权保留或删除其管辖留言中的任意内容

本站有权在网站内转载或引用您的评论

参与本评论即表明您已经阅读并接受上述条款

最新资讯

IBM DB2本地缓冲区溢出漏洞(CVE-2017-1297

英国最新航母仍然运行 Windows XP

Facebook 月活跃用户突破 20 亿

NVIDIA 将发布专为挖掘数字货币设计的显卡

三星将在 7 月 7 日发布翻修过的 Galaxy

研究证实存在互相环绕的超大质量黑洞

MIT 的汽油引擎无人机能在空中停留五天

苹果 tvOS 11 与 macOS High Sierra 也开放

Adobe 授权微店在中国卖 Creative Cloud

天文学家拍下目前为止最清晰的参宿四照片

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 148,637评论 1 318
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 63,443评论 1 266
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 99,164评论 0 218
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 42,075评论 0 188
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 50,080评论 1 266
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 39,365评论 1 184
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 30,901评论 2 283
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 29,649评论 0 176
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 33,122评论 0 223
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 29,734评论 2 225
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 31,093评论 1 236
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 27,548评论 2 222
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 32,028评论 3 216
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 25,765评论 0 9
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 26,291评论 0 178
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 34,162评论 2 239
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 34,293评论 2 242

推荐阅读更多精彩内容