eygle.com   eygle.com
eygle.com  
 

« September 2006 | Blog首页 | November 2006 »

1 2 3 下一页


October 31, 2006

Oracle9i与Oracle10g之间的高级复制配置

作者:eygle

出处:http://blog.eygle.com

今天有朋友问及,Oracle9i和Oracle10g之间能够构建高级复制环境。
基于实现原理,我们知道一定是可以的,但是还是动手测试了一下。

测试了简单的表复制,结论是没有问题。
高级复制的详细过程可以参考我以前的文章:
http://www.eygle.com/archives/2005/06/oraclessoeaeaeo.html

测试的简单过程如下(略去了一些基本步骤).
首先测试两个数据库的连通性:

$ sqlplus "/ as sysdba"

SQL*Plus: Release 9.2.0.4.0 - Production on Tue Oct 31 10:36:31 2006

Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.


Connected to:
Oracle9i Enterprise Edition Release 9.2.0.4.0 - 64bit Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.4.0 - Production

SQL> show parameter glob

NAME TYPE VALUE
------------------------------------ ----------- ---------------------
global_context_pool_size string
global_names boolean TRUE
SQL> select * from global_name;

GLOBAL_NAME
----------------------------------------------------------------------
HSBILL.HURRAY.COM.CN

SQL> exit
Disconnected from Oracle9i Enterprise Edition Release 9.2.0.4.0 - 64bit Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.4.0 - Production

bash-2.03$ tnsping mars

TNS Ping Utility for Solaris: Version 9.2.0.4.0 - Production on 31-OCT-2006 10:39:41

Copyright (c) 1997 Oracle Corporation. All rights reserved.

Used parameter files:
/opt/oracle/product/9.2.0/network/admin/sqlnet.ora


Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = 172.16.31.110)(PORT = 1521))) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = mars)))
OK (10 msec)

两个数据库分别创建db link:
9i的数据库:

bash-2.03$ sqlplus repadmin/repadmin

SQL*Plus: Release 9.2.0.4.0 - Production on Tue Oct 31 10:57:49 2006

Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.


Connected to:
Oracle9i Enterprise Edition Release 9.2.0.4.0 - 64bit Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.4.0 - Production

SQL> create public database link "MARS.HURRAY.COM.CN" connect to repadmin identified by repadmin using 'MARS';

Database link created.

SQL> select * from dual@mars;

D
-
X

10g的数据库:

bash-2.03$ sqlplus "/ as sysdba"

SQL*Plus: Release 10.2.0.1.0 - Production on Tue Oct 31 10:15:20 2006

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


Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options

SQL> select username from dba_users where username='REPADMIN';

USERNAME
------------------------------
REPADMIN

SQL> connect repadmin/repadmin
Connected.
SQL> select * from tab;

no rows selected

SQL> select * from global_name;

GLOBAL_NAME
--------------------------------------------------------------------------------
MARS.HURRAY.COM.CN

SQL> create public database link "HSBILL.HURRAY.COM.CN" connect to repadmin identified by repadmin using 'HSBILL';

Database link created.

SQL> select * from dual@hsbill;

D
-
X

两个数据库分别创建测试表:

SQL> connect eygle/eygle
Connected.

SQL> create table eygle as select * from v$session;

Table created.

SQL> alter table eygle add (constraint pk_eygle primary key (SADDR));

Table altered.

进行复制创建:

SQL> connect repadmin/repadmin
Connected.

SQL> execute dbms_repcat.create_master_repgroup('rep_910');

PL/SQL procedure successfully completed.

SQL> execute dbms_repcat.create_master_repobject(sname=>'eygle',oname=>'eygle', type=>'table',use_existing_object=>true,gname=>'rep_910',copy_rows=>false);

PL/SQL procedure successfully completed.

SQL> execute dbms_repcat.generate_replication_support('eygle','eygle','table');

PL/SQL procedure successfully completed.

SQL> execute dbms_repcat.add_master_database(gname=>'rep_910',master=>'MARS.HURRAY.COM.CN',use_existing_objects=>true, copy_rows=>false, propagation_mode => 'synchronous');

PL/SQL procedure successfully completed.


SQL> execute dbms_repcat.resume_master_activity('rep_910',true);

PL/SQL procedure successfully completed.

基本测试:

SQL> select count(*) from eygle.eygle;

COUNT(*)
----------
20

SQL> select count(*) from eygle.eygle@mars;

COUNT(*)
----------
20

SQL> delete from eygle.eygle where rownum <11;

10 rows deleted.

SQL> commit;

Commit complete.

SQL> select count(*) from eygle.eygle;

COUNT(*)
----------
10

SQL> select count(*) from eygle.eygle@mars;

COUNT(*)
----------
10

SQL> select * from v$version@mars;

BANNER
----------------------------------------------------------------
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bi
PL/SQL Release 10.2.0.1.0 - Production
CORE 10.2.0.1.0 Production
TNS for Solaris: Version 10.2.0.1.0 - Production
NLSRTL Version 10.2.0.1.0 - Production

SQL> select * from v$version;

BANNER
----------------------------------------------------------------
Oracle9i Enterprise Edition Release 9.2.0.4.0 - 64bit Production
PL/SQL Release 9.2.0.4.0 - Production
CORE 9.2.0.3.0 Production
TNS for Solaris: Version 9.2.0.4.0 - Production
NLSRTL Version 9.2.0.4.0 - Production

SQL>

本例未作全面测试,仅用于说明Oracle9iR2和Oracle10gR2之间的高级复制功能上可行。

-The End-

Posted by eygle at 2:27 PM | Comments (4)


October 30, 2006

如何启动DataGuard的备用数据库

作者:eygle

出处:http://blog.eygle.com

一大早来到公司,打开邮箱,发现收到了一堆的报警邮件,一个Standby数据库Down掉了。

登陆检查主库,警告日志记录了错误信息:

*** 2006-10-30 07:32:10.614
kcrrfail: dest:2 err:12560 force:0
ORA-12560: TNS:protocol adapter error
*** 2006-10-30 07:34:10.615
Error 12541 connecting to destination LOG_ARCHIVE_DEST_2 standby host 'bmarksb'
Error 12541 attaching to destination LOG_ARCHIVE_DEST_2 standby host 'bmarksb'
Heartbeat failed to connect to standby 'bmarksb'. Error is 12541.
*** 2006-10-30 07:34:10.615
kcrrfail: dest:2 err:12541 force:0
ORA-12541: TNS:no listener
*** 2006-10-30 07:36:10.615
Error 12541 connecting to destination LOG_ARCHIVE_DEST_2 standby host 'bmarksb'
Error 12541 attaching to destination LOG_ARCHIVE_DEST_2 standby host 'bmarksb'
Heartbeat failed to connect to standby 'bmarksb'. Error is 12541.

马上登陆从库主机,手工启动备用数据库:

[oracle@wapcom2 bdump]$ sqlplus "/ as sysdba"

SQL*Plus: Release 9.2.0.6.0 - Production on Mon Oct 30 08:17:24 2006

Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.

Connected to an idle instance.

SQL> startup nomount;
ORACLE instance started.

Total System Global Area 470881780 bytes
Fixed Size 452084 bytes
Variable Size 167772160 bytes
Database Buffers 301989888 bytes
Redo Buffers 667648 bytes
SQL> alter database mount standby database;

Database altered.

SQL> alter database recover managed standby database disconnect from session;

Database altered.

SQL> exit
Disconnected from Oracle9i Enterprise Edition Release 9.2.0.6.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.6.0 - Production
[oracle@wapcom2 bdump]$ lsnrctl start

观察从库的日志信息,发现归档可以自动应用:

[oracle@wapcom2 bdump]$ tail -f alert_bmark.log
Standby Database mounted.
Completed: alter database mount standby database
Mon Oct 30 08:19:23 2006
alter database recover managed standby database disconnect from session
Attempt to start background Managed Standby Recovery process
MRP0 started with pid=12
MRP0: Background Managed Standby Recovery process started
Media Recovery Waiting for thread 1 seq# 5151
Mon Oct 30 08:19:29 2006
Completed: alter database recover managed standby database di
Mon Oct 30 08:22:58 2006
Media Recovery Log /opt/oracle/oradata/bmark/stdarch/1_5151.arc
Media Recovery Log /opt/oracle/oradata/bmark/stdarch/1_5152.arc
Media Recovery Log /opt/oracle/oradata/bmark/stdarch/1_5153.arc
Media Recovery Log /opt/oracle/oradata/bmark/stdarch/1_5154.arc
Media Recovery Log /opt/oracle/oradata/bmark/stdarch/1_5155.arc
Media Recovery Waiting for thread 1 seq# 5156

再检查原因,发现原来是主机出现问题,在夜间不断重起:

-bash-2.05b$ last |grep reboot
reboot system boot 2.4.21-15.ELsmp Mon Oct 30 08:10 (02:14)
reboot system boot 2.4.21-15.ELsmp Mon Oct 30 07:51 (02:32)
reboot system boot 2.4.21-15.ELsmp Mon Oct 30 07:38 (02:45)
reboot system boot 2.4.21-15.ELsmp Mon Oct 30 07:35 (02:48)
reboot system boot 2.4.21-15.ELsmp Mon Oct 30 07:21 (03:02)
reboot system boot 2.4.21-15.ELsmp Mon Oct 30 07:18 (03:05)
reboot system boot 2.4.21-15.ELsmp Mon Oct 30 06:39 (03:44)
reboot system boot 2.4.21-15.ELsmp Mon Oct 30 06:37 (03:46)
reboot system boot 2.4.21-15.ELsmp Mon Oct 30 06:32 (03:51)
reboot system boot 2.4.21-15.ELsmp Mon Oct 30 06:03 (04:21)
reboot system boot 2.4.21-15.ELsmp Mon Oct 30 01:48 (08:36)
reboot system boot 2.4.21-15.ELsmp Mon Oct 30 01:23 (09:01)
reboot system boot 2.4.21-15.ELsmp Mon Oct 30 00:39 (09:44)

初步看来是硬件出现了故障,最近的硬件故障极为频繁,年底也到了事故多发期
提醒大家也多多注意。

参考文档:
http://www.eygle.com/ha/dataguard-step-by-step.htm

-The End-

Posted by eygle at 10:57 AM | Comments (10)


October 29, 2006

游览的勇气 香山归来记

作者:eygle

出处:http://blog.eygle.com

为了去香山,早晨6:30就爬起床,收拾停当后7:00来到楼下,等候737路公共汽车,这一路车可以直达香山。到了车站我们才知道,这已经不算早了,车站站满了一望即知去香山的游人,而到达的公交车上也是满满的人。

好在一路顺畅,一个小时左右就到达了香山,在山脚下,看到汹涌的人流,我们还是一下子就晕了,原来香山也不容易上啊。

为了清静一点,我和Julia沿着小路上山,人不多,但是路也不好走,好在天气非常晴朗,有北京难得一见的蓝天,那么即使红叶红的并非那么鲜艳,我们也仍然很开心了:
香山红叶

到了山顶就更觉得人海的壮观,每一棵树下都会有一堆的人在打牌吃东西,真可以用四个字来形容:People Mountain People Sea :) 在登山的主路上,到处都在堵人,行走都极为困难。原本我们想坐缆车下山的,可是一看排队坐缆车的队伍,马上改变了主意。

略作休息,赶快下山,感觉最美丽的红叶都不是在山顶看到,在攀登与下山的过程中,我们见到了最美的风景:
香山红叶

到了山脚,离开香山成为了很多人的梦魇,懒得描述,去香山真的需要极大的勇气,如果能不选在周末就是最好。

不过这仍然是快乐的一天,虽然极为辛苦:
香山红叶

我也终于看到了香山的红叶。

-The End-

Posted by eygle at 8:55 PM | Comments (3)


香山赏红叶 北京秋意浓

作者:eygle

出处:http://blog.eygle.com

来北京这么多年,还从来没有去香山看过红叶,今年打算去一次。

天明之后,希望能看到美丽的枫叶:
leaf

先了解一下香山:

香山公园位于北京西北郊小西山山脉东麓,距城20公里,占地160公顷,是一座著名的具有皇家园林特色的大型山林公园。
香山公园始建于金大定二十六年(1186年),距今已有800多年历史。元、明、清都在此营建离宫别院,为皇家游幸驻跸之所。清乾隆十年在此兴建亭台楼阁,殿宇廊轩,共成名噪京城的二十八景,后筑围墙并赐名"静宜园",名列京西"三山五园"。后遭英法联军和八国联军的焚掠。1956年开辟为人民公园,经过近半个世纪的建设,现已成为中外闻名的北京十大公园之一。 
香山公园文物古迹丰富珍贵,亭台楼阁似星辰散布山林之间。这里有燕京八景之一"西山晴雪"; 这里有集明清两代建筑风格的寺院"碧云寺";这里有国内仅存的木质贴金"五百罗汉堂";这里有迎接六世班禅的行宫"宗镜大昭之庙";这里有颇具江南特色的古雅庭院"见心斋";这里有世纪伟人毛泽东和中共中央进驻北平最早居住和办公的地方"双清别墅";这里有世纪伟人孙中山先生灵柩暂厝地--碧云寺金刚宝座塔。
香山公园地势崛峻,峰峦叠翠,泉沛林茂。主峰香炉峰(俗称鬼见愁)海拔557米。园内各类树木26万余株,仅古树名木就达5800多株,约占北京城区的四分之一,森林覆盖率高达98%,近年被有关部门测定为北京负氧离子最高的地区之一。公园内人与自然和谐相处,鸟啼虫鸣,松鼠嬉闹于沟壑林间。这里春日繁花似锦、夏时凉爽宜人、冬来银妆素裹。尤其是深秋时节,10万株黄栌如火如荼,气势磅礴,曾被评为"北京新十六景"之一。
香山公园旅游服务设施齐全。游,可乘大型吊椅式游览索道(全长1400米,落差431米),西山美景、北京城廓尽收眼底。吃,松林餐厅环境优美,昆虫野菜、泉水煮饭,别具风味。住,香山别墅功能齐全,是观光旅游、洽谈会议、度假休闲的理想场所。住在这里,悠闲散步即可到达中国科学院植物园、北京植物园、卧佛寺。向东数公里便是驰名中外的颐和园。往南还有八达处、世界公园等旅游景点。

恩,睡觉去,天明之后登香山,希望明日有晴空!

-The End-

Posted by eygle at 12:20 AM | Comments (1)


October 28, 2006

怀柔百泉山 秋意方正浓

作者:eygle

出处:http://blog.eygle.com

昨天是公司的团队建设日,公司全体员工一起奔赴怀柔百泉山进行为期一天的登山、花鼓球、拔河等项目的活动。

早晨6:30爬起床,早早出门,路上真是畅通无阻,如果上班时间也能有这样的交通,那该有多好啊!

百泉山大约1个半小时的车程,山上有微微的寒意,但是爬起山来马上就热了起来,所有员工分成9个团队,带着各自的任务书开始登山,在竞争中,一天的活动开始展开。

虽然是很小的山,但是却有不错的风景。

看看红叶,已经是分外的鲜艳:
红叶

有水的地方在北京就殊为难得:
山水

我们的团队很快抵达了峰顶,恩,确切的说是一个谷底,上面有一个小小的瀑布:
瀑布

秋意正浓,这是个适合出游的季节,看大自然的千姿百色。

-The End-

Posted by eygle at 11:10 AM | Comments (0)


October 27, 2006

系统表空间IO错误 数据损坏处理一则

作者:eygle

出处:http://blog.eygle.com

同事最近遇到一个数据库问题,说是系统表空间出现坏块,警告日志文件中不断出现如下错误:

[oracle@gdmstest bdump]$ tail -20 alert_mydb.log
Linux Error: 4: Interrupted system call
Additional information: 23710
Wed Oct 25 16:47:44 2006
Errors in file /opt/oracle/admin/mydb/bdump/mydb_smon_19646.trc:
ORA-00604: error occurred at recursive SQL level 1
ORA-01115: IO error reading block from file 1 (block # 23712)
ORA-01110: data file 1: '/opt/oracle/oradata/mydb/system01.dbf'
ORA-27091: skgfqio: unable to queue I/O
ORA-27072: skgfdisp: I/O error
Linux Error: 4: Interrupted system call
Additional information: 23710
Wed Oct 25 16:47:59 2006
Errors in file /opt/oracle/admin/mydb/bdump/mydb_smon_19646.trc:
ORA-00604: error occurred at recursive SQL level 1
ORA-01115: IO error reading block from file 1 (block # 23712)
ORA-01110: data file 1: '/opt/oracle/oradata/mydb/system01.dbf'
ORA-27091: skgfqio: unable to queue I/O
ORA-27072: skgfdisp: I/O error
Linux Error: 4: Interrupted system call
Additional information: 23710

而通过dbv检查又没有报数据块损坏:

[oracle@gdmstest mydb]$ dbv file=system01.dbf blocksize=8192

DBVERIFY: Release 9.2.0.4.0 - Production on Thu Oct 26 11:36:42 2006

Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.

DBVERIFY - Verification starting : FILE = system01.dbf


DBVERIFY - Verification complete

Total Pages Examined : 23709
Total Pages Processed (Data) : 13000
Total Pages Failing (Data) : 0
Total Pages Processed (Index): 2090
Total Pages Failing (Index): 0
Total Pages Processed (Other): 1377
Total Pages Processed (Seg) : 0
Total Pages Failing (Seg) : 0
Total Pages Empty : 7242
Total Pages Marked Corrupt : 0
Total Pages Influx : 0

我们一起来看看这个问题,首先从错误日志来看,其实这并不是一个数据块损坏的问题:
ORA-01115: IO error reading block from file 1 (block # 23712)

这是个IO错误,数据块不能读取。

而DBV的提示也只是说检查了23709个数据块,这些数据块没有问题,而我们真正报错的数据块是23712号数据块,也就是说DBV检查到这个块附近,无法继续读取,进而退出。

而系统表空间远远大于 23709 * 8k / 1024 = 185M。

此时检查系统日志,dmesg日志中有大量的寻址错误,也就是说硬件出现了故障:

[maintain@gdmstest bdump]$ dmesg
: error=0x40 { UncorrectableError }, LBAsect=58847319, high=3, low=8515671, sector=14266880
end_request: I/O error, dev 03:06 (hda), sector 14266880
hda: dma_intr: status=0x51 { DriveReady SeekComplete Error }
hda: dma_intr: error=0x40 { UncorrectableError }, LBAsect=58847319, high=3, low=8515671, sector=14266880
end_request: I/O error, dev 03:06 (hda), sector 14266880
hda: dma_intr: status=0x51 { DriveReady SeekComplete Error }
hda: dma_intr: error=0x40 { UncorrectableError }, LBAsect=58847319, high=3, low=8515671, sector=14266880
end_request: I/O error, dev 03:06 (hda), sector 14266880
hda: dma_intr: status=0x51 { DriveReady SeekComplete Error }

至此问题被定位。

如果我们尝试cp系统表空间文件,同样会收到硬件的错误提示信息:

[oracle@gdmstest mydb]$ cp system01.dbf system01.dbf.bk
cp: 正在读入‘system01.dbf’: 输入/输出错误
[oracle@gdmstest mydb]$ ll
总用量 2173060
....
-rw-r----- 1 oracle dba 524296192 10月 25 16:49 system01.dbf
-rw-r----- 1 oracle dba 194236416 10月 25 17:00 system01.dbf.bk
...............

只能复制194236416 Bytes,也就是 194236416 / 8192 = 23710.5,同样是读到23709个数据块左右,硬件的损坏就要通过系统的其它手段去解决了。

-The End-

Posted by eygle at 7:30 PM | Comments (10)


October 26, 2006

Oracle10.2.0.2强制性补丁发布通知

作者:eygle

出处:http://blog.eygle.com

刚刚收到Oracle的一个强制性补丁发布通知,该补丁用来修正10.2.0.2中的一个严重Bug。
如果不应用这个补丁,后续的Patch将无法生效:
邮件转载如下:

Dear Valued Customer,

You are being sent this email because you have downloaded the 10.2.0.2 RDBMS server patchset for Sun Sparc Solaris 64-bit from www.metalink.com.

Please note that Patch 5117016 is a MANDATORY PATCH required to be installed and run immediately AFTER installation of the 10.2.0.2 Patch Set on Sun Sparc Solaris 64-bit. This patch fixes a known issue in 10.2.0.2 Patch Set on Sun Sparc Solaris where the libserver10.a library is installed incorrectly into $ORACLE_HOME/rdbms/lib instead of into $ORACLE_HOME/lib.

Any patches applied without Patch 5117016 installed must be backed out, Patch 5117016 must be applied and then the patches reinstalled.

Not applying the patch can cause subsequent problems such as:

Applying patches on top of 10.2.0.2 may have no effect.
Changing the DBA user or SGA attach address may have no effect
Further details on this issue can be found in ALERT Note 394933.1

Thank you,
Oracle Support Services


P.S. Please do not reply to this email as this email account is not monitored. If you require further assistance, please use MetaLink, https://metalink.oracle.com, to submit a Service Request.

这个邮件中存在太多显而易见的错误,例如 www.metalink.com 根本不是Oracle公司的网址,这些错误差点让我以为这是封钓鱼邮件,还好在Metalink上找到了相关说明

看来Oracle公司写邮件也太不严格。

-The End-

Posted by eygle at 12:03 PM | Comments (1)


UTL_INADDR包获取ip地址的内部原理

作者:eygle

出处:http://blog.eygle.com

今天有朋友在MSN上问我如何获得已经连接用户的IP地址。

我们知道,通过SYS_CONTEXT函数可以获得这部分信息,当前用户的ip等信息可以通过如下命令轻易获取:

SQL> select sys_context('userenv','host') from dual;

SYS_CONTEXT('USERENV','HOST')
--------------------------------------------------------------------------------
WORKGROUP\GQGAI

SQL> select sys_context('userenv','ip_address') from dual;

SYS_CONTEXT('USERENV','IP_ADDR
--------------------------------------------------------------------------------
172.16.34.20

可是如果我们希望获取其它session的地址信息等,通过SYS_CONTEXT函数就只能通过LOGON触发器来完成。

而如果没有触发器记录,则我们可以通过UTL_INADDR Package来实现。
我们看一下UTL_INADDR包获取ip等信息的实现原理。

我们在数据库中进行如下查询:

[oracle@jumper oracle]$ sqlplus "/ as sysdba"

SQL*Plus: Release 9.2.0.4.0 - Production on Wed Oct 25 11:24:22 2006

Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.


Connected to:
Oracle9i Enterprise Edition Release 9.2.0.4.0 - Production
With the Partitioning option
JServer Release 9.2.0.4.0 - Production

SQL> !
[oracle@jumper oracle]$ ps -ef|grep sql
oracle 14700 14663 1 11:24 pts/0 00:00:00 sqlplus
oracle 14732 14702 0 11:24 pts/0 00:00:00 grep sql
[oracle@jumper oracle]$ ps -ef|grep LO
oracle 14701 14700 0 11:24 ? 00:00:00 oracleeygle (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))
oracle 14734 14702 0 11:24 pts/0 00:00:00 grep LO
[oracle@jumper oracle]$ exit
exit

SQL> SELECT UTL_INADDR.get_host_address('www.anysql.net') from dual;

UTL_INADDR.GET_HOST_ADDRESS('WWW.ANYSQL.NET')
---------------------------------------------------------------------
208.113.151.109

在Linux中我们通过strace跟踪这个进程,可以得到以下堆栈信息:

[oracle@jumper oracle]$ strace -p 14701
Process 14701 attached - interrupt to quit
read(7, "\0\313\0\0\6\0\0\0\0\0\3^\10a\200\0\0\0\0\0\0@\342\22\10"..., 2064) = 203
gettimeofday({1161746697, 269895}, NULL) = 0
getrusage(RUSAGE_SELF, {ru_utime={0, 30000}, ru_stime={0, 10000}, ...}) = 0
getrusage(RUSAGE_SELF, {ru_utime={0, 40000}, ru_stime={0, 10000}, ...}) = 0
gettimeofday({1161746697, 270542}, NULL) = 0
gettimeofday({1161746697, 270670}, NULL) = 0
getrusage(RUSAGE_SELF, {ru_utime={0, 40000}, ru_stime={0, 10000}, ...}) = 0
getrusage(RUSAGE_SELF, {ru_utime={0, 40000}, ru_stime={0, 10000}, ...}) = 0
gettimeofday({1161746697, 271614}, NULL) = 0
gettimeofday({1161746697, 271748}, NULL) = 0
getrusage(RUSAGE_SELF, {ru_utime={0, 40000}, ru_stime={0, 10000}, ...}) = 0
getrusage(RUSAGE_SELF, {ru_utime={0, 40000}, ru_stime={0, 10000}, ...}) = 0
gettimeofday({1161746697, 272347}, NULL) = 0
gettimeofday({1161746697, 272699}, NULL) = 0
getrusage(RUSAGE_SELF, {ru_utime={0, 40000}, ru_stime={0, 10000}, ...}) = 0
gettimeofday({1161746697, 272989}, NULL) = 0
gettimeofday({1161746697, 273140}, NULL) = 0
gettimeofday({1161746697, 273273}, NULL) = 0
getrusage(RUSAGE_SELF, {ru_utime={0, 40000}, ru_stime={0, 10000}, ...}) = 0
gettimeofday({1161746697, 273771}, NULL) = 0
gettimeofday({1161746697, 275526}, NULL) = 0
getpid() = 14701
open("/etc/resolv.conf", O_RDONLY) = 12
fstat64(12, {st_mode=S_IFREG|0644, st_size=46, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb6fba000
read(12, "search hurray.com.cn\nnameserver "..., 4096) = 46
read(12, "", 4096) = 0
close(12) = 0
munmap(0xb6fba000, 4096) = 0
socket(PF_UNIX, SOCK_STREAM, 0) = 12
connect(12, {sa_family=AF_UNIX, path="/var/run/.nscd_socket"}, 110) = -1 ENOENT (No such file or directory)
close(12) = 0
open("/etc/host.conf", O_RDONLY) = 12
fstat64(12, {st_mode=S_IFREG|0644, st_size=17, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb6fba000
read(12, "order hosts,bind\n", 4096) = 17
read(12, "", 4096) = 0
close(12) = 0
munmap(0xb6fba000, 4096) = 0
futex(0xb71a1a20, FUTEX_WAKE, 2147483647) = 0
open("/etc/hosts", O_RDONLY) = 12
fcntl64(12, F_GETFD) = 0
fcntl64(12, F_SETFD, FD_CLOEXEC) = 0
fstat64(12, {st_mode=S_IFREG|0644, st_size=175, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb6fba000
read(12, "# Do not remove the following li"..., 4096) = 175
read(12, "", 4096) = 0
close(12) = 0
munmap(0xb6fba000, 4096) = 0
open("/opt/oracle/product/9.2.0/lib/libnss_dns.so.2", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/lib/tls/libnss_dns.so.2", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/lib/i686/libnss_dns.so.2", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/lib/libnss_dns.so.2", O_RDONLY) = 12
read(12, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\240\16"..., 512) = 512
fstat64(12, {st_mode=S_IFREG|0755, st_size=18632, ...}) = 0
old_mmap(NULL, 17100, PROT_READ|PROT_EXEC, MAP_PRIVATE, 12, 0) = 0xb6fb6000
old_mmap(0xb6fba000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 12, 0x3000) = 0xb6fba000
close(12) = 0
open("/opt/oracle/product/9.2.0/lib/libresolv.so.2", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/lib/tls/libresolv.so.2", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/lib/i686/libresolv.so.2", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/lib/libresolv.so.2", O_RDONLY) = 12
read(12, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\320(\0"..., 512) = 512
fstat64(12, {st_mode=S_IFREG|0755, st_size=76508, ...}) = 0
old_mmap(NULL, 73604, PROT_READ|PROT_EXEC, MAP_PRIVATE, 12, 0) = 0xb6fa4000
old_mmap(0xb6fb3000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 12, 0xf000) = 0xb6fb3000
old_mmap(0xb6fb4000, 8068, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xb6fb4000
close(12) = 0
socket(PF_INET, SOCK_DGRAM, IPPROTO_IP) = 12
connect(12, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("208.113.151.109")}, 28) = 0
send(12, "\324#\1\0\0\1\0\0\0\0\0\0\3www\5anysql\3com\0\0\1\0\1", 31, 0) = 31
gettimeofday({1161746697, 286025}, NULL) = 0
poll([{fd=12, events=POLLIN, revents=POLLIN}], 1, 5000) = 1
ioctl(12, FIONREAD, [74]) = 0
recvfrom(12, "\324#\201\200\0\1\0\1\0\1\0\0\3www\5anysql\3com\0\0\1\0"..., 1024, 0,
{sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("208.113.151.109")}, [16]) = 74
close(12) = 0
gettimeofday({1161746697, 290245}, NULL) = 0
getrusage(RUSAGE_SELF, {ru_utime={0, 40000}, ru_stime={0, 20000}, ...}) = 0
getrusage(RUSAGE_SELF, {ru_utime={0, 40000}, ru_stime={0, 20000}, ...}) = 0
gettimeofday({1161746697, 291553}, NULL) = 0
write(10, "\2\275\0\0\6\0\0\0\0\0\20\31\266\344\217\3700\320\341S"..., 701) = 701
read(7, "\0\215\0\0\6\0\0\0\0\0\3^\t@\0\0\0\1\0\0\0\0\0\0\0\0\0"..., 2064) = 141
gettimeofday({1161746697, 294898}, NULL) = 0
getrusage(RUSAGE_SELF, {ru_utime={0, 40000}, ru_stime={0, 20000}, ...}) = 0
getrusage(RUSAGE_SELF, {ru_utime={0, 40000}, ru_stime={0, 20000}, ...}) = 0
gettimeofday({1161746697, 295496}, NULL) = 0
getrusage(RUSAGE_SELF, {ru_utime={0, 40000}, ru_stime={0, 20000}, ...}) = 0
gettimeofday({1161746697, 295847}, NULL) = 0
gettimeofday({1161746697, 295981}, NULL) = 0
lseek(9, 1024, SEEK_SET) = 1024
read(9, "\30\0$\0007\0@\0J\0V\0`\0i\0t\0~\0\232\0\245\0\320\0\330"..., 512) = 512
lseek(9, 47104, SEEK_SET) = 47104
read(9, "\f\0^\5\0\0P\0x\5\0\0\214\0y\5\0\0\250\0z\5\0\0\313\0{"..., 512) = 512
gettimeofday({1161746697, 297024}, NULL) = 0
write(10, "\0\202\0\0\6\0\0\0\0\0\4\1\0\0\0\1\1\0\0\0{\5\0\0\0\0\1"..., 130) = 130
read(7,
Process 14701 detached

在这个信息中,我们注意到Oracle顺序访问了如下文件来完成地址定位:

open("/etc/resolv.conf", O_RDONLY) = 12
open("/etc/host.conf", O_RDONLY) = 12
open("/etc/hosts", O_RDONLY) = 12

首先获取域名解析服务器,在根据host.conf文件确定解析顺序,因为缺省hosts文件优先,又继续读取/etc/hosts文件。

如果hosts文件存在解析关系,则返回信息;如果不存在,则继续问询DNS服务器,获得解析地址,如果不能解析,则会出错:

SQL> select UTL_INADDR.get_host_address('www.a.com') from dual;
select UTL_INADDR.get_host_address('www.a.com') from dual
*
ERROR at line 1:
ORA-29257: host www.a.com unknown
ORA-06512: at "SYS.UTL_INADDR", line 35
ORA-06512: at "SYS.UTL_INADDR", line 40
ORA-06512: at line 1

也就是说,UTL_INADDR的数据获取已经不依赖于数据库信息了,而SYS_CONTEXT的信息获取仍然来自数据库内部。

这就是UTL_INADDR包的工作原理。

-The End-

Posted by eygle at 11:30 AM | Comments (2)


October 25, 2006

Oracle11g的新特性-11g New Features

作者:eygle

出处:http://blog.eygle.com

随着这几天Oracle OpenWorld大会的召开,Oracle11g的新特性越来越多的被展现出来。

此前,我曾经介绍过Oracle11g将可能在10月份的这个大会上推出,当时关于Alpha版的信息已经可以见到,现在出现的已经是Beta版,离Oracle11g的正式版已经不远。

Laurent Schneider 在他的Blog中提到,关于Oracle11g的名字还没有最后确定,就像10g推出时一样,Oracle可能给11版的数据库一个新的名字。可是据我估计,更改的可能性不大,因为Grid技术在10g中还并不成熟,推广和使用也极为有限,Oracle应该会沿着这个方向至少再走1~2个版本才对。

那么11g中将会出现哪些激动人心的新特性(new features)呢?
Justin Kestelyn 在他的Blog中提到了很多Beta版中引入的新特性:

1.如果说10g着重于降低所有者成本,那么11g将着重降低变更管理成本(也可以被称为提供变更保证)

2.DataGuard将引入一个新特性-Flashback Standby
这个新特性可以使得备用数据库可以创建一个快照,从而能够重演主库的所有负载变化,使得通过备用数据库研究主库的负载变化等成为可能,而且通过闪回功能,备用库仍然可以和主库保持一致。
eygle注:在我看来,这一新特性是丰富了DataGuard的功能,使得DataGuard可以发挥更大的作用。

3.在变更管理增强方面,Oracle提供在线的升级(Upgrade)和补丁应用(hot Patching),从而实现无当机(no downtime)的系统维护.
eygle注:这真是一个激动人心的特性,减少Down机时间的问题修复显然已经被期待已久。
Online.Patching

4.快速的故障解决
这一特性是通过引入自动收集故障相关信息来完成的,同时数据库提供修复建议(repair Advisor)等工具协助快速故障诊断。

5.关于分区的增强
实现了通过逻辑对象分区,同时实现了自动分区创建的功能。
eygle注:自动分区的创建,一直以来我们都是通过自己编写的过程来实现的,现在Oracle将这个过程内置在数据库中,这只能算得上一个易用性方面的小增强吧。

6.其它
新的高性能LOB基础架构
本地Java & PL/SQL编译器
新的PHP驱动

让我们一起期待11g的来临吧!

-The End-

Posted by eygle at 10:30 AM | Comments (7)


October 22, 2006

就这样 我们的年华开始老去

作者:eygle

出处:http://blog.eygle.com

今天Kamus在北四环的"李老爹"大摆宴席庆祝他成功跳槽到Oracle公司,这是他很久以来的梦想,恭喜他在三年内经过5次跳槽后终于成功进入Oracle。

今晚到场的人有:Kamus,Easyfree,Coolyl,Ora-600 + MM,菜刀 + MM,rollingpig + LP,eygle + Julia,yangtingkun ,很久没有这么大规模的聚会了,而且慢慢的,大家都开始成双成对的出现,也许这说明我们都已经渐渐老去.....
回想,2003年我刚到北京的时候,大家经常聚在我的住所,上网、聊天、聚餐....真是年轻快乐的岁月...

李老爹的香辣蟹味道还算不错,不过服务实在是差到了极点,开始时差了四套碗筷,催了四五次,足足等了半个小时才算补齐;喝饮料时又没有杯子,又是催了N次,最后服务员说用完了,我们问怎么办,服务员笑着说,用茶杯吧,ft,可怜那么大的一家餐馆,服务员一点规范都没有。
这里可以算得上在北京遇到的最差的餐馆....

rollingpig是第一次见到,比照片上要年轻英俊得多,最近刚刚娶得美人归,正是春风得意。

600刚从昆明经历了长期旅行归来,打开新买的IBM T60给我们展示大量美丽图片,不过每次都被我们揭穿经过ps的照片:)

coolyl照例迟到,我刚到的时候还没有合适的位子,我和Kamus说,等Coolyl到的时候一定都是左右无人了,果然被我说中.....

easy提醒我还欠他几张DVD没有归还,可我明明记得已经还过了,我再找...

菜刀明年就将完成他的北大硕士之旅,祝愿他能大展宏图...

Yangtingkun是最后一个来到的,因为走错了地方:)在Oracle技术方面,他是钻研最勤奋的一个,这么多年一直坚持不懈,我要向他多学习。

Kamus呢?依然那么的帅,但愿我到他那个年纪能够比他更帅,哈哈。

-The End-

Posted by eygle at 11:28 PM | Comments (19)


1 2 3 下一页


CopyRight © 2004-2008 eygle.com, All rights reserved.