Oracle11G
imp user/pass@orcl file=/opt/user.dmp fromuser=user touser=user ignore=y;
出现 IMP-00058: ORACLE error 12154 encountered 错误。
发现 /data/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@demo admin]$ more listener.ora
# listener.ora Network Configuration File: /data/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 = demo)(PORT = 1521))
)
)
ADR_BASE_LISTENER = /data/oracle
注意HOST参数需要与系统的hostname一致
[oracle@demo 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 = /data/oracle
[oracle@demo 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.
ORCL =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = demo)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl)
)
)
阅读(10298) | 评论(0) | 转发(0) |