分享

史上最详细Solaris 10上Oracle 10g安装步骤图解新手教程

 崔锋1v14jbrb4q 2017-09-02

需要远程登录到主机上操作,之前我用的是putty,filezilla这样的工具,而今天用另一种xmanager,它的组件xftp、xshell、xstart已经可以完成所需工作

-bash-3.00# ifconfig -a
lo0: flags=2001000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL> mtu 8232 index 1
        inet 127.0.0.1 netmask ff000000
e1000g0: flags=1004843<UP,BROADCAST,RUNNING,MULTICAST,DHCP,IPv4> mtu 1500 index 2
        inet 192.168.116.128 netmask ffffff00 broadcast 192.168.116.255
        ether 0:c:29:66:1a:f9
在主机上得出IP地址之后,就可以连接了。

用xshell连接,如图4


 官方要求的包
SUNWarc
SUNWbtool
SUNWhea
SUNWlibm
SUNWlibms
SUNWsprot
SUNWtoo
SUNWi1of
SUNWi1cs
SUNWi15cs
SUNWxwfnt

查看是否安装了包

-bash-3.00# pkginfo -i SUNWarc SUNWbtool SUNWhea SUNWlibm SUNWlibms SUNWsprot SUNWtoo  SUNWi1of  SUNWi1cs SUNWi15cs SUNWxwfnt
system      SUNWarc   Lint Libraries (usr)
system      SUNWbtool CCS tools bundled with SunOS
system      SUNWhea   SunOS Header Files
system      SUNWi1of  ISO-8859-1 (Latin-1) Optional Fonts
system      SUNWlibm  Math & Microtasking Library Headers & Lint Files (Usr)
system      SUNWlibms Math & Microtasking Libraries (Usr)
system      SUNWsprot Solaris Bundled tools
system      SUNWtoo   Programming Tools
system      SUNWxwfnt X Window System platform required fonts
    错误: 未发现”SUNWi1cs”的信息
    错误: 未发现”SUNWi15cs”的信息

本来想把这两个包从光盘里挑出来传进去安装,但其实不行的,只能从光盘直接读取

安装包

-bash-3.00# pwd
/cdrom/sol_10_807_x86/Solaris_10/Product
-bash-3.00# pkgadd -d /cdrom/sol_10_807_x86/Solaris_10/Product SUNWi1cs

处理软件包范例<SUNWi1cs>来自</cdrom/sol_10_807_x86/Solaris_10/Product>

X11 ISO8859-1 Codeset Support(i386) 2.0,REV=2004.10.17.15.04
Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
Use is subject to license terms.
使用</>作为包的基本目录
## 正在处理软件包信息.
## 正在处理系统信息.
   8软件包路径名已经正确地安装
## 检查软件包的从属性
## 检查磁盘空间需求
## 检查同已经安装的软件包之间的冲突.
## 检查setuid/setgid程序。

在这个软件包中包含了正文程序,只有具有超级-用户的权限才能在这个软件包
的安装过程中执行它们.

要继续安装<SUNWi1cs> [y,n,?] y

安装X11 ISO8859-1 Codeset Support成为<SUNWi1cs>

##正在安装1部分- 1.
232 块

安装<SUNWi1cs>成功
-bash-3.00# pkgadd -d /cdrom/sol_10_807_x86/Solaris_10/Product SUNWi15cs

处理软件包范例<SUNWi15cs>来自</cdrom/sol_10_807_x86/Solaris_10/Product>

X11 ISO8859-15 Codeset Support(i386) 2.0,REV=2004.10.17.15.04
Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
Use is subject to license terms.
使用</>作为包的基本目录
## 正在处理软件包信息.
## 正在处理系统信息.
   6软件包路径名已经正确地安装
## 检查软件包的从属性
## 检查磁盘空间需求
## 检查同已经安装的软件包之间的冲突.
## 检查setuid/setgid程序。

在这个软件包中包含了正文程序,只有具有超级-用户的权限才能在这个软件包
的安装过程中执行它们.

要继续安装<SUNWi15cs> [y,n,?] y

安装X11 ISO8859-15 Codeset Support成为<SUNWi15cs>

##正在安装1部分- 1.
1460 块

安装<SUNWi15cs>成功

添加用户组

-bash-3.00# groupadd oinstall
-bash-3.00# groupadd dba
-bash-3.00# mkdir -p /fantlam/oracle
-bash-3.00# useradd -g oinstall -G dba -s /usr/bin/bash -d /fantlam/oracle oracle
-bash-3.00# passwd oracle
新口令:
请重新输入新口令:
passwd:oracle 的口令已成功更改
-bash-3.00# chown -R oracle:oinstall fantlam

设置环境变量
-bash-3.00# su – oracle
Sun Microsystems Inc.   SunOS 5.10      Generic January 2005
-bash-3.00$ vi .bash_profile

export PATH

ORACLE_BASE=/fantlam

ORACLE_HOME=$ORACLE_BASE/oracle

ORACLE_SID=fantlam

PATH=$ORACLE_HOME/bin:$PATH

DISPLAY=192.168.1.100:0.0

export ORACLE_BASE ORACLE_HOME ORACLE_SID PATH DISPLAY

-bash-3.00$ exit
logout
-bash-3.00$ su – oracle
口令:
Sun Microsystems Inc.   SunOS 5.10      Generic January 2005
-bash-3.00$ env | grep ORA
ORACLE_SID=fantlam
ORACLE_BASE=/fantlam
ORACLE_HOME=/fantlam/oracle

用xftp把软件传到主机上 

图5


 解压oracle

-bash-3.00$ ls
10202_database_solx86.zip    oracle
-bash-3.00$ unzip 10202_database_solx86.zip
-bash-3.00$ ls -l
总数 1330932
-rw-r–r–   1 oracle   oinstall 681090961  1月 24日 01:02 10202_database_solx86.zip
drwxrwxr-x   6 oracle   oinstall     512 2006   7月 25 database
drwxr-xr-x   2 oracle   oinstall     512  1月 24日 09:37 oracle
-bash-3.00$ pwd
/fantlam
-bash-3.00$ chown -R oracle:oinstall database/

 修改参数

用root用户修改 vi /etc/system
(G 去到最后一行 按ESC a插入以下代码)
set noexec_user_stack=1
set semsys:seminfo_semmni=100
set semsys:seminfo_semmns=1024
set semsys:seminfo_semmsl=256
set semsys:seminfo_semvmx=32767
set shmsys:shminfo_shmmax=4294967295
set shmsys:shminfo_shmmin=1
set shmsys:shminfo_shmmni=100
set shmsys:shminfo_shmseg=10

不需要重启

使用xstart登录到主机,可以进行图形界面操作,其实用xshell也是可以直接调出的。

图6


 接下来跟着图一步步走

图7


 下一步

图8 


 选择企业版

图9


 弹出框可以不理会

图10


 通过了所有检查,可以继续

图11


 仅安装软件

图12


 开始安装

图13


 等待

图14


 安装完成,按照提示要执行脚本

图15


 -bash-3.00# cd /fantlam
-bash-3.00# pwd
/fantlam
-bash-3.00# ./oraInventory/orainstRoot.sh
更改权限/fantlam/oraInventory 到 770.
更改组名/fantlam/oraInventory 到 oinstall.
脚本的执行已完成
-bash-3.00# ./oracle/root.sh
Running Oracle 10g root.sh script…

The following environment variables are set as:
    ORACLE_OWNER= oracle
    ORACLE_HOME=  /fantlam/oracle

Enter the full pathname of the local bin directory: [/usr/local/bin]:
Creating /usr/local/bin directory…
   Copying dbhome to /usr/local/bin …
   Copying oraenv to /usr/local/bin …
   Copying coraenv to /usr/local/bin …

Creating /var/opt/oracle/oratab file…
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.sh script.
Now product-specific root actions will be performed.

 OK 安装成功。

图16


安装软件之后我们再来创建数据库

配置监听器

-bash-3.00$ netca

图17


 完成之后查看进程 ps -ef | grep /fantlam 可以看到监听程序已经运行起来了

-bash-3.00$ ps -ef | grep /fantlam
  oracle   751   632   0 19:39:33 pts/1       0:00 grep /fantlam
  oracle   749     1   0 19:36:46 ?           0:00 /fantlam/oracle/bin/tnslsnr LISTENER -inherit

 创建数据库

-bash-3.00$ dbca

图24


 基本上按默认走

图25


 起个数据库名,注意提示

图27


 设置口令

图29


 图32

 选择字符集

图34


 图35


 完成

图36


 等待创建

图37


 为scott用户解锁

图38


 这样数据库就创建完毕

查询oracle数据库字符集
SQL> select userenv(‘language’) from dual;

USERENV(‘LANGUAGE’)
——————————————————————————–
AMERICAN_AMERICA.AL32UTF8

数据库在系统启动时候默认没有自启动

手动启动数据库

SQL*Plus: Release 10.2.0.2.0 – Production on Fri Jan 29 19:12:06 2010

Copyright (c) 1982, 2005, Oracle.  All Rights Reserved.
SQL> conn /as sysdba
Connected to an idle instance.
SQL> startup
ORACLE instance started.

Total System Global Area  289406976 bytes
Fixed Size                  1279820 bytes
Variable Size             117442740 bytes
Database Buffers          167772160 bytes
Redo Buffers                2912256 bytes
Database mounted.
Database opened.

启动监听器

-bash-3.00$ lsnrctl start

LSNRCTL for Solaris: Version 10.2.0.2.0 – Production on 29-JAN-2010 19:36:44

Copyright (c) 1991, 2005, Oracle.  All rights reserved.

Starting /fantlam/oracle/bin/tnslsnr: please wait…

TNSLSNR for Solaris: Version 10.2.0.2.0 – Production
System parameter file is /fantlam/oracle/network/admin/listener.ora
Log messages written to /fantlam/oracle/network/log/listener.log
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=unknown)(PORT=1521)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC0)))

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=unknown)(PORT=1521)))
STATUS of the LISTENER
————————
Alias                     LISTENER
Version                   TNSLSNR for Solaris: Version 10.2.0.2.0 – Production
Start Date                29-JAN-2010 19:36:46
Uptime                    0 days 0 hr. 0 min. 0 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /fantlam/oracle/network/admin/listener.ora
Listener Log File         /fantlam/oracle/network/log/listener.log
Listening Endpoints Summary…
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=unknown)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC0)))
Services Summary…
Service “PLSExtProc” has 1 instance(s).
  Instance “PLSExtProc”, status UNKNOWN, has 1 handler(s) for this service…
The command completed successfully
-bash-3.00$
-bash-3.00$ ps -ef | grep /fantlam
  oracle   751   632   0 19:39:33 pts/1       0:00 grep /fantlam
  oracle   749     1   0 19:36:46 ?           0:00 /fantlam/oracle/bin/tnslsnr LISTENER -inherit

关闭数据库方法

SQL> shutdown immediate;

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多