前言,我们在做sap basis时,总是对文件进行了备份,包括sap的安装文件、数据库安装文件。现在我们通过以上备份,对系统进行异机恢复测试。本次测试,其实非常有意义的,sap的安装会耗费大量的时间,如果通过免安装恢复,可以节约大量的时间。在我们进行同构硬件升级时,这个意义比较大,可以直接通过tar包进行操作,再把数据库恢复到最新,可以大大的提高速度
一、操作系统准备
1.1安装操作系统并安装相应的包
在服务器上安装操作系统这一步比较简单
补丁包的安装也比较简单,对于其它unix或者linux系统来说,其步骤基本上是差不多的
root@MYRESTBI:/export/home# pkginfo -i SUNWarc SUNWbtool SUNWhea SUNWlibm SUNWlibms SUNWpool SUNWpoolr SUNWsprot SUNWtoo SUNWuiu8 SUNWfont-xorg-core SUNWfont-xorg-iso8859-1 SUNWmfrun SUNWxorg-client-programs SUNWxorg-clientlibs SUNWxwfsw SUNWxwplt
system SUNWarc Lint Libraries (usr)
system SUNWbtool CCS tools bundled with SunOS
system SUNWfont-xorg-core X.Org Foundation X11 core fonts
system SUNWfont-xorg-iso8859-1 X.Org Foundation X11 iso8859-1 fonts
system SUNWhea SunOS Header Files
system SUNWlibm Math & Microtasking Library Headers & Lint Files (Usr)
system SUNWlibms Math & Microtasking Libraries (Usr)
system SUNWmfrun Motif RunTime Kit
system SUNWpool Resource Pools
system SUNWpoolr Resource Pools (Root)
system SUNWsprot Solaris Bundled tools
system SUNWtoo Programming Tools
system SUNWuiu8 Iconv modules for UTF-8 Locale
system SUNWxorg-client-programs X.Org Foundation X Client Programs
system SUNWxorg-clientlibs X.Org Foundation X Client Libraries
system SUNWxwfsw X Window System platform required font software
system SUNWxwplt X Window System platform software
以上包存在,就没有问题了!我们采用的用恢复文件的方式进行的,所以我们可以不安装图形界面,需要补安装的是字符集
root@MYRESTBI:/export/home# pkg install pkg:/text/[email protected]
Packages to install: 1
Create boot environment: No
Create backup boot environment: No
DOWNLOAD PKGS FILES XFER (MB) SPEED
Completed 1/1 42/42 0.2/0.2 0B/s
PHASE ITEMS
Installing new actions 69/69
Updating package state database Done
Updating image state Done
Creating fast lookup database Done
root@MYRESTBI:~# pkg install pkg:/system/locale/[email protected]
Packages to install: 3
Create boot environment: No
Create backup boot environment: Yes
Services to change: 1
DOWNLOAD PKGS FILES XFER (MB) SPEED
Completed 3/3 5382/5382 82.9/82.9 0B/s
PHASE ITEMS
Installing new actions 6132/6132
Updating package state database Done
Updating image state Done
Creating fast lookup database Done
最后用locale -a来检查就行了
1.2创建文件目录或者挂载点
事先准备好存储,建好pool池,我这里建了三个挂载点,如下:
root@MYRESTBI:~# zpool create -f datapool /dev/dsk/c8t2d0
root@MYRESTBI:~# zpool add -f datapool /dev/dsk/c8t3d0
root@MYRESTBI:~# zpool add -f datapool /dev/dsk/c8t4d0
root@MYRESTBI:~# zpool add -f datapool /dev/dsk/c8t5d0
root@MYRESTBI:~# zpool add -f datapool /dev/dsk/c8t6d0
root@MYRESTBI:/export/solaris# zfs create -o mountpoint=/usr/sap datapool/usrsap
root@MYRESTBI:/export/solaris# zfs create -o mountpoint=/sapmnt datapool/sapmnt
root@MYRESTBI:/export/solaris# zfs create -o mountpoint=/oracle datapool/oracle
root@MYRESTBI:/export/solaris# mkdir -p /oracle/BIP
1.3 创建用户组及用户
这一步,尽量使我们本机上的用户名与id与源环境的相同。
通过/etc/passwd及group文件来查看,在备份的时候,我们也将这两个文件一同备份
--创建用户组
root@MYRESTBI:/export/home# groupadd -g 100 sapinst
root@MYRESTBI:/export/home# groupadd -g 101 sapsys
root@MYRESTBI:/export/home# groupadd -g 102 dba
root@MYRESTBI:/export/home# groupadd -g 103 oper
root@MYRESTBI:/export/home# usermod -G +sapinst root
--创建用户
root@MYRESTBI:/export/home# useradd -u 100 -b /export/home bipadm
root@MYRESTBI:/export/home# useradd -u 101 -b /export/home sapadm
root@MYRESTBI:/export/home# useradd -u 102 -b /oracle/BIP orabip
root@MYRESTBI:/export/home# useradd -u 103 -b /export/home daaadm
--把用户添加到组里
添加主组
root@MYRESTBI:/export/home# usermod -g sapsys sapadm --添加主组
root@MYRESTBI:/export/home# usermod -g sapsys bipadm
root@MYRESTBI:/export/home# usermod -g dba orabip
root@MYRESTBI:/export/home# usermod -g sapsys daaadm
添加辅组
root@MYRESTBI:/export/home# usermod -G +sapinst bipadm --添加辅组
root@MYRESTBI:/export/home# usermod -G +sapinst sapadm
root@MYRESTBI:/export/home# usermod -G +sapinst orabip
root@MYRESTBI:/export/home# usermod -G +sapinst daaadm
root@MYRESTBI:/export/home# usermod -G +dba bipadm
root@MYRESTBI:/export/home# usermod -G +oper bipadm
root@MYRESTBI:/export/home# usermod -G +oper orabip
1.4创建资源使用
solaris是创建project,aix及linux也是通过编辑系统参数来实现
root@MYRESTBI:/export/home# projadd -p 200 -c "SAP System BIP" -U bipadm,orabip \-K "process.max-file-descriptor=(basic,65536,deny)" \-K "process.max-sem-nsems=(priv,2048,deny)" \-K "project.max-sem-ids=(priv,1024,deny)" \-K "project.max-shm-ids=(priv,256,deny)" \-K "project.max-shm-memory=(priv,18446744073709551615,deny)" \BIP
如果没有这一步,后面的数据库及sap进程会报错
oracle数据库会报:
ORA-27102 out of memory
sap在启动的时候会报:
rdisp/http_min_wait_dia_wp : 1 -> 1
***LOG CPS=> DpLoopInit, ICU ( 4.0.1 4.0.1 5.1) [dpxxdisp.c 1702]
***LOG Q0I=> NiPConnect2: 192.168.91.133:3900: connect (146: Connection refused) [nixxi.cpp 3285]
*** ERROR => NiPConnect2: SiPeekPendConn failed for hdl 17/sock 12
(SI_ECONN_REFUSE/146; I4; ST; 10.10.1.133:3900) [nixxi.cpp 3285]
*** ERROR => MsIAttachEx: NiBufConnect to MYRESTBI/3900 failed (rc=NIECONN_REFUSED) [msxxi.c 713]
***LOG Q0L=> DpLoopInit, nomscon () [dpxxdisp.c 1804]
CCMS: SemInMgt: Semaphore Management initialized by AlAttachShm_Doublestack.
CCMS: SemInit: Semaphore 38 initialized by AlAttachShm_Doublestack.
CCMS: start to initalize 3.X shared alert area (first segment).
上面的好些东西就说明是与内存、信号等相关的
我也编辑了/etc/system中的一些参数,如下:
set zfs:zfs_arc_max = 2147483648
set shmsys:shminfo_shmmax = 38654705664
set semsys:seminfo_semmni = 1000
set semsys:seminfo_semmns = 50000
set pg_contig_disable = 1
具体的错误,大家可以通过/usr/sap/BIP/DVEBMGS01/work/dev_disp及dev_w0来查看报错,然后具体处理
1.5编辑hosts
MYRESTBI:orabip> cat /etc/hosts
#
# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
# Internet host table
#
::1 localhost
127.0.0.1 localhost loghost
10.10.1.133 MYRESTBI
通过以上步骤后,操作系统方面的准备已经就绪,可以进行恢复了
二、sap软件、数据库软件的恢复
1、sap软件、数据库软件物理恢复
打开nbu,通过调用备份进行恢复
export Fri Apr 18 11:45:56 CST 2014
oracle Fri Apr 18 11:45:55 CST 2014
sapmnt Fri Apr 18 11:45:53 CST 2014
usr Fri Apr 18 11:45:54 CST 2014
可以看到所要备份的目录,选择目录进行还原,具体过程就不在多说。如果通过tar包的方式,也是没问题的,目的就把源机目录还原到目标端去
2、恢复还原数据库
2.1对还原后的数据库安装软件进行处理
orabip@MYRESTBI:~/11203/rdbms/lib$ relink all
writing relink log to: /oracle/BIP/112_64/install/relink.log
orabip@MYRESTBI:~/11203/rdbms/lib$ relink all
writing relink log to: /oracle/BIP/112_64/install/relink.log
orabip@MYRESTBI:~/11203/rdbms/lib$ relink all
writing relink log to: /oracle/BIP/112_64/install/relink.log
orabip@MYRESTBI:~/11203/rdbms/lib$ cd $ORACLE_HOME
orabip@MYRESTBI:~/112_64$ cat oraInst.loc
inventory_loc=/oracle/oraInventory
inst_group=dba
orabip@MYRESTBI:~/112_64$ cat oraInst.loc
inventory_loc=/oracle/oraInventory
inst_group=dba
orabip@MYRESTBI:~/112_64$ cat oraInst.loc
inventory_loc=/oracle/oraInventory
inst_group=dba
orabip@MYRESTBI:~/112_64/clone/config$ cd /oracle/BIP/112_64/clone/config
orabip@MYRESTBI:~/112_64/clone/config$ vi cs.properties
# Copyright (c) 2005, Oracle. All rights reserved.
# clone command line
clone_command_line= -silent -noConfig -nowait -invPtrLoc
orabip@MYRESTBI:~/112_64/clone/config$ vi cs.properties
# Copyright (c) 2005, Oracle. All rights reserved.
# clone command line
clone_command_line= -silent -noConfig -nowait -invPtrLoc
orabip@MYRESTBI:~/112_64/clone/config$ vi cs.properties
# Copyright (c) 2005, Oracle. All rights reserved.
# clone command line
clone_command_line= -silent -noConfig -nowait -invPtrLoc
orabip@MYRESTBI:~/112_64/clone/bin$ ./clone.pl \
> ORACLE_HOME="/oracle/BIP/11203"
./runInstaller -clone -waitForCompletion "ORACLE_HOME=/oracle/BIP/112_64" -defaultHomeName -silent -noConfig -nowait -invPtrLoc
Starting Oracle Universal Installer...
Checking swap space: must be greater than 500 MB. Actual 39290 MB Passed
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2014-01-16_10-18-36AM. Please wait ...Oracle Universal Installer, Version 11.2.0.3.0 Production
Copyright (C) 1999, 2011, Oracle. All rights reserved.
You can find the log of this install session at:
/oracle/oraInventory/logs/cloneActions2014-01-16_10-18-36AM.log
OUI-10197:Unable to create a new Oracle Home at /oracle/BIP/112_64. Oracle Home already exists at this location. Select another location.
SEVERE:OUI-10197:Unable to create a new Oracle Home at /oracle/BIP/112_64. Oracle Home already exists at this location. Select another location.
root@MYRESTBI:~# cd /oracle/BIP/112_64
root@MYRESTBI:/oracle/BIP/112_64# ./root.sh
Performing root user operation for Oracle 11g
The following environment variables are set as:
ORACLE_OWNER= orabip
ORACLE_HOME= /oracle/BIP/11203
Enter the full pathname of the local bin directory: [/usr/local/bin]:
The contents of "dbhome" have not changed. No need to overwrite.
The contents of "oraenv" have not changed. No need to overwrite.
The contents of "coraenv" have not changed. No need to overwrite.
Entries will be added to the /var/opt/oracle/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root script.
Now product-specific root actions will be performed.
Finished product-specific root actions.
orabip@MYRESTBI:/usr/openv/netbackup/bin$ ./oracle_link
Thursday, January 16, 2014 10:23:27 AM CST
All Oracle instances should be shutdown before running this script.
Please log into the Unix system as the Oracle owner for running this script
Do you want to continue? (y/n) [n] y
LIBOBK path: /usr/openv/netbackup/bin
ORACLE_HOME: /oracle/BIP/112_64
Oracle version: 11.2.0.3.0
Platform type: sparc
Linking LIBOBK:
Moving 64-bit libobk.so to libobk.so.back
ln -s /usr/openv/netbackup/bin/libobk.so64.1 /oracle/BIP/112_64/lib/libobk.so
Done
Please check the trace file located in /tmp/make_trace.4612
to make sure the linking process was successful.
通过以上处理步骤,数据库软件基本上没什么问题了。
2.2恢复还原数据库
--创建数据目录,这个与原文件相同即可
orabip@MYRESTBI:/usr/openv/netbackup/bin$ ./oracle_link
Thursday, January 16, 2014 10:23:27 AM CST
All Oracle instances should be shutdown before running this script.
Please log into the Unix system as the Oracle owner for running this script
Do you want to continue? (y/n) [n] y
LIBOBK path: /usr/openv/netbackup/bin
ORACLE_HOME: /oracle/BIP/112_64
Oracle version: 11.2.0.3.0
Platform type: sparc
Linking LIBOBK:
Moving 64-bit libobk.so to libobk.so.back
ln -s /usr/openv/netbackup/bin/libobk.so64.1 /oracle/BIP/112_64/lib/libobk.so
Done
Please check the trace file located in /tmp/make_trace.4612
to make sure the linking process was successful.
通过以上处理步骤,数据库软件基本上没什么问题了。
2.2恢复还原数据库
--创建数据目录,这个与原文件相同即可
orabip@MYRESTBI:/usr/openv/netbackup/bin$ ./oracle_link
Thursday, January 16, 2014 10:23:27 AM CST
All Oracle instances should be shutdown before running this script.
Please log into the Unix system as the Oracle owner for running this script
Do you want to continue? (y/n) [n] y
LIBOBK path: /usr/openv/netbackup/bin
ORACLE_HOME: /oracle/BIP/112_64
Oracle version: 11.2.0.3.0
Platform type: sparc
Linking LIBOBK:
Moving 64-bit libobk.so to libobk.so.back
ln -s /usr/openv/netbackup/bin/libobk.so64.1 /oracle/BIP/112_64/lib/libobk.so
Done
Please check the trace file located in /tmp/make_trace.4612
to make sure the linking process was successful.
通过以上处理步骤,数据库软件基本上没什么问题了。
2.2恢复还原数据库
--创建数据目录,这个与原文件相同即可
orabip@MYRESTBI:~$ mkdir origlogA
orabip@MYRESTBI:~$ mkdir origlogB
orabip@MYRESTBI:~$ mkdir origlogB
orabip@MYRESTBI:~$ mkdir origlogB
orabip@MYRESTBI:~$ mkdir mirrlogA
orabip@MYRESTBI:~$ mkdir mirrlogB
orabip@MYRESTBI:~$ mkdir mirrlogB
orabip@MYRESTBI:~$ mkdir mirrlogB
orabip@MYRESTBI:~$ mkdir -p /oracle/BIP/origlogA/cntrl
orabip@MYRESTBI:~$ mkdir -p /oracle/BIP/origlogB/cntrl
orabip@MYRESTBI:~$ mkdir -p /oracle/BIP/origlogB/cntrl
orabip@MYRESTBI:~$ mkdir -p /oracle/BIP/origlogB/cntrl
orabip@MYRESTBI:~$ mkdir -p /oracle/BIP/sapdata1/cntrl
orabip@MYRESTBI:~$ mkdir -p /oracle/BIP/oraarch/BIParch
orabip@MYRESTBI:~$ mkdir -p /oracle/BIP/oraarch/BIParch
orabip@MYRESTBI:~$ mkdir -p /oracle/BIP/oraarch/BIParch
orabip@MYRESTBI:~$ mkdir -p /oracle/BIP/sapdata1/system_1
orabip@MYRESTBI:~$ mkdir -p /oracle/BIP/sapdata1/sysaux_1
orabip@MYRESTBI:~$ mkdir -p /oracle/BIP/sapdata1/sysaux_1
orabip@MYRESTBI:~$ mkdir -p /oracle/BIP/sapdata1/sysaux_1
orabip@MYRESTBI:~$ mkdir -p /oracle/BIP/sapdata1/undo_1
orabip@MYRESTBI:~$ mkdir -p /oracle/BIP/sapdata2/sr3_1
orabip@MYRESTBI:~$ mkdir -p /oracle/BIP/sapdata2/sr3_1
orabip@MYRESTBI:~$ mkdir -p /oracle/BIP/sapdata2/sr3_1
orabip@MYRESTBI:~$ mkdir -p /oracle/BIP/sapdata2/sr3_2
orabip@MYRESTBI:~$ mkdir -p /oracle/BIP/sapdata2/sr3_3
orabip@MYRESTBI:~$ mkdir -p /oracle/BIP/sapdata2/sr3_3
orabip@MYRESTBI:~$ mkdir -p /oracle/BIP/sapdata2/sr3_3
orabip@MYRESTBI:~$ mkdir -p /oracle/BIP/sapdata2/sr3_4
orabip@MYRESTBI:~$ mkdir -p /oracle/BIP/sapdata2/sr3_5
orabip@MYRESTBI:~$ mkdir -p /oracle/BIP/sapdata2/sr3_5
orabip@MYRESTBI:~$ mkdir -p /oracle/BIP/sapdata2/sr3_5
orabip@MYRESTBI:~$ mkdir -p /oracle/BIP/sapdata2/sr3_6
orabip@MYRESTBI:~$ mkdir -p /oracle/BIP/sapdata2/sr3_7
orabip@MYRESTBI:~$ mkdir -p /oracle/BIP/sapdata2/sr3_7
orabip@MYRESTBI:~$ mkdir -p /oracle/BIP/sapdata2/sr3_7
orabip@MYRESTBI:~$ mkdir -p /oracle/BIP/sapdata2/sr3_8
orabip@MYRESTBI:~$ mkdir -p /oracle/BIP/sapdata2/sr3_9
orabip@MYRESTBI:~$ mkdir -p /oracle/BIP/sapdata2/sr3_9
orabip@MYRESTBI:~$ mkdir -p /oracle/BIP/sapdata2/sr3_9
orabip@MYRESTBI:~$ mkdir -p /oracle/BIP/sapdata3/sr3730_1
orabip@MYRESTBI:~$ mkdir -p /oracle/BIP/sapdata3/sr3730_2
orabip@MYRESTBI:~$ mkdir -p /oracle/BIP/sapdata3/sr3730_2
orabip@MYRESTBI:~$ mkdir -p /oracle/BIP/sapdata3/sr3730_2
orabip@MYRESTBI:~$ mkdir -p /oracle/BIP/sapdata3/sr3730_3
orabip@MYRESTBI:~$ mkdir -p /oracle/BIP/sapdata3/sr3730_4
orabip@MYRESTBI:~$ mkdir -p /oracle/BIP/sapdata3/sr3730_4
orabip@MYRESTBI:~$ mkdir -p /oracle/BIP/sapdata3/sr3730_4
orabip@MYRESTBI:~$ mkdir -p /oracle/BIP/sapdata3/sr3730_5
orabip@MYRESTBI:~$ mkdir -p /oracle/BIP/sapdata3/sr3730_6
orabip@MYRESTBI:~$ mkdir -p /oracle/BIP/sapdata3/sr3730_6
orabip@MYRESTBI:~$ mkdir -p /oracle/BIP/sapdata3/sr3730_6
orabip@MYRESTBI:~$ mkdir -p /oracle/BIP/sapdata4/sr3usr_1
orabip@MYRESTBI:~$ mkdir -p /oracle/BIP/sapdata4/sr3730x_1
orabip@MYRESTBI:~$ mkdir -p /oracle/BIP/sapdata4/sr3730x_1
orabip@MYRESTBI:~$ mkdir -p /oracle/BIP/sapdata4/sr3730x_1
orabip@MYRESTBI:~$ mkdir -p /oracle/BIP/sapdata4/sr3730x_2
orabip@MYRESTBI:~$ mkdir -p /oracle/BIP/sapdata4/sr3730x_3
orabip@MYRESTBI:~$ mkdir -p /oracle/BIP/sapdata4/sr3730x_3
orabip@MYRESTBI:~$ mkdir -p /oracle/BIP/sapdata4/sr3730x_3
orabip@MYRESTBI:~$ mkdir -p /oracle/BIP/sapdata4/sr3730x_4
orabip@MYRESTBI:~$ mkdir -p /oracle/BIP/sapdata4/sr3730x_5
orabip@MYRESTBI:~$ mkdir -p /oracle/BIP/sapdata4/sr3730x_5
orabip@MYRESTBI:~$ mkdir -p /oracle/BIP/sapdata4/sr3730x_5
orabip@MYRESTBI:~$ mkdir -p /oracle/BIP/sapdata4/sr3730x_6
orabip@MYRESTBI:~$ mkdir -p /oracle/BIP/sapdata4/sr3730x_7
orabip@MYRESTBI:~$ mkdir -p /oracle/BIP/sapdata4/sr3730x_7
orabip@MYRESTBI:~$ mkdir -p /oracle/BIP/sapdata4/sr3730x_7
orabip@MYRESTBI:~$ mkdir -p /oracle/BIP/sapdata4/sr3730x_8
orabip@MYRESTBI:~$ mkdir -p /oracle/BIP/sapdata4/sr3730x_9
orabip@MYRESTBI:~$ mkdir -p /oracle/BIP/sapdata4/sr3730x_9
orabip@MYRESTBI:~$ mkdir -p /oracle/BIP/sapdata4/sr3730x_9
orabip@MYRESTBI:~$ mkdir -p /oracle/BIP/sapdata4/sr3730x_10
orabip@MYRESTBI:~$ mkdir -p /oracle/BIP/sapdata4/sr3730x_11
orabip@MYRESTBI:~$ mkdir -p /oracle/BIP/sapdata4/sr3730x_11
orabip@MYRESTBI:~$ mkdir -p /oracle/BIP/sapdata4/sr3730x_11
orabip@MYRESTBI:~$ mkdir -p /oracle/BIP/sapdata4/sr3730x_12
orabip@MYRESTBI:~$ mkdir -p /oracle/BIP/sapdata4/sr3730x_13
orabip@MYRESTBI:~$ mkdir -p /oracle/BIP/sapdata4/sr3730x_13
orabip@MYRESTBI:~$ mkdir -p /oracle/BIP/sapdata4/sr3730x_13
orabip@MYRESTBI:~$ mkdir -p /oracle/BIP/sapdata1/system_2
orabip@MYRESTBI:~$ mkdir -p /oracle/BIP/sapdata4/sr3730x_14
orabip@MYRESTBI:~$ mkdir -p /oracle/BIP/sapdata4/sr3730x_14
orabip@MYRESTBI:~$ mkdir -p /oracle/BIP/sapdata4/sr3730x_14
orabip@MYRESTBI:~$ mkdir -p /oracle/BIP/sapdata1/sysaux_2
orabip@MYRESTBI:~$ mkdir -p /oracle/BIP/sapdata4/sr3730x_15
--编辑参数文件
orabip@MYRESTBI:~$ mkdir -p /oracle/BIP/sapdata4/sr3730x_15
--编辑参数文件
orabip@MYRESTBI:~$ mkdir -p /oracle/BIP/sapdata4/sr3730x_15
--编辑参数文件
orabip@MYRESTBI:~$ vi BIPfile.ora
注意,以下的编辑,根据需要进行修改
BIP.__oracle_base='/oracle'#ORACLE_BASE set from environment
*._B_TREE_BITMAP_PLANS=FALSE
*._IN_MEMORY_UNDO=FALSE
*._INDEX_JOIN_ENABLED=FALSE
*._OPTIM_PEEK_USER_BINDS=FALSE
*._OPTIMIZER_MJC_ENABLED=FALSE
*._SORT_ELIMINATION_COST_RATIO=10
*._TABLE_LOOKUP_PREFETCH_SIZE=0
*.audit_file_dest='/oracle/BIP/saptrace/audit'
*.compatible='11.2.0'
*.control_file_record_keep_time=30
*.control_files='/oracle/BIP/origlogA/cntrlBIP.dbf','/oracle/BIP/origlogB/cntrlBIP.dbf'
*.db_block_size=8192
*.db_cache_size=9277129359
*.db_name='BIP'
*.db_recovery_file_dest='/oracle/BIP/oraflash'
*.db_recovery_file_dest_size=30000M
*.diagnostic_dest='/oracle/BIP/saptrace'
*.FILESYSTEMIO_OPTIONS='setall'
*.log_archive_dest_1='LOCATION=/oracle/BIP/oraarch/BIParch'
*.log_archive_format='%t_%s_%r.dbf'
*.log_checkpoints_to_alert=true
*.max_dump_file_size='20000'
*.open_cursors=2000
*.parallel_execution_message_size=16384
*.parallel_threads_per_cpu=1
*.pga_aggregate_target=12369505812
*.processes=750
*.query_rewrite_enabled='false'
*.recyclebin='off'
*.remote_login_passwordfile='exclusive'
*.remote_os_authent=true
*.replication_dependency_tracking=false
*.sessions=1500
*.shared_pool_size=9277129359
*.star_transformation_enabled='true'
*.undo_tablespace='PSAPUNDO'
--启动数据库到nomount状态
SQL> startup pfile='/oracle/BIP/orapfile.ora';
启动后,就可以通过rman进入恢复界面
--检查nbu里面的恢复文件
hdnbu1:/usr/openv/netbackup/db # mkdir altnames
hdnbu1:/usr/openv/netbackup/db # cd altnames/
hdnbu1:/usr/openv/netbackup/db/altnames # touch No.Restrictions
注意,如果在nbu上面首次执行恢复操作的话,以上三步不能少。
以下显示的是要恢复的控制文件,我们选择其一进行恢复
mynbu2:~ # bplist -C tarbidb -t 4 -R -b -l / | more
-rw-rw---- orabip dba 26476544 Jan 16 09:11 /c-749400663-20140116-07
-rw-rw---- orabip dba 26476544 Jan 16 09:11 /cntrl_4870_1_836989680
-rw-rw---- orabip dba 26476544 Jan 16 09:10 /c-749400663-20140116-06
-rw-rw---- orabip dba 32243712 Jan 16 09:00 /al_4868_1_836989017
-rw-rw---- orabip dba 26476544 Jan 16 07:17 /c-749400663-20140116-05
-rw-rw---- orabip dba 26476544 Jan 16 07:14 /cntrl_4866_1_836982673
-rw-rw---- orabip dba 26476544 Jan 16 07:12 /c-749400663-20140116-04
--恢复数据库控制文件
orabip@MYRESTBI:/etc$ cd /oracle/BIP
orabip@MYRESTBI:/etc$ cd /oracle/BIP
orabip@MYRESTBI:/etc$ cd /oracle/BIP
orabip@MYRESTBI:~$ export ORACLE_SID=BIP
orabip@MYRESTBI:~$ rman target /
Recovery Manager: Release 11.2.0.3.0 - Production on Thu Jan 16 11:06:31 2014
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
connected to target database (not started)
RMAN> startup nomount pfile='/oracle/BIP/BIPfile.ora';
Oracle instance started
Total System Global Area 19113713664 bytes
Fixed Size 2167280 bytes
Variable Size 9730788880 bytes
Database Buffers 9328132096 bytes
Redo Buffers 52625408 bytes
RMAN> run
{
allocate channel c1 type 'sbt_tape';
send 'NB_ORA_CLIENT=HDBIOPDB';
restore controlfile from '/cntrl_4243_1_845075914';
release channel c1;
}
using target database control file instead of recovery catalog
allocated channel: c1
channel c1: SID=1324 device type=SBT_TAPE
channel c1: Veritas NetBackup for Oracle - Release 7.5 (2012050823)
sent command to channel: c1
Starting restore at 16-JAN-14
channel c1: restoring control file
channel c1: restore complete, elapsed time: 00:02:05
output file name=/oracle/BIP/origlogA/cntrlBIP.dbf
output file name=/oracle/BIP/origlogB/cntrlBIP.dbf
Finished restore at 16-JAN-14
released channel: c1
--恢复数据库文件
orabip@MYRESTBI:~$ rman target /
Recovery Manager: Release 11.2.0.3.0 - Production on Thu Jan 16 11:06:31 2014
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
connected to target database (not started)
RMAN> startup nomount pfile='/oracle/BIP/BIPfile.ora';
Oracle instance started
Total System Global Area 19113713664 bytes
Fixed Size 2167280 bytes
Variable Size 9730788880 bytes
Database Buffers 9328132096 bytes
Redo Buffers 52625408 bytes
RMAN> run
{
allocate channel c1 type 'sbt_tape';
send 'NB_ORA_CLIENT=HDBIOPDB';
restore controlfile from '/cntrl_4243_1_845075914';
release channel c1;
}
using target database control file instead of recovery catalog
allocated channel: c1
channel c1: SID=1324 device type=SBT_TAPE
channel c1: Veritas NetBackup for Oracle - Release 7.5 (2012050823)
sent command to channel: c1
Starting restore at 16-JAN-14
channel c1: restoring control file
channel c1: restore complete, elapsed time: 00:02:05
output file name=/oracle/BIP/origlogA/cntrlBIP.dbf
output file name=/oracle/BIP/origlogB/cntrlBIP.dbf
Finished restore at 16-JAN-14
released channel: c1
--恢复数据库文件
orabip@MYRESTBI:~$ rman target /
Recovery Manager: Release 11.2.0.3.0 - Production on Thu Jan 16 11:06:31 2014
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
connected to target database (not started)
RMAN> startup nomount pfile='/oracle/BIP/BIPfile.ora';
Oracle instance started
Total System Global Area 19113713664 bytes
Fixed Size 2167280 bytes
Variable Size 9730788880 bytes
Database Buffers 9328132096 bytes
Redo Buffers 52625408 bytes
RMAN> run
{
allocate channel c1 type 'sbt_tape';
send 'NB_ORA_CLIENT=HDBIOPDB';
restore controlfile from '/cntrl_4243_1_845075914';
release channel c1;
}
using target database control file instead of recovery catalog
allocated channel: c1
channel c1: SID=1324 device type=SBT_TAPE
channel c1: Veritas NetBackup for Oracle - Release 7.5 (2012050823)
sent command to channel: c1
Starting restore at 16-JAN-14
channel c1: restoring control file
channel c1: restore complete, elapsed time: 00:02:05
output file name=/oracle/BIP/origlogA/cntrlBIP.dbf
output file name=/oracle/BIP/origlogB/cntrlBIP.dbf
Finished restore at 16-JAN-14
released channel: c1
--恢复数据库文件
orabip@MYRESTBI:~$ sqlplus "/as sysdba"
SQL*Plus: Release 11.2.0.3.0 Production on Thu Jan 16 11:24:26 2014
Copyright (c) 1982, 2011, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> alter database mount;
Database altered.
oraprd@MYRESTBI:~$ vi BIPrestore.sh
export ORACLE_SID=BIP
rman target / < run {
ALLOCATE CHANNEL ch00 TYPE 'SBT_TAPE';
send 'NB_ORA_CLIENT=tarbidb';
Restore database;
Switch datafile all;
}
这个需要的时间比较长,可以做些其它的准备
--恢复归档日志
SQL> select max(SEQUENCE#),min(SEQUENCE#) from v$archived_log where COMPLETION_TIME >= to_date('20140416 17:00:01','yyyymmdd hh24:mi:ss');
MAX(SEQUENCE#) MIN(SEQUENCE#)
-------------- --------------
5611 5331
oraprd@MYRESTBI:~$ vi BIPrestore.sh
export ORACLE_SID=BIP
rman target / < run {
ALLOCATE CHANNEL ch00 TYPE 'SBT_TAPE';
send 'NB_ORA_CLIENT=tarbidb';
Restore database;
Switch datafile all;
}
这个需要的时间比较长,可以做些其它的准备
--恢复归档日志
SQL> select max(SEQUENCE#),min(SEQUENCE#) from v$archived_log where COMPLETION_TIME >= to_date('20140416 17:00:01','yyyymmdd hh24:mi:ss');
MAX(SEQUENCE#) MIN(SEQUENCE#)
-------------- --------------
5611 5331
oraprd@MYRESTBI:~$ vi BIPrestore.sh
export ORACLE_SID=BIP
rman target / < run {
ALLOCATE CHANNEL ch00 TYPE 'SBT_TAPE';
send 'NB_ORA_CLIENT=tarbidb';
Restore database;
Switch datafile all;
}
这个需要的时间比较长,可以做些其它的准备
--恢复归档日志
SQL> select max(SEQUENCE#),min(SEQUENCE#) from v$archived_log where COMPLETION_TIME >= to_date('20140416 17:00:01','yyyymmdd hh24:mi:ss');
MAX(SEQUENCE#) MIN(SEQUENCE#)
-------------- --------------
5611 5331
orabip@MYRESTBI:~$ rman target /
Recovery Manager: Release 11.2.0.3.0 - Production on Thu Jan 16 11:57:27 2014
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
connected to target database: BIP (DBID=749400663, not open)
run
{
set archivelog destination to '/oracle/BIP/oraarch';
ALLOCATE CHANNEL ch00 TYPE 'SBT_TAPE';
send 'NB_ORA_CLIENT=tarbidb';
restore archivelog sequence between 2024 and 2027;
RELEASE CHANNEL ch00;
}
--还原数据库
recover database using backup controlfile until cancel;
第一次选择auto,然后会自动运用归档日志
SQL> recover database using backup controlfile until cancel;
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
ORA-00289: suggestion : /oracle/BIP/oraarch/BIParch1_5608_825957847.dbf
ORA-00280: change 47293818 for thread 1 is in sequence #5608
Specify log: {=suggested | filename | AUTO | CANCEL}
auto
ORA-00289: suggestion : /oracle/BIP/oraarch/BIParch1_5612_825957847.dbf
ORA-00280: change 47308405 for thread 1 is in sequence #5612
=suggested | filename | AUTO | CANCEL}
cancel
Media recovery cancelled.
="" resetlogs; --打开数据库
SQL> alter database open resetlogs;
create temporary tablespace saptemp tempfile '/oracle/BIP/sapdata2/saptemp01.dbf' size 8192m;
="" alter="" saptemp;
root@MYRESTBI:/sapmnt# chown -R bipadm:sapsys *
root@MYRESTBI:/sapmnt/BIP/exe# chown -R orabip:sapsys brarchive
root@MYRESTBI:/sapmnt/BIP/exe# chown -R orabip:sapsys brbackup
root@MYRESTBI:/sapmnt/BIP/exe# chown -R orabip:sapsys brconnect
3.2修改系统用户bipadm用户的文件
--修改系统用户文件
具体修改办法
通过编辑进入后,输入冒号(:)
然后键入 g/tarbidb/s//MYRESTBI/g
/export/home/bipadm
这个是根据建用户里的设置做的
.dbenv_tarbidb.1.csh
.dbenv_tarbidb.1.sh
.dbenv.sh
.dbenv.csh
这些文件里面涉及到tarbidb的部份,分部修改为MYRESTBI,我是把文件也进行了修改
如下:
MYRESTBI:bipadm> mv .dbenv_tarbidb.1.csh .dbenv_MYRESTBI.1.csh
其它的也这样进行修改。
--修改ERS10里的参数
MYRESTBI:bipadm> cd /usr/sap/BIP/ERS10/profile
MYRESTBI:bipadm> ls -lrt
total 29
-rw-r--r-- 1 bipadm sapsys 2193 Apr 18 16:10 DEFAULT.PFL
-rw-r--r-- 1 bipadm sapsys 48 Apr 18 16:44 BIP_ERS10_tarbidb.lst
-rw-r--r-- 1 bipadm sapsys 2258 Apr 18 16:48 BIP_ERS10_tarbidb
-rw-r--r-- 1 bipadm sapsys 1216 Apr 21 11:41 dev_icm.old
-rw-r--r-- 1 bipadm sapsys 1192 Apr 21 11:42 dev_icm_sec
-rw-r--r-- 1 bipadm sapsys 1218 Apr 21 11:42 dev_icm
-rw-r--r-- 1 bipadm sapsys 876 Apr 21 14:09 dev_sapstart
主要对最上面的三个文件进行修改,把文件里的内容hostname进行替换,也就是把tarbidb替换成MYRESTBI
然后把文件名进行更名如BIP_ERS10_tarbidb.lst更换成BIP_ERS10_MYRESTBI.lst
--修改SYS里面的参数文件
MYRESTBI:bipadm> cd /usr/sap/BIP/SYS/profile
drwxr-xr-x 2 bipadm sapsys 4 Apr 18 15:23 oracle
-rw-r--r-- 1 bipadm sapsys 2193 Apr 18 16:10 DEFAULT.PFL
-rw-r--r-- 1 bipadm sapsys 160 Apr 18 16:21 dev_sapstart
-rw-r--r-- 1 bipadm sapsys 92 Apr 18 16:21 sapstart.log
-rw-r--r-- 1 bipadm sapsys 71 Apr 18 16:21 INSTSTAT
-rw-r--r-- 1 bipadm sapsys 48 Apr 18 16:44 BIP_ERS10_tarbidb.lst
-rw-r--r-- 1 bipadm sapsys 2064 Apr 18 16:46 DEFAULT.1.PFL
-rw-r--r-- 1 bipadm sapsys 593 Apr 18 16:46 DEFAULT.2.PFL
-rw-r--r-- 1 bipadm sapsys 708 Apr 18 16:47 DEFAULT.3.PFL
-rw-r--r-- 1 bipadm sapsys 742 Apr 18 16:47 DEFAULT.4.PFL
-rw-r--r-- 1 bipadm sapsys 826 Apr 18 16:47 DEFAULT.5.PFL
-rw-r--r-- 1 bipadm sapsys 2258 Apr 18 16:48 BIP_ERS10_tarbidb
-rw-r--r-- 1 bipadm sapsys 12180 Apr 18 16:49 BIP_DVEBMGS01_tarbidb
-rw-r--r-- 1 bipadm sapsys 2506 Apr 18 16:50 BIP_ASCS00_tarbidb
-rw-r--r-- 1 bipadm sapsys 2438 Apr 18 16:50 BIP_ASCS00_tarbidb.1
-rw-r--r-- 1 bipadm sapsys 12468 Apr 18 16:51 BIP_DVEBMGS01_tarbidb.1
-rw-rw---- 1 bipadm sapsys 4254 Apr 18 16:51 BIP_DVEBMGS01_tarbidb.2
修改方法与上面类似,为了彻底,我对所的文件名及内容都进行了修改
--修改sap里面的tnsnames.ora
MYRESTBI:bipadm> cd /usr/sap/BIP/SYS/profile/oracle
-rw-r--r-- 1 bipadm sapsys 500 Nov 9 22:52 sqlnet.ora
-rw-r--r-- 1 bipadm sapsys 492 Apr 18 15:23 tnsnames.ora
将配置文件中的tarbidb替换成MYRESTBI
3.3修改daaadm用户相关文件
MYRESTBI:daaadm> cd /usr/sap/DAA/SYS/profile/
MYRESTBI:daaadm> ls -lrt
total 17
-rw-r--r-- 1 daaadm sapsys 449 Nov 10 06:50 DEFAULT.PFL
-rw-r--r-- 1 daaadm sapsys 1782 Apr 21 10:44 DAA_SMDA98_tarbidb
-rw-r--r-- 1 daaadm sapsys 1669 Apr 21 10:45 DAA_SMDA98_tarbidb.1
-rw-r--r-- 1 daaadm sapsys 1742 Apr 21 10:46 DAA_SMDA98_tarbidb.2
其修改方法同上面所述,完全一样,文件里的内容及文件名均进行替换
通过以上的修改,那么基本上我们sap软件的配置修改工作已经结束,也就是说,相当于我们安装好了sap软件,数据库也完成了
三、启动sap软件
检查数据库连接是否正常
MYRESTBI:bipadm> R3trans -d
This is R3trans version 6.24 (release 720 - 08.07.13 - 20:13:05 ).
unicode enabled version
R3trans finished (0000).
说明数据库已经正常
启动sap软件
MYRESTBI:bipadm> startsap
Checking BIP Database
Database is not available via R3trans
-------------------------------------------
Trying to start BIP database ...
Log file: /export/home/bipadm/startdb.log
BIP database started
Starting Startup Agent sapstartsrv
OK
Instance Service on host MYRESTBI started
-------------------------------------------
starting SAP Instance ERS10
Startup-Log is written to /export/home/bipadm/startsap_ERS10.log
-------------------------------------------
/usr/sap/BIP/ERS10/exe/sapcontrol -prot NI_HTTP -nr 10 -function Start
Instance on host MYRESTBI started
Starting Startup Agent sapstartsrv
OK
Instance Service on host MYRESTBI started
-------------------------------------------
starting SAP Instance ASCS00
Startup-Log is written to /export/home/bipadm/startsap_ASCS00.log
-------------------------------------------
/usr/sap/BIP/ASCS00/exe/sapcontrol -prot NI_HTTP -nr 00 -function Start
Instance on host MYRESTBI started
Starting Startup Agent sapstartsrv
OK
Instance Service on host MYRESTBI started
-------------------------------------------
starting SAP Instance DVEBMGS01
Startup-Log is written to /export/home/bipadm/startsap_DVEBMGS01.log
-------------------------------------------
/usr/sap/BIP/DVEBMGS01/exe/sapcontrol -prot NI_HTTP -nr 01 -function Start
Instance on host MYRESTBI started
然后通过gui登录恢复环境,图形界面出来了
通过ps -ef | grep -i sap ,一切正常!
四、问题处理与排查
问题1:
启动sap的时候,发现启动的数据库,也被关闭掉,后来排查是因为内存设置不合理所致
问题2.
开始的时候,始终无法启动BIP_DVEBMGS01,后来通过排查目录下面的
/usr/sap/BIP/DVEBMGS01/work dev_disp, dev_w0两个文件,找到问题把在,仍然是内存设置不合理。
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/29371470/viewspace-1147135/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/29371470/viewspace-1147135/