Home Backend Development PHP Tutorial Linux下Oracle8i的安装(转)_PHP

Linux下Oracle8i的安装(转)_PHP

Jun 01, 2016 pm 12:35 PM
oracle sqlplus Can Install document user Table of contents

ORACLE8

oracle 8.05 的简明安装和操作说明
oralce 支持Linux 给了我们一个免费解除她的好机会,但有好多网友并非此中专业人士(就象我一样),我就把我的一些操作程序写出来,希望对大家会有所帮助。
一。安装前的准备工作
   1 ,建立一个oracle 的安装用户,因为oracle 不能用root来安装,若强行用root她会报错,然后罢工。
       #useradd oracle(当然可以是任何名字,但推荐用oracle 做用户名)
       #passwd oracle
     进入/etc/group  找到oracle组,把组名改为dba (并非必须,但推荐)
    #cd /etc
    #vi group
注意:一定要保证oracle用户只在一个组里,否则当oracle installer 建立数据库时无法建立正确的控制文件。
     2 ,建立oracle的安装目录和数据库的mount point 。For example ,我是在根目录下建立一个 /oracle 目录作为oracle 8.05 的安装点。
       #cd /
    #mkdir /oracle
    #chown oracle /oracle(改变目录的属主为oracle用户)
    #chgro dba /oracle(改变目录的属组为dba组)
    #cd /oracle
    #su oracle(切换为oracle用户)
    $mkdir home(oracle的home)
    $mkdir db1(oracle数据库的三个存放点《mount point》)
    $mkdir db2
    $mkdir db3
    3,在oracle 用户的登陆目录下,修改   .proflie 文件,加入必须的环境变量:
    $cd ~oracle
    $vi .profile  加入以下内容:
    ORACLE_OWNER=oracle
    export ORACLE_OWNER
    ORACLE_HOME=/oracle/home
    export ORACLE_HOME
    ORACLE_SID=mytable             
    export ORACLE_SID
    LD_LIBRARY_PATH=/oracle/home/lib/
    export LD_LIBRARY_PATH
    ORACLE_BASE=/oracle
    export ORACLE_BASE
    PATH="$PATH:/oracle/home/bin:usr/local/bin"
#the end
    使刚才的设定生效:
     $source .profile

  4,用root身份将oralce 8.05 的压缩文件解压:
    $su root      
    #tar xzvf filename(应该是一个 .tar.gz 文件)(为以下的说明方便,假设解压在/download/目录下)
    
       进入/download/orainst/运行oratab.sh
     #cd /download/orainst
    #./oratab.sh
设定成功后,就可开始安装。
二,安装
    安装很简单,只要运行oarinst 按提示操作即可,偶尔有报错说文件或目录不存在,可能是她的bug,只要切换一个控制台手动建立目录即可,或者重新运行安装程序,已安装的部分会提示略过。
        $cd /download/orainst
    $./orainst
    需要输入的参数:
    若.profile 文件已生效,安装期间要输入的OARCLE_HOME,ORACLE_BASE ,ORACLE_SID均会自动填写,唯一要手动填写的三个数据库的mount point.(/oracle/db1,/oracle/db2 ,/oracle/db3)
三,后期配置与基本操作
1。启动和关闭oracle server
若安装正常,应该就可以启动了,进入server manager 启动oracle server
      $svrmgrl
    sml>connect internal
    sml>startup
    sml>exit
这样oracle 就启动了。
若要关闭:
    $svrmgrl
    sml>connect internal
    sml>shutdown
    sml>exit
若无法启动,查看你的/oracle/home/dbs 目录下是否有 initmytable.ora文件,确认其中的table_name=mytable已设定,否则手动该过来。其他可以不动。
若没有这个文件,可以将这个目录下的init.ora拷贝,改名为initmytable.ora ,并把table_name改过来。(未改前是table_name=default)
这样应该就可以了。
2.用sqlplus来查询
启动server以后,就可以通过sqlplus联上server,爽一爽。(oracle默认已建立两个有dba 权限的用户:system/manager  和sys/change_on_install)
    $sqlplus system/manager
    sql>select * from user_tables
    哇,好大一串东西呀!!
    唉,sqlplus的操作我这里就不管罗。
3,sqlplus的远程连接
我测试的是用oarcle 8.0 for NT 的 sqlplus 8.0 来进行远程连接
若是默认完全安装,Net 8  应该已经配好了。
启动监听器:
    $lsnrctl
    lsn>start
    lsn>exit
这样监听器就起来了,可以用其他机器上的sqlplus 试一试,挺好玩的。
如果起不来,
A.看你的适配器是否装了
    $adapters
若没有安装则要运行 /download/orainst/下的 oarinst 把适配器装上来。
B.到oacle_home/network/admin下找一下lintener.ora与我文件对一下,没有的话就拷过去。

# This file is locate in :~oracle_home/network/admin
#
# Installation Generated Net8 Configuration
# Version Date: Jun-17-97
# Filename: Listener.ora
#
LISTENER =                    
  (ADDRESS_LIST =
    (ADDRESS= (PROTOCOL= IPC)(KEY= mytable))
        (ADDRESS= (PROTOCOL= IPC)(KEY= PNPKEY))
        (ADDRESS= (PROTOCOL= TCP)(Host= yourhonst.yourdoman)(Port= 1521))
  )
SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (GLOBAL_DBNAME= yourhost.yourdoman.)
      (ORACLE_HOME= /oracle/home)
      (SID_NAME = rsb)
    )
    (SID_DESC =
      (SID_NAME = extproc)
      (ORACLE_HOME = /oracle/home)
      (PROGRAM = extproc)
    )
  )
STARTUP_WAIT_TIME_LISTENER = 0
CONNECT_TIMEOUT_LISTENER = 10
TRACE_LEVEL_LISTENER = OFF
#The end.

C.到/etc下查看services文件,看是否有类似的一行
    listener             1521  #oracle tcp listener
如果没有就加上去。
reboot ,应该就可以拉
好拉,就到这里,就到这里吧。
Auther:charcoal
E-mail:charcoal@mail.hn.cninfo.net
1998/12/26 于长沙
------------------------------------------------------------------------ZZZXXXZZZ
E-group home: http://www.eGroups.com/list/njlug
Free Web-based e-mail groups by eGroups.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Roblox: Bubble Gum Simulator Infinity - How To Get And Use Royal Keys
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Nordhold: Fusion System, Explained
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Mandragora: Whispers Of The Witch Tree - How To Unlock The Grappling Hook
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Hot Topics

Java Tutorial
1664
14
PHP Tutorial
1269
29
C# Tutorial
1249
24
What to do if the oracle can't be opened What to do if the oracle can't be opened Apr 11, 2025 pm 10:06 PM

Solutions to Oracle cannot be opened include: 1. Start the database service; 2. Start the listener; 3. Check port conflicts; 4. Set environment variables correctly; 5. Make sure the firewall or antivirus software does not block the connection; 6. Check whether the server is closed; 7. Use RMAN to recover corrupt files; 8. Check whether the TNS service name is correct; 9. Check network connection; 10. Reinstall Oracle software.

How to solve the problem of closing oracle cursor How to solve the problem of closing oracle cursor Apr 11, 2025 pm 10:18 PM

The method to solve the Oracle cursor closure problem includes: explicitly closing the cursor using the CLOSE statement. Declare the cursor in the FOR UPDATE clause so that it automatically closes after the scope is ended. Declare the cursor in the USING clause so that it automatically closes when the associated PL/SQL variable is closed. Use exception handling to ensure that the cursor is closed in any exception situation. Use the connection pool to automatically close the cursor. Disable automatic submission and delay cursor closing.

How to create cursors in oracle loop How to create cursors in oracle loop Apr 12, 2025 am 06:18 AM

In Oracle, the FOR LOOP loop can create cursors dynamically. The steps are: 1. Define the cursor type; 2. Create the loop; 3. Create the cursor dynamically; 4. Execute the cursor; 5. Close the cursor. Example: A cursor can be created cycle-by-circuit to display the names and salaries of the top 10 employees.

What to do if the oracle log is full What to do if the oracle log is full Apr 12, 2025 am 06:09 AM

When Oracle log files are full, the following solutions can be adopted: 1) Clean old log files; 2) Increase the log file size; 3) Increase the log file group; 4) Set up automatic log management; 5) Reinitialize the database. Before implementing any solution, it is recommended to back up the database to prevent data loss.

How to export oracle view How to export oracle view Apr 12, 2025 am 06:15 AM

Oracle views can be exported through the EXP utility: Log in to the Oracle database. Start the EXP utility, specifying the view name and export directory. Enter export parameters, including target mode, file format, and tablespace. Start exporting. Verify the export using the impdp utility.

Oracle's Role in the Business World Oracle's Role in the Business World Apr 23, 2025 am 12:01 AM

Oracle is not only a database company, but also a leader in cloud computing and ERP systems. 1. Oracle provides comprehensive solutions from database to cloud services and ERP systems. 2. OracleCloud challenges AWS and Azure, providing IaaS, PaaS and SaaS services. 3. Oracle's ERP systems such as E-BusinessSuite and FusionApplications help enterprises optimize operations.

What steps are required to configure CentOS in HDFS What steps are required to configure CentOS in HDFS Apr 14, 2025 pm 06:42 PM

Building a Hadoop Distributed File System (HDFS) on a CentOS system requires multiple steps. This article provides a brief configuration guide. 1. Prepare to install JDK in the early stage: Install JavaDevelopmentKit (JDK) on all nodes, and the version must be compatible with Hadoop. The installation package can be downloaded from the Oracle official website. Environment variable configuration: Edit /etc/profile file, set Java and Hadoop environment variables, so that the system can find the installation path of JDK and Hadoop. 2. Security configuration: SSH password-free login to generate SSH key: Use the ssh-keygen command on each node

How to stop oracle database How to stop oracle database Apr 12, 2025 am 06:12 AM

To stop an Oracle database, perform the following steps: 1. Connect to the database; 2. Shutdown immediately; 3. Shutdown abort completely.

See all articles