当前位置:  数据库>其它
本页文章导读:
    ▪OEM简介及按钮乱码问题      自ORACLE 9i之后,Oracle提供了一个基于Web图形化数据管理工具Oracle企业管理器(Oracle Enterprise Manager),用来代替SQL命令来管理数据库。 Windows下OEM默认是开启的,可以直接访问,Linux下必须通过.........
    ▪NoSql之MongoDB的常用类管理      1、DBCollection的管理 package com.boonya.mongo; import java.util.Set; import com.mongodb.DBCollection; public class CollectionManager { public static DBCollection getDbCollection(String collectionName){ return DBConnection.getInstance().getC.........
    ▪ORA-39700: database must be opened with UPGRADE option      1. 错误 操作系统和数据库都是服务提供商安装的,过了几个月才想起要用这个数据库,启动时出现如下错误。 SQL> startup ORACLE instance started. Total System Global Area 4932501504 bytes Fixed Size   &n.........

[1]OEM简介及按钮乱码问题
    来源: 互联网  发布时间: 2013-11-07

自ORACLE 9i之后,Oracle提供了一个基于Web图形化数据管理工具Oracle企业管理器(Oracle Enterprise Manager),用来代替SQL命令来管理数据库。

Windows下OEM默认是开启的,可以直接访问,Linux下必须通过命令启动,相关命令如下:

--查看当前OEM状态

EMCTL STATUS DBCONSOLE;

--停止OEM

EMCTL STOP  DBCONSOLE;

--启动OEM

EMCTL STRAT DBCONSOLE;

OEM的访问URL如下:

http://localhost:1158/em

如是本地访问则lcalhost本地服务的用户名,当远程访问OEM时则可输入远程服务器的IP地址。

在Linux下安装oracle后,Windows下访问OEM时会出现按钮中文乱码情况,解决方法如下:

1、停止OEM

[oracle@localhost ~]$ emctl stop dbconsole

TZ set to PRC

Oracle Enterprise Manager 10g DatabaseControl Release 10.2.0.1.0 

Copyright (c) 1996, 2005 OracleCorporation.  All rights reserved.

http://localhost.localdomain:1158/em/console/aboutApplication

Stopping Oracle Enterprise Manager 10gDatabase Control ...

 ... Stopped.

2、找到如下路径:

$ORACLE_HOME/jdk/jre/lib

$ORACLE_HOME/jre/1.4.2/lib

,执行下列步骤

[oracle@localhost ~]$ cd/opt/oracle/product/10.2.0/db_1/jdk/jre/lib/

[oracle@localhost lib]$ cp font.propertiesfont.properties.1.bat

[oracle@localhost lib]$ cp font.properties.zh_CN.Redhatfont.properties

[oracle@localhost lib]$ cd/opt/oracle/product/10.2.0/db_1/jre/1.4.2/lib/

[oracle@localhost lib]$ cp font.propertiesfont.properties.1.bat

[oracle@localhost lib]$ cpfont.properties.zh_CN.Redhat font.properties

此时可以查看文件font.properties最后一行如下

filename.-misc-zysong18030-medium-r-normal--*-%d-*-*-c-*-iso10646-1=/usr/share/fonts/zh_CN/TrueType/zysong.ttf

3、切换root用户查看是否存在文件/usr/share/fonts/zh_CN/TrueType/zysong.ttf,默认情况下是不存在此文件,如不存在,则可从Windows下C:/Windows/fonts找到中文字符文件,如不存在可用其他文件代替,替换文件名即可,推荐使用STSONG,处理结构如下所示:

[root@localhost ~]# cd/usr/share/fonts/zh_CN/TrueType/

[root@localhost TrueType]# ll

total 11440

-rwxrwxr-x 1 root root 11697600 Mar  8 13:53 zysong.ttf

需注意的是zysong.ttf文件名必须小写。

4、清楚OEM下的缓存图片

[oracle@localhost~]$cd/opt/oracle/product/10.2.0/db_1/oc4j/j2ee/oc4j_applications/applications/em/em/cabo/images/cache/zhs/

[oracle@localhost zhs]$ ll *.gif

-rw-r----- 1 oracle oinstall 1681 Mar 1211:07 b-0c_ASH_5.gif

-rw-r----- 1 oracle oinstall 1260 Mar 1210:05 b-3d-1.gif

-rw-r----- 1 oracle oinstall 1608 Mar 1210:05 b-61af-1.gif

……

[oracle@localhost zhs]$ rm *.gif

[oracle@localhost zhs]$ rm *.imx

5、重新启动OEM

[oracle@localhost zhs]$ emctl startdbconsole

TZ set to PRC

Oracle Enterprise Manager 10g DatabaseControl Release 10.2.0.1.0 

Copyright (c) 1996, 2005 OracleCorporation.  All rights reserved.

http://localhost.localdomain:1158/em/console/aboutApplication

Starting Oracle Enterprise Manager 10gDatabase Control ................................. started.

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

Logs are generated in directory/opt/oracle/product/10.2.0/db_1/localhost.localdomain_testdb/sysman/log

作者:olnathen 发表于2013-3-12 21:37:14 原文链接
阅读:0 评论:0 查看评论

    
[2]NoSql之MongoDB的常用类管理
    来源: 互联网  发布时间: 2013-11-07

1、DBCollection的管理

package com.boonya.mongo;
import java.util.Set;
import com.mongodb.DBCollection;
public class CollectionManager {
 
 public static DBCollection  getDbCollection(String collectionName){
  return DBConnection.getInstance().getCollection(collectionName.equals("")?"myCollection":collectionName);
 }
 
 public String getCollectionNames(){
  String strNames="";
  Set<String> colls =DBConnection.getInstance().getCollectionNames();
  for (String cname : colls) {
   strNames+=cname+",";
  }
  return strNames;
 }

}

2、并发操作管理

package com.boonya.mongo;
import com.mongodb.BasicDBObject;
import com.mongodb.DB;
import com.mongodb.DBCollection;
import com.mongodb.DBObject;
import com.mongodb.WriteConcern;

public class ConcurrencyManager {
 
 private static DBCollection coll= CollectionManager.getDbCollection("myCollection");
 
 /**
  * If you want to ensure complete consistency in a “session” (maybe an http request), 
  * you would want the driver to use the same socket, which you can achieve by using a
  * “consistent request”. Call requestStart() before your operations and requestDone()
  * to release the connection back to the pool:
  * DB and DBCollection are completely thread safe. In fact, they are cached so you get
  * the same instance no matter what
  */
 public void insertData(){
  DB db=DBConnection.getInstance();
  db.requestStart();
  try {
   db.requestEnsureConnection();
   //do something
  } finally {
   db.requestDone();
  }

 }
 
 /**
  * Since by default a connection is given back to the pool after each request, you may 
  * wonder how calling getLastError() works after a write. You should actually use a 
  * write concern like WriteConcern.SAFE instead of calling getLastError() manually. 
  * The driver will then call getLastError() before putting the connection back in the pool.
  * 
  * WriteConcern.NONE            No exceptions thrown. 
     * WriteConcern.NORMAL          Exceptions are only thrown when the primary node is unreachable for
     *                              a read, or the full replica set is unreachable. 
     * WriteConcern.SAFE            Same as the above, but exceptions thrown when there is a server error
     *                              on writes or reads. Calls getLastError(). 
     * WriteConcern.REPLICAS_SAFE   Tries to write to two separate nodes. Same as the above, but
     *                              will throw an exception if two writes are not possible. 
     * WriteConcern.FSYNC_SAFE      Same  as WriteConcern.SAFE, but also waits for write to be written to disk. 
     *
  */
 public void writeConcern(){
  coll.insert(new BasicDBObject("name","boonya").append("age", 21), WriteConcern.SAFE);

  // is equivalent to

  DB db=DBConnection.getInstance();
  DBCollection coll=CollectionManager.getDbCollection("myCollection");
  db.requestStart();
  try {
     coll.insert(new BasicDBObject("name","boonya").append("age", 21));
     DBObject err = db.getLastError();
     System.out.println(err);
  } finally {
     db.requestDone();
  }

 }

}

3、数据库管理

package com.boonya.mongo;
import java.net.UnknownHostException;
import com.mongodb.MongoClient;
public class DatabaseManager {
 
 public String getDatabaseNames() throws UnknownHostException{
  String strNames="";
  MongoClient mongoClient;
  mongoClient = new MongoClient();
  for (String name : mongoClient.getDatabaseNames()) {
     strNames+=name+",";
  }
  return strNames;
 }
 
 public void  dropDatabase(String databaseName) throws UnknownHostException{
      MongoClient mongoClient = new MongoClient();
      mongoClient.dropDatabase(databaseName);
 }

}

4、文档管理

package com.boonya.mongo;
import java.util.ArrayList;
import java.util.List;
import com.mongodb.BasicDBObject;
import com.mongodb.DBCollection;
import com.mongodb.DBCursor;
import com.mongodb.DBObject;
public class DocumentManager {
 
 private static DBCollection coll= CollectionManager.getDbCollection("myCollection");
 
 public void insertADocument(){
  BasicDBObject doc = new BasicDBObject("name", "MongoDB").append("type", "database")
   .append("count", 1)
   .append("info", new BasicDBObject("x", 203).append("y", 102));
         coll.insert(doc);
 }
 
 /**
  * PRINT BELOW:
  * { "_id" : "49902cde5162504500b45c2c" ,
     * "name" : "MongoDB" ,
     * "type" : "database" ,
     *  "count" : 1 ,
     *  "info" : { "x" : 203 , "y" : 102}}
  * @return
  */
 public DBObject findTheFirstDocument(){
  System.out.println("collection count:"+coll.getCount());
  DBObject myDoc = coll.findOne();
  System.out.println(myDoc);
        return myDoc;
 }
 
    public List<DBObject> getADocumentsByCursor(){
     List<DBObject> docs=new ArrayList<DBObject>();
     DBCursor cursor =coll.find();
     try {
        while(cursor.hasNext()) {
         DBObject obj=cursor.next();
            System.out.println(obj);
            docs.add(obj);
        }
        return docs;
     } finally {
        cursor.close();
     }
 }
    
    /**
     * PRINT LIKE THIS:
     * { "_id" : "49903677516250c1008d624e" , "i" : 71 }
     */
    public void queryADocument(){
     BasicDBObject query = new BasicDBObject("i", 71);
     DBCursor cursor =coll.find();
     cursor = coll.find(query);
     try {
        while(cursor.hasNext()) {
            System.out.println(cursor.next());
        }
     } finally {
        cursor.close();
     }
    }
    
    public void  editQueryRegular(){
     //db.things.find({j: {$ne: 3}, k: {$gt: 10} });
     BasicDBObject query = new BasicDBObject("j", new BasicDBObject("$ne", 3)
            .append("k", new BasicDBObject("$gt", 10)));
     DBCursor cursor = coll.find(query);
        try {
         while(cursor.hasNext()) {
           System.out.println(cursor.next());
            }
        } finally {
         cursor.close();
        }
    }
    
    public void getAsetDocument(){
     BasicDBObject query = new BasicDBObject("i", new BasicDBObject("$gt", 50));  // e.g. find all where i > 50
//     query = new BasicDBObject("i", new BasicDBObject("$gt", 20).
//                append("$lte", 30));  // i.e.   20 < i <= 30
     DBCursor  cursor = coll.find(query);
     try {
        while(cursor.hasNext()) {
            System.out.println(cursor.next());
        }
     } finally {
        cursor.close();
     }
    }
 

}

5、索引管理

package com.boonya.mongo;
import java.util.List;
import com.mongodb.BasicDBObject;
import com.mongodb.DBCollection;
import com.mongodb.DBObject;

public class IndexManager {

  private static DBCollection coll= CollectionManager.getDbCollection("myCollection");

  public void createIndex(){
    // create index on "i", ascending
    coll.createIndex(new BasicDBObject("i", 1));
  }

  public List<DBObject> getIndexList(){
    List<DBObject> list = coll.getIndexInfo();
    for (DBObject o : list) {
       System.out.println(o);
       list.add(o);
    }
    return list;
  }

}

6、预读取机制

package com.boonya.mongo;
import com.mongodb.BasicDBObject;
import com.mongodb.DBCollection;
import com.mongodb.DBCursor;
import com.mongodb.DBObject;
import com.mongodb.ReadPreference;
public class ReadPreferences {

  private static DBCollection coll= CollectionManager.getDbCollection("myCollection");

 /**
  * ReadPreference.primary();
  * ReadPreference.primaryPreferred();
  * ReadPreference.secondary();
  * ReadPreference.secondaryPreferred();
  * ReadPreference.nearest();
  */
  public void read(){
    DBObject query = new BasicDBObject("name", "simple doc");

    //Read from primary if available, otherwise a secondary.
    ReadPreference preference = ReadPreference.primaryPreferred();
    DBCursor cur = new DBCursor(coll, query, (DBObject) preference);

    //Read from any member node from the set of nodes which respond the fastest. 
    //The responsiveness of a node is measured with pings. Any node whose ping 
    //time is within 15 milliseconds of the node with the lowest ping time is considered near.
    DBObject result =coll.findOne(query, (DBObject) ReadPreference.nearest());


    // initialize a properly tagged read preference
    ReadPreference tagged_pref =ReadPreference.secondaryPreferred(new BasicDBObject("datacenter", "Los Angeles"));

    // include the tagged read preference in this request}}
    DBObject result1=coll.findOne(new BasicDBObject("name", "simple doc"), (DBObject) tagged_pref);

    // read from either LA or US_West
    DBObject tagSetOne = new BasicDBObject("datacenter", "Los Angeles");
    DBObject tagSetTwo = new BasicDBObject("region", "US_West");
    ReadPreference pref =ReadPreference.primaryPreferred(tagSetOne, tagSetTwo);

 }

}


 

作者:boonya 发表于2013-3-12 23:39:30 原文链接
阅读:0 评论:0
    
[3]ORA-39700: database must be opened with UPGRADE option
    来源: 互联网  发布时间: 2013-11-07

1. 错误

操作系统和数据库都是服务提供商安装的,过了几个月才想起要用这个数据库,启动时出现如下错误。

SQL> startup
ORACLE instance started.

Total System Global Area 4932501504 bytes
Fixed Size                  2103096 bytes
Variable Size             889194696 bytes
Database Buffers         4026531840 bytes
Redo Buffers               14671872 bytes
Database mounted.
ORA-01092: ORACLE instance terminated. Disconnection forced
 
2. 查看alert.log

ORA-00704: bootstrap process failure
ORA-39700: database must be opened with UPGRADE option
 
3. 查看数据库版本为:10.2.0.5.0,应该是他们做过数据库的升级而没有执行这个脚本造成的
$ORACLE_HOME\rdbms\admin\catupgrd.sql;
 
4.处理过程很简单
startup upgrade;
@$ORACLE_HOME\rdbms\admin\catupgrd.sql;
@$ORACLE_HOME/rdbms/admin/utlrp.sql;  --重新编译失效的object,跟这个问题本身关系不大
重启数据库
shutdwon immediate;
startup
ok
 
 
 
 


 

作者:zero_plus 发表于2013-3-13 0:05:24 原文链接
阅读:63 评论:0 查看评论

    
最新技术文章:
▪gc buffer busy/gcs log flush sync与log file sync    ▪让你的PL/SQL更好用    ▪ADO.NET中的非脱机数据库查询
▪参数job_queue_processes与Oracle jobs    ▪11gR2游标共享新特性带来的一些问题以及_cursor...    ▪_library_cache_advice和latch:shared pool、latch:shared poo...
▪SQL: Date Utility    ▪DB2 分区表增加分区    ▪DB2第一步 — 创建表
▪oracle 数据库    ▪插入10万条记录测试    ▪rebuild index VS. rebuild index online
▪如何处理undo tablespace 表空间太大的问题    ▪ado执行存储过程中包含结果集获取输出参数为...    ▪oracle函数的demo
▪Entity Framework 学习建议及自学资源    ▪存储过程的编写    ▪Linux/Unix shell 自动发送AWR report(二)
▪第二章 Oracle恢复内部原理(基础数据结构)    ▪Redis源码学习之【Tcp Socket封装】    ▪Java Jdbc减少与Oracle之间交互提升批量处理性能...
▪南大通用GBase8a Vs Oracle11g 单机测试亲测    ▪oracle 中行列转换    ▪rhel下安装oracle10g+asm---测试环境搭建
▪Redis系列-主从复制配置    ▪MySQL索引与查询优化    ▪INDEX受到NULL值的影响
▪测试人员的SQL语言 系列    ▪SQL数据库基本语句    ▪MySQL Replication常见错误整理[持续更新...]
▪eclipse下建立esper的demo    ▪把oracle rac 转化为单机数据库    ▪Redis系列-存储篇sorted set主要操作函数小结
▪基本的SQL*Plus报表和命令    ▪druid简单教程    ▪11g调度--scheduler使用
▪EF基础一    ▪db2存储过程中循环语句while do的continue有没有...    ▪oracle 创建DBLINK
▪DB2数据库备份还原    ▪Warning: prerequisite DBD::mysql 1 not found错误解决方...    ▪innotop性能监视mysql,innodb工具
▪数据迁移:DataGuard配置    ▪QX项目实战-19.跨库数据同步    ▪Mysql EXPLAIN
▪Oracle 11g AWR 系列七:Active Session History (ASH) 报...    ▪Oracle 11G新特性(共36个)    ▪父子节点问题
▪OEM简介及按钮乱码问题    ▪NoSql之MongoDB的常用类管理    ▪ORA-39700: database must be opened with UPGRADE option
▪node.js 访问redis数据库,pub/sub    ▪使用DBMS_REDEFINITION在线重定义分区表    ▪SQL Developer 使用问题与解决方法汇总
▪oralce 11g dataguard 概念    ▪ORA-30004 错误处理    ▪oracle分组函数rollup,cube
▪Sql Developer 使用问题与解决方法汇总    ▪Configure Oracle Dataguard Primary-ASM to Physical-ASM    ▪Oracle Data Guard 理论知识
▪Control File 恢复    ▪Oracle数据文件收缩    ▪Oracle 11g AWR 系列五:如何生成 AWR 报告?
▪Wireshark数据包分析实战(第2版)    ▪MySql用户权限控制    ▪db2和oracle查询序列区别
▪更新blob字段的存储过程    ▪MySQLReport分析报告三    ▪DB2中的序列
▪Oracle中DBMS_RANDOM.STRING 的用法    ▪SQL SERVER无法安装成功,sqlstp.log文件提示[未发...    ▪Data Guard 部署物理备库的 10 大注意事项
▪万能数据库查询分析器使用技巧之(九)    ▪SQL 自定义Split函数    ▪视图 v$sql,v$sqlarea,$sqltext,v$sqltext_with_newlines 的...
▪Data Guard Standby_archive_dest 和 Log_archive_dest_n 的...    ▪机房收费系统数据库设计(一)    ▪利用putty的SSH tunnel连接Oracle
▪DBCA建库偶遇ORA-27125    ▪使用PowerPivot建立简单的分析模型    ▪Linux/Unix shell 自动发送AWR report
▪写入到blob字段的存储过程    ▪关于JDBC中ResultSet接口的一点细节探究    ▪Data Guard 配置 Standby Redo Log
▪linux下redis的安装    ▪windows下redis的安装    ▪手动创建数据库步骤(简单翻译官方文档)
▪Ubuntu安装Mongodb    ▪SQL CLR应用    ▪redis的配置文件参数--详细说明
 


站内导航:


特别声明:169IT网站部分信息来自互联网,如果侵犯您的权利,请及时告知,本站将立即删除!

©2012-2021,,E-mail:www_#163.com(请将#改为@)

浙ICP备11055608号-3