• 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;

  • 相关阅读:
    浮动
    关于在windows下同时安装两个mysql,并用Navicat工具同时连接
    关于Springboot项目打包部署运行,命令行运行jar提示没有主清单属性
    If you want an embedded database (H2, HSQL or Derby), please put it on the classpath.(个人笔记)
    关于IDEA解决默认的javacompile以及Language level自动默认jdk1.5的问题
    你真的精通JavaWeb吗?
    Java8新特性(个人笔记待续)
    Netty(个人笔记待续)
    初识网络编程(1)
    走进shiro
  • 原文地址:https://www.cnblogs.com/createyuan/p/6609536.html
Copyright © 2020-2023  润新知