sqlplus远程连接给ORA-21561

时间:2015-07-10 10:49:40

标签: oracle sqlplus

我已根据给定here

的指令安装了sqlplus
sqlplus 'username/password@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.0.100)(PORT=1521))(CONNECT_DATA=(SID=ORCL)))'

这给了我错误

SQL*Plus: Release 11.2.0.4.0 Production on Fri Jul 10 16:10:38 2015

Copyright (c) 1982, 2013, Oracle.  All rights reserved.

ERROR:
ORA-21561: OID generation failed


Enter user-name: 

这个问题的解决方案是什么?

PS:我已经添加了主机名,主机已经有了价值。

6 个答案:

答案 0 :(得分:58)

将服务器名称附加到hosts文件。

如果您的/ etc / hosts文件如下所示:

127.0.0.1   localhost localhost.localdomain

应该改为:

127.0.0.1   localhost localhost.localdomain hostname

hostname可以从命令" hostname"。

获得

答案 1 :(得分:13)

如果您使用的是Mac,请将本地计算机名称添加到/ etc / hosts

中的127.0.0.1

就像

var phpString = "<?php echo json_encode($file_lines); ?>";

查找本地计算机名称的方法

系统偏好设置&gt;分享(如果找不到,请搜索它) 在顶部,您可以看到您的本地计算机名称

或者您可以使用&#34;主机名&#34;命令获取本地计算机名称

答案 2 :(得分:0)

此问题也可能是由Option Explicit Sub CopyRng(frmSht As Worksheet, frmRow As Integer, offset As Integer, toRow As Integer) Dim r As Integer For r = 1 To 3: Sheets(3).Cells(toRow, offset + 2 * r).Value = frmSht.Cells(frmRow, r).Value Next End Sub Sub InterleaveRows() Dim dict As Object Set dict = CreateObject("Scripting.Dictionary") With Sheets(2) Dim r As Integer, r2 As Integer, r3 As Integer: r3 = 2 Dim val As String For r = 2 To .Range("A" & .Rows.Count).End(xlUp).row: dict(.Cells(r, "A").Value) = r Next End With CopyRng Sheets(1), 1, -1, 1 CopyRng Sheets(2), 1, 0, 1 For r = 2 To Sheets(1).Range("A" & Sheets(1).Rows.Count).End(xlUp).row: val = Sheets(1).Cells(r, "A").Value If (dict.Exists(val)) Then r2 = dict(val) CopyRng Sheets(1), r, -1, r3 CopyRng Sheets(2), r2, 0, r3 dict.Remove val Else CopyRng Sheets(1), r, -1, r3 End If r3 = r3 + 1 Next For r = 0 To dict.Count - 1 r2 = dict.items()(r) CopyRng Sheets(2), r2, 0, r3 r3 = r3 + 1 Next End Sub 文件上的错误权限引起的。如果Oracle uid无法读取,则会显示错误。

确保所有人都可以阅读/ etc / hosts:

/etc/hosts

答案 3 :(得分:0)

获得的答案here

1 - 获取您的主机名:

$ hostname

新宿主

2 - 更改/ etc / hosts的内容:

$ sudo cat / etc / hosts

127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain

:: 1 localhost localhost.localdomain localhost6 localhost6.localdomain6

$ sudo nano / etc / hosts

$ sudo cat / etc / hosts

127.0.0.1 localhost new-host

:: 1 localhost localhost.localdomain localhost6 localhost6.localdomain6

希望这会有所帮助(:

答案 4 :(得分:0)

查看/ etc / sysconfig / network 如果需要更改主机名

答案 5 :(得分:-1)

试试这个,不要单引号

sqlplus username/password@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.0.100)(PORT=1521))(CONNECT_DATA=(SID=ORCL)))