su - oracle
sqlplus "/ as sysdba
startup /shutdown
oemapp console

解决方案 »

  1.   

    可以看一下"Unix 系统的 Oracle9i 管理员参考"
      

  2.   

    你应该对Oracle的架构有一个整体的了解再去看一命令,这样的效果要好
      

  3.   

    ORACLE FOR LINUX 安装文档
    ORALCE安装中的技巧:
    TAR包解开的方法: tar -xvf vnc-3.3.3r1_x86_linux_2.0.tar
    1.把jms数据库给关闭 shutdown immediate.
    2.把新的这个数据库关闭,然后把/oradata/serp/下边的文件删除掉,然后把jms /oradata/serp/下的文件ftp过来。
    3。把jms 下边的 /app/oracle/product/9.2.0.4/dbs/下边的orapwserp  ,spfileserp.ora 拷贝到 新的服务器的这个上边的相同位置
    4.chown -R oracle:dba  /oradata
    5.chown -R oraccle:dba /app
    6.改IP
    编辑退出时按ESC
    :wq
    启动FTP:
    service vsftpd restart
    手动对数据库归档:alter system archive log;
    显示归档情况:archive log list
    赋值:chown -R oracle:dba /oradata
    显示某目录下的文件大小总值:
    du -hk
    显示硬盘使用状态:df -hk
    目录操作命令CD:cd *  代表进入本目录下唯一文件夹,cd 后面所要跟的名字可以只输一个或两个文件名后按TAB键,可智能输入。各种版本的LINUX,安装操作都有一些区别,但是大同小异,无非是大一些补丁。更改一些核心参数。下边是RH3.0安装文档
    1. 安装LINUX RH3.0,注意安装的时候要把开发包,开发工具全部安装。注意tmp空间最少要400M以上,否则必须单独给oracle单独分配临时空间(加入环境变量 TMPDIR=)2. 察看内存和swap空间(swap空间为内存的两倍)
        #grep MemTotal /proc/meminfo 
    #cat /proc/swaps3. 修改核心参数(根据内存大小来设定,下边的是512M,受影响的主要是kernel.shmmax(共享内存段大小))
    #  vi /etc/sysctl.conf
    kernel.shmmni = 4096
    kernel.shmall = 2097152
    kernel.sem = 250 32000 100 128
    fs.file-max = 65536
    net.ipv4.ip_local_port_range = 1024 65000
    kernel.shmmax = 536870912  
    执行sysctl –p 立即生效4. 创建oracle用户和dba组
    #groupadd dba
    # useradd –G dba oracle
    # passwd oracle
    Changing password for user oracle.
    New password: oracle
    BAD PASSWORD: it is based on a dictionary word
    Retype new password: oracle
    passwd: all authentication tokens updated successfully3.  Relink gcc so that the older gcc will be used during the Oracle installation
    $su - root
    # mv /usr/bin/gcc  /usr/bin/gcc323
    # ln -s /usr/bin/gcc296  /usr/bin/gcc
    # mv /usr/bin/g++  /usr/bin/g++323      # if g++ doesn't exist, then gcc-c++ was not installed
    # ln -s /usr/bin/g++296 /usr/bin/g++ 5.修改oracle用户的环境变量
    #su – oracle
    $ vi .bash_profile
    PATH=$PATH:$HOME/bin
    export PATH
    unset USERNAME
    下边是添加的:
    export ORACLE_BASE=/app/oracle
    export ORACLE_HOME=$ORACLE_BASE/product/9.2.0.4
    export ORACLE_SID=serp
    export ORACLE_TERM=xterm
    export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK
    export ORA_NLS33=$ORACLE_HOME/ocommon/nls/admin/data
    LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
    LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
    export LD_LIBRARY_PATH
    export PATH=$PATH:$ORACLE_HOME/bin
    export LD_ASSUME_KERNEL=2.4.1 6.解压oracle安装文件
       #gunzip lnx_920_disk1.cpio.gz lnx_920_disk2.cpio.gz lnx_920_disk3.cpio.gz
        # cpio –idmv < lnx_920_disk1.cpio 
    # cpio –idmv < lnx_920_disk2.cpio 
    # cpio –idmv < lnx_920_disk3.cpio
       也可以用简化过程:
    # zcat Linux9i_Disk1.cpio.gz | cpio –idmv 
    # zcat Linux9i_Disk2.cpio.gz | cpio –idmv 
    # zcat Linux9i_Disk3.cpio.gz | cpio –idmv 7.安装jdk。下载jdk for linux  j2sdk-1_4_2_04-linux-i586.bin 用ftp bin格式传输到/usr下边。然后可以直接执行:
    # ./ j2sdk-1_4_2_04-linux-i586.bin
      

  4.   

    8. 把安装软件和存放数据的目录拥有者付给oracle
       #chown –R oracle:dba /oracle
       # chmod 777 /tmp 9 再安装数据库以前打补丁(只是针对rh3.0)
      download the patch p3006854_9204_LINUX.zip from http://metalink.oracle.com.
      To apply the patch, run 
    su - root
    # unzip p3006854_9204_LINUX.zip
    Archive:  p3006854_9204_LINUX.zip
       creating: 3006854/
      inflating: 3006854/rhel3_pre_install.sh
      inflating: 3006854/README.txt
    # cd 3006854
    # sh rhel3_pre_install.sh
    Applying patch...
    Patch successfully applied

    补丁是为了解决
    When you execute runInstaller from the Oracle 9iR2 (9.2.0) CD, you will get the following error message: 
    Error occurred during initialization of VM
    Unable to load native library: /tmp/OraInstall2003-10-25_03-14-57PM/jre/lib/i386/libjava.so:
        symbol __libc_wait, version GLIBC_2.0 not defined in file libc.so.6 with link time reference10.开始安装数据库
     到解开安装软件的目录:/oracle/Disk1/
    $ ./runIinstaller
     - Welcome Screen:       Click Next
     - Inventory Location:   Click Next
     - Unix Group Name:      Use "dba" and click Next
                             When asked to run /tmp/orainstRoot.sh, run it before you click Continue(打开另一个sh窗口。以root用户执行/tmp/orainstRoot.sh),
     - File Locations:       Use default values
     - Available Products:   Select "Oracle9i Database 9.2.0.1.0"
     - Installation Types:   Select Custom since we only want to install the software for now
     - Available Products:   Click Next or add some more components.
     - Components Locations: Accept default values and click Next
     - Privileged Operating System Groups:
                             I used the default values: OSDBA Group = dba, OSOPER Group = dba
     - Oracle Managent Server Repository:
                             I used the default choice
     - Create database:      Select NO since we first have to patch Oracle before a database can be created!
     - Summary:              Start the Install
     - Configuration tools:  Tools won't come up. Simply ignore it.
     - At the end of the installation, exit runInstaller.注:
    You may get the following errors:
    Error in invoking target install of makefile /opt/oracle/product/9.2.0/network/lib/ins_oemagent.mk.
    Click ignore. This will be fixed by applying the patch 3119415 after the 9.2.0.4 patchset has been applied. You won't be able to apply the patch 3119415 at this time since the file /opt/oracle/oraInventory/ContentsXML/comps.xml doesn't exist yet. Error in invoking target install of makefile /opt/oracle/product/9.2.0/ctx/lib/ins_ctx.mk.
    Click ignore. This is fixed by applying the 9.2.0.4 patchset.11 应用oracle patch 
    To patch Oracle9iR2, download the Oracle 9i Release 2 Patch Set 3 Version 9.2.0.4.0 for Linux x86 from http://metalink.oracle.com. 
    Copy the downloaded "p3095277_9204_LINUX.zip" file to e.g. /tmp and run the following command: 
    su - oracle
    $ cp p3095277_9204_LINUX.zip /tmp
    $ cd /tmp
    $ unzip p3095277_9204_LINUX.zip
    Archive:  p3095277_9204_LINUX.zip
      inflating: 9204_lnx32_release.cpio
      inflating: README.html
      inflating: patchnote.css
    $
    $ cpio -idmv < 9204_lnx32_release.cpio
    Disk1/stage/locks
    Disk1/stage/Patches/oracle.apache.isqlplus/9.2.0.4.0/1/DataFiles/bin.1.1.jar
    Disk1/stage/Patches/oracle.apache.isqlplus/9.2.0.4.0/1/DataFiles/lib.1.1.jar
    ...
    To patch the runInstaller, run: 
    su - oracle
    $ echo $LD_ASSUME_KERNEL    # it is important that this variable is set!
    2.4.1
    $ cd /tmp/Disk1/
    $ ./runInstaller - Welcome Screen:       Click Next
     - File Locations:       Use default values
     - Available Products:   Select "Oracle Universial Installer 2.2.0.18.0 !"
     - Components Locations: Accept default values and click Next
     - Summary:              Start the Install
     - At the end of the installation, you must exit runInstaller!To patch Oracle9iR2, run: 
    su - oracle
    $ echo $LD_ASSUME_KERNEL    # it is important that this variable is set!
    2.4.1
    $ cd $ORACLE_HOME/bin
    $ ./runInstaller - Welcome Screen:       Click Next
     - File Locations:       Use default values
     - Available Products:   Select "Oracle9iR2 Patch Set 3 9.2.0.4.0 !"
     - Summary:              Start the Install
     - At the end of the installation, exit runInstallerYou may get the following error:
    Error in invoking target install of makefile /opt/oracle/product/9.2.0/network/lib/ins_oemagent.mk.
    Click ignore. This will be fixed by applying the patch 3119415 after the 9.2.0.4 patchset has been applied. The patch 3119415 cannot be applied while the patch process for the 9.2.0.4 patchset is running. 
    After the 9.2.0.4 patchset has been applied, download the patch p3119415_9204_LINUX.zip from http://metalink.oracle.com. See bug 3119415 for more information. Also, download the opatch Release 2.2.0 utility from http://metalink.oracle.com. See bug 2617419 for more information. 
    To install opatch, run: 
    su - oracle
    $ cp p2617419_210_GENERIC.zip /tmp
    $ cd /tmp
    $ unzip p2617419_210_GENERIC.zip
    Before you apply the 3119415 patch, you need to make sure the fuser binary can be found by the oracle user, see the PATH environment variable below. Otherwise the patch can't be applied because the fuser binary is used by opatch. 
    To apply the 3119415 patch, run 
    su - oracle
    $ unzip p3119415_9204_LINUX.zip
    $ cd 3119415
    $ export PATH=$PATH:/tmp/OPatch
    $ export PATH=$PATH:/sbin        # the patch needs "fuser" which is located in /sbin
    $ which opatch
    /tmp/OPatch/opatch
    $ opatch apply
    12 用dbca创建数据库
     把创建过程保存为一个脚本。然后执行脚本。