我正在尝试使用此命令直接在sqlplus中登录(无需输入用户名和密码)
sqlplus / @ db_name
但我遇到了这个错误
ORA-01017: invalid username/password; logon denied
我被授予OPS $用户
GRANT CONNECT TO ops$user;
答案 0 :(得分:0)
好的,因为数据库在本地机器上,你不应该使用@db_name,“sqlplus /”应该正常工作 - 只需确保正确设置环境变量ORACLE_SID。 注意请确保在创建用户时指定了“IDENTIFIED EXTERNALLY”。 请注意,您必须以“用户”身份登录到计算机;我记得在Windows上可能还需要域作为Oracle用户名的一部分。
答案 1 :(得分:0)
这是我用作以os身份验证的用户身份登录的脚本。请注意init设置“os_authent_prefix”。如果它设置为“OPS $”并且您希望保持这种方式,则必须修改脚本,以便您创建的用户名以“OPS $”为前缀。
祝你好运!
--------------------------------------------------------------------------------
-- name: create_os_user.sql
-- purpose:
-- author: Bjarte Brandt
-- date: 25.10.2010
-- remarks:
-- alter system set os_authent_prefix='' scope=spfile;
--------------------------------------------------------------------------------
set ver off
prompt parameter OS_AUTHENT_PREFIX has to be empty.
prompt
show parameter os_authent_prefix
set term off
column col noprint new_value os_user
select upper(SYS_CONTEXT('USERENV','OS_USER')) col from dual;
set term on
prompt
prompt Create user: "&os_user"
create user "&os_user" identified externally;
grant dba to "&os_user";
set ver on