2010 年 05 月 19日, 星期三
HP系统备份及恢复方案
今天应客户要求写了一下HP系统备份及恢复方案
HP系统备份及恢复方案
1 检查系统是否安装ignite软件
# swlist -l bundle |grep -i ignite
IGNITE C.7.4.157 HP-UX Installation Utilities (Ignite-UX)
# whereis make_tape_recovery
make_tape_recovery: /opt/ignite/bin/make_tape_recovery /opt/ignite/share/man/man1m.Z/make_tape_recovery.1m
2 备份
2.1 查看make_tape_recovery参数
# /opt/ignite/bin/make_tape_recovery -help
Usage: make_tape_recovery [-s iux_server|[-l lanic_id]] [-A]
[-B boot_destination_file] [-I][-a tape_device_file][-p] [-r]
[-t tape_title] [-v] [-i|-ib] [-d description] [-f content_file][-D tape_vol_name]
[-x content-options] [-P s|w|e] [-m tar|cpio|pax] [XToolkit-Options] [-?]
-s iux_server Specifies the server on which configuration files and
archives reside
-A Specifies all files on each selected disk or volume
group that are included
-B boot_dest_file Specifies the temporary location of the LIF volume
-I Cause the system recovery process to be interactive when
booting from the tape
-a tape_device_file Specifies the tape device file
-r Resumes creation of the archive
-p Previews the processing that would take place without
actually creating the archive
-t tape_title Specifies a custom message of the archive tape
-v Specifies verbose output
-i Causes make_tape_recovery to run interactively
-d description Specifies the one line description of the archive
-D tape_vol_name Specifies 6-character ANSI tape volume name. IPF tape only
-f content_file Specifies the location of the file which identifies
keywords to specify inclusions and exclusions for the
archive
-l lanic_id Specifies the lanic id of the system being archived,
used with -s option
-m tar|cpio|pax Specify in which format the files/directories image in
the archive will be stored
-x content_option Specifies the included/excluded disk or volume groups
-n num_cfg_dir Specifies the number of configuration and log file
directories to be saved on the system
-? Display this help screen
2.2 执行系统备份
# /opt/ignite/bin/make_tape_recovery -Av
# /opt/ignite/bin/make_tape_recovery -Av -a /dev/rmt/1mn (提定磁带设备)
2.3 检查备份是否成功
# /opt/ignite/bin/check_tape_recovery
#cat /var/opt/ignite/recovery/latest/recovery.log
3 恢复
3.1 恢复磁带上的所有数据
3.1.1 非交互式恢复系统
[1] 在磁带机中,插入系统恢复带
[2] Boot 系统
[3] 中断Boot 流程,进入 Boot_admin> 提示下
[4] Boot_admin> bo 8/16.0.0 (8/16.0.0: 磁带机的 hardware path )
[5] 选取 " non-interactive "
[6] 等待系统恢复完毕
3.1.2 交互式恢复系统
[1] 在磁带机中,插入系统恢复带
[2] Boot 系统
[3] 中断Boot 流程,进入 Boot_admin> 提示下
[4] Boot_admin> bo 8/16.0.0 (8/16.0.0: 磁带机的 hardware path )
[5] 不选取 " non-interactive "
[6] 选取
a. [ Install HP-UX ]
b. [ Advanced Installation ]
c. 配置或改变如下选项:
disks, file systems,
hostname, IP ddress,
timezone, root password,
DNS server, and gateway
[7] 选取 [install continue… ],直到系统恢复完毕
3.2 恢复磁带上部分文件
[1] 在磁带机中,插入系统恢复带
#mt -t /dev/rmt/0mn fsf 1
#tar -xvf /dev/rmt/0m filename (filename为需要恢复的文件名)
# tar -xvf /dev/rmt/0m etc/hosts (恢复文件时,如果需要放在原来的位置,则需要在根目录执行恢复)
# tar -xvf /dev/rmt/0m u01/app/oracle/oradata (恢复oradata目录下的所有文件)
2010 年 05 月 18日, 星期二
客户在做impdp时,报“ORA-30036: unable to extend segment by 8 in undo tablespace 'UNDOTBS1'”
昨天快下班时,客户在QQ上发来信息,说在做impdp测试时,一直报ORA-30036,undotbs表空间不足,查了一下,找到两个相关的文章:
735366.1 - Run Out Of Space On Undo Tablespace Using Import/Export DataPump
727894.1 - Import Data Pump Exhausts Undo Tablespace - ORA-30036
Cause
Excess undo generation can occur when there is a Primary Key (PK) constraint present on the system.
Import datapump will perform index maintenance and this can increase undo usage especially if there is other DML occurring on the database).
Solution
Disable constraints for Primary Keys (PK) on the database during import datapump load.
This will reduce undo as index maintenance will not be performed.
用以下测试通过:
1、先导入数据
1)CONTENT=METADATA_ONLY
TABLE_EXISTS_ACTION=REPLACE
EXCLUDE=CONSTRAINT
EXCLUDE=INDEX
2)CONTENT=DATA_ONLY
2、创建索引,启用约束等等
metalink登陆故障解决!
昨天客户咨询个问题,于是就登陆metalink想查询一下,没想到尽然登陆不上,报以下错误:
Authorization Required
This server could not verify that you are authorized to access the document requested. Either you supplied the wrong credentials (e.g., bad password), or your browser doesn't understand how to supply the credentials required.
Oracle-Application-Server-10g/10.1.3.4.0 Oracle-HTTP-Server Server at support.oracle.com Port 443 让同事用我账户登陆,却可以登陆,说明是我的系统问题,这个系统是五一的时候重新安装的,安装后没有登陆过metalink,因此google了一下报错信息,找到以下网页:“http://www.resources4writers.com/password_problems.htm”通过该网页成功解决metalink登陆问题。主要是修改安全设置中的“用户验证”登陆改为“用户名及密码验证”即可。
从今天起开始继续写Blog
看看能不能坚持下去,大家拭目以待!
2007 年 01 月 26日, 星期五
SHELL
if [ `whoami` != 'oracle' ]
then
echo "Error: You must be oracle to execute."
exit 99
fi
2006 年 11 月 21日, 星期二
AIX及WAS修改为中文环境问题
今天客户的WEBSPHERE 环境想从英文改为中文,操作系统是AIX,环境是英文,修改步骤见网上找来的资料
一、中文问题
如果操作系统不支持中文,应首先使操作系统支持中文。
附录中提供为Aix安装中文补丁包的步骤,其他操作系统请参照相关资料。
(1)weblogic
修改startweblogic.sh(startweblogic.cmd)中启动server的命令,重新设置虚拟机参数
添加-Ddefault.client.encoding=GBK -Dfile.encoding=GBK -Duser.language=Zh -Duser.region=CN
具体如下:
%JAVA_HOME%binjava %JAVA_VM% %MEM_ARGS% %JAVA_OPTIONS%
-Ddefault.client.encoding=GBK -Dfile.encoding=GBK -Duser.language=Zh -Duser.region=CN
-Dweblogic.Name=%SERVER_NAME%
-Dweblogic.ProductionModeEnabled=%PRODUCTION_MODE%
-Djava.security.policy="%WL_HOME%serverlibweblogic.policy" weblogic.Server
(2)websphere
修改应用程序服务器->进程定义->JVM虚拟机->一般自变量定义
添加-Ddefault.client.encoding=GBK -Dfile.encoding=GBK -Duser.language=Zh -Duser.region=CN
=======================================================================
二、内存调优
通过分析运行日志,在中间件服务器运行时,可找到管理信息->日志分析
服务器不运行情况下,可超找服务器主目录下的fpplogs目录.
查看是否存在OutOfMemoryError错误,如果存在说明存在超出虚拟机分配的内存,
应该适当调整虚拟机内存。
(1)weblogic
可以设置-Xms(最小使用内存) -Xmx(最大使用内存),-XX:MaxPermSize
最大使用内存:对于UNIX而言,一般不应超过物理内存的75%;
对于Windows, 一般不应超过物理内存的50%;
-XX:MaxPermSize 一般应为ms(最大使用内存)的一半;
具体操作时,修改startweblogic.sh(startweblogic.cmd)中启动server的命令,重新设置虚拟机参数
set MEM_ARGS=-Xms128m -Xmx512m -XX:MaxPermSize=256m
%JAVA_HOME%binjava %JAVA_VM% %MEM_ARGS% %JAVA_OPTIONS%
-Dweblogic.Name=%SERVER_NAME%
-Dweblogic.ProductionModeEnabled=%PRODUCTION_MODE%
-Djava.security.policy="%WL_HOME%serverlibweblogic.policy" weblogic.Server
(2)websphere
修改应用程序服务器->进程定义->JVM虚拟机
设置最大最小内存,并重新启动服务器.
========================================================================
三、连接池的优化
可以参照同一时间连接数据库的用户数量,进行设置,
数据库的最大连接数不能小于高峰时期同一时间连接用户的数量。
(1)weblogic
Services->jdbc-->Connection Pools-->centerconn-->connections
initial Capacity(初始连接数):10
Maximum Capacity(最大连接数):50
CapacityIncrement:(每次递增数):3
(2)websphere
请参考weblogic设置数据源的最大最小连接数。
========================================================================
附录:
在AIX中使用中文有两种途径:第一是在安装AIX时选择中文语言,装好的系统自动显示中文(这种方法不推荐使用,它没有第二种方法使用起来灵活)。第二是安装AIX时选择英文,系统启动后手工设置中文环境,方法如下:
1. 将AIX系统盘的第一张光盘放入光驱;
2. 运行命令:
smitty
--> System Environments
--> Manage Languange Environment
--> Change/Show Primary Language Environment
--> Change/Show Cultural Convention, Language, or Keyboard
在随后显示的菜单中将光标分别移到以下字段:
Primary CULTURAL Convention
Primary LANGUAGE translation
Primary KEYBOARD
按下,从弹出的菜单中选择“IBM-eucCN”将上述字段改为简体中文,按下回车键后系统自动从光盘安装中文环境软件包。此操作完成后重新启动系统,操作界面即为简体中文。
========================================================================
注:本文档只做参照,并不能千篇一律的这样做.还需要具体问题具体分析.
2006 年 10 月 19日, 星期四
面试
有一个公司的重要部门的经理要离职了,董事长决定要找一位才德兼备的人来接替这个位置。
但连续来应征的几个人都没有通过董事长的”考试”。
这天,一个三十多岁的留美博士前来应征,董事长却是通知他凌晨三点去他家考试。
这位青年于是凌晨三点就去按董事长家的铃,却未见人来应门,一直到八点钟,董事长才让他进门。
考的题目是由董事长口述,董事长问他:「你会写字吗?」年轻人说:「会。」
董事长拿出一张白纸说:「请你写一个白饭的『白』字。
他写完了,却等不到下一题,疑惑地问:「就这样吗?」
董事长静静地看着他,回答:「对!考完了!」
年轻人觉得很奇怪,这是哪门子的考试啊?
第二天,董事长去董事会宣布,该名年轻人通过了考试,而且是一项严格的考试!
他说明:「一个这么年轻的博士,他的聪明与学问一定不是问题,所以我考其它更难的。」
又接着说:「首先,我考他牺牲的精神,我要他牺牲睡眠,半夜三点钟来参加公司的应考,他做到了;
我又考他的忍耐,要他空等五个小时,他也做到了;我又考他的脾气,看他是否能够不发飙,他也做到了;
最后,我考他的谦虚,我只考堂堂一个博士五岁小孩都会写的字,他也肯写。
一个人已有了博士学位,又有牺牲的精神、忍耐、好脾气、谦虚,这样才德兼备的人,我还有什么好挑剔的呢?
我决定任用他!」
这位董事长看人的角度非常独到且正确,可不是吗?
气度,决定了一个人的高度,一个有气度的人才才会有所成就,A否则他未来的成就势必会受到局限。
在谨记「知识就是力量」的同时,也不妨也提醒自己----「气度决定了高度」,
这是一个知识爆炸的时代,在我们追求知识、升学、才艺…的同时,
千万不要忽略了:
所谓的『内在』,除了充实知识、才艺外,还包括了充实修养、品格。2006 年 08 月 29日, 星期二
今天安装ORACL9.2.01 FOR AIX 4.3
查找JDK1.3.1 费了不少时间,因此记录一下下载地址:
2006 年 08 月 08日, 星期二
今天写了一个过程,用来捕捉哪个客户端在什么时间运行过该过程
以Sys用户准备环境:
install package by execute as sys: ../rdbms/admin/dbmssupp.sql
grant execute on dbms_support to scott ;
grant select on v_$session to scott ;
在SCOTT用户下做测试:
create table TEST_LOG
( V_MACHINE VARCHAR2(40),
V_TIME DATE )
CREATE OR REPLACE PROCEDURE SP_TEST as
LS_SID
VARCHAR2(3);
LS_MACHINE VARCHAR2(40);
LS_DATE
DATE;
begin
select sys.dbms_support.mysid into LS_SID from dual;
select MACHINE into LS_MACHINE from sys.v_$session where sid = LS_SID;
select sysdate into LS_DATE from dual;
insert into test_log values (LS_MACHINE, LS_DATE);
commit;
end;
用另外一种方法也可以:
select sys_context('userenv','ip_address') from dual;
2006 年 08 月 02日, 星期三
看到一个ORACLE命令,原来没有用过,记录一下!
对于ORACLE 错误,可以使用 oerr ora xxxx 来查阅该错误是否严重。如:
oerr ora 1578
2006 年 07 月 29日, 星期六
今天去拍婚纱照了,心情相当愉快
四千元的套系,谈的时候要求自带数码相机及DV机过去拍。
今天请了两个朋友过去帮忙拍,一个用数码相机,一个用DV机。队伍还挺庞大的,呵呵!
2006 年 07 月 21日, 星期五
最近太忙了,没时间更新一下博客!
真是对不起观众,请原谅!2006 年 07 月 11日, 星期二
"在HACMP 5.1中使用磁盘总线作为心跳网络" ZT
在HACMP 5.1中使用磁盘总线作为心跳网络
|
2006 年 06 月 21日, 星期三
今天写的一个过程
CREATE OR REPLACE PROCEDURE run_sql asbegin
execute immediate 'begin sys.dbms_system.set_ev(14,64,10046,8,''''); end;';
end;