zoukankan      html  css  js  c++  java
  • oracle故障解决

    修改了字符集,修改错了,然后不能启动

    alter system set nls_language='AMERICA';

    shutdown immediate;

    startup

    报错

    [oracle@oracle4 ~]$ sqlplus / as sysdba

    SQL*Plus: Release 11.2.0.4.0 Production on Fri Mar 24 08:41:45 2017

    Copyright (c) 1982, 2013, Oracle.  All rights reserved.

    Connected to an idle instance.

    SQL> startup nomount
    ORA-12700: invalid NLS parameter value (nls_language)
    SQL> alter system set nls_language='AMERICAN' scope=spfile;
    alter system set nls_language='AMERICAN' scope=spfile
    *
    ERROR at line 1:
    ORA-01034: ORACLE not available
    Process ID: 0
    Session ID: 0 Serial number: 0

    然后错上加错

    vi spfilemy.ora将nls_language去掉,就又报下面的错

    [oracle@oracle4 dbs]$ vi spfilemy.ora
    [oracle@oracle4 dbs]$ sqlplus / as sysdba

    SQL*Plus: Release 11.2.0.4.0 Production on Fri Mar 24 08:44:42 2017

    Copyright (c) 1982, 2013, Oracle.  All rights reserved.

    Connected to an idle instance.

    SQL> startup
    ORA-01078: failure in processing system parameters
    LRM-00109: could not open parameter file '/u01/app/oracle/product/11.2.0.4/dbhome_1/dbs/initmy.ora'

    所以不能用vi修改spfilemy.ora文件

    [oracle@oracle4 dbs]$ sqlplus / as sysdba
    
    SQL*Plus: Release 11.2.0.4.0 Production on Fri Mar 24 09:11:13 2017
    
    Copyright (c) 1982, 2013, Oracle.  All rights reserved.
    
    Connected to an idle instance.
    
    SQL> create pfile from spfile;
    create pfile from spfile
    *
    ERROR at line 1:
    ORA-01565: error in identifying file '?/dbs/spfile@.ora'
    ORA-27046: file size is not a multiple of logical block size
    Additional information: 1

    http://blog.csdn.net/h254931252/article/details/52847948

    Java对Oracle中Clob数据类型是不能够直接插入的,但是可以通过流的形式对clob类型数据写入或者读取,网上代码并不算特别多,讲的也不是很清楚,我对网上资料进行了整理和总结,具体看代码:

     使用java + oracle插入clob类型的数据

     使用java + oracle插入clob类型的数据,需要用以下的步骤:
    1、将数据插入数据库,对于clob字段,使其为空clob数据。例如:insert into test values(1,empty_clob())";
    2、从数据库中取出插入的clob字段,并将其赋值给oracle.sql.clob类型的变量。例如
    String sqll="select content from test where id=1 for update";
      ResultSet rss=stmt.executeQuery(sqll);
      if(rss.next()){
       CLOB clob = ((OracleResultSet)rss).getCLOB(1);
    3、给clob数据重新赋值,然后更新到数据库中。
    例如:
    clob.putString(1,"ddddddddddddddddddddddddddddddddddd");
       sql="update test set content=? where id=1";
       PreparedStatement pstmt=con.prepareStatement(sql);
       pstmt.setClob(1,clob);
       pstmt.executeUpdate();

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

    dba角色用户,居然没有创建视图权限

    官方文档如是说:

    The owner of the schema containing the view must have the privileges necessary to either select, insert, update, or delete rows from all the tables or views on which the view is based. The owner must be granted these privileges directly, rather than through a role.

    其实授予这个权限就可以了

    grant SELECT ANY DICTIONARY to personal;

  • 相关阅读:
    SQLServer2005安装提示服务无法启动解决方法
    如何处理SQL Server2005配置管理器打不开的问题!
    如何卸载oracle 10g数据库
    Gesture实现手势滑动效果
    为android虚拟机配置正确的DNS服务器地址
    a链接事件点击函数
    web 音频文件自动播放(兼容所有浏览器)
    关于Jquery中的$.each获取各种返回类型数据的使用方法
    jquery如何在异步方式中给全局变量赋值
    jquery的blur之后,focus获取不到焦点的解决办法
  • 原文地址:https://www.cnblogs.com/createyuan/p/6609536.html
Copyright © 2011-2022 走看看