Linux-oracle_tar包方式安装文档

13 篇文章 0 订阅
10 篇文章 0 订阅

1        引言

1.1   目的

   ·   编写本安装手册是为了规范项目实施人员在进行软件安装过程中的行为,确保系统上线后顺利运行。

   ·   本文面向项目实施组成员、维护人员;认证计费系统的管理人员。  
   ·   所需附件: 密码:rco2

1.2   项目背景

   ·   项目名称:BBOSS10.0项目

   ·   项目安装地点:

   ·   项目所安装的产品名称:BBOSS10.0

   ·   项目产品安装所需要的硬件环境:本处略

1.3   术语及缩略语定义

1.3.1     术语定义:

1.3.2     缩略语定义:

   

1.4   参考资料

1.4.1     文件

  ·  标书

  ·  批文

  ·  合同

  ·  方案建议书等。

1.4.2     资料

  

2        Oracle10g安装

2.1  安装配置

2.1.1     安装准备

安装linux服务器,假定主机名称为oracle。

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

如果有两台或两台以上的服务器,其主机名不能相同,否则连库有问题,切记。命名格式,推荐如下:

两台数据库:oracle1oracle2

两台认证服务器:radius1radius2

两台WEB服务器:WEB1WEB2

在《CentOS5.3图形安装手册》“安装步骤-->安装步骤-->配置网络接口”中同样有说明。

(如果操作系统已经安装好,则使用现场的服务器名称即可。)

2.1.2     配置主机名和ip

oracle不支持动态的ip地址,必须配置为静态IP,切换到root管理员。

su - root

vi  /etc/hosts

修改/etc/hosts文件即可。 (红色行内容为新添加部分,尽可能放在上面)

vi  /etc/hosts

----------------------------------------------------------------------------

# Do not remove the following line, or various programs

# that require network functionality will fail.

192.168.44.203          oracle localhost

127.0.0.1               oraclelocalhost.localdomain localhost

::1            localhost6.localdomain6 localhost6

----------------------------------------------------------------------------

#hostname  oracle

检查主机名是否变成了oracle

#hostname

运行以下命令,重启网络生效:

#servicenetwork restart

****************************************************

如果在安装系统时忘记配置主机名,则按如下步骤修改:

/etc/sysconfg/network中配置主机名。

HOSTNAME=新主机名

     主机名修改后,同时要改/etc/hosts的主机名。

然后主机生效命令:hostname新主机名 重启服务器生效。

之后命令:hostname,检查主机名是否已变。

****************************************************

2.1.3      修改内核参数(用root修改)

在/etc/sysctl.conf文件中加入下列行:

#kernel.shmmax =536870912

#kernel.shmmax= 2147483648

#kernel.shmall =2097152

kernel.shmmni =4096

kernel.sem = 25032000 100 128

fs.file-max =65536

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

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

普通人员按上述配置即可。

专家可计算参照配置:shmmax则有自己的计算方法:内存以G为单位,将其换算成Byte单位在乘以80%,例如;2G内存,换算公式为:2*1024*1024*1024*80%=1717986918

 

运行下列命令改变核心参数:

/sbin/sysctl -p

2.1.4      limits.conf配置(用root修改)

在/etc/security/limits.conf文件中加入下列行:

* soft nproc 2047

* hard nproc 16384

* soft nofile 1024

* hard nofile65536

2.1.5      login配置

在/etc/pam.d/login文件中加入下列行:

session required/lib/security/pam_limits.so

2.1.6      禁用securelinux

通过编辑/etc/selinux/config 文件禁用secure linux,确认其中的SELINUX标记如下:SELINUX=disabled

立即生效命令:setenforce 0

2.1.7      检查安装包(用root

检查下列包是否安装,若未安装则要先安装(安装操作系统是若按要求安装全部包则没有问题):

rpm -qa|grep compat|sort

需要包括如下安装包:

compat-libstdc++-33-3.2.3-47.3

compat-libgcc-296-2.96-132.7.2

compat-libcom_err-1.0-5 (可以没有这个包?)

compat-openldap-2.1.30-3

compat-db-4.1.25-9

java-1.4.2-gcj-compat-1.4.2.0-27jpp

compat-libstdc++-296-2.96-132.7.2

2.1.8      创建下列组和用户

(用root管理员)

groupadd oinstall

groupadd dba

useradd -m -goinstall -G dba oracle

passwd oracle

qazwsx

 

-------------------------------------------切换到oracle

su - oracle

id oracle

显示用户组,即OK。

uid=501(oracle) gid=501(oinstall) groups=501(oinstall),502(dba)

2.1.9      创建安装oracle的目录

       (用root管理员)

2.1.10  设置环境变量

切换到 oracle用户

su – oracle

ls –a

.bash_profile

       把下列行加在.bash_profile文件(注意文件名前面‘.’逗号)末尾。(直接拷贝)

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

#---------------------------

# set oracleenvironment

exportORACLE_OWNER=oracle

exportORACLE_BASE=/u01/app/oracle

export ORACLE_HOME=$ORACLE_BASE/product/10.2.0

export ORACLE_SID=orcl

exportPATH=$PATH:$HOME/bin:$ORACLE_HOME/bin

exportCLASSPATH=$CLASSPATH:$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib

exportLD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib:/usr/lib:$ORACLE_HOME/rdbms/lib

export NLS_LANG=.ZHS16CGB231280 

export LANG=zh_CN.GB18030

exportLANGUAGE=zh_CN.GB18030:zh_CN.GB2312:zh_CN

aliassql="sqlplus tsd/tsd2010psw@orcl"

exportDISPLAY=192.168.44.143:0.0

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

其中192.168.44.143改为你的PC机IP----就是你的笔记本,不是服务器,如果直接包tar包安装,不涉及图形安装,则不用管DISPLAY参数。不装oracle不需要关心。

 然后保存退出,执行下面命令,使用变量生效。

source .bash_profile

2.2  tar包安装

采集使用tar包的安装方式,类似绿色软件,即拷过来即可使用。这样会节省大量时间,因为安装、修改字符集、数据库升级、升级后续的处理需要大量的时间。当然tar包的安装方式,要做适当的配置,但是这个时间与完全安装比较可以忽略。安装步骤如下。

2.2.1      生成tar包

很简单,直接tar包oracle的全部目录即可。一般情况下,oracle的安装目录只有一个,只要把这个目录tar包即可。当然如果只有数据库程序,没有建数据库空间文件,则只tar.包数据库程序一个目录即可。安装后,空间、用户还可重建,与完全安装的oracle无异。

道理应该说明白了,以我司常用项目为例,打包命令如下:

只打包数据库程序:

tar cvfz app.tar.gz /u01/app

其中 /u01 为oracle程序安装目录。

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

前tar包文件有现成有,已经tar包。目录为:file://192.168.44.85\system_iso\Oracle10G

获取app.tar.gz 安装包即可。

2.2.2      安装过程

首先建/u01 目录

su - root

mkdir -p /u01/

chown -R oracle:dba /u01

上传app.tar.gz 包到/u01目录下

直接解压:

cd  /u01

tar xvfz app.tar.gz

2.2.3      参数配置

修改监听配置

vi $ORACLE_HOME/network/admin/listener.ora

(ADDRESS = (PROTOCOL = TCP)(HOST = ha01)(PORT= 1521))-

其中红色部分改为本机名称。(hostname查看)

修改连接配置

vi $ORACLE_HOME/network/admin/tnsnames.ora

(ADDRESS = (PROTOCOL = TCP)(HOST = ha01)(PORT= 1521))-

其中红色部分改为本机名称。(hostname查看)

注意:listener.oratnsnames.oraHOST配置要完全一致,否则有问题。

----------结束

2.3  安装后处理

2.3.1     ORACLE自启动配置

注意:如果做oracle双机,则不能进行该配置,由双机程序来控制oracle的启动。(在双机安装文档中说明)

A) 用root用户,进入进入目录/etc/rc.d/init.d,建立ORACLE启动脚本文件。

文件名:oracle_orcl.sh,文件体内容如下:

将以下内容复制到文件中,按Ctrl+C退出

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

#!/bin/sh

#chkconfig:2345 80 80

#description:oracle_orcl

#

#/etc/rc.d/init.d/oracle_orcl

#auto start database orcl instance

 

#setoracle env

exportORACLE_OWNER=oracle

exportORACLE_BASE=/u01/app/oracle

exportORACLE_HOME=$ORACLE_BASE/product/10.2.0

exportORACLE_SID=orcl

exportPATH=$PATH:$HOME/bin:$ORACLE_HOME/bin

exportCLASSPATH=$CLASSPATH:$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib

exportLD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib:/usr/lib:$ORACLE_HOME/rdbms/lib

exportNLS_LANG=.ZHS16CGB231280

exportLANG=zh_CN.GB18030

exportLANGUAGE=zh_CN.GB18030:zh_CN.GB2312:zh_CN

 

ORACLE_USER=oracle

 

exportORACLE_OWNER ORACLE_BASE ORACLE_HOME ORACLE_SID PATH CLASSPATH

exportLD_LIBRARY_PATH NLS_LANG LANG LANGUAGE ORACLE_USER

#startor stop script

 

case$1 in

start)

su- "$ORACLE_USER"<<EOO

lsnrctlstart

sqlplus/nolog<<EOS

connect/ as sysdba

startup

EOS

EOO

;;

 

stop)

su- "$ORACLE_USER"<<EOO

lsnrctlstop

sqlplus/nolog<<EOS

connect/ as sysdba

shutdownimmediate

EOS

EOO

;;

 

*)

echo"Usage: $0 {start|stop}"

;;

esac

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

 

B) 赋予oracle_linuxdb执行权限,执行命令:chmod 755 oracle_orcl.sh

下面运行该脚本,进行测试。
       启动,运行命令:./oracle_orcl.sh start

关闭,执行命令:./oracle_orcl.sh stop

可以用sqlplus user/pass@tnsname来测试启动和关闭数据库是否成功。

C) 发布,执行如下命令:
       chkconfig --add oracle_orcl.sh

D)检查启动结果

chkconfig --list|grep oracle                     只显示oracle,如下(下面表示已打开启动服务)

oracle_orcl.sh  0:关闭  1:关闭 2:启用  3:启用 4:启用  5:启用 6:关闭


       下面补充说明,不需要操作。

chkconfig命令运行成功后,在rc2.d,rc3.d,rc4.d,rc5.d下面建立了S80oracle_orcl.sh和连接文件,可以在系统启动的时候,运行脚本启动数据库。在rc0.d、rc1.d和rc6.d目录下面建立了K80oracle_orcl.sh文件,用于在系统关闭的时候自动运行脚本关闭数据库。如下命令,若显示如下即正常:

chkconfig--add oracle_orcl.sh         发布启动程序

chkconfig oracle_orcl.sh on                    打开启动服务

chkconfig --del oracle_orcl.sh          关闭启动服务

chkconfig --list                                 显示启动项

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

***********************安装全部结束*********************************************

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

2.3.2     root数据库环境配置

如果有root使用oracle数据的程序,如radius,需要rootoracle环境变量,否则root无法使用oracle

# su - root

# vi /etc/profile

把以下内容加到该文件尾部(同oracle用户的环境变量完全一样)

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

exportORACLE_OWNER=oracle

exportORACLE_BASE=/u01/app/oracle

exportORACLE_HOME=$ORACLE_BASE/product/10.2.0

export ORACLE_SID=orcl

exportPATH=$PATH:$HOME/bin:$ORACLE_HOME/bin

exportCLASSPATH=$CLASSPATH:$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib

exportLD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib:/usr/lib:$ORACLE_HOME/rdbms/lib

export NLS_LANG=.ZHS16CGB231280 

export LANG=zh_CN.GB18030

exportLANGUAGE=zh_CN.GB18030:zh_CN.GB2312:zh_CN

aliassql="sqlplus tsd/tsd2010psw@orcl"

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

然后保存退出,执行下面命令,使用变量生效。

source  /etc/profile

3        常用操作命令

3.1  服务器传载文件命令

推荐安装SecureCRT来操作服务器,相对于SSH更加灵活。可以用rz/sz很好的远程下载上传文件。需要在linux下安装lrzsz的rpm包,默认已经安装。默认下载文件存放的目录为 安装目录的 download目录下。

3.2  启停Oracle命令

切换到oracle用户(oracle数据库的安装、启停、建空间、建用户等必须用 oracle操作员)

3.2.1     启动oracle

安装完数据库后,默认已经启动的。通过命令:ps -ef|grep oracle 可以看到oracle的监听、数据库进程。

su –oracle

$lsnrctlstart--启动监听  

$sqlplus / nolog

sql>conn / as sysdba

sql>startup (一般不需要加参数,只要设置好环境变量)

sql>quit (或exit 退出sql模式)

(直接运行sql 命令,能登录到oracle表示启动正常。)

-------------------------------------------------------------------------------

3.2.2     关闭oracle

su –oracle

$lsnrctlstop

$sqlplus / nolog

sql>conn / as sysdba

sql>shutdown immediate

sql> quit

3.3  初始化数据

3.3.1      建空间目录

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

切到 oracle用户

su - oracle

(批量拷贝执行下面语句)

chmod 755 oracle_orcl.sh

mkdir -p/u02/oradata/tsd_tablespace

cd/u02/oradata/tsd_tablespace

mkdir tsdconfig

mkdir tsd_temp

mkdir tsdbilling

mkdir tsdvoice

mkdir tsdcdr

mkdir tsdbill01

mkdir tsdbill02

mkdir tsdbill03

mkdir tsdbill04

mkdir tsdbill05

mkdir tsdbill06

mkdir tsdbill07

mkdir tsdbill08

mkdir tsdbill09

mkdir tsdbill10

mkdir tsdbill11

mkdir tsdbill12

 

mkdir tsdtab01

mkdir tsdtab02

mkdir tsdtab03

mkdir tsdtab04

mkdir tsdtab05

mkdir tsdtab06

mkdir tsdtab07

mkdir tsdtab08

mkdir tsdtab09

mkdir tsdtab10

mkdir tsdtab11

mkdir tsdtab12

 

mkdir tsdreport

mkdir tsdcharge

mkdir tsdhis

mkdir tsdlog

mkdir tsdbroadband

mkdir tsdhthhf_n

mkdir tsdhthhf_y

mkdir tsdteljob_y

mkdir tsdteljob_n

 

mkdir tsdbymx01

mkdir tsdbymx02

mkdir tsdbymx03

mkdir tsdbymx04

mkdir tsdbymx05

mkdir tsdbymx06

mkdir tsdbymx07

mkdir tsdbymx08

mkdir tsdbymx09

mkdir tsdbymx10

mkdir tsdbymx11

mkdir tsdbymx12

-------------------电话扩展--------------------

mkdir tsdhthhf

mkdir tsdbillyt201

mkdir tsdbill1called

mkdir undotbs

mkdir tsdyhdang

mkdir tsdindex

mkdir tsdindex_base

mkdir tsdindex_hdmx

mkdir tsd_hd

mkdir tsdhthhf

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

3.3.2     建表空间 /--------------------------------------------执行Sh脚本

切换到oracle用户,登录到 sqlplus

su - oracle

sqlplus nolog

sql>conn /as sysdba

删除空间语句,不需要执行

--drop tablespace radius_user includingcontents and datafiles

--drop tablespace tsdbilling includingcontents and datafiles;

(批量拷贝执行下面语句)

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

create tablespacetsdconfig  datafile'/u02/oradata/tsd_tablespace/tsdconfig/tsdconfig01.dbf' size 20M autoextend on;

create temporarytablespace tsd_temp tempfile'/u02/oradata/tsd_tablespace/tsd_temp/tsd_temp01.dbf' size 50M autoextend on;

--createtablespace tsdbilling datafile'/u02/oradata/tsd_tablespace/tsdbilling/tsdbilling01.dbf' size 80M autoextendon;

create tablespacetsdbilling datafile '/u02/oradata/tsd_tablespace/tsdbilling/tsdbilling01.dbf'size 2048M;

alter tablespace tsdbilling add datafile'/u02/oradata/tsd_tablespace/tsdbilling/tsdbilling02.dbf'size 2048M;

alter tablespace tsdbilling add datafile'/u02/oradata/tsd_tablespace/tsdbilling/tsdbilling03.dbf'size 2048M;

alter tablespace tsdbilling add datafile'/u02/oradata/tsd_tablespace/tsdbilling/tsdbilling04.dbf'size 2048M;

alter tablespace tsdbilling add datafile'/u02/oradata/tsd_tablespace/tsdbilling/tsdbilling05.dbf'size 2048M;

alter tablespace tsdbilling add datafile'/u02/oradata/tsd_tablespace/tsdbilling/tsdbilling06.dbf'size 2048M;

alter tablespace tsdbilling add datafile'/u02/oradata/tsd_tablespace/tsdbilling/tsdbilling07.dbf'size 2048M;

alter tablespace tsdbilling add datafile'/u02/oradata/tsd_tablespace/tsdbilling/tsdbilling08.dbf'size 2048M;

alter tablespace tsdbilling add datafile'/u02/oradata/tsd_tablespace/tsdbilling/tsdbilling09.dbf'size 2048M;

alter tablespace tsdbilling add datafile'/u02/oradata/tsd_tablespace/tsdbilling/tsdbilling10.dbf'size 2048M;

alter tablespacetsdbilling add datafile '/u02/oradata/tsd_tablespace/tsdbilling/tsdbilling11.dbf'size 2048M autoextend on;

alter tablespacetsdbilling add datafile '/u02/oradata/tsd_tablespace/tsdbilling/tsdbilling12.dbf'size 2048M autoextend on;

alter tablespacetsdbilling add datafile '/u02/oradata/tsd_tablespace/tsdbilling/tsdbilling13.dbf'size 2048M autoextend on;

alter tablespacetsdbilling add datafile '/u02/oradata/tsd_tablespace/tsdbilling/tsdbilling14.dbf'size 2048M autoextend on;

alter tablespacetsdbilling add datafile '/u02/oradata/tsd_tablespace/tsdbilling/tsdbilling15.dbf'size 2048M autoextend on;

create tablespacetsdvoice datafile '/u02/oradata/tsd_tablespace/tsdvoice/tsdvoice01.dbf' size20M autoextend on;

create tablespacetsdcdr datafile '/u02/oradata/tsd_tablespace/tsdcdr/tsdcdr01.dbf' size 20Mautoextend on;

create tablespacetsdbill01 datafile '/u02/oradata/tsd_tablespace/tsdbill01/tsdbill0101.dbf' size40M autoextend on;

create tablespacetsdbill02 datafile '/u02/oradata/tsd_tablespace/tsdbill02/tsdbill0201.dbf' size40M autoextend on;

create tablespacetsdbill03 datafile '/u02/oradata/tsd_tablespace/tsdbill03/tsdbill0301.dbf' size40M autoextend on;

create tablespacetsdbill04 datafile '/u02/oradata/tsd_tablespace/tsdbill04/tsdbill0401.dbf' size40M autoextend on;

create tablespacetsdbill05 datafile '/u02/oradata/tsd_tablespace/tsdbill05/tsdbill0501.dbf' size40M autoextend on;

create tablespacetsdbill06 datafile '/u02/oradata/tsd_tablespace/tsdbill06/tsdbill0601.dbf' size40M autoextend on;

create tablespacetsdbill07 datafile '/u02/oradata/tsd_tablespace/tsdbill07/tsdbill0701.dbf' size40M autoextend on;

create tablespacetsdbill08 datafile '/u02/oradata/tsd_tablespace/tsdbill08/tsdbill0801.dbf' size40M autoextend on;

create tablespacetsdbill09 datafile '/u02/oradata/tsd_tablespace/tsdbill09/tsdbill0901.dbf' size40M autoextend on;

create tablespacetsdbill10 datafile '/u02/oradata/tsd_tablespace/tsdbill10/tsdbill1001.dbf' size40M autoextend on;

create tablespacetsdbill11 datafile '/u02/oradata/tsd_tablespace/tsdbill11/tsdbill1101.dbf' size40M autoextend on;

create tablespacetsdbill12 datafile '/u02/oradata/tsd_tablespace/tsdbill12/tsdbill1201.dbf' size40M autoextend on;

create tablespacetsdtab01 datafile '/u02/oradata/tsd_tablespace/tsdtab01/tsdtab0101.dbf' size 40Mautoextend on;

create tablespacetsdtab02 datafile '/u02/oradata/tsd_tablespace/tsdtab02/tsdtab0201.dbf' size 40Mautoextend on;

create tablespacetsdtab03 datafile '/u02/oradata/tsd_tablespace/tsdtab03/tsdtab0301.dbf' size 40Mautoextend on;

create tablespacetsdtab04 datafile '/u02/oradata/tsd_tablespace/tsdtab04/tsdtab0401.dbf' size 40Mautoextend on;

create tablespacetsdtab05 datafile '/u02/oradata/tsd_tablespace/tsdtab05/tsdtab0501.dbf' size 40Mautoextend on;

create tablespacetsdtab06 datafile '/u02/oradata/tsd_tablespace/tsdtab06/tsdtab0601.dbf' size 40Mautoextend on;

create tablespacetsdtab07 datafile '/u02/oradata/tsd_tablespace/tsdtab07/tsdtab0701.dbf' size 40Mautoextend on;

create tablespacetsdtab08 datafile '/u02/oradata/tsd_tablespace/tsdtab08/tsdtab0801.dbf' size 40Mautoextend on;

create tablespacetsdtab09 datafile '/u02/oradata/tsd_tablespace/tsdtab09/tsdtab0901.dbf' size 40Mautoextend on;

create tablespacetsdtab10 datafile '/u02/oradata/tsd_tablespace/tsdtab10/tsdtab1001.dbf' size 40Mautoextend on;

create tablespacetsdtab11 datafile '/u02/oradata/tsd_tablespace/tsdtab11/tsdtab1101.dbf' size 40Mautoextend on;

create tablespacetsdtab12 datafile '/u02/oradata/tsd_tablespace/tsdtab12/tsdtab1201.dbf' size 40Mautoextend on;

create tablespacetsdreport datafile '/u02/oradata/tsd_tablespace/tsdreport/tsdreport01.dbf' size20M autoextend on;

create tablespacetsdcharge datafile '/u02/oradata/tsd_tablespace/tsdcharge/tsdcharge01.dbf' size20M autoextend on;

create tablespacetsdhis datafile '/u02/oradata/tsd_tablespace/tsdhis/tsdhis01.dbf' size 20Mautoextend on;

create tablespacetsdlog datafile '/u02/oradata/tsd_tablespace/tsdlog/tsdlog01.dbf' size 20Mautoextend on;

create tablespacetsdbroadband datafile'/u02/oradata/tsd_tablespace/tsdbroadband/tsdbroadband01.dbf' size 50Mautoextend on;

create tablespacetsdhthhf_n datafile '/u02/oradata/tsd_tablespace/tsdhthhf_n/tsdhthhf_n01.dbf'size 20M autoextend on;

create tablespacetsdhthhf_y datafile '/u02/oradata/tsd_tablespace/tsdhthhf_y/tsdhthhf_y01.dbf'size 40M autoextend on;

create tablespacetsdteljob_y datafile'/u02/oradata/tsd_tablespace/tsdteljob_y/tsdteljob_y01.dbf' size 40M autoextendon;

create tablespacetsdteljob_n datafile'/u02/oradata/tsd_tablespace/tsdteljob_n/tsdteljob_n01.dbf' size 20M autoextendon;

create tablespacetsdbymx01 datafile '/u02/oradata/tsd_tablespace/tsdbymx01/tsdbymx0101.dbf' size40M autoextend on;

create tablespacetsdbymx02 datafile '/u02/oradata/tsd_tablespace/tsdbymx02/tsdbymx0201.dbf' size40M autoextend on;

create tablespacetsdbymx03 datafile '/u02/oradata/tsd_tablespace/tsdbymx03/tsdbymx0301.dbf' size40M autoextend on;

create tablespacetsdbymx04 datafile '/u02/oradata/tsd_tablespace/tsdbymx04/tsdbymx0401.dbf' size40M autoextend on;

create tablespacetsdbymx05 datafile '/u02/oradata/tsd_tablespace/tsdbymx05/tsdbymx0501.dbf' size40M autoextend on;

create tablespacetsdbymx06 datafile '/u02/oradata/tsd_tablespace/tsdbymx06/tsdbymx0601.dbf' size40M autoextend on;

create tablespacetsdbymx07 datafile '/u02/oradata/tsd_tablespace/tsdbymx07/tsdbymx0701.dbf' size40M autoextend on;

create tablespacetsdbymx08 datafile '/u02/oradata/tsd_tablespace/tsdbymx08/tsdbymx0801.dbf' size40M autoextend on;

create tablespacetsdbymx09 datafile '/u02/oradata/tsd_tablespace/tsdbymx09/tsdbymx0901.dbf' size40M autoextend on;

create tablespacetsdbymx10 datafile '/u02/oradata/tsd_tablespace/tsdbymx10/tsdbymx1001.dbf' size40M autoextend on;

create tablespacetsdbymx11 datafile '/u02/oradata/tsd_tablespace/tsdbymx11/tsdbymx1101.dbf' size40M autoextend on;

create tablespacetsdbymx12 datafile '/u02/oradata/tsd_tablespace/tsdbymx12/tsdbymx1201.dbf' size40M autoextend on;

----------------电话扩展表空间------------------------------

create tablespacetsdhthhf datafile '/u02/oradata/tsd_tablespace/tsdhthhf/tsdhthhf01.dbf' size 50Mautoextend on;

create tablespacetsdbillyt201 datafile '/u02/oradata/tsd_tablespace/tsdbillyt201/tsdbill20101.dbf'size 40M autoextend on;

create tablespacetsdbill1called datafile'/u02/oradata/tsd_tablespace/tsdbill1called/tsdbillcalled01.dbf'size 40Mautoextend on;

create tablespacetsdyhdang01 datafile '/u02/oradata/tsd_tablespace/tsdyhdang/tsdyhdang0101.dbf'size 40M autoextend on;

create tablespacetsdyhdang02 datafile '/u02/oradata/tsd_tablespace/tsdyhdang/tsdyhdang0201.dbf'size 40M autoextend on;

create tablespacetsdyhdang03 datafile '/u02/oradata/tsd_tablespace/tsdyhdang/tsdyhdang0301.dbf'size 40M autoextend on;

create tablespacetsdyhdang04 datafile '/u02/oradata/tsd_tablespace/tsdyhdang/tsdyhdang0401.dbf'size 40M autoextend on;

create tablespacetsdyhdang05 datafile '/u02/oradata/tsd_tablespace/tsdyhdang/tsdyhdang0501.dbf'size 40M autoextend on;

create tablespacetsdyhdang06 datafile '/u02/oradata/tsd_tablespace/tsdyhdang/tsdyhdang0601.dbf'size 40M autoextend on;

create tablespacetsdyhdang07 datafile '/u02/oradata/tsd_tablespace/tsdyhdang/tsdyhdang0701.dbf'size 40M autoextend on;

create tablespacetsdyhdang08 datafile '/u02/oradata/tsd_tablespace/tsdyhdang/tsdyhdang0801.dbf'size 40M autoextend on;

create tablespacetsdyhdang09 datafile '/u02/oradata/tsd_tablespace/tsdyhdang/tsdyhdang0901.dbf'size 40M autoextend on;

create tablespacetsdyhdang10 datafile '/u02/oradata/tsd_tablespace/tsdyhdang/tsdyhdang1001.dbf'size 40M autoextend on;

create tablespacetsdyhdang11 datafile '/u02/oradata/tsd_tablespace/tsdyhdang/tsdyhdang1101.dbf'size 40M autoextend on;

create tablespacetsdyhdang12 datafile '/u02/oradata/tsd_tablespace/tsdyhdang/tsdyhdang1201.dbf'size 40M autoextend on;

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

3.3.3      建数据库用户

/*创建用户tsd,密码为tsd2010psw*/

切换到oracle用户,登录到 sqlplus

su - oracle

sqlplus nolog

sql>conn /as sysdba

(批量拷贝执行下面语句)

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

create user tsdidentified by tsd2010psw;

alter user tsddefault tablespace tsdbilling;

alter user tsdtemporary tablespace tsd_temp ;

grantconnect,resource,create session, dba, create table, create view, create trigger to tsd;

grant select anytable, create sequence, create procedure, create role to tsd;

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

3.3.4      导入导出数据

export LANG=zh_CN.GBK    //这个是linux的字符集设置

export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK   //这个是oracle的字符集设置

---------------------------------------------

导出数据库

必须切换到 oracle用户执行

su - oracle 

exportLANG=zh_CN.GBK

exportNLS_LANG=AMERICAN_AMERICA.ZHS16GBK

exp tsd/tsd2010psw@orcl owner=tsd direct=y buffer=30720 file=tsd1209.dmplog=tsd1209.dmp.log rows=y compress=y

其中rows=n  只导表结构,不导数据。compress=y 以压缩的方式导出

导入数据库

主数据库为全量数据库,认证数据库轻量数据库。

全量数据当然也可做认证使用,轻量数据库不能支撑业务。

因此,必须分别导入对应的数据库

用oracle用户上传bboss.dmp到/usr/local/oracle 目录下面。必须切换到 oracle用户执行。

su - oracle 

export LANG=zh_CN.GBK

exportNLS_LANG=AMERICAN_AMERICA.ZHS16GBK

imp tsd/tsd2010psw@orcl buffer=30720 fromuser=tsd touser= tsd ignore=ncommit=y file= tsd1116.dmp log= tsd1116dmp.log rows=y &

3.4   

4        FAQ常见问题处理

4.1  Lsnrctlstart错误

问题描述服务器有半年未启动,启动数据库正常,但启动listener出现以下错误:
TNS-12557: TNS protocol adapter not loadable
TNS-12560: TNS protocol adapter error
  TNS-00527: Protocol Adapter notloadable
服务器是linux AS3
在metalink上查到相关文章:
Startingthe Listener Fails With: TNS-12557 or TNS-12555: TNS:Permission Denied [ID343253.1]
原来是/var/tmp目录权限被人改过了,oracle帐号不能访问,把该目录权限改回来就能正常启动了。

4.2  操作系统版本错误

如果在Terminal启动runInstaller时遇到“Checking operating systemversion: must be redhat-2.1, redhat-3, SuSE-9, SuSE-8 or UnitedLinux-1.0 Failed”这种问题,表明oracle不能识别你的系统内核,这个问题可以通过修改内核配置文件解决,如下:

cat > /etc/redhat-release << EOF
Red Hat Enterprise Linux AS release 3 (Taroon)
EOF

 

还有另外一种解决办法:

vi /home/database/install/oraparam.ini

找到:

Linux=redhat-3,SuSE-9,redhat-4,centos-5,UnitedLinux-1.0,asianux-1,asianux-2

上面红色部分为新增,然后在下面增下如下节:

[Linux-centos5.3-optional]

TEMP_SPACE=80

SWAP_SPACE=150

MIN_DISPLAY_COLORS=256

 

4.3         libnnz10.so: cannotrestore segment prot after reloc: Permission denied

error while loading sharedlibraries: $ORACLE_HOME/lib/libnnz10.so: cannot restore segment prot afterreloc: Permission denied
看来是selinux的缘故,关掉selinux试试!
修改SELINUX=disabled,然后重启系统才能生效,或者执行:setenforce 0,立即生效。
果然,关闭selinux后,sqlplus可以正常登陆了。
其实在上面出现Permission denied时,也可以执行
#chcon -t texrel_shlib_t $ORACLE_HOME/lib/*.so

4.4  安装过程错误处理

1)Checking Network Configuration requirements ...

Check complete. The overall result of this check is: Not executed<<<<

 

这里不支持动态的ip地址,修改上面提到的/etc/hosts文件即可。 (红色行为新添加部分)

vi  /etc/hosts

# Do not remove the following line, or various programs

# that require network functionality will fail.

192.168.44.203          oracle localhost

127.0.0.1               oraclelocalhost.localdomain localhost

::1            localhost6.localdomain6 localhost6

 

2)Checking physical memory requirements ...

Expected result: 922MB

改错误可以忽略

4.5  Oracle装完启动错误

1.启动时如果出现错误:

则如下处理


2.如果出现错误


处理方法

vi /u01/app/oracle/product/10.2.0/dbs/initcinms.ora

修改

shared_pool_size = 3500000                                          #SMALL

为:

shared_pool_size = 62198988                                         # SMALL

3.如果出现错误


处理方法:

ls /u01/app/oracle/admin/orcl/pfile/

init.ora.826201017487

cp /u01/app/oracle/admin/orcl/pfile/init.ora.826201017487$ORACLE_HOME/dbs/initcinms.ora

 

--------------------------------------------------------------------------------------------------------------------------

4.6IP改变oracle启动报错

很简单,把服务器/etc/hosts配置一下即可。如

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

[root@bill1 ~]#cat /etc/hosts

# Do not removethe following line, or various programs

# that requirenetwork functionality will fail.

122.9.56.196          bill1 localhost

127.0.0.1               bill1 localhost.localdomainlocalhost

::1             localhost6.localdomain6 localhost6

 

 

改一下:

[root@bill1 ~]#cat /etc/hosts

# Do not removethe following line, or various programs

# that requirenetwork functionality will fail.

61.172.100.250          bill1 localhost

127.0.0.1               bill1 localhost.localdomainlocalhost

::1             localhost6.localdomain6 localhost6

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

重启oracle监听、数据库即可。

4.7删除数据库用户

-----------------------------------------------------

su - oracle

sqlplus nolog

sql>conn /as sysdba

sql> drop user tsdcascade;

      -----------------------------------------------------

 

4.8删除表空间文件

drop tablespace tsdconfig      including contents and datafiles;

drop tablespace tsd_temp        including contents and datafiles;

drop tablespace tsdbilling      including contents and datafiles;

drop tablespace tsdvoice        including contents and datafiles;

drop tablespace tsdcdr          including contents and datafiles;

drop tablespace tsdbill01       including contents and datafiles;

drop tablespace tsdbill02       including contents and datafiles;

drop tablespace tsdbill03       including contents and datafiles;

drop tablespace tsdbill04       including contents and datafiles;

drop tablespace tsdbill05       including contents and datafiles;

drop tablespace tsdbill06       including contents and datafiles;

drop tablespace tsdbill07       including contents and datafiles;

drop tablespace tsdbill08       including contents and datafiles;

drop tablespace tsdbill09       including contents and datafiles;

drop tablespace tsdbill10       including contents and datafiles;

drop tablespace tsdbill11       including contents and datafiles;

drop tablespace tsdbill12       including contents and datafiles;

drop tablespace tsdtab01        including contents and datafiles;

drop tablespace tsdtab02        including contents and datafiles;

drop tablespace tsdtab03        including contents and datafiles;

drop tablespace tsdtab04        including contents and datafiles;

drop tablespace tsdtab05        including contents and datafiles;

drop tablespace tsdtab06        including contents and datafiles;

drop tablespace tsdtab07        including contents and datafiles;

drop tablespace tsdtab08        including contents and datafiles;

drop tablespace tsdtab09        including contents and datafiles;

drop tablespace tsdtab10        including contents and datafiles;

drop tablespace tsdtab11        including contents and datafiles;

drop tablespace tsdtab12        including contents and datafiles;

drop tablespace tsdreport       including contents and datafiles;

drop tablespace tsdcharge       including contents and datafiles;

drop tablespace tsdhis          including contents and datafiles;

drop tablespace tsdlog          including contents and datafiles;

drop tablespace tsdbroadband    including contents and datafiles;

drop tablespace tsdhthhf_n      including contents and datafiles;

drop tablespace tsdhthhf_y      including contents and datafiles;

drop tablespace tsdteljob_y     including contents and datafiles;

drop tablespace tsdteljob_n     including contents and datafiles;

drop tablespace tsdbymx01       including contents and datafiles;

drop tablespace tsdbymx02       including contents and datafiles;

drop tablespace tsdbymx03       including contents and datafiles;

drop tablespace tsdbymx04       including contents and datafiles;

drop tablespace tsdbymx05       including contents and datafiles;

drop tablespace tsdbymx06       including contents and datafiles;

drop tablespace tsdbymx07       including contents and datafiles;

drop tablespace tsdbymx08       including contents and datafiles;

drop tablespace tsdbymx09       including contents and datafiles;

drop tablespace tsdbymx10       including contents and datafiles;

drop tablespace tsdbymx11       including contents and datafiles;

drop tablespace tsdbymx12       including contents and datafiles;

---------------------------------------------------------------------------------------------------------------------------

----------------电话扩展表空间------------------------------

drop tablespace tsdhthhf including contentsand datafiles;

drop tablespace tsdbillyt201 includingcontents and datafiles;

drop tablespace tsdbill1called includingcontents and datafiles;

drop tablespace tsdyhdang01 includingcontents and datafiles;

drop tablespace tsdyhdang02 includingcontents and datafiles;

drop tablespace tsdyhdang03 including contentsand datafiles;

drop tablespace tsdyhdang04 includingcontents and datafiles;

drop tablespace tsdyhdang05 includingcontents and datafiles;

drop tablespace tsdyhdang06 includingcontents and datafiles;

drop tablespace tsdyhdang07 includingcontents and datafiles;

drop tablespace tsdyhdang08 includingcontents and datafiles;

drop tablespace tsdyhdang09 includingcontents and datafiles;

drop tablespace tsdyhdang10 includingcontents and datafiles;

drop tablespace tsdyhdang11 includingcontents and datafiles;

drop tablespace tsdyhdang12 includingcontents and datafiles;

 

4.9  清除BIN$zpffb4hJt43gQKjAMy1m5g==$0

1、从oracle10g开始删除数据库表的时候并不是真正删除,而是放到了recyclebin中,这个过程类似 windows里面删除的文件会被临时放到回收站中。

2、删除的表系统会自动给他重命名就是你看到的 【BIN$】开头的名字

3、通过 showrecyclebin 命令可以查看被删掉的表的详细信息,或者查询
 select * from recyclebin;

4、收回表的命令:
   flashback table 原表名 to before drop;

5、清除回收站的命令:
   purge recyclebin;

6、如果不想删除的表经过回收站
   drop table 表名 purge;
   或者停用数据库的回收战功能
   10.1版本中,修改隐藏参数 _recyclebin
      alter system set"_recyclebin" = false;
   10.2版本中,
      alter system set recyclebin = off;


   ·   本文面向项目实施组成员、维护人员;认证计费系统的管理人员。
   ·   本文面向项目实施组成员、维护人员;认证计费系统的管理人员。
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值