发布新日志

  • sqlplus troubleshooting

    2008-11-12 16:39:52

     

    1.       分析数据库出错可以到 $ORACLE_BASE/admin/EMS/bdump目录下的alert_EMS.log中查找(/oradata/oracle/ORACLE/app/oracle/admin/EMS/bdump/alert_EMS.log)

    2.       SQL> !oerr ora 39700   #SQLPLUS种输入相应error code可查看details

     

    39700, 00000, "database must be opened with UPGRADE option"

    // *Cause:  A normal database open was attempted, but the database has not

    //          been upgraded to the current server version.

    // *Action: Use the UPGRADE option when opening the database to run

    //          catupgrd.sql (for database upgrade), or to run catalog.sql

    //          and catproc.sql (after initial database creation).

  • ORACLE三种关闭方式

    2008-11-12 16:38:42

    1、shutdown normal 
       正常方式关闭数据库。


    2、shutdown immediate 
       立即方式关闭数据库。 
       在SVRMGRL中执行shutdown immediate,数据库并不立即关闭, 
       而是在Oracle执行某些清除工作后才关闭(终止会话、释放会话资源), 
       当使用shutdown不能关闭数据库时,shutdown immediate可以完成数据库关闭的操作。 


    3、shutdown abort 
       直接关闭数据库,正在访问数据库的会话会被突然终止, 
       如果数据库中有大量操作正在执行,这时执行shutdown abort后,重新启动数据库需要很长時間

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

    shutdown abort 的时候,跟kill 进程是一样的效果
    数据库立即关闭,这个时候文件状态可能不一致
    因为正常关闭数据库会同步校验各文件,使得重新启动的时候文件时间点一致并且不用进行崩溃恢复

    若检查点信息一致,则做崩溃恢复
    若检查点信息不一致(正好在更新文件头)则需要做介质恢复

    这些问题都好处理,最怕的问题是这个时候系统有大量IO,结果这样造成写的突然中断,碰巧造成文件块的逻辑坏块,那麻烦比较大一些,尤其是系统表空间的block损坏


    虽然shutdown abort 出错的几率很小,1000个人可能只有一个人碰到,但是我们还是要小心。
    正确的处理流程是,shutdown immediate ,若数据库迟迟不能down下来,在os上观察IO状况,几乎没有io的时候,另开一窗口shutdown  abort ,几乎不会出问题了
  • Oracle三种启动方式

    2008-11-12 16:21:33

    1、STARTUP   NOMOUNT    
    NONOUNT选项仅仅创建一个Oracle实例,当实例打开后,系统将显示一个SGA内存结构和大小的列表;

    2、STARTUP   MOUNT  
    该命令创建实例并且安装数据库,但没有打开数据库,在这种打开方式下,除了可以看到SGA系统列表以外,系统还会给出"数据库装载完毕"的提示;

    3、STARTUP    
    该命令完成创建实例、安装实例和打开数据库的所有三个步骤,这时系统除了可以看到前面Startup Mount方式下的所有提示外,还会给出一个"数据库已经打开"的提示,此时,数据库系统处于正常工作状态,可以接受用户请求。

  • Installation for oracle 10g

    2008-11-12 15:58:49

    Installation for oracle 10g

    Oracle 10g (10.2.0.1) and patch set (10.2.0.3) CD package:

    O:\proj\shanghai\1150\software\EMS\Oracle10g

    Preinstallation tasks

    1.       Run ‘gzip -d 10gr2_db_sol.cpio.gz’ to decompress oracle 10g.

    2.       Run ‘cpio -idmv < 10gr2_db_sol.cpio’ to decompress oracle 10g.

    3.       Run ‘gzip -d ems.7.0.0.0.0.tar.Z’ and ‘tar –xvf ems.7.0.0.0.0.tar’ to decompress Panorama

    4.       Run ‘./uninstall.sh manager’ to uninstall Panorama and Oracle. When it asks if you want to uninstall Oracle, say ‘yes’.

    5.       After running ‘./setup.sh’, ‘cd /usr/afcems_install’ and edit the file installOracleConfigEMS.rsp to make sure all values match your server; i.e. the number of Oracle mount points to be configured is correct, the location of the mount points is correct, the Oracle version to be installed is Oracle 10 (it defaults to 9i), Oracle source location also defaults to Oracle 9i, so change it to where your Oracle 10 files can be found, etc. 

           TIP – you can only save your changes with ‘:w!’.

    Silent installation for oracle 10g

    1.         Configure your DISPLAY variable to be your PC IP address (in bash: DISPLAY=192.168.xxx.xxx:0.0;export DISPLAY)( run /usr/openwin/bin/xclock to make sure it is set correctly )

    2.         Now run ‘./installOracleConfigEMS –f installOracleConfigEMS.rsp’ which will silently install Oracle 10.  It may ask you to reboot the server (‘/etc/shutdown –y –g0 –i6’) if the /etc/system file has been changed, and you must run the above executable again.

    Installation oracle 10g patch set

    Preinstallation tasks

    1.         Complete silent installation for oracle 10g.

    2.         Run ‘/etc/init.d/dbora stop’ to stop all processes

    If the scrīpt doesn’t work, you have to manually stop all processes, listeners and database instances in the Oracle home directory, where you need to install the patch set.

    3.         Run ‘unzip patch5337014_10203_SOLARIS64.zip’ to decompress patch set.

    Interactive installation for oracle 10g patch set

    1.         Login in as the oracle user.

    2.         Configure your DISPLAY variable to be your PC IP address (in bash: DISPLAY=192.168.xxx.xxx:0.0;export DISPLAY)( run /usr/openwin/bin/xclock to make sure it is set correctly )

    3.         Run ‘cd patchset_directory/Disk1’.

    4.         Run ‘./runInstaller’.

    5.         On the Welcome screen, click Next.

    6.         In the Specify Home Details screen, select the name of the Oracle home that you want to update, or select the Path that you want to update from the list, then click Next.

    7.         On the Summary screen, click Install. (This screen lists all of the patches available for installation.)

    8.         When prompted, run the ‘$ORACLE_HOME/root.sh’ scrīpt as the root user.

    9.         On the End of Installation screen, click Exit, then click Yes to exit from Oracle Universal Installer.

    Postinstallation tasks

    Upgrading a Release 10.2 Database using Oracle Database Upgrade Assistant

    After you install the patch set, you must perform the following steps on every database associated with the upgraded Oracle home:

    1.         $ dbua

    2.         On the Welcome screen, click Next.

    3.         On the Databases screen, select the name of the Oracle Database that you want to update, then click Next.

    4.         On the Recompile invalid objects screen, select the Recompile the invalid objects at the end of upgrade option, then click Next.

    5.         If you have not taken the back up of the database earlier, on the Backup screen, select the I would like to take this tool to backup the database option, mentions the Path, and then click Next.

    6.         On the Summary screen, check the summary, then click Finish.

    7.         On the End of upgradation screen, click Exit, then click Yes to exit from Oracle Database Upgrade Assistant.

    Troubleshooting:

    behavīor:

    After completing installation for oracle 10g, startup oracle database throws the following errors:

    ORA-01092: ORACLE instance terminated. Disconnection forced

    ORA-39700: database must be opened with UPGRADE option.

    Solution:

    You must finish the postinstallation tasks.

    TIP:

    1.         Path for installation oracle error log: $ORACLE_BASE/admin/EMS/bdump/alert_EMS.log

    2.         Type ‘SQL> !oerr ora 39700‘ in sqlplus to get more details:

    SQL>!oerr ora 39700

    39700, 00000, "database must be opened with UPGRADE option"

    // *Cause:  A normal database open was attempted, but the database has not

    //          been upgraded to the current server version.

    // *Action: Use the UPGRADE option when opening the database to run

    //          catupgrd.sql (for database upgrade), or to run catalog.sql

    //          and catproc.sql (after initial database creation).

     

  • restart oracle

    2008-11-12 15:55:52

     

    启动/关闭监听:

    Su – oracle

    $ lsnrctl start                #启动监听

    $ lsnrctl stop                 #关闭监听

    $ lsnrctl status        #查看监听状态

     

    启动/关闭数据库:

    Su – oracle

    $ sqlplus /nolog

    SQL> conn / as sysdba

    SQL> shutdown       #关闭数据库
    SQL> startup                #
    启动数据库

    SQL> show parameters inst

    SQL> exit

    $ ps -ef | grep oracle

Open Toolbar