首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > oracle >

ORA-01034引发的一系列有关问题

2012-02-07 
ORA-01034引发的一系列问题我进入数据库以后,可以进行show user等操作,但无法进行某些操作,比如select,alt

ORA-01034引发的一系列问题
我进入数据库以后,可以进行show user等操作,但无法进行某些操作,比如select,alter等如下
SQL> connect /as sysdba
Connected to an idle instance.
SQL> select * from v$version
  2 ;
select * from v$version
*
ERROR at line 1:
ORA-01034: ORACLE not available
Process ID: 0
Session ID: 0 Serial number: 0


SQL> quit
Disconnected
我以为要先用emtcl start dbconsole
先用emtcl status dbconsole,但是告诉我DORACLE_UNIQNAME不存在,需要设置,我设置成
set ORACLE_UNIQNAME=$ORACLE_SID,但是执行上述命令还是不行
我就在.bash_profile里面export了ORACLE_UNIQNAME,然后就问题更大了,就出现了
OC4J Configuration issue. /home/oracle/u01/app/product/11.1.0/db_1/oc4j/j2ee/OC4J_DBConsole_localhost.localdomain_ORCL not found. 
我找了一下,确实没有这个文件,又回去改了.bash_profile
但是执行上述命令还是一样的找不到那个文件,显示如下
[oracle@localhost ~]$ cd /home/oracle/u01/app/product/11.1.0/db_1/oc4j/j2ee/
[oracle@localhost j2ee]$ ll
total 64
-rw-r--r-- 1 oracle oinstall 1009 Aug 15 11:20 deploy_db_wf.ini
drwxr-xr-x 14 oracle oinstall 4096 Aug 15 11:04 home
drwxr-xr-x 3 oracle oinstall 4096 Aug 15 10:54 oc4j_applications
drwxr-x--- 6 oracle oinstall 4096 Aug 15 10:54 OC4J_DBConsole
drwxr-x--- 10 oracle oinstall 4096 Aug 15 12:16 OC4J_DBConsole_localhost_orcl
drwxr-xr-x 5 oracle oinstall 4096 Aug 15 10:54 OC4J_Workflow_Component_Container
drwxr-xr-x 5 oracle oinstall 4096 Aug 15 10:54 OC4J_Workflow_Management_Container
drwxr-xr-x 2 oracle oinstall 4096 Aug 15 11:03 utilities

然后 我在网上找了方法说,首先emca -repos recreate
但是出现了一下情况
[oracle@localhost ~]$ emca -repos recreate

STARTED EMCA at Sep 21, 2011 11:25:38 AM
EM Configuration Assistant, Version 11.2.0.0.2 Production
Copyright (c) 2003, 2005, Oracle. All rights reserved.

Enter the following information:
Database SID: ORCL
Listener port number: 1521
Password for SYS user:  
Password for SYSMAN user:  
Password for SYSMAN user:  
Do you wish to continue? [yes(Y)/no(N)]: y
Sep 21, 2011 11:26:31 AM oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at /home/oracle/u01/app/cfgtoollogs/emca/emca_2011_09_21_11_25_37.log.
Sep 21, 2011 11:26:32 AM oracle.sysman.emcp.EMConfig perform
SEVERE: Database instance unavailable.
Refer to the log file at /home/oracle/u01/app/cfgtoollogs/emca/emca_2011_09_21_11_25_37.log for more details.
Could not complete the configuration. Refer to the log file at /home/oracle/u01/app/cfgtoollogs/emca/emca_2011_09_21_11_25_37.log for more detail
我在/home/oracle/u01/app/cfgtoollogs/emca/emca_2011_09_21_11_25_37.log.里面贴出了下面的内容
21/09/2011 11:26:32 oracle.sysman.emcp.EMConfig perform
SEVERE: Database instance unavailable.
Refer to the log file at /home/oracle/u01/app/cfgtoollogs/emca/emca_2011_09_21_11_25_37.log for more details.
21/09/2011 11:26:32 oracle.sysman.emcp.EMConfig perform
CONFIG: Stack Trace:
oracle.sysman.emcp.exception.EMConfigException: Database instance unavailable.
  at oracle.sysman.emcp.EMDBPreConfig.checkServiceName(EMDBPreConfig.java:1574)
  at oracle.sysman.emcp.EMDBPreConfig.checkReposParams(EMDBPreConfig.java:2600)
  at oracle.sysman.emcp.EMDBPreConfig.checkParameters(EMDBPreConfig.java:1354)
  at oracle.sysman.emcp.EMDBPreConfig.invoke(EMDBPreConfig.java:209)
  at oracle.sysman.emcp.EMDBPreConfig.invoke(EMDBPreConfig.java:195)
  at oracle.sysman.emcp.EMConfig.perform(EMConfig.java:250)
  at oracle.sysman.emcp.EMConfigAssistant.invokeEMCA(EMConfigAssistant.java:589)
  at oracle.sysman.emcp.EMConfigAssistant.performConfiguration(EMConfigAssistant.java:1448)
  at oracle.sysman.emcp.EMConfigAssistant.statusMain(EMConfigAssistant.java:573)
  at oracle.sysman.emcp.EMConfigAssistant.main(EMConfigAssistant.java:521)
21/09/2011 11:26:32 oracle.sysman.emcp.EMConfig restoreOuiLoc


CONFIG: Restoring oracle.installer.oui_loc to /home/oracle/u01/app/product/11.1.0/db_1/oui
请帮忙解决下这个问题吧,非常感谢!


[解决办法]
这是因为在oracle9i和oracle10g中,数据库默认将使用spfile启动数据库,如果spfile不存在,则就会出现上述错误。
解决方法:
将$ORACLE_BASE/admin/数据库名称/pfile目录下的init.ora.012009233838形式的文件copy 到$ORACLE_HOME/dbs目录下initoracle.ora即可。(注:initoracle.ora中的oracle为你的实例名 ORACLE_SID)
比如我的就为:
cp /oracle/admin/xok/pfile/init.ora.75200916276 /oracle/product/11.1.0/dbs/initorcl.ora
sqlplus / as sysdba;
SQL> startup
ORACLE instance started.
Total System Global Area 855982080 bytes
Fixed Size 2143000 bytes
Variable Size 486542568 bytes
Database Buffers 360710144 bytes
Redo Buffers 6586368 bytes

热点排行