我进入数据库以后,可以进行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 recreateSTARTED 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
请帮忙解决下这个问题吧,非常感谢!