Thursday, September 28, 2006

daily work of a dba(未排版)

ORACLE数据库管理员的职责 ORACLE数据库管理员应按如下方式对ORACLE数据库系统做定期监控: (1). 每天对ORACLE数据库的运行状态,日志文件,备份情况,数据 库的空间使用情况,系统资源的使用情况进行检查,发现并解决 问题。 (2). 每周对数据库对象的空间扩展情况,数据的增长情况进行监控,对数据库做健康检查,对数据库对象的状态做检查。 (3). 每月对表和索引等进行Analyze,检查表空间碎片,寻找数据库 性能调整的机会,进行数据库性能调整,提出下一步空间管理 计划。对ORACLE数据库状态进行一次全面检查。 每天的工作 (1).确认所有的INSTANCE状态正常 登陆到所有数据库或例程,检测ORACLE后台进程: $ps –efgrep ora (2). 检查文件系统的使用(剩余空间)。如果文件系统的剩余空间小于20%,需删除不用的文件以释放空间。 $df –k (3). 检查日志文件和trace文件记录alert和trace文件中的错误。 连接到每个需管理的系统 ? 使用’telnet’ ? 对每个数据库,cd 到bdump目录,通常是$ORACLE_BASE//bdump ? 使用 Unix ‘tail’命令来查看alert_.log文件 ? 如果发现任何新的ORA- 错误,记录并解决 (4). 检查数据库当日备份的有效性。 对RMAN备份方式: 检查第三方备份工具的备份日志以确定备份是否成功 对EXPORT备份方式: 检查exp日志文件以确定备份是否成功 对其他备份方式: 检查相应的日志文件 (5). 检查数据文件的状态记录状态不是“online”的数据文件,并做恢复。 Select file_name from dba_data_files where status=’OFFLINE’ (6). 检查表空间的使用情况 SELECT tablespace_name, max_m, count_blocks free_blk_cnt, sum_free_m,to_char(100*sum_free_m/sum_m, '99.99') '%' AS pct_free FROM ( SELECT tablespace_name,sum(bytes)/1024/1024 AS sum_m FROM dba_data_files GROUP BY tablespace_name), ( SELECT tablespace_name AS fs_ts_name, max(bytes)/1024/1024 AS max_m, count(blocks) AS count_blocks, sum(bytes/1024/1024) AS sum_free_m FROM dba_free_space GROUP BY tablespace_name ) WHERE tablespace_name = fs_ts_name (7). 检查剩余表空间 SELECT tablespace_name, sum ( blocks ) as free_blk , trunc ( sum ( bytes ) /(1024*1024) ) as free_m, max ( bytes ) / (1024) as big_chunk_k, count (*) as num_chunks FROM dba_free_space GROUP BY tablespace_name; (8). 监控数据库性能 运行bstat/estat生成系统报告 或者使用statspack收集统计数据 (9). 检查数据库性能,记录数据库的cpu使用、IO、buffer命中率等等 使用vmstat,iostat,glance,top等命令 (10). 日常出现问题的处理。 每周的工作 (1). 控数据库对象的空间扩展情况 根据本周每天的检查情况找到空间扩展很快的数据库对象,并采取相 应的措施 -- 删除历史数据 --- 扩表空间 alter tablespace add datafile ‘’ size --- 调整数据对象的存储参数 next extent pct_increase (2). 监控数据量的增长情况 根据本周每天的检查情况找到记录数量增长很快的数据库对象,并采 取相应的措施 -- 删除历史数据 --- 扩表空间 alter tablespace add datafile ‘’ size (3). 系统健康检查 检查以下内容: init.ora controlfile redo log file archiving sort area size tablespace(system,temporary,tablespace fragment) datafiles(autoextend,location) object(number of extent,next extent,index) rollback segment logging &tracing(alert.log,max_dump_file_size,sqlnet) (4). 检查无效的数据库对象 SELECT owner, object_name, object_type FROM dba_objects WHERE status=’INVALID’。 (5). 检查不起作用的约束 SELECT owner, constraint_name, table_name, constraint_type, status FROM dba_constraints WHERE status = 'DISABLED’ AND constraint_type = 'P' (6). 检查无效的trigger SELECT owner, trigger_name, table_name, status FROM dba_triggers WHERE status = 'DISABLED’ 每月的工作 (1). Analyze Tables/Indexes/Cluster analyze table estimate statistics sample 50 percent; (2). 检查表空间碎片 根据本月每周的检查分析数据库碎片情况,找到相应的解决方法 (3). 寻找数据库性能调整的机会 比较每天对数据库性能的监控报告,确定是否有必要对数据库性能进 行调整 (4). 数据库性能调整 如有必要,进行性能调整 (5). 提出下一步空间管理计划 根据每周的监控,提出空间管理的改进方法Oracle DBA 日常管理 目的:这篇文档有很详细的资料记录着对一个甚至更多的ORACLE 数据库每天的,每月的, 每年的运行的状态的结果及检查的结果,在文档的附录中你将会看到所有检查,修改的SQL 和PL/SQL 代码。 目录 1.日常维护程序 A. 检查已起的所有实例 B. 查找一些新的警告日志 C. 检查DBSNMP 是否在运行 D. 检查数据库备份是否正确 E. 检查备份到磁带中的文件是否正确 F. 检查数据库的性能是否正常合理,是否有足够的空间和资源 G. 将文档日志复制到备份的数据库中 H. 要常看DBA 用户手册 2.晚间维护程序 A.收集VOLUMETRIC 的数据 3.每周维护工作 A. 查找那些破坏规则的OBJECT B. 查找是否有违反安全策略的问题 C. 查看错误地方的SQL*NET 日志 D. 将所有的警告日志存档 E. 经常访问供应商的主页 4.月维护程序 A. 查看对数据库会产生危害的增长速度 B. 回顾以前数据库优化性能的调整 C. 查看I/O 的屏颈问题 D. 回顾FRAGMENTATION E. 将来的执行计划 F. 查看调整点和维护 5.附录 A. 月维护过程 B. 晚间维护过程 C. 周维护过程 6.参考文献 ---------------------------------------------------------------- 一.日维护过程 A.查看所有的实例是否已起 确定数据库是可用的,把每个实例写入日志并且运行日报告或是运行测试 文件。当然有一些操作我们是希望它能自动运行的。 可选择执行:用ORACLE 管理器中的‘PROBE’事件来查看 B.查找新的警告日志文件 1. 联接每一个操作管理系统 2. 使用‘TELNET’或是可比较程序 3. 对每一个管理实例,经常的执行$ORACLE_BASE//bdump 操 作,并使其能回退到控制数据库的SID。 4. 在提示下,使用UNIX 中的‘TAIL’命令查看alert_.log,或是 用其他方式检查文件中最近时期的警告日志 5. 如果以前出现过的一些ORA_ERRORS 又出现,将它记录到数据库 恢复日志中并且仔细的研究它们,这个数据库恢复日志在〈FILE〉中 C.查看DBSNMP 的运行情况 检查每个被管理机器的‘DBSNMP’进程并将它们记录到日志中。 在UNIX 中,在命令行中,键入ps –ef grep dbsnmp,将回看到2 个 DBSNMP 进程在运行。如果没有,重启DBSNMP。 D.查数据库备份是否成功 E.检查备份的磁带文档是否成功 F.检查对合理的性能来说是否有足够的资源 1. 检查在表空间中有没有剩余空间。 对每一个实例来说,检查在表空间中是否存在有剩余空间来满足当天 的预期的需要。当数据库中已有的数据是稳定的,数据日增长的平均 数也是可以计算出来,最小的剩余空间至少要能满足每天数据的增 长。 A) 运行‘FREE.SQL’来检查表空间的剩余空间。 B) 运行‘SPACE.SQL’来检查表空间中的剩余空间百分率 2. 检查回滚段 回滚段的状态一般是在线的,除了一些为复杂工作准备的专用 段,它一般状态是离线的。 a) 每个数据库都有一个回滚段名字的列表。 b) 你可以用V$ROLLSTAT 来查询在线或是离线的回滚段的现在状 态. c) 对于所有回滚段的存储参数及名字, 可用 DBA_ROLLBACK_SEGS 来查询。但是它不如V$ROLLSTAT 准确。 3. 识别出一些过分的增长 查看数据库中超出资源或是增长速度过大的段,这些段的存储参 数需要调整。 a) 收集日数据大小的信息, 可以用 ‘ANALYZE5PCT.SQL’。如果你收集的是每晚的信息, 则可跳过这一步。 b) 检查当前的范围,可用‘NR.EXTENTS.SQL’。 c) 查询当前表的大小信息。 d) 查询当前索引大小的信息。 e) 查询增长趋势。 4. 确定空间的范围。 如果范围空间对象的NEXT_EXTENT 比表空间所能提供的最大范 围还要大,那么这将影响数据库的运行。如果我们找到了这个目标,可 以用‘ALTER TABLESPACE COALESCE’调查它的位置,或加另外 的数据文件。 A)运行‘SPACEBOUND.SQL’。如果都是正常的,将不返回任何行。 5. 回顾CPU,内存,网络,硬件资源论点的过程 A)检查CPU的利用情况,进到x:\web\phase2\default.htm =>system metrics=>CPU 利用页,CPU 的最大限度为400,当CPU 的占用保持 在350 以上有一段时间的话,我们就需要查看及研究出现的问题。 G.将存档日志复制到备用数据库中 如果有一个备用数据库,将适当的存档日志复制到备用数据库的期望 位置,备用数据库中保存最近期的数据。 H. 经常查阅DBA 用户手册 如果有可能的话,要广泛的阅读,包括DBA 手册,行业杂志,新闻 组或是邮件列表。 ------------------------------------------------------------- 二.晚间维护过程 大部分的数据库产品将受益于每晚确定的检查进程的运行。 A. 收集VOLUMETRIC 数据 1. 分析计划和收集数据 更准确的分析计算并保存结果。 a) 如果你现在没有作这些的话,用‘MK VOLFACT.SQL’来创建测定体积的 表。 b) 收集晚间数据大小的信息,用‘ANALYZE COMP.SQL’。 c) 收集统计结果,用‘POP VOL.SQL’。 d) 在空闲的时候检查数据,可能的话,每周或每个月进行。 我是用MS EXCEL 和ODBC 的联接来检查数据和图表的增长 ------------------------------------------------------------- 三.每周维护过程 A. 查找被破坏的目标 1. 对于每个给定表空间的对象来说,NEXT_EXTENT 的大小是相同的,如 12/14/98,缺省的NEXT_EXTENT 的DATAHI 为1G,DATALO 为500MB, INDEXES 为256MB。 A) 检查NEXT_EXTENT 的设置,可用‘NEXTEXT。SQL’。 B) 检查已有的EXTENTS,可用‘EXISTEXT。SQL’。 2. 所有的表都应该有唯一的主键 a) 查看那些表没有主键,可用‘NO_PK.SQL’。 b) 查找那些主键是没有发挥作用的,可用‘DIS_PK.SQL’。 c) 所有作索引的主键都要是唯一的,可用‘ NONUPK。SQL’来检 查。 3. 所有的索引都要放到索引表空间中。运行‘MKREBUILD_IDX。SQL’ 4. 不同的环境之间的计划应该是同样的,特别是测试环境和成品环境之间的 计划应该相同。 a) 检查不同的2 个运行环境中的数据类型是否一致,可用 ‘DATATYPE.SQL’。 b) 在2 个不同的实例中寻找对象的不同点, 可用 ‘OBJ_COORD.SQL’。 c) 更好的做法是,使用一种工具,象寻求软件的计划管理器那样的 工具。 B. 查看是否有危害到安全策略的问题。 C. 查看报错的SQL*NET 日志。 1. 客户端的日志。 2. 服务器端的日志。 D..将所有的警告日志存档 E..供应商的主页 1. ORACLE 供应商 http://www.oracle.com http://technet.oracle.com http://www.oracle.com/support http://www.oramag.com 2. Quest Software http://www.quests.com 3. Sun Microsystems http://www.sun.com ---------------------------------------------------------------- 四.月维护过程 A.查看对数据库会产生危害的增长速度 1. 从以前的记录或报告中回顾段增长的变化以此来确定段增长带来危害 B. 回顾以前数据库优化性能的调整 1. 回顾一般ORACLE 数据库的调整点,比较以前的报告来确定有害的发展 趋势。 C. 查看I/O 的屏颈问题 1. 查看前期数据库文件的活动性,比较以前的输出来判断有可能导致屏颈 问题的趋势。 D. 回顾FRAGMENTATION E. 计划数据库将来的性能 1. 比较ORACLE 和操作系统的CPU,内存,网络,及硬盘的利用率以此 来确定在近期将会有的一些资源争夺的趋势 2. 当系统将超出范围时要把性能趋势当作服务水平的协议来看 F. 完成调整和维护工作 1.使修改满足避免系统资源的争夺的需要,这里面包括增加新资源或使预期 的停工。 ---------------------------------------------------------------- 五.附录 A. 日常程序 -- free.sql --To verify free space in tablespaces --Minimum amount of free space --document your thresholds: -- = m SELECT tablespace_name, sum ( blocks ) as free_blk , trunc ( sum ( bytes ) / (1024*1024) ) as free_m, max ( bytes ) / (1024) as big_chunk_k, count (*) as num_chunks FROM dba_free_space GROUP BY tablespace_name 1. Space.sql -- space.sql -- To check free, pct_free, and allocated space within a tablespace -- 11/24/98 SELECT tablespace_name, largest_free_chunk , nr_free_chunks, sum_alloc_blocks, sum_free_blocks , to_char(100*sum_free_blocks/sum_alloc_blocks, '09.99') '%' AS pct_free FROM ( SELECT tablespace_name , sum(blocks) AS sum_alloc_blocks FROM dba_data_files GROUP BY tablespace_name ) , ( SELECT tablespace_name AS fs_ts_name , max(blocks) AS largest_free_chunk , count(blocks) AS nr_free_chunks , sum(blocks) AS sum_free_blocks FROM dba_free_space GROUP BY tablespace_name ) WHERE tablespace_name = fs_ts_name 2. analyze5pct.sql -- analyze5pct.sql -- To analyze tables and indexes quickly, using a 5% sample size -- (do not use this script if you are performing the overnight -- collection of volumetric data) -- 11/30/98 BEGIN dbms_utility.analyze_schema ( '&OWNER', 'ESTIMATE', NULL, 5 ) ; END ; /3. nr_extents.sql -- nr_extents.sql -- To find out any object reaching -- extents, and manually upgrade it to allow unlimited -- max_extents (thus only objects we *expect* to be big -- are allowed to become big) -- 11/30/98 SELECT e.owner, e.segment_type , e.segment_name , count(*) as nr_extents , s.max_extents , to_char ( sum ( e.bytes ) / ( 1024 * 1024 ) , '999,999.90') as MB FROM dba_extents e , dba_segments s WHERE e.segment_name = s.segment_name GROUP BY e.owner, e.segment_type , e.segment_name , s.max_extents HAVING count(*) > &THRESHOLD OR ( ( s.max_extents - count(*) ) < &&THRESHOLD ) ORDER BY count(*) desc 4. spacebound.sql -- spacebound.sql -- To identify space-bound objects. If all is well, no rows are returned. -- If any space-bound objects are found, look at value of NEXT extent -- size to figure out what happened. -- Then use coalesce (alter tablespace coalesce . -- Lastly, add another datafile to the tablespace if needed. -- 11/30/98 SELECT a.table_name, a.next_extent, a.tablespace_name FROM all_tables a, ( SELECT tablespace_name, max(bytes) as big_chunk FROM dba_free_space GROUP BY tablespace_name ) f WHERE f.tablespace_name = a.tablespace_name AND a.next_extent > f.big_chunk B. 每晚处理程序 1. mk_volfact.sql -- mk_volfact.sql (only run this once to set it up; do not run it nightly!) -- -- Table UTL_VOL_FACTS CREATE TABLE utl_vol_facts ( table_name VARCHAR2(30), num_rows NUMBER, meas_dt DATE ) TABLESPACE platab STORAGE ( INITIAL 128k NEXT 128k PCTINCREASE 0 MINEXTENTS 1 MAXEXTENTS unlimited ) / -- Public Synonym CREATE PUBLIC SYNONYM utl_vol_facts FOR &OWNER..utl_vol_facts / -- Grants for UTL_VOL_FACTS GRANT SELECT ON utl_vol_facts TO public / 2. analyze_comp.sql -- -- analyze_comp.sql -- BEGIN sys.dbms_utility.analyze_schema ( '&OWNER','COMPUTE'); END ; / 3. pop_vol.sql -- -- pop_vol.sql -- insert into utl_vol_facts select table_name , NVL ( num_rows, 0) as num_rows , trunc ( last_analyzed ) as meas_dt from all_tables -- or just user_tables where owner in ('&OWNER') -- or a comma-separated list of owners / commit / C. 每周处理程序 1. nextext.sql -- -- nextext.sql -- -- To find tables that don't match the tablespace default for NEXT extent. -- The implicit rule here is that every table in a given tablespace should -- use the exact same value for NEXT, which should also be the tablespace's -- default value for NEXT. -- -- This tells us what the setting for NEXT is for these objects today. -- -- 11/30/98 SELECT segment_name, segment_type, ds.next_extent as Actual_Next , dt.tablespace_name, dt.next_extent as Default_Next FROM dba_tablespaces dt, dba_segments ds WHERE dt.tablespace_name = ds.tablespace_name AND dt.next_extent !=ds.next_extent AND ds.owner = UPPER ( '&OWNER' ) ORDER BY tablespace_name, segment_type, segment_name 2. existext.sql -- -- existext.sql -- -- To check existing extents -- -- This tells us how many of each object's extents differ in size from -- the tablespace's default size. If this report shows a lot of different -- sized extents, your free space is likely to become fragmented. If so, -- this tablespace is a candidate for reorganizing. -- -- 12/15/98 SELECT segment_name, segment_type , count(*) as nr_exts , sum ( DECODE ( dx.bytes,dt.next_extent,0,1) ) as nr_illsized_exts , dt.tablespace_name, dt.next_extent as dflt_ext_size FROM dba_tablespaces dt, dba_extents dx WHERE dt.tablespace_name = dx.tablespace_name AND dx.owner = '&OWNER' GROUP BY segment_name, segment_type, dt.tablespace_name, dt.next_extent 3. No_pk.sql -- -- no_pk.sql -- -- To find tables without PK constraint -- -- 11/2/98 SELECT table_name FROM all_tables WHERE owner = '&OWNER' MINUS SELECT table_name FROM all_constraints WHERE owner = '&&OWNER' AND constraint_type = 'P' 4. disPK.sql -- -- disPK.sql -- -- To find out which primary keys are disabled -- -- 11/30/98 SELECT owner, constraint_name, table_name, status FROM all_constraints WHERE owner = '&OWNER' AND status = 'DISABLED’ AND constraint_type = 'P' 5. nonuPK.sql -- -- nonuPK.sql -- -- To find tables with nonunique PK indexes. Requires that PK names -- follow a naming convention. An alternative query follows that -- does not have this requirement, but runs more slowly. -- -- 11/2/98 SELECT index_name, table_name, uniqueness FROM all_indexes WHERE index_name like '&PKNAME%' AND owner = '&OWNER' AND uniqueness = 'NONUNIQUE' SELECT c.constraint_name, i.tablespace_name, i.uniqueness FROM all_constraints c , all_indexes i WHERE c.owner = UPPER ( '&OWNER' ) AND i.uniqueness = 'NONUNIQUE' AND c.constraint_type = 'P' AND i.index_name = c.constraint_name 6. mkrebuild_idx.sql -- -- mkrebuild_idx.sql -- -- Rebuild indexes to have correct storage parameters -- -- 11/2/98 SELECT 'alter index ' index_name ' rebuild ' , 'tablespace INDEXES storage ' ' ( initial 256 K next 256 K pctincrease 0 ) ; ' FROM all_indexes WHERE ( tablespace_name != 'INDEXES' OR next_extent != ( 256 * 1024 ) ) AND owner = '&OWNER' / 7. datatype.sql -- -- datatype.sql -- -- To check datatype consistency between two environments -- -- 11/30/98 SELECT table_name, column_name, data_type, data_length, data_precision, data_scale, nullable FROM all_tab_columns -- first environment WHERE owner = '&OWNER' MINUS SELECT table_name, column_name, data_type, data_length, data_precision, data_scale, nullable FROM all_tab_columns@&my_db_link -- second environment WHERE owner = '&OWNER2' order by table_name, column_name 8. obj_coord.sql -- -- obj_coord.sql -- -- To find out any difference in objects between two instances -- -- 12/08/98 SELECT object_name, object_type FROM user_objects MINUS SELECT object_name, object_type FROM user_objects@&my_db_link 六. 参考文献 1. Loney, Kevin Oracle8 DBA Handbook 2. Cook, David Database Management from Crisis to Confidence [http://www.orapub.com/] 3. Cox, Thomas B. The Database Administration Maturity Model

Thursday, September 21, 2006

RHEL2.1/3/4以及windows上oracle VLM的设置

RHEL2.1/3/4
Meta:317055.1,317141.1,200266.1

windows
Meta:46001.1,46053.1,225349.1

32bit windows中/3GB,/PAE以及AWE的对比

32bit windows将默认最大可识别内存(4G)中的2G预留给了自己的内核,
而/3GB开关将这部分预留的大小从2G减为1G。

/PAE扩大了原有的32位寻址方式,使得windows可以识别更多的内存,但是仍然没有改变每个进程仅能使用4G内存的限制。

AWE使用的内存映射功能,配合/PAE可以使单个进程使用大量的内存(不受4G限制)。

=========================================

/3GB和/PAE共同使用,windows无法识别任何16G以上的内存。
/PAE单独使用(注1),每个进程最多使用4G内存。

注1:/PAE开关同时打开或者关闭pae和awe功能,
但是只有在对oracle等程序进行相应的配置后,
AWE功能才被使用。

the instance needs recovery and all controlfiles are damaged

Scenario:
1.your database needs recovery(i.e. instance crash, power off, media problem)
2.all of the controlfiles are damaged
3.you have a available backup, all the archivelogs.

Solution:
1.restore all the files needs restoration
2.recover database using backup controlfile until cancel
3.print "auto" when prompted
4.recover database using backup controlfile until cancel

Go to step 5 and step 6 if online redo logs are damaged, go to step 7 and step 8 if not

5.print "cancel"
6.alter database open resetlogs

7.print the name of one online log(you may have to try several times to find which one is correct)
8.alter database open

Wednesday, September 20, 2006

oracle10g中Segment shrink online不适用的场合

Shrink operations can be performed only on segments in locally managed tablespaces with automatic segment space management (ASSM). Within an ASSM tablespace, all segment types are eligible for online segment shrink except these:

IOT mapping tables
Tables with rowid based materialized views
Tables with function-based indexes

Tuesday, September 19, 2006

remove oracle from OS

ORACLE 完全删除
Windows: 参考:Note:190096.1 及124353.1
1、控制面板,管理工具,服务:停止oracle相关服务。
2、使用oracle universal installer卸载oracle软件。
3、进入注册表regedit 删除:
HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Oracle相关
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Application\Oracle相关
4、检查控制面板,系统,环境变量是否有oracle相关,删除。系统重新启动
5、删除oracle安装目录及其所有文件(如果有不让删除的,可以先改名,重启系统再删除),删除开始菜单中oracle相关及桌面的oracle快捷方式。
6、删除c:\program files\oracle及其所有文件。
7、系统重启,确认3,5,6步操作完成。

LINUX: Note:275493.1
1、停止oracle相关服务。
2、删除$ORACLE_HOME。
3、删除$ORACLE_BASE/oraInventory目录。
4、修改/etc/oratab文件,删除数据库记录信息。
5、删除/tmp下oracle相关文件
6、删除/opt/orcl开头的文件
7、/usr/local/bin目录下的文件不必删除,但在下次安装oracle软件后运行root.sh时会提示你已经有文件了,到时选择覆盖即可。

Summary About the Large SGA & Address Space on RH Linux


Note:260152.1 on metalink

Monday, September 18, 2006

Technology limits (certified[/theoretical]) of redhat linux

Version 2.1
Version 3
Version 4

x86
16GB
64GB
64GB

Itanium2
32GB
128GB
256GB/1024TB

AMD64/EM64T
n/a
128GB
128GB/1TB

Power
n/a
64GB
128GB/1TB

zSeries
n/a
64GB
64GB

Maximum filesize
1TB
1TB
8TB

Maximum filesystem size (Ext3)
1TB
1TB
8TB

Maximum x86 per-process virtual address space
3GB
Approx 4GB
Approx 4GB

=======================================
AS system limits (all architectures):



Maximum physical CPUs
-
-
-
Maximum memory
-
-
-
ES system limits (all architectures)



Maximum physical CPUs
2
2
2
Maximum memory
4GB
8GB
16GB

the maximum memory supported by 64bit RHEL4U3

Red Hat Enterprise Linux 4 Update 3
Supported Memory
Theoretical Memory
x86_64
128 GB
1 TB
Itanium2
256 GB
1024 TB
POWER
256 GB
2 TB

不同内存时windows的settings

内存需求

4 GB或更少
启用/3GB

4 GB至16GB
启用/3GB
启用AWE
启用/PAE

大于16 GB
禁用/3GB
启用AWE
启用/PAE

如果在实际物理内存大于16G的时候同时启用3GB和PAE开关,OS将无法访问16G以上的内存。

各版本windows能支持的maximum内存

Windows 2000 Advanced Server
8 GB

Windows 2000 Datacenter Server
32 GB

Windows Server 2003企业版(32位)
32 GB

Windows Server 2003企业版(64位)
64 GB

Windows Server 2003 Datacenter Server(32位)
64 GB

Windows Server 2003 Datacenter Server(64位)
512 GB

row_number()函数

select * from test;
name score
---- -----
yang 99
yang 98
yang 100
li 80
li 90

select name,score,row_number() over (partition by name order by score desc) "rownum "from test;
name score rownum
---- ----- ------
yang 100 1
yang 99 2
yang 98 3
li 90 1
li 80 2

Thursday, September 14, 2006

提高load、export、import的性能

Using integrity constraint states in the following order can ensure the best benefits:

1.Disable state.

2.Perform the operation (load, export, import).

3.Enable novalidate state.

4.Enable state.

Some benefits of using constraints in this order are:

1.No locks are held.

2.All constraints can go to enable state concurrently.

3.Constraint enabling is done in parallel.

4.Concurrent activity on table is permitted.

当前是第几周呢

select to_char(sysdate,'ww') from dual;

oracle10g手工建库

1.创建相应目录
(1)存放控制文件、数据文件、日志文件的目录
(2)adump、bdump、cdump、udump
1.设置oracle_sid
2.创建一个pfile
必备参数:control_file,sga_target,pga_aggregate_target,compatible,db_name,db_block_size
3.startup nomount pfile=刚才创建的pfile
4.执行create database语句
必备clause:datafile,sysaux,character set(推荐US7ASCII, national character set 默认AL16UTF16,不用指定), logfile
5.顺序执行2个必须的脚本
@/u01/oracle/rdbms/admin/catalog.sql
@/u01/oracle/rdbms/admin/catproc.sql

vmware下linux+oracle手册

http://www.oracle.com/technology/global/cn/tech/linux/vmware/cookbook/index.html

10g中的PRO*C哪里去了

Since 10gR2 only component "Precompilers" is shown in the Universal Installer,
no separation of Pro*C, Pro*Cobol etc

Metalink:338686.1

redhat ES3 下oracle的自动启动/关闭,支持spfile

1.Edit /etc/oratab file for Linux.
Database entries in the oratab file appears in the following format: ORACLE_SID:ORACLE_HOME:{YN}
In the preceding command, Y or N specifies whether you want the dbstart and dbshut scripts to start up and shut down the database. For each database that you want to start up, find the ORACLE_SID entry identified by the sid in the first field. Change the last field for each to Y.

2.In the /etc/init.d directory, create a dbora script similar to the following, if it does not already exist. Be sure to give the full path of the dbstart utility.
#!/bin/sh
# Set ORA_HOME to be equivalent to the $ORACLE_HOME
# from which you wish to execute dbstart and dbshut
#
# Set ORA_OWNER to the user id of the owner of the
# Oracle database in ORA_HOME.

ORA_HOME=/u01/app/oracle/product/9.2.0.4
ORA_OWNER=oracle
if [ -f !$ORA_HOME/bin/dbstart ]
then
echo "Oracle startup: cannot start"
exit
fi

case "$1" in
'start')
# Start the Oracle databases:
# The following command assumes that the oracle login
# will not prompt the user for any values
su - $ORA_OWNER -c $ORA_HOME/bin/dbstart
touch /var/lock/subsys/dbora
;;
'stop')
# Stop the Oracle databases:
# The following command assumes that the oracle login
# will not prompt the user for any values
su - $ORA_OWNER -c $ORA_HOME/bin/dbshut
;;
esac

3.Go to the /etc/init.d directory, and issue this command:chmod 755 dbora
4.Create symbolic links to the dbora script in the appropriate run-level script directories, as follows:
# ln -s /etc/init.d/dbora /etc/rc.d/rc0.d/K10dbora
# ln -s /etc/init.d/dbora /etc/rc.d/rc3.d/S99dbora
# ln -s /etc/init.d/dbora /etc/rc.d/rc5.d/S99dbora
# ln -s /etc/init.d/dbora /etc/rc.d/rc6.d/K10dbora

5.If your database uses an spfile to start, you must do the follows:
- make a backup copy of your existing dbstart script prior to proceeding ($ORACLE_HOME/bin/dbstart)
- edit the dbstart script
- add the following line:
SPFILE=${ORACLE_HOME}/dbs/spfile${ORACLE_SID}.ora
after this line: PFILE=${ORACLE_HOME}/dbs/init${ORACLE_SID}.ora
- change:
if [ -f $PFILE ] ; then
to: if [ -f $PFILE -o -f $SPFILE ] ; then

Note:
The original script in the manual starts a background process by add a "&" to the end of the "su" command, and this may make the script not work.
All above have been tested under Redhat ES3, oracle 9.2.0.4.


Reference:
Oracle9i Installation Guide Release 2 (9.2.0.1.0) for UNIX Systems:
AIX-Based Systems, Compaq Tru64 UNIX, HP 9000 Series HP-UX, Linux Intel, and Sun Solaris
Part No. A96167-01
Document 207508.1 on metalink.oracle.com
Document 83630 on OiSC

手动standby数据库

在时间点A冷备数据库,然后启动主库正常使用,standby数据库不打开或者只open readonly。
经过一段时间后,想要使standby库与主库再次一致。

实现方法:
SQL> alter database backup controlfile to 'back.ctl';
SQL> show parameter log_archive_dest (Decide where to put the archived logs)
SQL> select name from v$controlfile (Decide where to put the backup of control file)
Note:
You should change the name of "back.ctl" and duplicate it to match the results of this query.

SQL>shutdown;

拷贝back.ctl以及所有的archivelog,onlinelog到standby库。

SQL> startup mount;
SQL> select * from v$recover_file; (Use this to verify all the datafiles need recovery)
SQL> recover database until cancel using backup controlfile;
auto (input "auto" as prompt)
手工指定onlinelog(一个一个尝试,失败就再来一次)
SQL> alter database open resetlogs;

redhat linux下oracle的audit file有关pid的重复使用的问题

测试环境:
OS : RedHat Linux AS 3.0
DB : Oracle 10g R2


The "pid" of ora_.aud increases over time,
but this "pid" will be reused if the OS is rebooted.


When the "pid" is reused,
oracle appends the new audit entries to the end of the existing audit file,
but not overwrite it.

exp/expdp时对多个表使用多个不同的query条件

It is impossible to generate a single dmp file or integrate several dmp files into a single one when using oracle9i, and in one word, this task cannot be done in oracle9i.

Note:This can be done using data pump if you update your database to 10g, look down for more information.

HOW TO DO WHEN USING DATA PUMP OF ORACLE 10G
-------------------------------------------------------------
Please note there are two new features now:
1.Parameter "QUERY" can be specified to a certain table.
2.Parameter "QUERY" can be specified more than once.

Look at my experiment:
C:\Documents and Settings\Administrator>expdp scott/tiger parfile=D:\par.txt
Export: Release 10.2.0.1.0 - Production on Thursday, 06 July, 2006 20:11:31Copyright (c) 2003, 2005, Oracle. All rights reserved.
Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - ProductionWith the Partitioning, OLAP and Data Mining options
Starting "SCOTT"."SYS_EXPORT_TABLE_01": scott/******** parfile=D:\par.txt
Estimate in progress using BLOCKS method...
Processing object type TABLE_EXPORT/TABLE/TABLE_DATA
Total estimation using BLOCKS method: 128 KB
Processing object type TABLE_EXPORT/TABLE/TABLE
. . exported "SCOTT"."TEMP1" 4.953 KB 0 rows
. . exported "SCOTT"."TEMP2" 4.960 KB 1 rows
Master table "SCOTT"."SYS_EXPORT_TABLE_01" successfully loaded/unloaded
******************************************************************************
Dump file set for SCOTT.SYS_EXPORT_TABLE_01 is:
D:\EXP2.DMP
Job "SCOTT"."SYS_EXPORT_TABLE_01" successfully completed at 20:11:47
C:\Documents and Settings\Administrator>

Contents of par.txt:

TABLES=temp1,temp2
QUERY=SCOTT.TEMP1:"WHERE ID=0"
QUERY=SCOTT.TEMP2:"WHERE ID2=2"
directory=direc
nologfile=y
DUMPFILE=exp2.dmp

sql文的限制

9i
The maximum size of a sql statement is 64K.

10g
There is no limit on the maximum number of columns in a select list.
The maximum size of a sql statement depends on on many factors, including database configuration, disk space, and memory. But the formula is not open to public(The official voice of ORACLE), so it's better to have a test before using long select statement.

temp表空间的缩小、计算、移动方法

缩小方法:
-- Create new temporary tablespace with smaller size.
SQL> create temporary tablespace TEMP1 tempfile 'c:\temp01.dbf' size 100M extent management local uniform size 128K;
-- Set new tablespace as default temporary tablespace for all users in database.
SQL> alter user temporary tablespace TEMP1;
If you have a large number of users, the following SQL can be used to generate the code to change them all.
SQL> select 'alter user 'username' temporary tablespace TEMP1;' from dba_users;
-- Drop the old tablespace.SQL> drop tablespace temp including contents.

计算方法:无,无法估计temp表空间的合适大小
移动方法:
To move tempfiles of temporary tablespace:
first: alter database tempfile 'c:\..\temp1.dbf' offline.
second: use the Operating system command to copy or move the tempfile;
third: update the control file using the:
alter database rename file 'c:\...\temp1.dbf' to 'c:\...\temp2.dbf';
But:Renaming Locally-Managed TEMPFILES is not permited by oracle with the error :ORA-01516

solution1:
a.create a new temporary tablespace:
create temporary tablespace temp2 tempfile 'c:\...\temp3.dbf' size 10m extent management local uniform size 1m;
b.set the new temporary tablespace to the default temporary tablespace alter database default temporary tablespace temp2;
c.drop and recreate the old temporary tablespace:
drop tablespace temp1;
create temporary tablespace temp1 tempfile 'c:\...\temp1.dbf' size 10m reuse extent management local uniform size 1m;
This temporary tablespace temp1 will prepared for the temp2's backup.

solution2:
a.add the default temporary tablespace "temp1" a new tempfile:
alter tablespace temp1 add tempfile 'c:\..\temp2.dbf' size 10m;
b.drop the default temporary tablespace temp1's old tempfile:
alter database tempfile 'c:\..\temp1.dbf' drop including datafiles;

undo表空间的缩小、计算、移动方法

缩小方法:
--Try to reduce the size of the undo tablespace directly
SQL> alter database datafile "file_name" resize 100M;
--If this succeeds, then nothing else needs to be done.
--If this fails(ORA-03297), please use the following method.
-- Create new undo tablespace with smaller size.
SQL> create undo tablespace UNDO_RBS1 datafile 'undorbs1.dbf' size 100m;
-- Set new tablespace as undo_tablespace
SQL> alter system set undo_tablespace=undo_rbs1;
-- Drop the old tablespace.
SQL> drop tablespace undo_rbs0 including contents.

NOTE:
Dropping the old tablespace may give ORA-30013 : undo tablespace '%s' is currently in use. This error indicates you must wait for the undo tablespace to become unavailable.
In other words, you must wait for existing transaction to commit or rollback.

计算方法:
Sizing an UNDO tablespace requires three pieces of data.

(UR) UNDO_RETENTION in seconds
(UPS) Number of undo data blocks generated per second
(DBS) Overhead varies based on extent and file size (db_block_size)

UndoSpace = [UR * (UPS * DBS)] + (DBS * 24)

Two can be obtained from the initialization file: UNDO_RETENTION and DB_BLOCK_SIZE.
The third piece of the formula requires a query against the database. The number of undo blocks generated per second can be acquired from V$UNDOSTAT.

The following formula calculates the total number of blocks generated and divides it by the amount of time monitored, in seconds:

SQL>SELECT (SUM(undoblks))/ SUM ((end_time - begin_time) * 86400) FROM v$undostat;

Column END_TIME and BEGIN_TIME are DATE data types. When DATE data types are subtracted, the result is in days. To convert days to seconds, you multiply by 86400, the number of seconds in a day.
The result of the query returns the number of undo blocks per second. This value needs to be multiplied by the size of an undo block, which is the same size as the database block defined in DB_BLOCK_SIZE.

The following query calculates the number of bytes needed:
SQL> SELECT (UR * (UPS * DBS)) + (DBS * 24) AS "Bytes" FROM (SELECT value AS UR FROM v$parameter WHERE name = 'undo_retention'), (SELECT (SUM(undoblks)/SUM(((end_time - begin_time)*86400))) AS UPS FROM v$undostat), (select block_size as DBS from dba_tablespaces where tablespace_name= (select value from v$parameter where name = 'undo_tablespace'));

移动方法:
1. If the database is up, shut it down.
2. Copy the datafile to the new name/location at operating system level.
3. Mount the database.
4. Rename the file inside Oracle.
5. Open the database.
6. Query v$dbfile to confirm that the changes made were correct.
7. Remove the datafile(s) from the old location at the operating system level.


Reference:
Doc 268870.1 on MetaLink "How to Shrink the datafile of Undo Tablespace"
Doc 262066.1 on MetaLink "How To Size UNDO Tablespace For Automatic Undo Management"
Doc 620383.995 on MetaLink "Move Undo tablespace"


另一种OverHead的计算方法:
db_block_size:
2K : 32 + V$UNDOSTAT.MAXCONCURRENCY * 2
4K : 16 + V$UNDOSTAT.MAXCONCURRENCY * 2
8K : 8 + V$UNDOSTAT.MAXCONCURRENCY * 2
16K : 4 + V$UNDOSTAT.MAXCONCURRENCY * 2

redhatlinux下从oracle9.2.0.4到oracle9.2.0.7使用transport tablespace的一些主要bug

本文没有考虑特殊数据类型,只考虑了partition以及subpartition。

Test 1
~~~~
columns of the test table: age number(3), name varchar2(30)
Source database: 9.2.0.4
Target database: 9.2.0.7
Step 1: Alter column "age" to unused.
Step 2: Export the tablespace which contains the test table.
Step 3: Import the tablespace.
Step 4: Select from the test table, and the contents of the column "name" are miscode.

Test 2
~~~~~
Source database: 9.2.0.4
Target database: 9.2.0.7
Step 1: Create a table having subpartitions, and the subpartitions are created using SUBPARTITION TEMPLATE.
Step 2: Export the tablespace which contains the test table.
Step 3: Try to import the tablespace, but always fails.
Step 4: Create a table having subpartitions, and the subpartitions are NOT created using SUBPARTITION TEMPLATE.
Step 5: Export the tablespace which contains the test table.
Step 6: Import the tablespace, and everything is OK.

Test 3
~~~~~
Columns of table "testlong": id number(2), longcol long
Columns of table "testlongraw": id number(2), longrawcol long raw
Source database: 9.2.0.4
Target database: 9.2.0.7
Step 1
~~~~~~
alter table testlong add (text varchar2(30));
alter table testlongraw add (text varchar2(30));
insert into testlong(id,text) values(1,'This is row 1');
insert into testlong(id,text) values(2,'This is row 2');
insert into testlongraw(id,text) values(1,'This is row 1');
insert into testlongraw(id,text) values(2,'This is row 2');
commit;
select * from testlong;
id longcol text
------ ------------- ---------------
1 This is row 1
2 This is row 2
select * from testlongraw;
id longrawcol text
------ ---------------- ---------------
1 This is row 1
2 This is row 2
Step 2
~~~~~~
Export the tablespace including table testlong and testlongraw.
Successfully without warnings.
Step 3
~~~~~~
Import the tablespace including table testlong and testlongraw.
Successfully without warnings.
Step 4
~~~~~~
(Select from the target database)
select * from testlong;
id longcol text
------ ------------- ---------------
1 This is row 1
2 This is row 2
select * from testlongraw;
id longrawcol text
------ ---------------- ---------------
1 5
2 5



Subpartition template的查询方法:
If there are templates used to create subpartitions, then the information of all these templates is shown in the static data dictionary views below:
DBA_SUBPARTITION_TEMPLATES describes all subpartition templates in the database.
DBA_LOB_TEMPLATES describes all LOB subpartition templates in the database.

Subpartition template的消除方法:

Subpartition templates can be removed using "ALTER TABLE table_name SET SUBPARTITION TEMPLATE ()".
After the execution of this statement, the existing subpartitions remain and the whole tablespace set can be transported successfully without any warnings.

Wednesday, September 13, 2006

oracle10gR2RAC

http://www.oracle.com/technology/pub/articles/hunter_rac10gr2.html#1

oracle10gR1RAC

http://www.oracle.com/technology/global/cn/pub/articles/hunter_rac10g.html#1

redhat AS3U7下安装oracle10.1.0.3RAC

redhat AS3U7下安装oracle 10.1.0.3 RAC
一.安装linux时选择包
1.Applications=> editors
2.Servers=>ftp server
=>legacy network server=>telnet server, rsh server
3.Development=>development tools
=>legacy software development
4.System=>system tools=>sysstat
二.创建用户oracle
1.Groupadd oinstall
2.Groupadd dba
3.Useradd –m –g oinstall –G dba oracle
4.Passwd oracle
三.编辑/etc/hosts文件
127.0.0.1 localhost.localdomain localhost
10.10.10.31 rac1local.us.oracle.com rac1local
10.10.10.32 rac2local.us.oracle.com rac2local
192.168.203.31 rac1.us.oracle.com rac1
192.168.203.32 rac2.us.oracle.com rac2
192.168.203.111 rac1-vip.us.oracle.com rac1-vip
192.168.203.112 rac2-vip.us.oracle.com rac2-vip
四.编辑/etc/sysctl.conf文件
fs.file-max = 65536
kernel.shmmax = 2147483648
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 1024 65000
net.core.rmem_default = 262144
net.core.rmem_max = 262144
net.core.wmem_default = 262144
net.core.wmem_max = 262144
运行 "sysctl -p",使修改生效
五.安装vmware-tools
自行安装,不介绍
六.与主机时间同步
# vmware-toolbox

单击 "Options" 并选择 "Time synchronization..."
关闭
七.克隆linux系统
1.关闭当前node1
2.克隆node1
八.配置克隆的系统
1.主机名
2.IP(eth0,eth1)
九.添加共享磁盘
1.1G
2.11G
3.11G
disk.locking="false"
diskLib.dataCacheMaxSize=0
diskLib.dataCacheMaxReadAheadSize=0
diskLib.dataCacheMinReadAheadSize=0
diskLib.dataCachePageSize=4096
diskLib.maxUnsyncedWrites=0
十.配置rawdevices(所有node,并且使用root用户)
1.【一个node】
分区 1:(ocr_file)
i. 命令:输入 "n" 并按下 ENTER 键。
ii.命令操作:输入 "p" 并按下 ENTER 键。
iii.分区编号:输入 "1" 并按下 ENTER 键。
iv.第一个 cylinder:按 ENTER 键。
v. 最后一个 cylinder:+250M。

分区 2:(voting_disk)
i. 命令:输入 "n" 并按下 ENTER 键。
ii.命令操作:输入 "p" 并按下 ENTER 键。
iii.分区编号:输入 "2" 并按下 ENTER 键。
iv.第一个 cylinder:按 ENTER 键。
v. 最后一个 cylinder:+250M。
2.编辑 /etc/sysconfig/rawdevices 文件
添加:
/dev/raw/raw1 /dev/sda1
/dev/raw/raw2 /dev/sda2
3.更改权限
chown oracle:oinstall /dev/raw/raw1
chown oracle:oinstall /dev/raw/raw2
chmod 660 /dev/raw/raw1
chmod 660 /dev/raw/raw2

4.重启所有node,确认都能看到分区情况,并且能够自动装载。
/usr/bin/raw -qa
5.Mkdir /ocfs, chown oracle:oinstall /ocfs
6.以oracle 身份为表决磁盘和 OCR 文件创建符号链接

$ cd /ocfs
$ ln -sf /dev/raw/raw1 ocr_file
$ ln -sf /dev/raw/raw2 voting_disk



十一.配置ssh(所有node,并且使用oracle用户)
参照:
Oracle® Database Oracle Clusterware and Oracle Real Application Clusters Installation Guide10g Release 2 (10.2) for LinuxPart Number B14203-06

2 Pre-Installation Tasks
2.3.7 Configuring SSH on All Cluster Nodes
十二.创建oraclehome(所有node,并且使用root用户)
1.Mkdir -p /u01/app/oracle
2.Chown -R oracle:oinstall /u01/app/oracle
十三.安装CRS(只在一个node,并且使用oracle用户)
放入光盘,运行runInstaller
i. 屏幕显示:“Welcome”
单击“Next”

ii.屏幕显示:“Specify Inventory directory and credentials”
1. 将 Inventory 目录更改为:/u01/app/oracle/oraInventory
2. 将操作系统组名称更改为:oinstall
3. 单击“Next”

iii.弹出窗口……以 root 身份运行/u01/app/oracle/oraInventory/orainstRoot.sh
# /u01/app/oracle/oraInventory/orainstRoot.sh
在安装程序中单击“Continue”。

iv.屏幕显示:“Specify File Locations”
将 Name 更改为:CRS10g
将 Path 更改为:/u01/app/oracle/CRS10g
单击“Next”

v. 屏幕显示:“Language Selection”
单击“Next”

vi.屏幕显示:“Cluster Configuration”
保持 Cluster Name 为“crs”不变
对于公共节点名称,使用“rac1.us.oracle.com”。
对于专用节点名称,使用“rac1local.us.oracle.com”。
单击“Next”


vii.屏幕显示:“Private Interconnect Enforcement”
对于 eth0,在“Interface Type”中选择“Public”。
对于 eth1,在“Interface Type”列中选择“Private”。
单击“Next”

viii.屏幕显示:“Oracle Cluster Registry”
输入:/ocfs/ocr_file
单击“Next”

ix.屏幕显示:“Voting Disk”
输入:/ocfs/voting_disk
单击“Next”

x. 屏幕显示:“Summary”
单击“Install”结束安装

xi.弹出 Setup Privileges 窗口:以 root 在每个节点
上运行:

# /u01/app/oracle/CRS10g/root.sh

忽略:
“WARNING:directory '/u01/app/oracle' is not owned by root”



CRS 成功消息如下:
“Oracle CRS stack installed and running under init(1M)”


在安装程序弹出窗口中单击“OK”。

xii.屏幕显示:“End of Installation”,退出安装程序
单击“Exit”并确认退出。

xiii.检查 CRS 是否正在运行

# ps -efm grep crs (应该有很多行)


d. 取出 Oracle10g CRS CD
十四.编辑“.bash_profile”(所有node,并且使用oracle用户)
Node1
export ORACLE_SID=O10G1
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=/u01/app/oracle/DB10g
export ORA_CRS_HOME=/u01/app/oracle/CRS10g
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
export PATH=$PATH:$ORACLE_HOME/bin
# export LD_ASSUME_KERNEL=2.4.19 (RHEL3 vanilla 或 Update 1 需要)
Node2
export ORACLE_SID=O10G2
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=/u01/app/oracle/DB10g
export ORA_CRS_HOME=/u01/app/oracle/CRS10g
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
export PATH=$PATH:$ORACLE_HOME/bin
# export LD_ASSUME_KERNEL=2.4.19 (RHEL3 vanilla 或 Update 1 需要)

编辑之后用运行:source .bash_profile
十五.安装oracle软件(只在一个node,别且使用oracle用户)
i. 屏幕显示:“Welcome”
单击“Next”

ii.屏幕显示:“Specify File Locations”
将 Name 更改为:DB10g
确认验证 Path 为:/u01/app/oracle/DB10g
单击“Next”

iii.屏幕显示:“Specify Hardware Cluster Installation Mode”
选择:“Cluster Installation” (最上面的选项)
选择所有节点
单击“Next”

iv.屏幕显示:“Select Installation Type”
选择:“Enterprise Edition” (最上面的选项)
单击“Next”

v. 屏幕显示:“Product-specific Prerequisite Checks”
所有检查都应该是成功的。
单击“Next”

注意:如果 OS 内核参数不正确,则按照第 2 阶段的步骤在 OS 级别上修复,
然后按 Back 和 Next 按钮,这样就能通过检查。

vi.屏幕显示:“Select Database Configuration”
选择:“Do not create a starter database” (最下面的选项)
单击“Next”

vii.屏幕显示:Summary
单击“Install” (大约 10 分钟)


viii.弹出 Setup Privileges 窗口:在每个节点上以 root 身份运行 $ORACLE_HOME/root.sh

# $ORACLE_HOME/root.sh

1. “Enter the full pathname of the local..”接受默认选项。

2. VIP 配置助手 (vipca) 自动启动:
a. 屏幕显示:“Welcome”
单击“Next”
b. 屏幕显示:“1 of 2, Network Interfaces”
选择接口 — “eth0”,”eth1”
单击“Next”
c. 屏幕显示:“2 of 2, Virtial IPs for cluster nodes”
在“IP Alias Name”下输入“rac1-vip.us.oracle.com”。
按 TAB 自动填充“IP address”列。
单击“Next”
d. 屏幕显示:“Summary”
单击“Finish”

e. 对话框:“Configuration Assistant Progress Dialog”
所有步骤完成后,单击“OK”。
f. 对话框:“Configuration Results”
单击“Exit”

在安装程序弹出窗口中单击“OK”。

ix.屏幕显示:“End of Installation”,退出安装程序
单击“Exit”并确认退出。

c. 取出 Oracle10g 数据库 CD
十六.运行hangcheck-timer模块(所有node,root用户)

1.将以下行:

modprobe hangcheck-timer hangcheck_tick=30 hangcheck_margin=180

添加到:

REDHAT:/etc/rc.local
2.运行modprobe hangcheck-timer hangcheck_tick=30 hangcheck_margin=180
十七.安装配置ASM(所有node,root用户)
1.安装ASM的三个包
Rpm –Uvh oracleasm*
具体是:oracleasm-support
oracleasmlib
oracleasm-kernel version
2.运行/etc/init.d/oracleasm configure

Default user to own the driver interface []:oracle
Default group to own the driver interface []:oinstall
Start Oracle ASM library driver on boot (y/n) [n]:y
Fix permissions of Oracle ASM disks on boot (y/n) [y]:y
Writing Oracle ASM library driver configuration [ OK ]
Creating /dev/oracleasm mount point [ OK ]
Loading module "oracleasm" [ OK ]
Mounting ASMlib driver filesystem [ OK ]
Scanning system for ASM disks [ OK ]
十八.创建ASM磁盘(一个node,root用户)
需要先对ASM磁盘分区。
/etc/init.d/oracleasm createdisk VOL1 /dev/sdb1
/etc/init.d/oracleasm createdisk VOL2 /dev/sdc1
/etc/init.d/oracleasm listdisks

【在另外一个ndoe上】
/etc/init.d/oracleasm scandisks
/etc/init.d/oracleasm listdisks
十九.配置网络工具(一个node,oracle用户)
1.运行netca
Cluster configuration
All the nodes
Listener configuration
Add
Listener
Tcp
1521
No
Naming Methods configurationLocal naming
Next
Finish
二十.创建实例(一个node,oracle用户)
Oracle real application clusters database
Create a database
Select all
Custom database
Database name and sid
Default
Password
Asm
Sys’s password
The status of all the disk should be “PROVISIONED”
Name of the asm disk group
-----------------------
From here, do the select as you wish
(建库中可能会有一个错误消息,忽略)

至此完成

windows下安装oracle8.1.7

把CD上的内容拷贝到硬盘

cd \Disk1\stage\Components\oracle.swd.jre\1.1.7.30\1\DataFiles\Expanded\jre\win32\bin

把symcjit.dll 改成 symcjit.old

在硬盘上运行runInstaller

vmware下共享磁盘的关键设置

disk.locking="false"

diskLib.dataCacheMaxSize=0

diskLib.dataCacheMaxReadAheadSize=0

diskLib.dataCacheMinReadAheadSize=0

diskLib.dataCachePageSize=4096

diskLib.maxUnsyncedWrites=0

windows的HyperThreading技术

启动时:

F1 =》BOIS=》Advanced =》HyperThreading [Disable/Enable]
F10(Save &Exit)

redhat linux下配置r系列命令

服务器端:
1。修改/etc/xinetd.d目录下rsh文件和rlogin文件,将disable改成no
2。修改/etc/securetty文件,增加rsh、rlogin、rexec、rcp四行记录,注意,是四行
3。增加/root/.rhosts文件,增加客户端主机名记录,例如:
yblx4
localhost
4。编辑/etc/hosts文件,增加客户端主机名与IP对应关系,例如:
192.168.196.134 yblx4
127.0.0.1 localhost.localdomain localhost
5。编辑/etc/hosts.equiv文件,增加客户端主机名记录,例如:
yblx4
localhost
6。service xinetd restart

redhat linux的运行级

# 0 - halt (Do NOT set initdefault to this)
# 1 - Single user mode
# 2 - Multiuser, without NFS (The same as 3, if you do not have networking)
# 3 - Full multiuser mode
# 4 - unused
# 5 - X11
# 6 - reboot (Do NOT set initdefault to this)

需要参考/etc/inittab才能判断系统缺省的运行级别:id:3:initdefault:
切换运行级telinit X

windows下配置Active Directory

http://www.microsoft.com/china/technet/prodtechnol/windowsserver2003/technologies/directory/activedirectory/stepbystep/domcntrl.mspx

windows下配置ftp

  一、用IIS架设

  如果只是想建个小型的同时在线用户数不超过10个的FTP服务器,且不会同时进行大流量的数据传输,可以用IIS 5.0作为服务器软件来架设(IIS只适用于Windows NT/2000/XP操作系统)。

  1.安装

  Windows XP默认安装时不安装IIS组件,需要手工添加安装。进入控制面板,找到“添加/删除程序”,打开后选择“添加/删除Windows组件”,在弹出的“Windows组件向导”窗口中,将“Internet信息服务(IIS)”项选中。在该选项前的“√”背景色是灰色的,这是因为Windows XP默认并不安装FTP服务组件。再点击右下角的“详细信息”,在弹出的“Internet信息服务(IIS)”窗口中,找到“文件传输协议(FTP)服务”,选中后确定即可。


  安装完后需要重启。Windows NT/2000和Windows XP的安装方法相同。

  2.设置
  
  电脑重启后,FTP服务器就开始运行了,但还要进行一些设置。点击“开始→所有程序→管理工具→internet信息服务”,进入“internet信息服务”窗口后,找到“默认FTP站点”,右击鼠标,在弹出的右键菜单中选择“属性”。在“属性”中,我们可以设置FTP服务器的名称、IP、端口、访问账户、FTP目录位置、用户进入FTP时接收到的消息等。

  1)FTP站点基本信息

  进入“FTP站点”选项卡,其中的“描述”选项为该FTP站点的名称,用来称呼你的服务器,可以随意填,比如“我的小站”;“IP地址”为服务器的IP,系统默认为“全部未分配”,一般不须改动,但如果在下拉列表框中有两个或两个以上的IP地址时,最好指定为公网IP;“tCp端口”一般仍设为默认的21端口;“连接”选项用来设置允许同时连接服务器的用户最大连接数;“连接超时”用来设置一个等待时间,如果连接到服务器的用户在线的时间超过等待时间而没有任何操作,服务器就会自动断开与该用户的连接。

  2)设置账户及其权限

  很多FTP站点都要求用户输入用户名和密码才能登录,这个用户名和密码就叫账户。不同用户可使用相同的账户访问站点,同一个站点可设置多个账户,每个账户可拥有不同的权限,如有的可以上传和下载,而有的则只允许下载。

  3)安全设定

  进入“安全账户”选项卡,有“允许匿名连接”和“仅允许匿名连接”两项,默认为“允许匿名连接”,此时FTP服务器提供匿名登录。“仅允许匿名连接”是用来防止用户使用有管理权限的账户进行访问,选中后,即使是adMinistrator(管理员)账号也不能登录,FTP只能通过服务器进行“本地访问”来管理。至于“FTP站点操作员”选项,是用来添加或删除本FTP服务器具有一定权限的账户。iis与其他专业的FTP服务器软件不同,它基于WindoWs用户账号进行账户管理,本身并不能随意设定FTP服务器允许访问的账户,要添加或删除允许访问的账户,必须先在操作系统自带的“管理工具”中的“计算机管理”中去设置WindoWs用户账号,然后再通过“安全账户”选项卡中的“FTP站点操作员”选项添加或删除。但对于WindoWs 2000和WindoWs Xp专业版,系统并不提供“FTP站点操作员”账户添加与删除功能,只提供adMinistrator一个管理账号。

  提示:匿名登录一般不要求用户输入用户名和密码即可登录成功,若需要,可用“anonyMous”作为用户名,以任意电子邮件地址为密码来登录。

  4)设置用户登录目录

  最后设置FTP主目录(即用户登录FTP后的初始位置),进入“主目录”选项卡,在“本地路径”中选择好FTP站点的根目录,并设置该目录的读取、写入、目录访问权限。“目录列表样式”中“uniX”和“Ms-dos”的区别在于:假设将G\FTP设为站点根目录,则当用户登录FTP后,前者会使主目录显示为“\”,后者显示为“G\FTP”。
设置完成后,FTP服务器就算真正建成了。如果前面IP地址为218.1.1.1,则用户使用FTP客户端软件(用来登录FTP服务器的上传/下载软件,如CuteFTP、FlashFXp等,如无特别说明,本文中所称Ftp客户端软件均以CuteFtp pro 2.0为例)时,主机处填218.1.1.1,端口填21,此服务器的地址表述为:FTP//218.1.1.121。IIS虽然安装简单,设置较简便,但功能不强,管理也很麻烦,尤其是连新建一个基本的授权访问账户都要进行繁杂的设置,而且IIS本身的安全性也比较差,容易受到诸如“红色代码”等专门针对IIS漏洞进行攻击的病毒侵袭,因而很多人都喜欢使用第三方的FTP服务器软件来架设。

  二、用Serv-U等第三方FTP服务器软件架设

  除IIS外,还有很多FTP服务器软件可以架设,如Wu-FTP、proFTPd、Serv-U等,但大部分只适用于uniX、linuX系统,如果使用WindoWs系统,强烈推荐使用serv-u。serv-u(下载地址:http//WWW.neWhua.CoM/FTPservu.htM,含汉化包)是一种被广泛运用的FTP服务器端软件,支持WindoWs 3X/9X/Me/nt/2000等全WindoWs系列。它安装简单,功能强大,可以用同一个ip设定多个FTP服务器、限定登录用户的权限、登录主目录及空间大小、支持远程登录管理等,适合绝大部分个人自建FTP的需要。

  1.安装

  Serv-U的安装比IIS还简单。先执行英文原版安装文件,按提示一路“neXt”即可。要注意的是,在选择安装目录时,最好选择安装在一个非系统盘里,以免将来系统发生异常时还要重新进行账号等的设置。然后执行汉化文件,选择原版安装目录,一路“下一步”即可完成安装。

  2.设置
  
  与IIS不同,Serv-U在第一次运行时会以向导的方式一步一步地提示用户进行设置,整个过程不超过五分钟,非常人性化。为了方便说明,先假设我们要架设一个固定IP为218.1.1.1,端口为21,根目录绝对路径为G\FTP,允许匿名访问和拥有一个用户名为dys、密码为syd、管理账户名叫“MyFTP”的公网FTP服务器。运行Serv-U,弹出向导窗口,依次设置如下选项:

  1)“您的IP地址”:这里我们填入218.1.1.1,如果你是adsl等方式拨号上网,拥有的是动态IP或者不知道本机IP,此处请留空。
  2)“域名”:就是该FTP站点的名称,可以随意取名,这里填入“MyFTP”。
  3)“匿名账号”:决定该FTP站点是否允许匿名用户访问。选择“是”。
  4)“匿名主目录”:设置匿名用户登录站点后所处的目录位置。输入“G\FTP”。
  5)“锁定于主目录”:假设在“匿名主目录”中设置匿名用户登录后所处的目录位置为“G:\FTP\Guest”,那么,选择“是”后,当匿名用户登录FTP后,就被锁定在G\FTP\Guest目录下,只能查看Guest目录里的内容,不能进入上级目录“FTP”,同时该目录在FTP客户端软件中显示为“\”,如果未被锁定,则会完整显示为“G:\FTP\Guest”。这里选择“是”。
  6)“命名的账号”:决定是否要创建有一定管理权限的账户。这里选“是”。
  7)“账号名称”:就是具有一定管理权限的账户登录名称。填入“dys”。
  8)“账号密码”:设置账户的登录密码。输入“syd”。
  9)“主目录”:与“匿名主目录”一样,用来设置管理账户登录后所处的目录位置。输入“G:\Ftp”。
  10)“锁定于主目录”:选择“是”。
  11)“管理员权限”:用来设置管理账户的管理权限级别。这里选“无权限”,后面再详述。
设置完成,地址为:FTP//218.1.1.121的FTP服务器就算架设成功了。最后可用CuteFTP分别以匿名和dys的账户登录验证。
提示:以上这些设置并非最终设定,你还可以在Serv-U主界面中随时修改。

  3.用同一个IP架设多个FTP服务器

  如果带宽允许的话,你还可利用同一个IP轻松架设多个服务器。在Serv-U中,将“本地服务器”下“域”中的每个FTP服务器称为“域”,刚才创建的“MyFTP”服务器就是一个名叫“MyFTP”的域。要架设多个服务器,实际上就是创建多个拥有不同端口的域而已。

  右击“域”,选“新建域”,在弹出的向导中参照“MyFTP”进行设置,只是在端口处一定不要与已经创建的“域”的端口或被其他系统服务占用的端口冲突即可。如果填入22,则此服务器的地址就是:FTP//218.1.1.122。依此而为,就可以架设多个FTP服务器了。

windows下配置telnet

启动 Telnet 服务
安装 Windows 2000 Server 时 Telnet 服务的启动类型被设为手动。


手动启动 Telnet 服务
您可以使用下面任一方法手动启动 Telnet 服务: • 在命令提示符下键入 net start telnet。
• 单击开始,指向程序,指向管理工具,然后单击 Telnet 服务器管理。在命令提示符下键入 4 启动 Telnet 服务。
• 单击开始,指向程序,指向管理工具,单击服务,右键单击 Telnet 服务,然后单击启动。
• 单击开始,指向程序,指向管理工具,单击服务,右键单击 Telnet 服务,单击属性,然后单击启动。

自动启动 Telnet 服务
您可以按如下步骤设置 Telnet 服务让其自动启动: 1. 单击开始,指向程序,指向管理工具,然后单击服务。
2. 右键单击 Telnet 服务,然后单击属性。
3. 在启动类型框中单击自动。
4. 单击确定。

使用 Telnet 服务
要开始使用 Telnet 服务,键入如下命令以连接到远程服务器:
telnet ip_address / server_name
其中 ip_address 是服务器的 IP 地址, server_name 是服务器的名称。

备注:默认情况下,服务器使用 NTLM 身份验证,并提示输入用户名和密码。

redhat linux AS 2.1下安装oracle8.1.7

安装linux2.1 update6

1.选择安装过程中使用的语言
2.选择键盘,不需要修改
3.选择鼠标,不需要修改
4.选择安装模式,这里选用advanced server
5.硬盘分区,选择手动
6.“/boot” 类型ext3 大小100M,Swap空间类型swap 大小2048M,“/” 类型ext3 大小其余所有空间。
7.这页不要修改
8.这页不要修改
9.编辑需要的IP信息
10.防火墙设置
11.语言及默认语言
12.时区
13.Root用户密码
14.选择安装包,全选
15.选择显卡及显存
16.开始安装
17.安装完毕后选择是否创建引导盘
18.选择显示器,不要修改
19.选择屏幕设置,不要修改
20.确认退出,系统重启
21.重启完毕,使用root用户登录
22.单击VM菜单,选择Install VMware Tools
23.等待约10秒后,依次执行如下命令
mount /dev/cdrom /mnt/cdrom
cp /mnt/cdrom/VMwareTools-5.0.0-13124.tar.gz /tmp/
cd /tmp
gunzip VMwareTools-5.0.0-13124.tar.gz
tar xvf VMwareTools-5.0.0-13124.tar
这时,应当在/tmp目录下看到vmware-tools-distrib文件夹
24.安装vmware tools,所有提示单击回车键选择默认设置
25.执行startx,启动X系统
26.确认X系统运转正常
至此,linux2.1安装完毕。


安装oracle8.1.7


◎需要的rpm包(相同或者更高版本)
binutils-2.11.90.0.8-12(installed)
compat-glibc-6.2-2.1.3.2.i386.rpm (CD1)
compat-egcs-6.2-1.1.2.16.i386.rpm(CD2)
compat-libs-6.2-3.i386.rpm (CD2)
查看是否安装:rpm –q binutils compat-glibc compat-egcs compat-libs
安装命令(需要进入包所在的目录):rpm –ivh full_package_name

◎需要修改的核心参数
SHMMAX 2147483648
SHMMIN 1
SHMMNI 4096
SHMALL 2097152
FILE-MAX 65536
IP_LOCAL_PORT_RANGE 1024 65000
SHMSEG 10
SEMMNI 128
SEMMSL 250
SEMMNS 32000
SEMOPM 100
SEMVMX 32767
修改命令:cat >> /etc/sysct.conf <<>kernel.shmmax=2147483648
>kernel.shmmin=1
>kernel.shmmni=4096
>kernel.shmall=2097152
>fs.file-max=65536
>net.ipv4.ip_local_port_range=1024 65000
>kernel.shmseg=10
>kernel.sem=250 32000 100 128
>kernel.semvmx=32767
>EOF
注意:修改之后需要重启才能生效

◎创建oracle用户、相关用户组、目录
依次执行命令:
groupadd oinstall
groupadd dba
useradd –m –g oinstall –G dba oracle
passwd oracle(按照提示修改用户oracle的密码)
mkdir –p /u01/app/oracle
chown –R oracle:oinstall /u01/app/oracle
chmod –R 775 /u01/app/oracle
◎注销,使用oracle用户登录,修改“.bash_profile”文件
添加如下内容:
umask=022
export LD_ASSUME_KERNEL=2.2.5
export LDEMULATION=elf_i386_glibc21
export GCC_EXEC_PREFIX=/usr/i386-glibc21-linux/lib/gcc-lib/
export ORACLE_SID=lx28i
export ORACLE_HOME=/u01/app/oracle/product/8.1.7
export ORACLE_BASE=/u01/app/oracle
PATH=$ORACLE_HOME/bin:/opt/bin:/bin:/usr/bin:/usr/local/bin:/usr/sbin:/usr/X11R6/bin:/usr/local/bin:/usr/local/java/bin
PATH=$PATH:$HOME/bin
export JAVA_HOME=/usr/local/java
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib:/usr/local/lib
export PATH
unset USERNAME
echo ".bash_profile reloaded"

修改并保存以后,执行source .bash_profile命令使之生效。

◎下载并安装jdk和jre(需要对相关目录有权限的用户),网址www.blackdown.com
jdk118_v3-glibc-2.1.3.tar.bz2
jre118_v3-glibc-2.1.3.tar.bz2

将jdk解压至/usr/local/java,目录结构为: java下就是很多文件夹了


jre备用。

安装oracle8.1.7开始(使用oracle用户):

1.运行runInstaller
2.OUI界面
3.选择oraclehome,不要修改
4.选择安装组,oinstall
5.打开终端,用root用户执行指定的脚本,然后点retry
6.选择安装组件
7.选择安装类型
8.选择javahome,不要修改
9.选择数据库名,要与sid一致
10. 安装开始
11. Linking到97%的时候,会有一个错误,点忽略
12. 用root用户执行指定的脚本
13. 执行配置工具的时候会hang,点右上角的X强行退出


修复安装过程中的两个问题,重要:

1.打开一个新的终端,修改$ORACLE_HOME/lib/sysliblist文件
修改前:-ldl –lm –lpthread
修改后:-ldl –lm –lnsl –lpthread
执行命令:relink all (可能会花一些时间,耐心等待,不要中断)

2.解压缩jre,目录任意,建议/usr/local/下
删除$ORACLE_HOME/JRE
执行命令:ln –s /usr/local/jre118_v3 $ORACLE_HOME/JRE
现在,配置工具可以使用了

安装到此结束。

现在可以用netca配置监听器及网络服务,用dbassist创建数据库。
注意:创建数据库可能花费相当可观的时间,请不要中途停止。

redhat linux 4 允许远程X输入

redhat linux 4 允许远程X输入
客户端:
1. 编辑/etc/hosts文件,增加服务器端主机名与IP对应关系,例如:
192.168.196.134 yblx4
127.0.0.1 localhost.localdomain localhost
2.执行命令:xhost + 服务器端主机名。例如:
xhost + yblx4
3.编辑/etc/X11/gdm/gdm.conf文件
(1)找到#DisallowTCP=true,改成DisallowTCP=false
(2)找到[xdmcp]区,将下面的的Enable选项改成true

4.重新启动

主机端:
1.编辑/etc/hosts文件,增加客户端主机名与IP对应关系,例如:
192.168.196.135 yblx49i1
127.0.0.1 localhost.localdomain localhost

redhat linux下配置nfs

1.检查软件包
rpm –q nfs-utils
rpm –q portmap
2.配置/etc/exports
格式:<输出目录> [客户端1(选项1,选项2,……)] [客户端2(选项1,选项2,……)]
例如:/media 192.168.196.*(ro)
3.启动服务(要按顺序)
service portmap start
service nfs start
4.查看nfs服务器的共享信息
showmount –e nfs服务器名或IP
例如:showmount –e 192.168.196.134
5.挂载nfs共享目录到本地目录/卸载
mount –t nfs 服务器名或IP:输出目录 本地挂载目录
umount 本地挂载目录
例如:
mount –t nfs 192.168.196.134:/media /mnt/nfs
umount /mnt/nfs

redhat linux下配置samba

1.检查samba服务程序是否安装
rpm –q samba
2.检查/etc/sercices文件中netbios-开头的记录是否都可用
3.生成/etc/samba/smbpasswd文件
smbpasswd –a linux帐户名(例如:smbpasswd –a oracle)
4.配置/etc/samba/smb.conf文件
workgroup=windows操作系统中的组名(例如:workgroup=ORACLE)
interfaces=你要使用的网卡的名称或IP(例如:interfaces=eth0或interfaces=192.168.196.134)
wins support=yes
encrypt password=yes(传送密码时加密,不是必须,但建议)

设置完毕后使用testparm命令查看smb.conf有无语法错误和你设置的参数。
5.映射用户,映射以后在使用samba服务器上的共享资源时,就可以直接使用windows的帐户。
如要启动映射,去掉smb.conf文件中username map=/etc/samba/smbusers前面的分号,然后编辑/etc/samba/smbusers文件
格式:单独的linux帐号=要映射的windows帐号(1映射n时,用空格隔开)
例如:oracle=Administrator yang
6.服务的启动停止:service smb start/stop/restart
7.Windows客户端的连接
打开一个窗口,地址栏输入“//linux主机名”或者“//linux机器的IP”

8.Linux客户端
(1)检查客户端是否安装
rpm –q samba-client
(2)编辑/etc/samba/lmhosts
格式:IP地址 主机名(netBIOS名称)
例如:192.168.196.134 yblx4
(3)列出共享资源列表
smbclient –L //主机名或IP地址 –U 登录用户名
例如:smbclient –L //yblx4 –U oracle

(4)使用共享资源
smbclient //主机名或IP地址/共享目录名 –U 登录用户名
例如:smbclient //yblx4/oracle –U oracle

Smbclient的使用方式和FTP类似,用get和put命令下载上传文件,用help查看帮助。

redhat linux下配置ssh

1. 检查服务器端的软件包安装
rpm –q openssh-server
2. 启动,停止服务程序
service sshd start/stop/restart
3. 检查客户端的软件包安装
rpm –q openssh-clients

另:启用服务器公钥认证
在服务器编辑文件/etc/ssh/sshd_config,找到语句“PasswordAuthentication yes”,并将语句改为“PasswordAuthentication no”。


1.Log in as the oracle user.
2.If necessary, create the .ssh directory in the oracle user's home directory and set the correct permissions on it:
$ mkdir ~/.ssh
$ chmod 700 ~/.ssh
3.Enter the following commands to generate an RSA key for version 2 of the SSH protocol:
$ /usr/bin/ssh-keygen -t rsa
4.Enter the following commands to generate a DSA key for version 2 of the SSH protocol:
$ /usr/bin/ssh-keygen -t dsa
5.On the local node, determine if you have an authorized key file (~/.ssh/authorized_keys). If the authorized key file already exists, then proceed to step 2. Otherwise, enter the following commands:
$ touch ~/.ssh/authorized_keys
$ cd ~/.ssh
$ ls
You should see the id_dsa.pub and id_rsa.pub keys that you have created.
6.Using SSH, copy the contents of the ~/.ssh/id_rsa.pub and ~/.ssh/id_dsa.pub files to the file ~/.ssh/authorized_keys, and provide the oracle user password as prompted. This process is illustrated in the following syntax example with a two-node cluster, with nodes node1 and node2, where the oracle user path is /home/oracle:
[oracle@node1 .ssh]$ ssh node1 cat /home/oracle/.ssh/id_rsa.pub >> authorized_keys
oracle@node1's password:
[oracle@node1 .ssh]$ ssh node1 cat /home/oracle/.ssh/id_dsa.pub >> authorized_keys
[oracle@node1 .ssh$ ssh node2 cat /home/oracle/.ssh/id_rsa.pub >> authorized_keys
oracle@node2's password:
[oracle@node1 .ssh$ ssh node2 cat /home/oracle/.ssh/id_dsa.pub >>authorized_keys
oracle@node2's password:
7.Use SCP (Secure Copy) or SFTP (Secure FTP) to copy the authorized_keys file to the oracle user .ssh directory on a remote node. The following example is with SCP, on a node called node2, where the oracle user path is /home/oracle:
[oracle@node1 .ssh]scp authorized_keys node2:/home/oracle/.ssh/
8.Repeat this process for each node in the cluster.
9.Change the permissions on the oracle user's /.ssh/authorized_keys file on all cluster nodes:
$ chmod 600 ~/.ssh/authorized_keys
10.Enter the following commands:
$ exec /usr/bin/ssh-agent $SHELL
$ /usr/bin/ssh-add
11.To test the SSH configuration, enter the following commands from the same terminal session, testing the configuration of each cluster node, where nodename1, nodename2, and so on, are the names of nodes in the cluster:
$ ssh nodename1 date
$ ssh nodename2 date

redhat linux下配置telnet

1、 检查软件:rpm –q telnet-server
本次测试用的为: telnet-server-0.17-30
2、 编辑/etc/xinetd.d/telnet
编辑最后一行为disable = no
3、 重新启动xinetd服务:/etc/init.d/xinetd restart
4、 尝试telnet登陆:
Red Hat Enterprise Linux ES release 4 (Nahant)
Kernel 2.6.9-5.EL on an i686
login: oracle
Password:
Last login: Thu Apr 20 21:26:34 on :0
-bash: [: /bin/bash: unary operator expected
[oracle@liqlx4 ~]$
5、 以root用户登陆
vi /etc/securetty
加入
pts/1
pts/2
pts/3
pts/4
pts/5
pts/6
pts/7
pts/8
pts/9
pts/10

redhat linux下配置ftp

1、 检查软件:rpm –qa vsftpd
vsftpd-2.0.1-5
2、 启动/重启vsftpd服务:service vsftpd start/restart
3、 编辑/etc下: vsftpd.ftpusers, vsftpd.user_list
注释掉root用户;

redhat linux下配置vnc

第1部分:VNC
1、 redhat下检查VNC是否安装: rpm –q vnc-server
本次实验平台是rhel 4自带的:vnc-server-4.0-8.1
2、 启动/重启vnc服务:/etc/init.d/vncserver start/restart
3、 启动一个桌面:
vncserver :1
杀掉一个桌面:vncserver –kill :1
第一次运行时会提示你配置远程连接的密码;
4、 尝试在远程访问redhat桌面:
http://linux:5801(使用vnc客户端端口为5901)
5、 编辑/root/.vnc/xstartup文件:
将最下一行编辑成:
startkde & -----就是启动远程KDE界面;
gnome-session & -----就是启动远程gnome界面;
6、 启动多用户桌面:
刚刚是用root启动了桌面1
用oracle用户启动桌面2
su – oracle
vncserver :2
此时如果要启动KDE或者gnome都还需要编辑/home/oracle/.vnc/xstartup文件,如上;