Tiptop管理员手册.doc
易拓管理员手册目录一)Linux基础概念2二)Linux基础操作21)登入Linux操作系统22)Linux基础指令8三)相关文件夹/文件介绍9Part2:Oracle部分10一、登入Oracle10二、启动Oracle10三、关闭Oracle11四、查看Oracle表空间使用情况11五、增加Oracle表空间12六、处理表锁13七、备份还原Oracle数据13Part3:GP部分15一、易拓系统架构说明15二、易拓目录结构说明16三、易拓用户说明17四、添加Tiptop ERP用户17五、新建ERP帐套19六、系统备份检查22七、Tiptop GP重要文件介绍24八、环境变量24九、系统慢问题25Part:1 OS部分一)Linux基础概念1)和Windows一样,Linux是一种操作系统,一样有文件、进程、磁盘分区各种概念。2)不同于Windows,Linux的维护是在命令行界面完成,因此需要掌握一些Linux维护指令。3)根据28定律,我们只要掌握20%的指令,就可以完成80%的维护操作了。4)现在开始万里长征第一步:登入Linux,以便进行对Linux的操作。二)Linux基础操作1)登入Linux操作系统1)推荐下载安装XShell最新版本登入OS,方便日后操作启动XShell à点击New 新建一个到AP操作系统的链接2)点击Connection选项,设定以下栏位的值:Name 连线标识,如:ERP-APHost AP的IP地址3)点击Authentiacation选项,设定以下栏位的值:User NamerootPasswordroot账户的密码,默认为tiptop4)点击Terminal选项,设定以下栏位的值:EncodingUnicode(UTF-8)5)点击OK,完成连线设置。6)双击连线即可登入Linux命令行方式7)下次登录时,只需要点击Open按钮,双击连线方式就可进入Linux进行操作了2)Linux基础指令进入Linux后,我们可以用Linux指令对Linux进行各种操作。1) 敲命令后,按回车即开始执行,不按回车不执行2) 多实践有助于快速掌握3) 这里只简单列出命令用法,百度上有更多命令的用法shutdown服务器关机rootTTP-2 # shutdown 慎重!reboot服务器重启rootTTP-2 # reboot 慎重!exit退出登录cd切换目录rootERP-AP # cd /u1 切换到/u1目录rootERP-AP u1# cd topprod 切换到/u1下面的topprod目录rootERP-AP topprod# cd . 切换到上级目录ls显示目录文件rootERP-AP u2# ls 显示当前目录文件oracle oraInventoryrootERP-AP u2# ls /u1/topprod 显示/u1/topprod目录文件42f per tiptop topcustsu切换用户rootERP-AP u2# su tiptop 切换到tiptop用户mkdir创建文件夹rootERP-AP u2# mkdir /tmp/xxxdir 在/tmp目录下创建一个xxxdir文件夹chmod改变文件权限rootERP-AP tmp# cd /tmprootERP-AP tmp# llrootERP-AP tmp# chmod 777 xxxdirchwon改变文件属主rootERP-AP tmp# chown tiptop.tiptop xxxdirdf查看磁盘空间使用情况rootTTP-2 # df -hFilesystem Size Used Avail Use% Mounted on/dev/sda1 9.7G 1.8G 7.4G 20% /tmpfs 1004M 388M 616M 39% /dev/shm/dev/sda3 132G 22G 103G 18% /u1/dev/sdb1 226G 117G 98G 55% /u2du查看文件夹大小rootTTP-2 # du -sh /u1/topprod 查看/u1/topprod文件夹大小2.8G/u1/topprod find查找文件rootTTP-2 # find /u1 -name aimr100.4gl 在/u1下查找名字为aimr100.4gl的文件/u1/oyd/tiptop/aim/4gl/aimr100.4glgrep筛选文本文件中的文字<topprod:/u1/topprod/tiptop> grep ds2 $FGLPROFILE 将$FGLPROFILE中有ds2字符串的行显示出来dbi.database.ds2.source = "topprod"dbi.database.ds2.username = "ds2"dbi.database.ds2.password = "ds2"dbi.database.ds2.schema = "ds2"dbi.database.ds2.ora.prefetch.rows = 1passwd修改用户密码rootTTP-2 # passwd oracle 修改Oracle用户的密码Changing password for user oracle.New password: 输入新密码BAD PASSWORD: it is based on a dictionary wordBAD PASSWORD: is too simpleRetype new password: 再次输入新密码确认passwd: all authentication tokens updated successfully.top类似于Windows的任务管理器,查看服务器CPU、内存、进程情况可参照:tar类似于Windows的WinRar打包压缩工具,用于打包或备份文件/文件夹可参照:三)相关文件夹/文件介绍/操作系统目录/u1ERP软件目录/u2数据库目录/u3备份目录.profileTiptop环境变量文件,请不要随意改动$FGLPROFILE文件数据库连接配置文件Part2:Oracle部分一、登入OraclerootTTP-2 # su - oracle <<切换为oracle用户</u2/oracle/product/11.2.0/dbhome_1> export ORACLE_SID=topprod <<设置要登陆的数据库的代号</u2/oracle/product/11.2.0/dbhome_1> sqlplus / as sysdba <<SQLPLUS以系统管理员登陆SQL*Plus: Release 11.2.0.2.0 Production on Thu Jan 5 13:30:14 2012Copyright (c) 1982, 2010, Oracle. All rights reserved.Connected to:Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit ProductionWith the Partitioning, OLAP, Data Mining and Real Application Testing optionsSQL> show user <<确认用户USER is "SYS"SQL> exit <<退出SQLPLUSDisconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit ProductionWith the Partitioning, OLAP, Data Mining and Real Application Testing options附注:操作需在DB主机上进行二、启动OraclerootTTP-2 # su - oracle <<切换为oracle用户</u1/usr/oracle> export ORACLE_SID=topprod <<设置要启动的数据库的代号</u1/usr/oracle> sqlplus / as sysdba <<SQLPLUS以系统管理员登陆SQL*Plus: Release 11.2.0.2.0 Production on Fri Jan 6 11:33:11 2012Copyright (c) 1982, 2010, Oracle. All rights reserved.Connected to an idle instance.SQL> startup; <<启动数据库ORACLE instance started.Total System Global Area 267227136 bytesFixed Size 2225632 bytesVariable Size 167774752 bytesDatabase Buffers 92274688 bytesRedo Buffers 4952064 bytesDatabase mounted.Database opened.SQL> exit <<启动完成后退出Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit ProductionWith the Partitioning, OLAP, Data Mining and Real Application Testing options附注:操作需在DB主机上进行三、关闭OraclerootTTP-2 # su - oracle <<切换为oracle用户</u1/usr/oracle> export ORACLE_SID=gp510</u1/usr/oracle> sqlplus / as sysdbaSQL*Plus: Release 11.2.0.2.0 Production on Fri Jan 6 11:31:11 2012Copyright (c) 1982, 2010, Oracle. All rights reserved.Connected to:Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit ProductionWith the Partitioning, OLAP, Data Mining and Real Application Testing optionsSQL> shutdown immediate; <<关闭数据库Database closed.Database dismounted.ORACLE instance shut down.SQL> exit <<完成关闭后退出Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit ProductionWith the Partitioning, OLAP, Data Mining and Real Application Testing options附注:操作需在DB主机上进行四、查看Oracle表空间使用情况rootTTP-2 # su tiptop <<在AP上以tiptop用户登陆<topprod:/u1/topprod/tiptop> sqlplus system/managertopprod <<以system用户登陆数据库SQL> q_tbsFREE; <<执行查看表空间使用情况的脚本TABLESPACE_NAME BYTES_USED BYTES_FREE LARGEST PERCENT_USED- - - - -SYSTEM 859832320 7143424 6291456 99.17SYSAUX 713031680 43581440 39911424 93.89DBS1 4613734400 354418688 126877696 92.32BLOBDBS1 314572800 49610752 49283072 84.23USERS 5242880 4194304 4194304 20RPTDBS1 2097152000 1941962752 1934229504 7.4UNDOTBS1 319815680 301727744 270532608 5.66TEMPTABS 2097152000 2063400960 1765212160 1.61TEMP02 524288000 523239424 523239424 .2SQL> exit <<退出SQLPLUSDisconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit ProductionWith the Partitioning, OLAP, Data Mining and Real Application Testing options附注:1)操作需在AP主机上进行2)当DBS1、RPTDBS1、TEMPTABS表空间使用率超过80%时,需及时增加相应表空间五、增加Oracle表空间<topprod:/u1/topprod/tiptop> sqlplus system/managertopprod SQL*Plus: Release 11.2.0.2.0 Production on Fri Jan 6 12:10:57 2012Copyright (c) 1982, 2010, Oracle. All rights reserved.Connected to:Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit ProductionWith the Partitioning, OLAP, Data Mining and Real Application Testing optionsSQL> select name from v$datafile order by name; <<查看数据文件情况NAME-/u2/oracle/oradata/topprod/blobdbs1.dbf/u2/oracle/oradata/topprod/dbs1-01.dbf/u2/oracle/oradata/topprod/dbs1-02.dbf/u2/oracle/oradata/topprod/dbs1-03.dbf/u2/oracle/oradata/topprod/dbs1-04.dbf/u2/oracle/oradata/topprod/dbs1-05.dbf <<dbs1表空间数据文件最大代号05/u2/oracle/oradata/topprod/rptdbs1-01.dbf/u2/oracle/oradata/topprod/sysaux01.dbf/u2/oracle/oradata/topprod/system01.dbf/u2/oracle/oradata/topprod/temp02.dbf/u2/oracle/oradata/topprod/temptabs.dbf/u2/oracle/oradata/topprod/undotbs01.dbf/u2/oracle/oradata/topprod/users01.dbf13 rows selected.SQL> alter tablespace dbs1 add datafile '/u2/oracle/oradata/topprod/dbs1-06.dbf' size 2000M;<<给dbs1表空间增加代号为06,大小为2000M的数据文件,使dbs1扩容2000MTablespace altered.SQL> q_tbsFREE; <<再观察表空间使用情况SQL>exit <<退出SQLPLUS六、处理表锁rootTTP-2 # su tiptop <<在AP上以tiptop用户登陆<topprod:/u1/topprod/tiptop> sqlplus system/managertopprod <<以system用户登陆数据库SQL> q_locktable;Locked Object Tiptop User Proc Terminal SID SERIAL# MACHINE- - - - - - -DS1.NMD_FILE tiptop 7208 29 41921 TTP-2DS1.NMD_FILE tiptop 13327 1155 54429 TTP-2SQL> alter system kill session '29,41921' immediate; <<杀掉造成锁的会话SQL> alter system kill session '1155,54429' immediate; <<杀掉造成锁的会话SQL>exit;附注:1)操作需在AP主机上进行七、备份还原Oracle数据1)备份ds1营运中心rootTTP-2 # su tiptop<topprod:/u1/usr/tiptop> exp ds1/ds1topprod file=/tmp/exp_ds1.dmp log=/tmp/exp_ds1.log2)备份ds1营运中心的ima_file表rootTTP-2 # su tiptop<topprod:/u1/usr/tiptop> exp ds1/ds1topprod file=/tmp/exp_ds1_ima_file.dmp tables=ima_file3) 还原ds1营运中心rootTTP-2 # su tiptop<topprod:/u1/topprod/tiptop> sqlplus system/managertopprod as sysdbaSQL> drop user ds1 cascade;SQL>create user ds1 identified by ds1 default tablespace dbs1 temporary tablespace temp;SQL>grant create session,create table to ds1;SQL>grant resource to ds1;SQL>grant create synonym to ds1;SQL>grant select on sys.v_$session to ds1;SQL>exit;<topprod:/u1/topprod/tiptop> imp ds1/ds1topprod file=/tmp/exp_ds1.dmp log=/tmp/imp_ds1.log4) 还原ds1营运中心的ima_filerootTTP-2 # su tiptop<topprod:/u1/topprod/tiptop> sqlplus ds1/ds1topprod <<1.登入ds1数据库SQL>create table ima_file_bak as select * from ima_file; <<2.备份ima_file到ima_file_bakSQL> truncate table ima_file; <<3.清空ima_file表数据SQL> exit; <<4.退出SQLPLUS<topprod:/u1/topprod/tiptop> imp ds1/ds1topprod file=/tmp/exp_ds1.dmp tables=ima_file ignore=y;<<5.导入ima_file数据5) 备份整个数据库<topprod:/u1/usr/tiptop> exp system/managertopprod file=/tmp/exp_all.dmp full=y6) 还原整个数据库1. 重建整个topprod实例2. 导入之前的exp_all.dmp备份<topprod:/u1/usr/tiptop>imp system/managertopprod file=/tmp/exp_all.dmp ignore=yPart3:GP部分一、易拓系统架构说明TiptopGeneroOracleLinux1) Tiptop GP安装于Linux或AIX操作系统上2) Tiptop GP使用Oracle数据库3) Tiptop GP是在Genero平台下开发的ERP系统二、易拓目录结构说明/根分区/u1程序区usrtiptoptoptestoracletopguigenero toptest测试区tiptop标准区aap,aim,axm,apm.topcust客制区cap,cbg,cim,cxm.topprod正式区tiptop标准区topcust客制区/u2数据库区oracle数据库程序oradb数据库文件/u3备份区backup每日备份/ 根分区存放OS操作系统文件/u1/usr 为各用户的家目录,存放.profile用户配置文件/u1/genero存放genero platform,是tiptop erp的开发及运行平台/u1/topprodTiptop ERP正式区程序/u1/toptestTiptop ERP测试区程序,供开发及测试用/u2/oracleOracle软件的安装目录/u2/oradb存放ERP数据的Oracle数据库文件/u3/backup存放Tiptop ERP程序及数据库的备份三、易拓用户说明tiptopGP正式区管理员用户toptestGP测试区管理员用户topguiGP测试账户,其.profile供ERP普通用户使用四、添加Tiptop ERP用户添加ERP用户分为两部分操作:1)后台Linux系统添加ERP账户2)前台p_zx作业中添加ERP账户注:两者名称必须一致包括大小写。以下以添加用户A001为例1)后台Linux系统添加A001账户<topprod:/u1/gp525/tiptop> su - <<切换到root账户Password: rootTTP-3 # useradd -g tiptop -s /bin/ksh -d /u1/usr/topgui A001 <<添加A001用户useradd: warning: the home directory already exists.Not copying any file from skel directory into it.rootTTP-3 # passwd A001 <<设置A001用户密码Changing password for user A001.New password: <<输入密码 注ps:密码字符不会显示BAD PASSWORD: it does not contain enough DIFFERENT charactersBAD PASSWORD: is too simpleRetype new password: <<再次输入密码设置passwd: all authentication tokens updated successfully.rootTTP-3 # exitlogout<topprod:/u1/gp525/tiptop> udm7(红字部分为为所下指令,篮字为注释,黑字为屏幕提示)2)前台运行p_zx作业添加A001账户,并赋予正确的权限。五、新建ERP帐套1)运行aooi930作业添加法人资料,这里添加编号为X1的法人2)执行aooi931集团架构资料维护作业,点击录入,并完善各项资料,点确定3)点击建立Schema,转到如下页面4) 点击全选,然后选修改密码,默认密码如下Ds密码dsSystem密码managerSys密码sys5) 确定后返回如下画面,点建立Schema开始创建DB由于创建DB需复制大量数据表,所以执行时间较长,约20分钟左右,请您耐心等待。六、系统备份检查1)备份时间及备份脚本Tiptop或root用户执行指令:crontab -lcrontab指令介绍:可以分析、理解、修改备份脚本里面内容<topprod:/u1/topprod/tiptop> crontab -l00 23 * * * /u3/backup/tools/backup.sh2)备份目录备份目录通常位于/u3/backup或/backup或/u2/backup请确认备份时间是否为近期备份,如非近期备份,请查找原因<topprod:/u3/backup> lltotal 32drwxr-xr-x 2 tiptop tiptop 4096 Sep 23 23:56 Fridrwxr-xr-x 2 tiptop tiptop 4096 Sep 26 23:56 Mon <<需确认备份时间是否为昨天或今天drwxr-xr-x 2 tiptop tiptop 4096 Sep 24 23:56 Satdrwxr-xr-x 2 tiptop tiptop 4096 Sep 25 23:56 Sundrwxr-xr-x 3 tiptop tiptop 4096 Sep 22 23:56 Thudrwxr-xr-x 2 tiptop tiptop 4096 Sep 27 14:11 toolsdrwxr-xr-x 2 tiptop tiptop 4096 Sep 20 23:55 Tuedrwxr-xr-x 2 tiptop tiptop 4096 Sep 21 23:55 Wed3)确认的备份正确性A)备份文件介绍exp_base_201109262300.dmp工厂数据备份文件exp_base_201109262300.log为备份日志genero.tgzgenero平台备份tiptop.tgztiptop备份B)检查备份文件正确性核对工厂数据备份,看是否有工厂没有备份出来,及文件事件是否为正确备份检查备份日志,看是否有备份报错确保dmp文件是可用的<topprod:/u3/backup> cd Mon/u3/backup/Mon<topprod:/u3/backup/Mon> lltotal 3395104-rw-r-r- 1 tiptop tiptop 1153974272 Sep 26 23:56 exp_all.dmp-rw-r-r- 1 tiptop tiptop 98672640 Sep 26 23:27 exp_base_201109262300.dmp-rw-r-r- 1 tiptop tiptop 187764 Sep 26 23:27 exp_base_201109262300.log-rw-r-r- 1 tiptop tiptop 153460736 Sep 26 23:05 exp_ds1_201109262300.dmp-rw-r-r- 1 tiptop tiptop 195411 Sep 26 23:05 exp_ds1_201109262300.log-rw-r-r- 1 tiptop tiptop 163905536 Sep 26 23:18 exp_ds_201109262300.dmp-rw-r-r- 1 tiptop tiptop 193760 Sep 26 23:18 exp_ds_201109262300.log-rw-r-r- 1 tiptop tiptop 540672 Sep 26 23:02 exp_ds21_201109262300.dmp-rw-r-r- 1 tiptop tiptop 1184 Sep 26 23:02 exp_ds21_201109262300.log-rw-r-r- 1 tiptop tiptop 66879488 Sep 26 23:07 exp_ds2_201109262300.dmp-rw-r-r- 1 tiptop tiptop 168380 Sep 26