Tip: 看不到本站引用 Flickr 的图片? 下载 Firefox Access Flickr 插件 | AD: 订阅 DBA notes -- ![]()
2008-05-06 Tue
Author:胜通 posted on Taobao.com
昨天,由于现实原因,需要更改数据库名,在此做下记录,以便日后参考!
在Oracle 9iR2提供了一个工具nid,可以通过它来更改db_name和dbid,这样就避免重建控制文件了。nid工具可以只用来更改数据库名(db_name),或者只更改数据库的id(dbid),或者两个同时更改。
当涉及到更改db_name的时候,由于数据库名还存在与参数文件中,因此,更改数据库名时也要更改相应的参数。如果你使用了spfile,那么要重建它。另外,还需要重建密码文件。
有关nid工具的详细使用情况,在metalink 文章 Note:224266.1有详细的记载。
首先,我们来看看nid的使用帮助:
DBNEWID: Release 9.2.0.6.0 - Production
Copyright (c) 1995, 2002, Oracle Corporation. All rights reserved.
Keyword Description (Default)
—————————————————-
TARGET Username/Password (NONE)
DBNAME New database name (NONE)
LOGFILE Output Log (NONE)
REVERT Revert failed change NO
SETNAME Set a new database name only NO
APPEND Append to output log NO
HELP Displays these messages NO
这里来解释一下几个问题:
(I):如果你只想更改数据库的id(dbid),那么你只需要指定target参数就可以了,具体的操作过程,请参考如下:
1. Backup the database
2. SHUTDOWN IMMEDIATE of the database
3. STARTUP MOUNT
4. Open one session and run NID with sysdba privileges
% nid TARGET=SYS/password@test_db
5. Shutdown IMMEDIATE of the database
6. Set the DB_NAME initialization parameter in the initialization parameter
file to the new database name
7. Create a new password file
8. Startup of the database with open resetlogs
(II):如果你想只更改数据库名(db_name),那么你需要设置SETNAME参数为Y,同时指定DBNAME参数,具体的操作过程,请参考如下:
1. Backup the database
2. SHUTDOWN IMMEDIATE of the database
3. STARTUP MOUNT
4. Open one session and run NID with sysdba privileges
% nid TARGET=SYS/password@test_db DBNAME=test_db2 SETNAME=Y
- the value of DBNAME is the new dbname of the database
- SETNAME must be set to Y. The default is N and causes the
DBID to be changed also.
5. shutdown IMMEDIATE of the database
6. Set the DB_NAME initialization parameter in the initialization parameter
file to the new database name
7. Create a new password file
8. Startup of the database(without resetlogs)
(III):如果你想同时更改数据库名(db_name)和数据库ID(dbid),那么你要指定DBNAME参数,同时设置SETNAME为N(其值默认也为N),具体操作过程,请参考如下:
1. Backup of the database.
2. Shutdown IMMEDIATE of the database
3. STARTUP MOUNT
4. Open one session and run NID with sysdba privileges
% nid TARGET=SYS/password@test_db DBNAME=test_db2
- the value of DBNAME is the new dbname of the database
5. After DBNEWID successfully changes the DBID,Shutdown IMMEDIATE of the database
6. Set the DB_NAME initialization parameter in the initialization parameter file to the new database name.
7. Create a new password file.
8. Startup of the database with open resetlogs
(IV):如果你只更改了数据库名,而没有更改数据库id,那么你打开数据库就不需要open resetlogs了。
下面是我自己做的一次操作,DBNAME和DBID同时更改。
1.数据库启动到mount状态
ORACLE instance started.
total System Global Area 923904016 bytes
Fixed Size 452624 bytes
Variable Size 385875968 bytes
Database Buffers 536870912 bytes
Redo Buffers 704512 bytes
Database mounted.
2. 使用NID更改
DBNEWID: Release 9.2.0.6.0 - Production
Copyright (c) 1995, 2002, Oracle Corporation. All rights reserved.
Connected to database TESTDB1 (DBID=287286795) — 注意这里的数据库名和数据库id
Control Files in database:
/cx300_testdb2/data1/control01.ctl
/cx300_testdb2/data2/control02.ctl
/cx300_testdb2/data3/control03.ctl
Change database ID and database name TESTDB1 to TESTDB2? (Y/[N]) => Y – 这里有个手工确认过程
Proceeding with operation
Changing database ID from 287286795 to 975736982
Changing database name from TESTDB1 to TESTDB2
Control File /cx300_testdb2/data1/control01.ctl – modified — 更改控制文件中相关控制信息,这里估计是致控制文件于某种状态,以便后面信息的更改。
Control File /cx300_testdb2/data2/control02.ctl - modified
Control File /cx300_testdb2/data3/control03.ctl - modified
Datafile /cx300_testdb2/data2/system01.dbf - dbid changed, wrote new name — 这里开始更改数据文件中的信息
Datafile /cx300_testdb2/data2/tbs_taobao_3.dbf - dbid changed, wrote new name
…………………………………………
Datafile /cx300_testdb2/data3/tbs_temp2.dbf - dbid changed, wrote new name
Control File /cx300_testdb2/data1/control01.ctl - dbid changed, wrote new name — 这里开始更改控制文件中的信息
Control File /cx300_testdb2/data2/control02.ctl - dbid changed, wrote new name
Control File /cx300_testdb2/data3/control03.ctl - dbid changed, wrote new name
Database name changed to TESTDB2. –- 数据库名更改完毕
Modify parameter file and generate a new password file before restarting. –- 这里提示要在再次启动数据库时要更改parameter file和password file
Database ID for database TESTDB2 changed to 975736982. –- 数据库id更改完毕
All previous backups and archived redo logs for this database are unusable.
Shut down database and open with RESETLOGS option. –- 由于更改了dbid,所以要以resetlogs选项打开数据库
Succesfully changed database name and ID.
DBNEWID - Completed succesfully.
3.Shutdown database
ORA-01109: database not open
Database dismounted.
ORACLE instance shut down.
4.修改初始化参数文件
db_domain=”"
db_name=testdb2
# db_name=testdb1
###########################################
5.重建口令文件
6.Startup mount,resetlogs打开
7.创建新的spfile
8.对数据库做个全备份
我这里其实在开始的时候还少了一步,就是在更改之前,要对全库做备份。这个很重要,备份最重要!
Today was the first official day of JavaOne. I visited a couple of non-JBoss sessions that sounded really interesting, and they were–so now I share them with you. The first is about an improved web recommendation system, and the second is for improving collaboration with your off-site coworkers.
But first, if you’re here with us…
Come visit us at the JBoss booth in the Pavilion. We’re straight back and on the right when you come through the door. Every day, we’re holding 15-minute mini-sessions in the booth on the hour. You can meet the core developers and ask your questions in person. We’ve also got JBoss t-shirts and free entitlements of JBoss Developer Studio.
Also, the JBoss technical sessions are all still ahead of us. So if you’re here at JavaOne, be sure to check them out. If you’re not, keep reading this week to hear more about what’s going on.
Recommendation systems, or, what’s that about my nose hair?
The first session I heard this morning was Stephen Green and Paul Lamere from Sun talking about an improved recommendation system for websites like Amazon or iTunes or any that uses recommendations. They had some impressive statistics about the power of recommendations to drive sales and downloads. NetFlix is even offering a million-dollar prize to the first team that can improve their recommendation accuracy by 10%, which, it turns out, is a tougher task than you might think.
They had quite a few amusing examples of bad recommendations they got from various sites. If you own “Baby One More Time,” you might like Report on Pre-War Intelligence. Because you bought The Chronicles of Narnia, you might like this nose and ear hair groomer.
Project Aura is based on collaborative filtering, which means grouping similar items based on a halo of users and terms. It creates a text aura from content analysis of things like reviews, blogs, and tags. But those things only work when that content and those users exist for comparison and analysis. So Aura solves the “cold start” problem for music through feature analysis.
It extracts information from the song file about things like rhythm and harmonic content. That data is then fed through a trained system that tags that unknown song with all the relevant categories, based on what it has learned from all the previous input. In the example they showed, an analysis of Queen’s “Bohemian Rhapsody” resulted in tags like “classic rock,” “happy,” “England,” “70s,” and “favorite artist.” In the end, general tags lead to more specific tags, which lead to recommendations.
Project Aura uses openid for users and Attention Profile Markup Language (APML) to attach a concept a user likes, such as an artist name, along with a degree to which the user likes it, to that user’s profile for their recommendations. It’s not available for use yet, but they did suggest checking out taste.sourceforge.net for a look at open source collaborative filtering.
Project Wonderland, or as I’m thinking of it, Second Work
Sun noticed that on any given day, half of their employees are out of the office. And as anyone who’s experienced it knows, the personal interaction you lose when you’re off site, especially long term, can be really important. Conference calls just aren’t the same as being in the meeting yourself.
Enter Project Wonderland. It’s an open source, Java-based, 3D, API-based graphics engine that manages the world, animations, and avatars for all the sorts of employee interactions that you’d have in real life. Think of it as going to work in Second Life. It’s built on top of Project Darkstar, which was created for MMORPGs, and is extensible with customizable worlds.
The real bonus over other options (like just having a meeting on IRC) is that it allows employees to interact in a more real-world fashion. You don’t have to train people how to use a system, how to open a private chat, etc., because the interactions are natural. If you’re in a group and want to have a private conversation, you simply walk away from the group, just like you would if you were all standing together in real life.
Project Wonderland is approaching version 0.5. They’re aiming for a 1.0 in 2009.
Personal recommendation of the day
For those of you here braving the crowds, relentless badge checkers, and $7 hot dogs, I found a great secret today. The one thing I’ve always hated about conferences at the Moscone Center is the lack of good, quick restaurants nearby. Then this morning, somebody told me about Organic Bakery. Go straight upstairs to the street, turn right out the doors (toward the carousel), then right at the corner. It’s a block or two up the street on the left, near the Metreon. They have great sandwiches and a tasty-looking hunk of quiche I intend to try tomorrow. Ever better, it’s inexpensive, and there was no line, even at lunchtime.
JBoss session schedule
- Introduction to Web Beans (TS-5286) – Wednesday, 10:50-11:50 a.m., Gavin King
- JSR 303: From a World of Constraints to Constrain the World (TS-5615) – Wednesday, 4:10-5:10 p.m., Emmanuel Bernard
- Open Source Development Tools for the Java™ Platform, Enterprise Edition (Java EE Platform), Web 2.0, and SOA (TS-7479) – Thursday, 4:10-5:10pm and Friday, May 9, 2:50-3:50 p.m., Burr Sutter and Max Katz (Exadel)
- Developing Service-Oriented Architecture Applications with OSGi (BOF-5846) – Thursday 6:30-7:30 p.m., Kevin Conner, Mark Little and Keith Babo (Sun Microsystems, Inc)
- Mark Little will also be on the panel for “PAN-5188 Open Standards for SOA and Java Technology” to participate in a discussion about Software Component Architecture.
作者:Fenng 发布在 dbanotes.net. ![]()
支付宝主办的阿里巴巴集团 2008 年度 "D4" 设计论坛将于 5 月 8 日举行。大家比较熟悉的刚刚落幕的 D2 技术论坛 是面向 Web 前端技术的,而 D4 则是面向设计(Design)的。

本届"D4" 设两个分论坛:
- 论坛一:交互设计的流程探讨
- 论坛二:如何通过用户研究来提升产品设计
每个分论坛将有阿里巴巴集团各子公司的嘉宾与大家共同探讨各自的主题。
分论坛一:交互设计的流程探讨
时间:2008年5月8日 19:00 -21:00
地点:华星时代广场 5F 天沐阁
嘉宾:李坏(淘宝)、蚂蚁(口碑)、方一鸣(阿里巴巴国际站)、陈晓华(阿里软件)
分论坛二:如何通过用户研究来提升产品设计
时间:2008年 5 月 8 日 19:00 -21:00
地点:华星时代广场 21F 应天书院
嘉宾:轻候(淘宝)、 杨昌源(阿里巴巴国际站)、刘昊(阿里巴巴中文站)
主办方:支付宝
协办方:阿里巴巴B2B,淘宝,阿里软件,阿里妈妈,口碑,中国雅虎
感兴趣的朋友请提前联系一下我,因为场地的确有限制。会议是免费的,华星时代广场就在西湖区文三路和万塘路交汇处。
--EOF--
相关文章|Related Articles
评论数量(8)|Add Comments
本文网址:http://www.dbanotes.net/web/alibaba_2008_d4.html
最近作者还说了什么? Follow Twitter / Fenng
今晚和老婆一起看了电影《Juno》,下载了很久的电影,2007年的片子,看完觉得非常喜欢:

这部片子在今年的奥斯卡上拿到了最佳原创剧本奖,250万美元的独立制作却获得了截止2008年2月份大约1.4亿美元的票房,这部电影受欢迎程度可见一斑。
简单说来这部片子讲的是一个怀孕的16岁女孩的故事,从一张椅子开始,到一张椅子结束。
片中涉及了16岁女孩的早孕、离异重组的家庭、以及正在破裂的婚姻,很多沉重的内容,然而整部片子的节奏却轻松舒缓,不探讨深刻,只描述生活。一个特别女孩的家庭、爱情以及成长。
摘录几句媒体的评论:
今年好莱坞最有影响力的女性,非这个16岁的怀孕小女孩莫属了,牙尖嘴利的她还混杂了非同一般的成熟和智慧。----《纽约邮报》艾莲·佩奇与生俱来的有侵略性的好斗品质,让她在电影领域中如鱼得水,而这部影片则在进一步确立了她的明星地位。----《电影信号灯》
每一个人的内心深处都有一个对与错的评判标准,而影片却让一切都得到了很好的发泄,这正是其成功的原因。----《交换电影》
影片中的演员带来了犀利尖锐的表演,同时还有可信度很高的对白和有新意的内容。----《好莱坞报道》
一部不甚完善的作品,所带来的娱乐性也是时断时续的。----《胶片评论》
影片中很多对白极其精彩,尤其是当父亲、继母知道Juno怀孕后,他们的宽容以及慈爱,让人深为感动。
VeryCD上有一个超清晰的25.5G的版本可以下载:
http://www.verycd.com/topics/263320/
-The End-
相关文章|Related Articles
评论数量(2)|Add Comments
本文网址:http://www.eygle.com/archives/2008/05/juno.html
发现很多朋友对 CSS 的优先权不甚了解,规则很简单。需要说明的一点,如果你的样式管理需要深层判断 CSS 的优先权,更应反思自己的 CSS 代码,是否合理?是否优化?
CSS2.1 中规定了关于 CSS 规则 Specificity(特异性)的计算方式,用一个四位的数字串(注:CSS2 中是用三位)来表示,最后以 Specificity 的高低判断 CSS 的优先权。
Specificity 具体的计算规则:
- 元素的 style 样式属性,加 1,0,0,0。
- 每个 ID 选择符(#id),加 0,1,0,0。
- 每个 class 选择符(.class)、每个属性选择符(例 [attr=”"] )、每个伪类(例 :hover),加 0,0,1,0。
- 每个元素或伪元素(例 :firstchild)等,加 0,0,0,1。
- 其他选择符(例 全局选择符 *,子选择符 >),加 0,0,0,0。
最后逐位相加数字串,得到最终的 Specificity 值,按照从左到右的顺序逐位比较。
除了 Specificity 还有一些其他规则:
- !important 声明的规则高于一切,如果 !important 声明冲突,则比较优先权。
- 如果优先权一样,则按源码中“后来者居上”的原则。
- 由继承而得到的样式属性不参与 specificity 的计算,低于一切其他规则(例 全局选择符 * )。
范例分析:
h1 {color: red;}
/* 只有一个普通元素加成,结果是 0,0,0,1 */
body h1 {color: green;}
/* 两个普通元素加成,结果是 0,0,0,2 */
/*0,0,0,1 小于 0,0,0,2 ,后者胜出*/
h2.grape {color: purple;}
/* 一个普通元素、一个class选择符加成,结果是 0,0,1,1*/
h2 {color: silver;}
/*一个普通元素,结果是 0,0,0,1 */
/*0,0,1,1 大于 0,0,0,1 ,前者胜出*/
html > body table tr[id=”totals”] td ul > li {color: maroon;}
/* 7个普通元素、一个属性选择符、两个其他选择符(子选择符 >),结果是0,0,1,7 */
li#answer {color: navy;}
/* 一个ID选择符,一个普通选择符,结果是0,1,0,1 */
/*0,0,1,7 小于 0,1,0,1,后者胜出*/
节选 old9 的《CSS的优先权》(无法穿越 GFW)


2008-05-05 Mon
2008-05-04 Sun
AnySQL.net
DBA notes
Oracle & Starcraft
eagle's home
Give you some color to see see!
AnySQL.net English
Oracle Scratchpad
Oracle Life
OracleDBA Blog---请享受无法回避的痛苦!
Uploads from dbanotes
Chanel [K]
xzh2000的博客
Oracle Security Blog
ERN空间
Eddie Awad's Blog
MySQL Performance Blog
The Tom Kyte Blog
del.icio.us/fenng/oracle
AIXpert
O'Reilly Databases
Red Hat Magazine
DBASupport
DB2 Magazine 中文版
developerWorks : AIX 专区的文章,教程
Pythian Group Blog » Log Buffer
车东[Blog^2]
blue_prince
玉面飞龙的BLOG
此生 今世
人生就是如此
Orange Tiger 木匠 的 移民生活
生活帮-LifeBang
Hey!! Sky!
dba on unix
Oracle Notes Wiki
Brotherxiao's Home
柔嘉维则@life.oracle.eng
Fenng's shared items in Google Reader
jametong's shared items in Google Reader
缥缈游侠-logzgh
Tanel Poder's blog: Core IT for geeks and pros
DBA Tools
ilonng
yangtingkun
NinGoo@Net
Oracle & Unix
Inside the Oracle Optimizer - Removing the black magic
Ricky's Test Blog
DBA@Taobao
存储部落
Think in 88
Alibaba DBA Team
Oracle Team @SNC
淘宝数据仓库团队
OracleBlog.cn