imp icms/password@portaldb file=/home/oracle/icms.dmp fromuser=icms touser=icms ignore=y;
出现 IMP-00058: ORACLE error 12154 encountered 错误。
发现 /opt/oracle/product/11.2.0/db_1/network/admin/目录下没有listener.ora 、sqlnet.ora、 tnsnames.ora三个文件,需要手工添加并且更正文件权限为安装oracle的用户权限 oracle:oinstall。
原因:数据库安装时,没有同时创建数据库实例,只是安装了数据库软件,oracle没有创建默认的网络参数文件,导致imp连接不到数据库的监听器(lsnrctl)。
1.首先关闭数据库:SQL>shutdown immediate;
2.然后重起监听器:LSNRCTL>stop
LSNRCTL>start
3.最后启动数据库:SQL>startup open;
4.各文件内容修改如下:
[oracle@portaldb admin]$ more listener.ora
# listener.ora Network Configuration File: /opt/oracle/product/11.2.0/db_1/network/admin/listener.ora
# Generated by Oracle configuration tools.
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = portal1)(PORT = 1521))
)
)
ADR_BASE_LISTENER = /data/oracle
注意HOST参数需要与系统的hostname一致
[oracle@portal1 admin]$ more sqlnet.ora
# sqlnet.ora Network Configuration File: /opt/oracle/product/11.2.0/db_1/network/admin/sqlnet.ora
# Generated by Oracle configuration tools.
NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT)
ADR_BASE = /opt/oracle
[oracle@portal1 admin]$ more tnsnames.ora
# tnsnames.ora Network Configuration File: /opt/oracle/product/11.2.0/db_1/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.
PORTALDB =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = portal1)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = portaldb)
)
)
5.tnsping portaldb查看是否可以正常。
阅读(10089) | 评论(0) | 转发(0) |