??xml version="1.0" encoding="utf-8" standalone="yes"?>小小水蜜桃在线观看,www.神马久久,成人高清免费观看mvhttp://www.aygfsteel.com/logicgate/zh-cnWed, 18 Jun 2025 18:02:06 GMTWed, 18 Jun 2025 18:02:06 GMT60testtesthttp://www.aygfsteel.com/logicgate/archive/2009/11/27/303957.htmllogicgatelogicgateFri, 27 Nov 2009 10:22:00 GMThttp://www.aygfsteel.com/logicgate/archive/2009/11/27/303957.html

logicgate 2009-11-27 18:22 发表评论
]]>
Oracle 学习W记Qsetup recovery cataloghttp://www.aygfsteel.com/logicgate/archive/2009/03/18/261393.htmllogicgatelogicgateWed, 18 Mar 2009 14:10:00 GMThttp://www.aygfsteel.com/logicgate/archive/2009/03/18/261393.html阅读全文

logicgate 2009-03-18 22:10 发表评论
]]>
Oracle 常见问题解决Ҏ (未完Q待l。。?http://www.aygfsteel.com/logicgate/archive/2009/03/17/261394.htmllogicgatelogicgateTue, 17 Mar 2009 15:43:00 GMThttp://www.aygfsteel.com/logicgate/archive/2009/03/17/261394.html1. Windows下Oracle10g OEM的Host Credentials问题

问题描述QOEM中很多配|需要用h供主机的用户名和密码Q但即输入正确QOEM也会出现如下的Validation ErrorQ?br /> Error - Connection to host as user xxx failed: ERROR: Wrong password for user

解决ҎQStart Menu -> Programs -> Administrative Tools -> Local Security Settings -> Local Policies -> User Rights Assignment -> Log on as a batch jobQ添加相应的用户?br />
未完Q待l。。?/span>


logicgate 2009-03-17 23:43 发表评论
]]>
behavior of database backup with "plus archivelog"http://www.aygfsteel.com/logicgate/archive/2009/03/17/261395.htmllogicgatelogicgateTue, 17 Mar 2009 15:40:00 GMThttp://www.aygfsteel.com/logicgate/archive/2009/03/17/261395.htmlThe RMAN reference document says that when the plus archivelog command is part of a backup script, RMAN will do:

1. runs an alter system archive log current statement
2. runs the backup archivelog all command. Note that if backup optimization is enabled, RMAN only backs up logs that have not yet been backed up
3. backs up the files specified in the BACKUP command
4. runs an alter system archive log current statement
5. backs up any remaining archived redo logs

The behavior of "plus archivelog" depends on whether optimization is enabled or disabled in RMAN. If backup optimization is off (which it is by default in RMAN), plus archivelogs will backup all archivelogs. If the archivelog destination is a flash recovery area, your database may keep very old archivelogs. Thus, the backup size will gradually grow and fill up the flash recovery area, since each backup includes all archivelogs in the flash recovery area.

To avoid backing up archivelogs that have already been backed up when using plus archivelog in a backup script, make sure you enable RMAN optimization.


logicgate 2009-03-17 23:40 发表评论
]]>
基本的RAID介绍http://www.aygfsteel.com/logicgate/archive/2009/03/10/261396.htmllogicgatelogicgateTue, 10 Mar 2009 15:24:00 GMThttp://www.aygfsteel.com/logicgate/archive/2009/03/10/261396.htmlRAID是英文Redundant Array of Independent DisksQ独立磁盘冗余阵列)Q简U磁盘阵列。下面将各个U别的RAID介绍如下?br />
RAID0
条带化(StripeQ存储。理Z_有N个磁盘组成的RAID0是单个磁盘读写速度的N倍。RAID 0q箋以位或字节ؓ单位分割数据Qƈ行读/写于多个盘上,因此h很高的数据传输率Q但它没有数据冗余,因此q不能算是真正的RAIDl构?br />


RAID1
镜象QMirrorQ存储。它是通过盘数据镜像实现数据冗余Q在成对的独立磁盘上产生?为备份的数据。当原始数据J忙Ӟ可直接从镜像拯中读取数据,因此RAID 1可以提高d性能。RAID 1是磁盘阵列中单位成本最高的Q但提供了很高的数据安全性和可用性。当一个磁盘失效时Q系l可以自动切换到镜像盘上读写,而不需要重l失效的数据?br />


RAID2
h码(Hamming CodeQ校验条带存储。将数据条块化地分布于不同的盘上,条块单位Z或字节,使用UCؓh码来提供错误查及恢复。这U编码技术需要多个磁盘存放检查及恢复信息Q得RAID 2技术实施更复杂Q因此在商业环境中很用?br />


RAID3
奇偶校验QXORQ条带存储,׃n校验盘,数据条带存储单位为字节。它同RAID 2非常cMQ都是将数据条块化分布于不同的硬盘上Q区别在于RAID 3使用单的奇偶校验Qƈ用单块磁盘存攑֥偶校验信息。如果一块磁盘失效,奇偶盘及其他数据盘可以重C生数据;如果奇偶盘失效则不媄响数据用。RAID 3对于大量的连l数据可提供很好的传输率Q但对于随机数据来说Q奇偶盘会成为写操作的瓶颈?br />


RAID4
奇偶校验QXORQ条带存储,׃n校验盘,数据条带存储单位为块。RAID 4同样也将数据条块化ƈ分布于不同的盘上,但条块单位ؓ块或记录。RAID 4使用一块磁盘作为奇偶校验盘Q每ơ写操作都需要访问奇偶盘Q这时奇偶校验盘会成为写操作的瓶颈,因此RAID 4在商业环境中也很用?br />


RAID5
奇偶校验QXORQ条带存储,校验数据分布式存储,数据条带存储单位为块。RAID 5不单独指定的奇偶盘,而是在所有磁盘上交叉地存取数据及奇偶校验信息。在RAID 5上,?写指针可同时寚w列设备进行操作,提供了更高的数据量。RAID 5更适合于小数据块和随机d的数据。RAID 3与RAID 5相比Q最主要的区别在于RAID 3每进行一ơ数据传输就需涉及到所有的阵列盘;而对于RAID 5来说Q大部分数据传输只对一块磁盘操作,q可q行q行操作。在RAID 5中有“写损失”,x一ơ写操作生四个实际的?写操作,其中两次L的数据及奇偶信息Q两ơ写新的数据及奇偶信息?br /> 当进行恢复时Q比如我们需要需要恢复下图中的A0Q这里就必须需要B0、C0、D0? parity才能计算q得出A0Q进行数据恢复。所以当有两块盘坏掉的时候,整个RAID的数据失效?br />


RAID6
奇偶校验QXORQ条带存储,两个分布式存储的校验数据Q数据条带存储单位ؓ块。与RAID 5相比QRAID 6增加了第二个独立的奇偶校验信息块。两个独立的奇偶pȝ使用不同的算法,数据的可靠性非帔RQ即使两块磁盘同时失效也不会影响数据的用。但RAID 6需要分配给奇偶校验信息更大的磁盘空_相对于RAID 5有更大的“写损失”,因此“写性能”非常差。较差的性能和复杂的实施方式使得RAID 6很少得到实际应用?br />


RAID7
q是一U新的RAID标准Q其自n带有化实时操作系l和用于存储理的Y件工P可完全独立于Lq行Q不占用LCPU资源。RAID 7可以看作是一U存储计机QStorage ComputerQ,它与其他RAID标准有明昑֌别?/p>

 

RAID 7{是至今ؓ止,理论上性能最高的RAID模式Q因为它从组建方式上已l和以往的方式有了重大的不同。基本成形式见图Q以往一个硬盘是一个组成阵列的“柱子”,而在RAID 7中,多个盘l成一个“柱子”,它们都有各自的通道Q也正因为如此,你可以把q个囑ֈ解成一个个盘q接在主通道上,只是比以前的{更ؓl分了。这样做的好处就是在?写某一区域的数据时Q可以迅速定位,而不会因Z往因单个硬盘的限制同一旉只能讉K该数据区的一部分Q在RAID 7中,以前的单个硬盘相当于分割成多个独立的盘Q有自己的读写通道?br />


RAID10和RAID01的比?/strong>
- RAID10是先做镜象,然后再做条带?br /> - RAID01则是先做条带Q然后再做镜象?/p>

比如?个盘ZQRAID10是先将盘分?l镜象,然后再对q?个RAID1做条带。RAID01则是先利?块盘做RAID0Q然后将另外3块盘做ؓRAID0的镜象。下面以4块盘Z来介l安全性方面的差别Q?/p>

 

1、RAID10的情?
q种情况中,我们假设当DISK0损坏Ӟ在剩下的3块盘中,只有当DISK1一个盘发生故障Ӟ才会D整个RAID失效Q我们可单计故障率?/3?/p>


 

2、RAID01的情?br /> q种情况下,我们仍然假设DISK0损坏Q这时左边的条带无法读取。在剩下?块盘中,只要DISK2QDISK3两个盘中M一个损坏,都会D整个RAID失效Q我们可单计故障率?/3?/p>


 

因此RAID10比RAID01在安全性方面要强?br />
从数据存储的逻辑位置来看Q在正常的情况下RAID01和RAID10是完全一LQ而且每一个读写操作所产生的IO数量也是一LQ所以在d性能上两者没什么区别。而当有磁盘出现故障时Q比如前面假讄DISK0损坏Ӟ我们也可以发玎ͼq两U情况下Q在ȝ性能上面也将不同QRAID10的读性能优于RAID01?/p>

已有 0 人发表留aQ猛?>>q里<<-参与讨论


JavaEye推荐






logicgate 2009-03-10 23:24 发表评论
]]>
Oracle 学习W记QBackup & Recovery 常用命ohttp://www.aygfsteel.com/logicgate/archive/2009/03/06/261397.htmllogicgatelogicgateFri, 06 Mar 2009 12:50:00 GMThttp://www.aygfsteel.com/logicgate/archive/2009/03/06/261397.html 

1 . set database to archivelog mode

SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.

SQL> startup mount;
ORACLE instance started.

Total System Global Area  251658240 bytes
Fixed Size                  1248356 bytes
Variable Size              83887004 bytes
Database Buffers          159383552 bytes
Redo Buffers                7139328 bytes
Database mounted.

SQL> alter database archivelog;
Database altered.

SQL> alter database open;
Database altered.

SQL> archive log list;
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence     1319
Next log sequence to archive   1321
Current log sequence           1321

 

2 . define flash recovery area

SQL> alter system set db_recovery_file_dest='D:\oracle\flash_recovery_area' scope=both;
System altered.
SQL> alter system set db_recovery_file_dest_size=15G scope=both;
System altered.

 

Oracle will use Oracle Managed File (OMF) for the flash recovery area. The free space in recovery area can be checked using OEM: All Metrics -> Recovery Area, or query vflash_recovery_area_usage view. To get more free space, you can use the following command to backup and then delete all the archived log files.

RMAN> backup archivelog all delete all input; 

 

3 . define multiple archived log destinations

SQL> alter system set log_archive_dest_1='location=use_db_recovery_file_dest' scope=both;
System altered.
SQL> alter system set log_archive_dest_2='location=D:\oracle\archivelog_area1' scope=both;
System altered.

 

4 . CONTROL_FILE_RECORD_KEEP_TIME

 

This parameter specify the minimum days the RMAN information is stored in the control file before overwritten. The default value is 7 days. When using catalog, a smaller value should be chosen.

 

5 . starting RMAN

rman target /
rman target / nocatalog
rman target sys/change_on_install@orcl
rman target sys/change_on_install@orcl catalog rman/rman@catdb
rman target sys/change_on_install log=xxx.log append
rman target sys/change_on_install cmdfile=xxx.rcv

 

6 . RMAN persistent settings

 

6.1 display settings

RMAN> show all;
RMAN> show controlfile autobackup;
RMAN> show retention policy;

 

6.2 configure settings

RMAN> configure retention policy to recovery window of 7 days;
RMAN> configure backup optimization on;
RMAN> configure default device type to disk;
RMAN> configure controlfile autobackup on;
RMAN> configure controlfile autobackup format for device type disk to '%F';
RMAN> configure device type disk backup type to compressed backupset parallelism 1;
RMAN> configure datafile backup copies for device type disk to 1;
RMAN> configure archivelog backup copies for device type disk to 1;
RMAN> configure channel device type disk maxpiecesize 1 G;
RMAN> configure maxsetsize to unlimited;
RMAN> configure encryption for database off;
RMAN> configure encryption algorithm 'AES128';
RMAN> configure archivelog deletion policy to none;
RMAN> configure snapshot controlfile name to 'D:\oracle\flash_recovery_area\sncfepcit.ora';

 

If the control file autobackup is enabled, then RMAN automatically backs up the control file and spfile in one of two circumstances:
- A successful backup is recorded in the RMAN repository
- A structural change to the database affects the contents of the control file

Control file autobackups are stored in the flash recovery area, unless otherwise specified.

 

6.3 reset settings to default value

RMAN> configure controlfile autobackup clear;
RMAN> configure retention policy clear;

 

7. RMAN commands

 

7.1 backup commands

RMAN> backup database;
RMAN> backup copy of database;
RMAN> backup as compressed backupset database;
RMAN> backup as backupset format ''/BACKUP/df_%d_%s_%p.bus' tablespace users;
RMAN> backup database plus archivelog delete all input;
RMAN> backup archivelog from sequence=234 delete input;
RMAN> backup tag='month_full_backup' datafile 1, 2, 3, 4;
RMAN> backup incremental level 0 database;
RMAN> backup incremental level 1 database;
RMAN> backup incremental level 1 cumulative database;

RMAN> run {
2> allocate channel c1 device type sbt;
3> allocate channel c2 device type sbt;
4> allocate channel c3 device type sbt;
5> backup incremental level = 0
6> format '/disk1/backup/df_%d_%s_%p.bak'
7> (datafile 1,4,5 channel c1)
8> (datafile 2,3,9 channel c2)
9> (datafile 6,7,8 channel c3);
10> alter system archive log current;
11> }

 

7.2 block change tracking

SQL> alter database enable block change tracking using file ''/mydir/rman_change_track.f' reuse;
SQL> alter database disable block change tracking;

 

7.3 incrementally updating backups

RMAN> backup as copy incremental level 0 datafile 1 tag 'basecopy';
RMAN> backup incremental level 1 for recover of copy with tag 'basecopy' datafile 1;
RMAN> recover copy of datafile 1 with tag 'basecopy';

 

7.4 list commands

RMAN> list backup of database summary;
RMAN> list backup of tablespace system summary;
RMAN> list backup of datafile {n|'file_name'} summary;
RMAN> list backup of database by {file|backup};
RMAN> list copy of database;

 

7.5 report commands

RMAN> report schema;
RMAN> report need backup incremental 0 database;
RMAN> report need backup days 3;
RMAN> report need backup redundancy 2;
RMAN> report need backup recovery window of 3 days;
RMAN> report obsolete redundancy 2;
RMAN> report obsolete recovery window of 3 days;

 

7.6 delete commands

RMAN> delete noprompt expired copy;
RMAN> delete noprompt expired backup;
RMAN> delete noprompt obsolete;
RMAN> delete obsolete redundancy 2;
RMAN> delete obsolete recovery window of 3 days;
RMAN> delete backupset 4;

 

8. RMAN v$ views

V$ARCHIVED_LOG
V$BACKUP_CORRUPTION
V$BACKUP_DEVICE
V$BACKUP_FILES
V$BACKUP_PIECE
V$BACKUP_REDOLOG
V$BACKUP_SET
V$BACKUP_SPFILE
V$COPY_CORRUPTION
V$RMAN_CONFIGURATION


已有 0 人发表留aQ猛?>>q里<<-参与讨论


JavaEye推荐





logicgate 2009-03-06 20:50 发表评论
]]>
Java l合数算?/title><link>http://www.aygfsteel.com/logicgate/archive/2009/03/05/261398.html</link><dc:creator>logicgate</dc:creator><author>logicgate</author><pubDate>Wed, 04 Mar 2009 16:13:00 GMT</pubDate><guid>http://www.aygfsteel.com/logicgate/archive/2009/03/05/261398.html</guid><description><![CDATA[ <p>今天工作中遇C个问题需要一个组合数法。google了一会,没有扑ֈ合适的Q于是就自己写了一个。主要是用了一个递归法。发出来分n一下,有用的着的就拿去Q觉得写得不好的拍点砖Q提点徏议?/p> <p> </p> <pre name="code" class="java">import java.util.*; public class Combination { public static void main(String[] args) { Vector testData = new Vector(Arrays.asList(1, 2, 3, 4, 5, 6)); Vector results = getAllCombinations(testData); for(int i=0; i<results.size(); i++) System.out.println(results.elementAt(i)); } public static Vector getAllCombinations(Vector data) { Vector allCombinations = new Vector(); for(int i=1; i<=data.size(); i++) { Vector initialCombination = new Vector(); allCombinations.addAll(getAllCombinations(data, i)); } return allCombinations; } public static Vector getAllCombinations(Vector data, int length) { Vector allCombinations = new Vector(); Vector initialCombination = new Vector(); combination(allCombinations, data, initialCombination, length); return allCombinations; } private static void combination(Vector allCombinations, Vector data, Vector initialCombination, int length) { if(length == 1) { for(int i=0; i<data.size(); i++) { Vector newCombination = new Vector(initialCombination); newCombination.add(data.elementAt(i)); allCombinations.add(newCombination); } } if(length > 1) { for(int i=0; i<data.size(); i++) { Vector newCombination = new Vector(initialCombination); newCombination.add(data.elementAt(i)); Vector newData = new Vector(data); for(int j=0; j<=i; j++) newData.remove(data.elementAt(j)); combination(allCombinations, newData, newCombination, length - 1); } } } }</pre> <p> </p> <p>试l果Q?/p> <pre name="code" class="java">[1] [2] [3] [4] [5] [6] [1, 2] [1, 3] [1, 4] [1, 5] [1, 6] [2, 3] [2, 4] [2, 5] [2, 6] [3, 4] [3, 5] [3, 6] [4, 5] [4, 6] [5, 6] [1, 2, 3] [1, 2, 4] [1, 2, 5] [1, 2, 6] [1, 3, 4] [1, 3, 5] [1, 3, 6] [1, 4, 5] [1, 4, 6] [1, 5, 6] [2, 3, 4] [2, 3, 5] [2, 3, 6] [2, 4, 5] [2, 4, 6] [2, 5, 6] [3, 4, 5] [3, 4, 6] [3, 5, 6] [4, 5, 6] [1, 2, 3, 4] [1, 2, 3, 5] [1, 2, 3, 6] [1, 2, 4, 5] [1, 2, 4, 6] [1, 2, 5, 6] [1, 3, 4, 5] [1, 3, 4, 6] [1, 3, 5, 6] [1, 4, 5, 6] [2, 3, 4, 5] [2, 3, 4, 6] [2, 3, 5, 6] [2, 4, 5, 6] [3, 4, 5, 6] [1, 2, 3, 4, 5] [1, 2, 3, 4, 6] [1, 2, 3, 5, 6] [1, 2, 4, 5, 6] [1, 3, 4, 5, 6] [2, 3, 4, 5, 6] [1, 2, 3, 4, 5, 6]</pre> <br/><br/> <span style="color:red;"> <a style="color:red;">已有 <strong>3</strong> 人发表留aQ猛?>><strong>q里</strong><<-参与讨论</a> </span> <br/><br/><br/> <span style="color:#E28822;">JavaEye推荐</span> <br/> <ul class='adverts'><li><a href='/adverts/152' target='_blank'><span style="color:red;font-weight:bold;">上v: 巨h|络诚聘Java, JS, |页游戏工程?/span></a></li><li><a href='/adverts/138' target='_blank'><span style="color:red;font-weight:bold;">加入阉K巴巴Q发展潜力无?/span></a></li><li><a href='/adverts/157' target='_blank'><span style="color:red;font-weight:bold;">江Q百世物科技有限公司诚聘资深Java工程?/span></a></li></ul> <br/><br/><br/> <img src ="http://www.aygfsteel.com/logicgate/aggbug/261398.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/logicgate/" target="_blank">logicgate</a> 2009-03-05 00:13 <a href="http://www.aygfsteel.com/logicgate/archive/2009/03/05/261398.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>晒一晒我的技术书c?/title><link>http://www.aygfsteel.com/logicgate/archive/2009/02/23/261399.html</link><dc:creator>logicgate</dc:creator><author>logicgate</author><pubDate>Mon, 23 Feb 2009 14:41:00 GMT</pubDate><guid>http://www.aygfsteel.com/logicgate/archive/2009/02/23/261399.html</guid><description><![CDATA[ <p>工作5q多了,和工作有关的技术书C一堆。大概可以分Z下五c:</p> <p> </p> <p>1. Core Java</p> <p>2. J2EE </p> <p>3. Software Engineer & Design Pattern</p> <p>4. Database</p> <p>5. Client Technology</p> <p> </p> <p>其实很多书都没有旉l看Q我无法用有限的生命ȝ无限的书。但看到喜欢的书Q还是忍不住M。可能买书也是会上瘾的吧。喜Ƣ一卷在手的感觉QR上,厕上Q床上,都可以翻几页。这U感觉是电子书籍和文档无法代替的?/p> <p> </p> <p>好了Q废话不多说Q直接上PP。大家觉得垃圄话,管拍。觉得好的话Q就投个_֍吧?/p> <p> </p> <p>1. Core Java</p> <p><br /> <img src="/upload/attachment/78056/e5282747-610a-3afd-9e0e-ba9243d99c1c.jpg" alt="" /></p> <p> </p> <p>2. J2EE</p> <p><br /> <img src="/upload/attachment/78060/47a53af7-b4dc-35ef-90a6-bc3b43bb0a8f.jpg" alt="" /></p> <p> </p> <p>3. Software Engineer & Design Pattern</p> <p><br /> <img src="/upload/attachment/78062/5900fe62-a8a5-35a0-9a3f-d026d6842e92.jpg" alt="" /></p> <p> </p> <p>4. Database</p> <p><br /> <img src="/upload/attachment/78058/31f3ec49-4d8a-3f8f-80ef-453ea9eb1793.jpg" alt="" /> </p> <p> </p> <p>5. Client Technology</p> <p><br /> <img src="/upload/attachment/78067/d39e42f2-f645-37d9-b5f6-b864f7f43728.jpg" alt="" /></p> <p> </p> <p>6. Others</p> <p><br /> <img src="/upload/attachment/78065/99a75d00-3cf0-3be7-8d62-50eb007fa6bf.jpg" alt="" /> <br /></p> <br/><br/> <span style="color:red;"> <a style="color:red;">已有 <strong>96</strong> 人发表留aQ猛?>><strong>q里</strong><<-参与讨论</a> </span> <br/><br/><br/> <span style="color:#E28822;">JavaEye推荐</span> <br/> <ul class='adverts'><li><a href='/adverts/138' target='_blank'><span style="color:red;font-weight:bold;">加入阉K巴巴Q发展潜力无?/span></a></li><li><a href='/adverts/157' target='_blank'><span style="color:red;font-weight:bold;">江Q百世物科技有限公司诚聘资深Java工程?/span></a></li><li><a href='/adverts/152' target='_blank'><span style="color:red;font-weight:bold;">上v: 巨h|络诚聘Java, JS, |页游戏工程?/span></a></li></ul> <br/><br/><br/> <img src ="http://www.aygfsteel.com/logicgate/aggbug/261399.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/logicgate/" target="_blank">logicgate</a> 2009-02-23 22:41 <a href="http://www.aygfsteel.com/logicgate/archive/2009/02/23/261399.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Oracle 学习W记Q重建Control Filehttp://www.aygfsteel.com/logicgate/archive/2009/02/22/261400.htmllogicgatelogicgateSun, 22 Feb 2009 04:02:00 GMThttp://www.aygfsteel.com/logicgate/archive/2009/02/22/261400.html1. 以sysdba登陆Q导出控制文?/p>
alter database backup controlfile to trace;

 

2. ?oracle_base%\oradata\%oracle_sid%\udump下找到刚刚创建的trc文gQ打开它。可以看到里面包含了两段sql脚本?/p>

-- Below are two sets of SQL statements, each of which creates a new
-- control file and uses it to open the database. The first set opens
-- the database with the NORESETLOGS option and should be used only if
-- the current versions of all online logs are available. The second
-- set opens the database with the RESETLOGS option and should be used
-- if online logs are unavailable.
-- The appropriate set of statements can be copied from the trace into
-- a script file, edited as necessary, and executed when there is a
-- need to re-create the control file.
--
--     Set #1. NORESETLOGS case
--
-- The following commands will create a new control file and use it
-- to open the database.
-- Data used by Recovery Manager will be lost.
-- Additional logs may be required for media recovery of offline
-- Use this only if the current versions of all online logs are
-- available.
-- After mounting the created controlfile, the following SQL
-- statement will place the database in the appropriate
-- protection mode:
--  ALTER DATABASE SET STANDBY DATABASE TO MAXIMIZE PERFORMANCE
STARTUP NOMOUNT
CREATE CONTROLFILE REUSE DATABASE "EPCIT" NORESETLOGS  ARCHIVELOG
    MAXLOGFILES 16
    MAXLOGMEMBERS 3
    MAXDATAFILES 100
    MAXINSTANCES 8
    MAXLOGHISTORY 454
LOGFILE
  GROUP 1 'D:\PTC\OCU_8.0\ORADATA\EPCIT\EPCITREDO01.LOG'  SIZE 10M,
  GROUP 2 'D:\PTC\OCU_8.0\ORADATA\EPCIT\EPCITREDO02.LOG'  SIZE 10M,
  GROUP 3 'D:\PTC\OCU_8.0\ORADATA\EPCIT\EPCITREDO03.LOG'  SIZE 10M
-- STANDBY LOGFILE
DATAFILE
  'D:\PTC\OCU_8.0\ORADATA\EPCIT\EPCITSYSTEM01.DBF',
  'D:\PTC\OCU_8.0\ORADATA\EPCIT\EPCITUNDOTBS01.DBF',
  'D:\PTC\OCU_8.0\ORADATA\EPCIT\EPCITSYSAUX01.DBF',
  'D:\PTC\OCU_8.0\ORADATA\EPCIT\EPCITBLOBS01.DBF',
  'D:\PTC\OCU_8.0\ORADATA\EPCIT\EPCITINDEX01.DBF',
  'D:\PTC\OCU_8.0\ORADATA\EPCIT\EPCITUSERS01.DBF',
  'D:\PTC\OCU_8.0\ORADATA\EPCIT\EPCITWCAUDIT01.DBF'
CHARACTER SET UTF8
;
-- Configure RMAN configuration record 1
VARIABLE RECNO NUMBER;
EXECUTE :RECNO := SYS.DBMS_BACKUP_RESTORE.SETCONFIG('CHANNEL','DEVICE TYPE DISK MAXPIECESIZE 100 M');
-- Configure RMAN configuration record 3
VARIABLE RECNO NUMBER;
EXECUTE :RECNO := SYS.DBMS_BACKUP_RESTORE.SETCONFIG('CONTROLFILE AUTOBACKUP','ON');
-- Configure RMAN configuration record 4
VARIABLE RECNO NUMBER;
EXECUTE :RECNO := SYS.DBMS_BACKUP_RESTORE.SETCONFIG('BACKUP OPTIMIZATION','ON');
-- Configure RMAN configuration record 5
VARIABLE RECNO NUMBER;
EXECUTE :RECNO := SYS.DBMS_BACKUP_RESTORE.SETCONFIG('DEVICE TYPE','DISK BACKUP TYPE TO COMPRESSED BACKUPSET PARALLELISM 1');
-- Commands to re-create incarnation table
-- Below log names MUST be changed to existing filenames on
-- disk. Any one log file from each branch can be used to
-- re-create incarnation records.
-- ALTER DATABASE REGISTER LOGFILE 'D:\ORACLE\FLASH_RECOVERY_AREA\EPCIT\ARCHIVELOG\2009_02_22\O1_MF_1_1_%U_.ARC';
-- Recovery is required if any of the datafiles are restored backups,
-- or if the last shutdown was not normal or immediate.
RECOVER DATABASE
-- All logs need archiving and a log switch is needed.
ALTER SYSTEM ARCHIVE LOG ALL;
-- Database can now be opened normally.
ALTER DATABASE OPEN;
-- Commands to add tempfiles to temporary tablespaces.
-- Online tempfiles have complete space information.
-- Other tempfiles may require adjustment.
ALTER TABLESPACE TEMP ADD TEMPFILE 'D:\PTC\OCU_8.0\ORADATA\EPCIT\EPCITTEMP01.DBF'
     SIZE 209715200  REUSE AUTOEXTEND ON NEXT 655360  MAXSIZE 32767M;
-- End of tempfile additions.
--
--     Set #2. RESETLOGS case
--
-- The following commands will create a new control file and use it
-- to open the database.
-- Data used by Recovery Manager will be lost.
-- The contents of online logs will be lost and all backups will
-- be invalidated. Use this only if online logs are damaged.
-- After mounting the created controlfile, the following SQL
-- statement will place the database in the appropriate
-- protection mode:
--  ALTER DATABASE SET STANDBY DATABASE TO MAXIMIZE PERFORMANCE
STARTUP NOMOUNT
CREATE CONTROLFILE REUSE DATABASE "EPCIT" RESETLOGS  ARCHIVELOG
    MAXLOGFILES 16
    MAXLOGMEMBERS 3
    MAXDATAFILES 100
    MAXINSTANCES 8
    MAXLOGHISTORY 454
LOGFILE
  GROUP 1 'D:\PTC\OCU_8.0\ORADATA\EPCIT\EPCITREDO01.LOG'  SIZE 10M,
  GROUP 2 'D:\PTC\OCU_8.0\ORADATA\EPCIT\EPCITREDO02.LOG'  SIZE 10M,
  GROUP 3 'D:\PTC\OCU_8.0\ORADATA\EPCIT\EPCITREDO03.LOG'  SIZE 10M
-- STANDBY LOGFILE
DATAFILE
  'D:\PTC\OCU_8.0\ORADATA\EPCIT\EPCITSYSTEM01.DBF',
  'D:\PTC\OCU_8.0\ORADATA\EPCIT\EPCITUNDOTBS01.DBF',
  'D:\PTC\OCU_8.0\ORADATA\EPCIT\EPCITSYSAUX01.DBF',
  'D:\PTC\OCU_8.0\ORADATA\EPCIT\EPCITBLOBS01.DBF',
  'D:\PTC\OCU_8.0\ORADATA\EPCIT\EPCITINDEX01.DBF',
  'D:\PTC\OCU_8.0\ORADATA\EPCIT\EPCITUSERS01.DBF',
  'D:\PTC\OCU_8.0\ORADATA\EPCIT\EPCITWCAUDIT01.DBF'
CHARACTER SET UTF8
;
-- Configure RMAN configuration record 1
VARIABLE RECNO NUMBER;
EXECUTE :RECNO := SYS.DBMS_BACKUP_RESTORE.SETCONFIG('CHANNEL','DEVICE TYPE DISK MAXPIECESIZE 100 M');
-- Configure RMAN configuration record 3
VARIABLE RECNO NUMBER;
EXECUTE :RECNO := SYS.DBMS_BACKUP_RESTORE.SETCONFIG('CONTROLFILE AUTOBACKUP','ON');
-- Configure RMAN configuration record 4
VARIABLE RECNO NUMBER;
EXECUTE :RECNO := SYS.DBMS_BACKUP_RESTORE.SETCONFIG('BACKUP OPTIMIZATION','ON');
-- Configure RMAN configuration record 5
VARIABLE RECNO NUMBER;
EXECUTE :RECNO := SYS.DBMS_BACKUP_RESTORE.SETCONFIG('DEVICE TYPE','DISK BACKUP TYPE TO COMPRESSED BACKUPSET PARALLELISM 1');
-- Commands to re-create incarnation table
-- Below log names MUST be changed to existing filenames on
-- disk. Any one log file from each branch can be used to
-- re-create incarnation records.
-- ALTER DATABASE REGISTER LOGFILE 'D:\ORACLE\FLASH_RECOVERY_AREA\EPCIT\ARCHIVELOG\2009_02_22\O1_MF_1_1_%U_.ARC';
-- Recovery is required if any of the datafiles are restored backups,
-- or if the last shutdown was not normal or immediate.
RECOVER DATABASE USING BACKUP CONTROLFILE
-- Database can now be opened zeroing the online logs.
ALTER DATABASE OPEN RESETLOGS;
-- Commands to add tempfiles to temporary tablespaces.
-- Online tempfiles have complete space information.
-- Other tempfiles may require adjustment.
ALTER TABLESPACE TEMP ADD TEMPFILE 'D:\PTC\OCU_8.0\ORADATA\EPCIT\EPCITTEMP01.DBF'
     SIZE 209715200  REUSE AUTOEXTEND ON NEXT 655360  MAXSIZE 32767M;
-- End of tempfile additions.

 

W一Dsql是在所有online redolog没有丢失Q以noresetlogs选项打开数据库的情况下用的。第二段则是在丢׃online redolog需要resetlogs的情况下使用?/p>

 

3. ?Set #1. NORESETLOGS case"下的sql拯出来Q存为reCreateCtl.sql

 

4. 以sysdba登陆Qshutdown immediate。然后删除所有控制文件。再q行reCreateCtl.sql?/p>

SQL> @reCreateCtl
ORACLE instance started.

Total System Global Area  251658240 bytes
Fixed Size                  1248356 bytes
Variable Size              83887004 bytes
Database Buffers          159383552 bytes
Redo Buffers                7139328 bytes

Control file created.
PL/SQL procedure successfully completed.
PL/SQL procedure successfully completed.
PL/SQL procedure successfully completed.
PL/SQL procedure successfully completed.

ORA-00283: recovery session canceled due to errors
ORA-00264: no recovery required

System altered.
Database altered.
Tablespace altered.

 

5. 成功创徏了控制文Ӟ数据库也正常打开。再没有使用Recovery Catalog的情况下QRMAN的备份资料是存在控制文g中的Q重建控制文件会D丢失备䆾资料库?/p>

已有 0 人发表留aQ猛?>>q里<<-参与讨论


JavaEye推荐






logicgate 2009-02-22 12:02 发表评论
]]>
Oracle 学习W记QSYSDBA登陆权限问题http://www.aygfsteel.com/logicgate/archive/2009/02/18/261401.htmllogicgatelogicgateWed, 18 Feb 2009 15:54:00 GMThttp://www.aygfsteel.com/logicgate/archive/2009/02/18/261401.html本文环境配置QOracle10gR2QWindows XP

 

Oracle的用户信息一般来说是保存在数据字兔R的,所以常规用户在Oracle数据库没有启动的时候是无法登陆的。但有两cȝ户例外,q就是具有sysdba或者sysoper权限的用戗Oracle sysdba或者sysoper用户的登陆有两种方式Q一是通过OS认证Q二是通过密码文g验证?/p>

 

I竟使用哪一U验证方式以及能否成功登陆取决于三个斚w的因素:

1. sqlnet.ora中SQLNET.AUTHENTICATION_SERVICES的设|?/p>

2. 参数文g中REMOTE_LOGIN_PASSWORDFILE的设|?/p>

3. 密码文g PWD%sid%.ora

 

Oracleq行权限验证的大致顺序如下:

1. ҎSQLNET.AUTHENTICATION_SERVICES的值决定是q行os验证q是密码文g验证?/p>

2. 如果是os验证Q根据当前用L用户l判断是否具有sysdba权限。如果os验证p|Q则q行密码文g验证?/p>

2. 如果是密码文仉证,REMOTE_LOGIN_PASSWORDFILE的g及密码文件是否存在决定了验证是否成功?/p>

 

1. OS ?/strong> ?/strong>

 

要启用os验证Q就必须在qlnet.ora中设|SQLNET.AUTHENTICATION_SERVICES=(NTS)Q然后在Windows中徏立ora_dba用户l,把相关用户加入到q个l中Qe.g., administratorQ,q样administrator可以在不用提供用户名和密码Q或者提供Q意的用户名和密码Q的情况下以sysdbaw䆾本地登陆。因为操作系l已l代替Oracleq行了验证?/p>

 

试一Qora_dba用户本地登陆

C:\>sqlplus / as sysdba
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the OLAP and Data Mining options
SQL>

C:\>sqlplus wrong_user/wrong_password as sysdba
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the OLAP and Data Mining options
SQL>

 

试二:非ora_dba用户本地登陆

C:\>sqlplus / as sysdba
ERROR:
ORA-01031: insufficient privileges
Enter user-name:

C:\>sqlplus wrong_user/wrong_password sysdba
ERROR:
ORA-01017: invalid username/password; logon denied
Enter user-name:

C:\>sqlplus sys/change_on_install as sysdba
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the OLAP and Data Mining options
SQL>
 

2. 密码文g验证

 

密码文g包含了被授予sysdba和sysoper权限的用L用户名和密码。这是一个加密文Ӟ一般来说存攑֜%oracle_home%/database目录下,文g名ؓPWD%sid%.ora?/p>

 

如果要用密码文仉证,则把sqlnet.ora改ؓSQLNET.AUTHENTICATION_SERVICES=noneQ或者从sqlnet.ora中删除SQLNET.AUTHENTICATION_SERVICES。同上匿名登陆sqlplus会失败,l出用户名和密码可以成功登陆?/p>

C:\>sqlplus / as sysdba
ERROR:
ORA-01031: insufficient privileges
Enter user-name:

C:\>sqlplus sys/change_on_install as sysdba
Connected to an idle instance.
idle>

 

试一Q删除密码文件。用用户名和密码登陆,p|Q?/p>

C:\>sqlplus sys/change_on_install as sysdba
ERROR:
ORA-01031: insufficient privileges
Enter user-name:

 

试二:恢复密码文gQ设|REMOTE_LOGIN_PASSWORDFILE=none。用用户名和密码登陆,p|Q?/p>

SQL> alter system set remote_login_passwordfile=none scope=spfile;
System altered.

C:\>sqlplus sys/change_on_install as sysdba
ERROR:
ORA-01017: invalid username/password; logon denied
Enter user-name:

 

试三:恢复密码文gQ设|REMOTE_LOGIN_PASSWORDFILE为EXCLUSIVE或者SHARED。用用户名和密码登陆,成功Q?/p>

SQL> alter system set remote_login_passwordfile=exclusive scope=spfile;
System altered.

C:\>sqlplus sys/change_on_install as sysdba
Connected to an idle instance.
SQL>

 

3. 密码文g

 

查看hsysdba或者sysoper权限的用P

SQL> select * from v$pwfile_users;

USERNAME                       SYSDB SYSOP
------------------------------  -------  -------
SYS                                  TRUE   TRUE

 

每次使用grant sysdba/sysoper授予新用LD权限或是alter user命o修改拥有sysdba/sysoper权限的用户密码的时候,Oracle都会自动的同步密码文Ӟq样保证在数据库没有打开的情冉|有特D权限的用户能正常的登陆数据库以q行理操作?/p>

SQL> grant sysdba to logicgate;
Grant succeeded.

SQL> select * from v$pwfile_users;

USERNAME                       SYSDB SYSOP
------------------------------- -------- --------
SYS                                  TRUE   TRUE
LOGICGATE                      TRUE   FALSE

 

使用orapwd命o可以重徏密码文g?/p>

C:\>orapwd
Usage: orapwd file=<fname> password=<password> entries=<users> force=<y/n>
  where
    file - name of password file (mandatory),
    password - password for SYS (mandatory),
    entries - maximum number of distinct DBA (optional),
    force - whether to overwrite existing file (optional)

 

其中文g名和密码是必需的。entries讄了密码文件可包含的dba用户的最大数目。force定义了是否覆盖当前文件。重建密码文件会清除pȝ内除了sys用户以外所有sysdba用户的密码。必M用grant sysdba同步密码文g?/p>

C:\>orapwd file=%oracle_home%\database\PWDepcit.ora password=temp entries=20 force=y;

C:\>sqlplus sys/temp as sysdba
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the OLAP and Data Mining options

SQL> select * from v$pwfile_users;

USERNAME                       SYSDB SYSOP
------------------------------- -------- --------
SYS                                  TRUE   TRUE


已有 0 人发表留aQ猛?>>q里<<-参与讨论


JavaEye推荐





logicgate 2009-02-18 23:54 发表评论
]]>
TrueOrders Data Export & Importhttp://www.aygfsteel.com/logicgate/archive/2009/02/16/261402.htmllogicgatelogicgateMon, 16 Feb 2009 14:52:00 GMThttp://www.aygfsteel.com/logicgate/archive/2009/02/16/261402.htmlData Export on Source Server

1. Open Windchil Shell and login to SQL Plus as user OB80

2. Execute the following SQL statement:

select * from nls_database_parameters t where t.parameter in ('NLS_LANGUAGE', 'NLS_TERRITORY', 'NLS_CHARACTERSET');

 

The result in the testing system is:
NLS_LANGUAGE: AMERICAN
NLS_TERRITORY: AMERICA
NLS_CHARACTERSET: UTF8

 

3. Exit SQL Plus

4. Execute the following command:

set NLS_LANG=AMERICAN_AMERICA.UTF8
 

5. Execute the following command to export TrueOrders data:

exp ob80/ob80 file=epcit.dmp log=epcit_exp.log compress=y;

 

Please make sure Export terminated successfully without warning.

6. TrueOrders data is exported to epcit.dmp located under the directory in which you run the export command (in this case, it’s D:\ptc\Windchill_8.0\db\sql).

7. Copy epcit.dmp to a directory on target server (e.g., D:\ptc\Windchill_8.0\db\sql).

 

Data Import on Source Server

1. Open Windchil Shell and login to SQL Plus as SYSDBA

2. Drop user OB80

drop user ob80 cascade;

 

The user ob80 is dropped, including all the objects (table, index, view, procedure...) belong to ob80. It may take several minutes.

3. Re-create user OB80

@create_user


Enter value for user: ob80
Enter value for temporary_tablespace: temp
Enter value for userdata_tablespace: users

4. Repeat Steps 2, 3, 4 from the Data Export phase

5. From the directory where you put the epcit.dmp (e.g., D:\ptc\Windchill_8.0\db\sql), execute the following command to import TrueOrders data:

imp ob80/ob80 file=epcit.dmp log=epcit_imp.log full=y commit=y;


Please make sure Import terminated successfully without warning.

6. Data migration completes.



已有 0 人发表留aQ猛?>>q里<<-参与讨论


JavaEye推荐





logicgate 2009-02-16 22:52 发表评论
]]>
2009q三大学习计?/title><link>http://www.aygfsteel.com/logicgate/archive/2009/02/14/261403.html</link><dc:creator>logicgate</dc:creator><author>logicgate</author><pubDate>Sat, 14 Feb 2009 13:30:00 GMT</pubDate><guid>http://www.aygfsteel.com/logicgate/archive/2009/02/14/261403.html</guid><description><![CDATA[ <p>Ҏ工作需要及个h兴趣Q本人制定了2009q的学习计划?/p> <p> </p> <p>1。EJB 3.0</p> <p>虽然公司不用EJBQ但无可否认EJB仍然是Y件公司应用最q泛的技术之一。根据前一阵子面试的经历,新加坡中大型软g公司大部分用的q是EJB。如果有一天公司抛弃Windchill的话QEJB 3.0会是我的首选徏议?/p> <p> </p> <p>2。Web Services</p> <p>不管它是真的有用Q还是忽悠hQM来多的公司开始考虑Web Services。ؓ了自q竞争力,学之Q?/p> <p> </p> <p>3。Oracle Database</p> <p>Z当前及未来的工作需要,对Oracle的学习主要侧重于三个斚wQ?/p> <p>- PL/SQL</p> <p>- Performance Tuning</p> <p>- Backup & Recovery</p> <p> </p> <p>希望明年的今日,我可以制定一个全新的学习计划Q?/p> <p> </p> <p>希望也听听大家的学习计划Q于大家共勉Q?/p> <p> </p> <br/><br/> <span style="color:red;"> <a style="color:red;">已有 <strong>41</strong> 人发表留aQ猛?>><strong>q里</strong><<-参与讨论</a> </span> <br/><br/><br/> <span style="color:#E28822;">JavaEye推荐</span> <br/> <ul class='adverts'><li><a href='/adverts/157' target='_blank'><span style="color:red;font-weight:bold;">江Q百世物科技有限公司诚聘资深Java工程?/span></a></li><li><a href='/adverts/138' target='_blank'><span style="color:red;font-weight:bold;">加入阉K巴巴Q发展潜力无?/span></a></li><li><a href='/adverts/152' target='_blank'><span style="color:red;font-weight:bold;">上v: 巨h|络诚聘Java, JS, |页游戏工程?/span></a></li></ul> <br/><br/><br/> <img src ="http://www.aygfsteel.com/logicgate/aggbug/261403.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/logicgate/" target="_blank">logicgate</a> 2009-02-14 21:30 <a href="http://www.aygfsteel.com/logicgate/archive/2009/02/14/261403.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>EJB 3 学习W记QGlassFish 入门http://www.aygfsteel.com/logicgate/archive/2009/02/11/261404.htmllogicgatelogicgateWed, 11 Feb 2009 10:50:00 GMThttp://www.aygfsteel.com/logicgate/archive/2009/02/11/261404.html1。下载,安装

电脑上必预先安装Jdk5 or Jdk6Qƈ且设|JAVA_HOME环境变量。从Sun的网站上下蝲 GlassFish v2.1 final buildQ是一个jar文g。下载后q行Q?/p>

F:\>java -Xmx256m -jar glassfish-installer-v2ur2-b04-windows.jar

 

如果q里不加?Xmx256mQ很有可能会报OutOfMemoryException。这个命令会产生一个名为glassfish的目录。在glassfish目录下运行:F:\glassfish>lib\ant\bin\ant -f setup.xml

如果最后能看到“BUILD SUCCESSFUL”,p明GlassFish已经安装成功了。GlassFish会徏立一个名为“domain1“的域?/p>

 

打开setup.xml文g我们可以看到默认的配|:

<property name="domain.name" value="domain1"/>
<property name="instance.name" value="server"/>
<property name="admin.user" value="admin"/>
<property name="admin.password" value="adminadmin"/>
<property name="admin.port" value="4848"/>
<property name="instance.port" value="8080"/>
<property name="orb.port" value="3700"/>
<property name="imq.port" value="7676"/>
<property name="https.port" value="8181"/>

 如果惌定义domain name, user, password or portsQ可以手动修改这个文件后再进行安装?/p>

 

2。启动GlassFish服务?/strong>

?glassfish_home%\bin目录d到path环境变量中。在L目录下键入asadmin start-domain卛_启动default domain (domain1)。成功启动后在http://localhost:8080/可以看到服务器欢q页面?/p>

 

3。用admin console

admin console是一个基于web的服务器理和配|^台。在览器中键入http://localhost:4848可以看到登陆页面。用setup.xml中定义的user & password卛_登陆。点d侧树形结构上的节点可以在右侧H口察看相应的管理项目?/p>

 

ApplicationsQ?理domain中部|的应用?/p>

Application Server -> GeneralQstart & stop instanceQ?view log filesQ?JNDI browsing。。?/p>

Application Server -> Adminstrator PasswordQ修改admin console的密?/p>

 

4。GlassFish的基本概?/strong>

 

DomainQ?/strong> 域(DomainQ是GlassFish的一个核心概念,我们可以为每个GlassFish服务器徏立多个域Q而域里面又可以包含多U可理的资源,包括实例、集及它们各自资源。需要注意的是,一个可理的资源,例如一个实例,只能专属于一个域?/p>

 

Domain Administrator Server(DAS)Q?/strong> 域管理服务器。DAS是GlassFish的一个核心组Ӟ在集的环境中,每个GlassFish服务器可能会存在多个服务实例 QInstanceQ,DAS本n也是一个符合Java EE5规范的服务实例,主要是ؓGlassFish提供核心理的功能。所有对域的理操作Q例如Netbeans IDE以及其他工具的管理请求,都是由DAS分发到各个服务器实例ȝQ而不是直接连接到各个服务器实例?对于一些需要多个实例进行操作的理hQDAS会将操作hq播到各个实例上去,所以,当DAS停止q行后,各种对域的管理操作都不能q行Q当Ӟ即 DAS已经停止了运行,域的集群和服务器实例仍然可以正常工作Q只要域q在正常q行?/p>

 

NodeQ?/strong> 一般来_一个nodeQ节点)׃表一个独立主机。一个很大的机器可能会分割ؓ多个独立的节炏V?strong> 节点需要一个轻量的代理(Node AgentQ来Ҏ务器实例q行q程生命周期理。节点代理主要负责实例的启动Q停止以及创建,同时Q也承担监视者以及重启失效进E的责Q?/p>

 

Server InstanceQ?/strong> 服务器实例?strong> 一个实例指的是掌管Java EE 5应用服务器的Java虚拟机。实例间的通信以及和DAS之间的通信是依赖于q程MBeanҎ的调用的?/p>

 

感觉q和Oracle的RAC架构很相伹{我们可以ؓoracle建立多个databaseQ每一个database可以包含多个instanceQEnterprise Grid Control负责理所有的instance?/p>

 

5。Domain的管?/strong>

 

5.1 create domain

 

F:\>asadmin create-domain --adminport 4849 myFirstDomain

成功后在%glassfish_home%\domains下可以看到myFirstDomain目录。asadmin start-domain myFirstDomain后键入http://localhost:4849卛_登陆admin console?/p>

 

直接在命令行键入asadmin create-domain可以看到所有可接受的参数。其中adminport和domain name是必需的,否则asadmin会报错?/p>

 

--profile可以为创建的domain指定一个profile。如果没有显C的指定profileQasadmin会?glassfish_home%\config\asadminenv.conf中AS_ADMIN_PROFILE定义的缺省profileQdeveloperQ。GlassFish提供developerQcluster & enterprise三种profile。GlassFish的admin guide上面_Do not create an enterprise domain unless you have HADB and the Network Security Services (NSS) keystore。就是说不要随便创徏enterprise profile玩。HADB应该是指高可用性数据库QNSS keystore是什么我׃明白了?/p>

 

--domaindir可以指定domain的目录。缺省目录ؓ%glassfish_home%\domains

 

5.2 start & stop & delete & list domain

 

F:\>asadmin start-domain myFirstDomain

F:\>asadmin stop-domain myFirstDomain

如果只有一个domainQ则可以省去domain name?/p>

F:\>asadmin delete-domain myFirstDomain

F:\>asadmin list-domains

 

5.3 domain的配|文?/p>

 

%glassfish_home%\domains\%domain_name%\config\domain.xml

对于其中大部分的配置GlassFish支持热部|Ԍ无需重启domain。这些配|包括:

- 部v应用和取消部|?/p>

- dQ移除JDBC, JMS, Connector resources and pools

- 改变日志U别

- 修改监控U别

。。?/p>

 

6。与IDE的集?/strong>

 

GlassFish与netbean, eclipse都可以方便的集成。比较v来netbean更简单些Q毕竟是自家的品嘛。eclipseq需要先下蝲一个server adapter?/p>

 

7。部|应?/strong>

 

在GlassFish中部|应用有三种Ҏ。下面以一个sample.warZ说明q三U方法。部|EJB module或者enterprise application的步骤大致相同?/p>

 

7.1 自动部v

 

?glassfish_home%\domains\%domain_name%下有一个autodeploy目录。把我的sample.war直接copy到这个目录下Q大概两U钟后出C个叫sample.war_deployed的文件。这说明部v成功了。在admin console的Applications -> Web Applications下可以看到这个应用。如果要取消部vQ把sample.war从autodeploy中删除即可?/p>

 

q种部v方式最单直接。但~点是只支持本地部vQ只能进行文仉|?jar, war, ear...)Q不能进行文件夹部vQ解压sample.war后把整个文g夹copy到autodeploy下部|无效)。而且部v的文件只能位于autodeploy下面?/p>

 

7.2 使用admin console部v

 

在admin console的Applications -> Web Applications中点Deploy按钮可以q入部v面?/p>

 

q里提供了两U选项。一U是Packaged file to be uploaded to the serverQ就是上传打包文仉|Ӏ用这个选项可以把本机的应用部v到远E服务器上。另外一U是Local packaged file or directory that is accessible from the Application Server。就是说使用本地打包文g或者文件夹q行部v。文件夹部v方式非常方便本机开发调试?/p>


比如说我在tomcat的webapps下有一个sample文g夹,我可以直接把q个文g多w|到GlassFish中而无需q行打包。部|后改动sample中的jsp文gQ刷新浏览器卛_看到改变Q不用重新部|Ӏ?/p>

 

7.3 使用asadmin命o部v

 

部vQ?/p>

asadmin deploy --port 4849 --user admin F:\apache-tomcat-5.5.27\webapps\sample.war

取消部vQ?/p>

asadmin undeploy --port 4849 --user admin sample

更详l的命o可以通过asadmin deploy --help获得?/p>

 

好了Q入门篇写到这里。等有机会深入研I研IӞ再写q阶,高񔽋,哈哈?/p>

已有 0 人发表留aQ猛?>>q里<<-参与讨论


JavaEye推荐






logicgate 2009-02-11 18:50 发表评论
]]>
EJB 3 学习W记QHelloWorld Stateless SessionBeanhttp://www.aygfsteel.com/logicgate/archive/2009/02/07/261405.htmllogicgatelogicgateSat, 07 Feb 2009 15:05:00 GMThttp://www.aygfsteel.com/logicgate/archive/2009/02/07/261405.html我的开发环境是eclipse 3.4 + glassfish-v2

 

1。下载安装glassfish-v2Q具体步骤就不说了,此处省略500字。。?/p>

2。运行asadmin start-appserv启动应用服务器?/p>

3。登陆admin console, http://localhost:4848


 

4。创建eclipse project



 

?glassfish_home%/lib中找到javaee.jar和appserv-rt.jarq两个文Ӟ加入到project Libraries中?/p>


 

5。编写HelloWorld EJB

 

IHelloWorld.java (remote interface):

package ejb;

import javax.ejb.Remote;

@Remote
public interface IHelloWorld
{
	public String sayHello();
}

 

HelloWorld.java (stateless session bean)

package ejb;

import javax.ejb.Stateless;

@Stateless(name="HelloWorldBean", mappedName="ejb/HelloWorldBeanJNDI")
public class HelloWorld implements IHelloWorld
{
	public String sayHello()
	{
		return ("Hello World! This is my first EJB3 Stateless SessionBean!");
	}
}

 

mappedName定义了HelloWorld的jndi nameQ稍后客L试E序需要用q个名字来做lookup?/p>

 

6。编写ant build.xml

<?xml version="1.0"?>

<project name="helloWorld" default="deploy" basedir=".">
	<property name="build.dir" value="${basedir}/class"/>
	<property name="glassfish.home" value="F:/glassfish-v2ur2"/>
	<property name="deploy.dir" value="${glassfish.home}/domains/domain1/autodeploy"/>

	<target name="jar">
		<jar destfile="helloWorld.jar">
			<fileset dir="${build.dir}">
				<include name="ejb/*.class"/>
			</fileset>
		</jar>
	</target>
	
	<target name="deploy" depends="jar">
		<copy file="${basedir}/helloWorld.jar" todir="${deploy.dir}"/>
	</target>
</project>

 

7。打包,部v?/p>

 

q行build.xmlQ把E序打包成helloWorld.jarq拷贝到glassfish的自动部|目录。如果部|成功,在glassfish的admin console中,Applications->EJB Modules下面可以扑ֈ我们的HelloWorldBean。如果程序中没有讄mappedNameQ去Application Server->General->JNDI Browsing也可以找到对应的jndi name?/p>



 

8。编写客L试E序?/p>

package test;

import javax.naming.InitialContext;
import ejb.IHelloWorld;

public class Test
{
	public void runTest() throws Exception
	{
		InitialContext ctx = new InitialContext();
		IHelloWorld bean = (IHelloWorld)ctx.lookup("ejb/HelloWorldBeanJNDI");
		System.out.println(bean.sayHello());
	}

	public static void main(String[] args)
	{
		try
		{
			Test t = new Test();
			t.runTest();
		}
		catch(Exception e)
		{
			e.printStackTrace();
		}
	}
}

 

q行试E序Q成功打印出Q?Hello World! This is my first EJB3 Stateless SessionBean!

 

感觉ejb3比ejb2了一堆繁琐的文g和xml配置Q而且支持pojo风格的编E,开发效率和可移植性都比以前要好得多?/p>

已有 0 人发表留aQ猛?>>q里<<-参与讨论


JavaEye推荐






logicgate 2009-02-07 23:05 发表评论
]]>
Oracle 学习W记QOracle10g重新配置Database Controlhttp://www.aygfsteel.com/logicgate/archive/2009/02/06/261406.htmllogicgatelogicgateFri, 06 Feb 2009 06:48:00 GMThttp://www.aygfsteel.com/logicgate/archive/2009/02/06/261406.html׃安装oracle的时候没有设|oracle_hostnameQoracle oem?oracle_home%下面产生了两个包含我当时的ip address的目录,192.168.1.112_epcit和oc4j\j2ee\OC4J_DBConsole_192.168.1.112_epcit q样一旦我的ip address改变了,q行emctl start dbcontrol会报错:

 

C:\>emctl status dbconsole
OC4J Configuration issue. %oracle_home%/oc4j/j2ee/OC4J_DBConsole_%ip%_%sid% not found.

 

只好重新配置database control了?/p>

 

1。数据库和listener都必dl启动ƈ正常工作?/p>

2。设|系l环境变量oracle_hostname Q如果你q没有设|的话)

2。emctl stop dbconsole Q如果你的db controlq在q行的话Q?/p>

3。sc delete OracleDBConsoleepcit Q删除windows serviceQ不删除好像最后会报错Q?/p>

4。emca -config dbcontrol db -repos recreate

 

C:\>emca -config dbcontrol db -repos recreate

STARTED EMCA at Feb 6, 2009 2:50:26 PM
EM Configuration Assistant, Version 10.2.0.1.0 Production
Copyright (c) 2003, 2005, Oracle.  All rights reserved.

Enter the following information:
Database SID: epcit
Listener port number: 1521
Password for SYS user: change_on_install
Password for DBSNMP user: change_on_install
Password for SYSMAN user: change_on_install
Email address for notifications (optional):
Outgoing Mail (SMTP) server for notifications (optional):
-----------------------------------------------------------------

You have specified the following settings

Database ORACLE_HOME ................ D:\oracle\product

Database hostname ................ BLC05
Listener port number ................ 1521
Database SID ................ epcit
Email address for notifications ...............
Outgoing Mail (SMTP) server for notifications ...............

-----------------------------------------------------------------
Do you wish to continue? [yes(Y)/no(N)]:y

 

...............

 

认一切okQ没有出现failed字样。如果有错的话,可以查看%oracle_home%\cfgtoollogs\emca\下面的log文g?/p>

登陆 http://blc05:5500/em  l于又看C熟悉的页面?/p>

已有 0 人发表留aQ猛?>>q里<<-参与讨论


JavaEye推荐






logicgate 2009-02-06 14:48 发表评论
]]>
发发关于pȝ框架的牢?/title><link>http://www.aygfsteel.com/logicgate/archive/2009/02/06/261407.html</link><dc:creator>logicgate</dc:creator><author>logicgate</author><pubDate>Thu, 05 Feb 2009 18:09:00 GMT</pubDate><guid>http://www.aygfsteel.com/logicgate/archive/2009/02/06/261407.html</guid><description><![CDATA[ <p>一直以来,我都希望能开发出一套完善的pȝ框架Q能让其他的开发h员尽量避免接触到复杂的底层技术细节,能把主要的精力放在业务需求上面,加快开发速度。但l果q是不尽人意。ȝ了一下原因,大概有以下几点吧?/p> <p> </p> <p>1。本力不뀂从毕业后就加入现在的公司,我从来没有接触过其它的系l,也没有h能够指点我,也许我自p了弯路而自p不知道?/p> <p> </p> <p>2。缺h力资源。h,事多。大部分的时间都攑֜了业务模块的开发上面。小公司的局限性注定了它不可能投入大量的h力和旉d底层框架的开发。这没有错,但是让我很无奈!</p> <p> </p> <p>3。需求太复杂。几百个对象之间错综复杂的关pd像一个蜘蛛网Q同时又要求pȝ界面user friendlyQ结果导致系l的复杂性大大增加?/p> <p> </p> <p>4。无技术文档。把一个没有详l技术文档的pȝ丢给一个开发h员,好比是把一个没有用h册的pȝ丢给客户又不l他们培训一栗五q了Q我q真的没有怎么写过开发文档。结果每ơ来一个新的程序员Q都要花上大半年的时_才能基本上熟悉系l框Ӟ做出点象样子的东ѝ但q没有哪一个能真正做到游刃有余Q灵zM用?/p> <p> </p> <p>MQ个力不?公司人太?客户需求复?~少技术文?开发进度慢+开发难度大=一个远q不完美的系l?/p> <br/><br/> <span style="color:red;"> <a style="color:red;">已有 <strong>9</strong> 人发表留aQ猛?>><strong>q里</strong><<-参与讨论</a> </span> <br/><br/><br/> <span style="color:#E28822;">JavaEye推荐</span> <br/> <ul class='adverts'><li><a href='/adverts/138' target='_blank'><span style="color:red;font-weight:bold;">加入阉K巴巴Q发展潜力无?/span></a></li><li><a href='/adverts/157' target='_blank'><span style="color:red;font-weight:bold;">江Q百世物科技有限公司诚聘资深Java工程?/span></a></li><li><a href='/adverts/152' target='_blank'><span style="color:red;font-weight:bold;">上v: 巨h|络诚聘Java, JS, |页游戏工程?/span></a></li></ul> <br/><br/><br/> <img src ="http://www.aygfsteel.com/logicgate/aggbug/261407.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/logicgate/" target="_blank">logicgate</a> 2009-02-06 02:09 <a href="http://www.aygfsteel.com/logicgate/archive/2009/02/06/261407.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Oracle 学习W记QOracle10g监听端口改变后DB Control无法使用的解x?/title><link>http://www.aygfsteel.com/logicgate/archive/2009/02/03/261408.html</link><dc:creator>logicgate</dc:creator><author>logicgate</author><pubDate>Tue, 03 Feb 2009 15:22:00 GMT</pubDate><guid>http://www.aygfsteel.com/logicgate/archive/2009/02/03/261408.html</guid><description><![CDATA[ <p>修改前的listener.ora</p> <p> </p> <p>SID_LIST_LISTENER =<br />   (SID_LIST =<br />     (SID_DESC =<br />       (SID_NAME = PLSExtProc)<br />       (ORACLE_HOME = D:\oracle\product)<br />       (PROGRAM = extproc)<br />     )<br />   )<br /> <br /> LISTENER =<br />   (DESCRIPTION_LIST =<br />     (DESCRIPTION =<br />       (ADDRESS = (PROTOCOL = TCP)(HOST = logicgate)(PORT = 1521))<br />     )<br />     (DESCRIPTION =<br />       (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))<br />     )<br />   )</p> <p> </p> <p>修改后的listener.ora</p> <p> </p> <p>SID_LIST_LISTENER =<br />   (SID_LIST =<br />     (SID_DESC =<br />       (SID_NAME = PLSExtProc)<br />       (ORACLE_HOME = D:\oracle\product)<br />       (PROGRAM = extproc)<br />     )<br />     (SID_DESC =<br />       (GLOBAL_DBNAME = epcit)<br />       (ORACLE_HOME = d:\oracle\product)<br />       (SID_NAME = epcit)<br />     )<br />   )<br /> <br /> LISTENER =<br />   (DESCRIPTION_LIST =<br />     (DESCRIPTION =<br />       (ADDRESS = (PROTOCOL = TCP)(HOST = logicgate)(PORT = 1523))<br />     )<br />     (DESCRIPTION =<br />       (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))<br />     )<br />   )</p> <p> </p> <p>监听端口?521变ؓ1523。由于oracle实例的动态注册只能在默认端口1521上运行,端口改变后我q里使用了静态注册。重新启动监听器Q?/p> <p> </p> <p>D:\>lsnrctl stop</p> <p>D:\>lsnrctl start</p> <p>D:\>lsnrctl services<br /> <br /> Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=logicgate)(PORT=1523)))<br /> Services Summary...<br /> Service "PLSExtProc" has 1 instance(s).<br />   Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...<br />     Handler(s):<br />       "DEDICATED" established:0 refused:0<br />          LOCAL SERVER<br /> Service "epcit" has 1 instance(s).<br />   Instance "epcit", status UNKNOWN, has 1 handler(s) for this service...<br />     Handler(s):<br />       "DEDICATED" established:0 refused:0<br />          LOCAL SERVER<br /> The command completed successfully</p> <p> </p> <p>可以看到数据库实?epcit"已经成功注册到监听器的端?523上面。改变监听器端口后运行tnsping会出错,但只要更改tnsnames.ora中对应的端口可以了?/p> <p> </p> <p>然后登陆database control, 出现如下错误Q?span class="xl">Enterprise Manager is not able to connect to the database instance. The state of the components are listed below。修Ҏ法如下:</span> </p> <p> </p> <p>1?oracle_home\%hostname%_epcit\sysman\config\emoms.properties 在这个文仉我们可以扑ֈ两个和端口有关的讄</p> <p>oracle.sysman.eml.mntr.emdRepPort=1521</p> <p>oracle.sysman.eml.mntr.emdRepConnectDescriptor=(DESCRIPTION\=(ADDRESS_LIST\=(ADDRESS\=(PROTOCOL\=TCP)(HOST\=LOGICGATE)(PORT\=1521)))(CONNECT_DATA\=(SERVICE_NAME\=epcit)))</p> <p>把旧的端口改为新的端口就ok?/p> <p> </p> <p>2?oracle_home\%hostname%_epcit\sysman\emd\targets.xml  把所有旧的端口换成新的?/p> <p> </p> <p>3。重启database controlQ登陆oemQ成功!</p> <br/><br/> <span style="color:red;"> <a style="color:red;">已有 <strong>0</strong> 人发表留aQ猛?>><strong>q里</strong><<-参与讨论</a> </span> <br/><br/><br/> <span style="color:#E28822;">JavaEye推荐</span> <br/> <ul class='adverts'><li><a href='/adverts/157' target='_blank'><span style="color:red;font-weight:bold;">江Q百世物科技有限公司诚聘资深Java工程?/span></a></li><li><a href='/adverts/138' target='_blank'><span style="color:red;font-weight:bold;">加入阉K巴巴Q发展潜力无?/span></a></li><li><a href='/adverts/152' target='_blank'><span style="color:red;font-weight:bold;">上v: 巨h|络诚聘Java, JS, |页游戏工程?/span></a></li></ul> <br/><br/><br/> <img src ="http://www.aygfsteel.com/logicgate/aggbug/261408.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/logicgate/" target="_blank">logicgate</a> 2009-02-03 23:22 <a href="http://www.aygfsteel.com/logicgate/archive/2009/02/03/261408.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>RAID-5与RAID-10内部分析(转蝲自piner)http://www.aygfsteel.com/logicgate/archive/2009/01/23/261409.htmllogicgatelogicgateThu, 22 Jan 2009 16:37:00 GMThttp://www.aygfsteel.com/logicgate/archive/2009/01/23/261409.html一直以来,看到关于raid5与raid10的性能之争q是非常多的Q甚臛_多h那拿Z试数据Q但是,到底谁是谁非。这里,我就q两Uraid的内部运行原理来分析一下,我们在什么情况下应当适合选哪一Uraid方式?/p>

 

Z方便ҎQ我q里拿同样多驱动器的盘来做ҎQraid5选择3D+1P的raidҎQraid10选择2D+2D的RaidҎQ分别如图:

那么Q我们分析如下三个过E:读,q箋写,随机写,但是Q在介绍q三个过E之前,我需要介l一个特别重要的概念Q?strong>cache ?/p>

 

cache技术最q几q_在磁盘存储技术上Q发展的非常q速,作ؓ高端存储Qcache已经是整个存储的核心所在,是中低端存储,也有很大的cache存在Q包括最单的raid卡,一般都包含有几十,甚至几百兆的raid cache?/p>

 

cache的主要作用是什么呢Q体现在M写两个不同的斚wQ如果作为写Q一般存储阵列只要求写到cacheq完成了写操作Q所以,阵列的写是非常快 速的Q在写cache的数据积累到一定程度,阵列才把数据刷到盘Q可以实现批量的写入Q至于cache数据的保护,一般都依赖于镜怸甉|Q或者是 UPSQ?/p>

 

cache的读一样不可忽视,因ؓ如果读能在cache中命中的话,减磁盘的寻道Q因为磁盘从寻道开始到扑ֈ数据Q一般都?ms以上Q而这个时 _对于那些密集型io的应用可能不是太理想。但是,如果cache能命中,一般响应时间则可以?ms以内?/p>


不要q信存储厂商的iopsQ每U的io敎ͼ数据Q他们可能全部在cache命中的基上做到的Q但是实际上Q你的cache命中率可能只?0%?

 

介绍完cacheQ我们就可以解释raid5与raid10在不同的模式下,工作效率问题了,那么我们来分别分析以上三个问题?/p>

 

1、读操作

因ؓraid5与raid10的磁盘都可以提供服务Q所以,在读上面他们基本是没有差别的Q除非是ȝ数据能媄响cache命中率,D命中率不一栗?/p>

 

2、连l写

q箋写的q程Q一般表C写入连l的大批量的数据Q如媒体数据,很大的文件等{,q个写操作过E,如果有写cache存在Qƈ且算法没有问题的 话,raid5比raid10甚至会更好一些(q里要假定存储有一定大够的写cacheQ而且计算校验的cpu不会出现瓉Q。因个时候的校验?在cache中完成,?块盘的raid5Q可以先在内存中计算好校验,同时写入3个数?1个校验。而raid10只能同时写入2个数?2个镜相?/p>

但是Q我前面也说q了Q写cache是可以缓存写操作的,{到一定时期再写到盘Q但是,写操作不比读操作Q这个写是迟早也要发生的Q也是_最后落到磁盘上的写q是避免不了的,不过Q如果不是连l性的l写Q只要不辑ֈ盘的写极限Q差别都不是太大?/p>

 

3、离散写

q里可能是最隄解,但是Q也是最重要的部分,数据库,如oracle 数据库大部分操作是L写,如每ơ写一个数据块的数据,?KQ联机日志虽然看h是连l写Q但是因为每ơ写的量不多Q不保证能添满raid5的一个条 带(保证每张盘都能写入)Q所以很多时候也是离散写入?/p>

我们再接上图Q假定要把一个数?变成数字4Q那么对于raid5Q实际发生了4ơioQ?br />        先读?与校?Q可能发生读命中
       然后在cache中计新的校?br />        写入新的数字4与新的校?

 

对于raid10Q我们可以看刎ͼ同样的单个操作,最lraid10只需?个ioQ而raid5需?个io?/strong>

 

但是Q这里我忽略了raid5在那两个L作的时候,q可能会发生d中操作,也就是说Q如果需要读取的数据已经在cache中,可能是不需??io的,也证明了cache对raid5 的重要性,不仅仅是计算校验需要,而且Ҏ能的提升由为重要。曾l测试过Q在raid5的阵列中Q如果关闭写cacheQraid5的性能差很多倍?/p>

 

q里Qƈ不是说cache对raid10׃重要了,因ؓ写缓Ԍd中等Q都是提高速度的关键所在,不过的是Qraid10对cache的依赖性没有raid5那么明显而已?/p>

 

到这里,大家应当也大致明白了raid5与raid10的原理与差别了,一般来_象小io的数据库cd操作Q徏议采用raid10Q而大型文件存储,数据仓库Q则从空间利用的角度Q可以采用raid5?/p>

已有 0 人发表留aQ猛?>>q里<<-参与讨论


JavaEye推荐






logicgate 2009-01-23 00:37 发表评论
]]>
վ֩ģ壺 | ع| Ȫ| ͩ®| ɽ| ľ˹| | | | ī񹤿| Ϊ| ƽ| Զ| û| ̨| | Ǭ| | пѷ| ɽ| ͨ| º| κ| غ| | ʡ| ͨ| | կ| ˳| | | | Ԫ| ˳| ʯ| ʡ| ƽ| ɳ| | |