ORA01031: insufficient privileges与ORA00845: MEMORY_TARGET not supported on this system——解决

 以sys用户登录提示没有权限,如下所示:
[oracle@localhost dbs]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.1.0 Production on Wed Apr 11 22:02:22 2012

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

ERROR:
ORA-01031: insufficient privileges

Enter user-name: sys
Enter password:
ERROR:
ORA-01034: ORACLE not available
ORA-27101: shared memory realm does not exist
Linux Error: 2: No such file or directory
Process ID: 0
Session ID: 0 Serial number: 0

一、查看remote_login_passwordfile 参数的值

SQL> show parameter password

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
remote_login_passwordfile            string      EXCLUSIVE

说明:

remote_login_passwordfile参数取值情况

(参考http://wenku.baidu.com/view/0df570bc1a37f111f1855b9b.html):

1.exclusive,默认为该值。当取该值时,允许客户端以sysdba或sysoper权限登录到数据库实例中完成数

                   据库管理操作;且允许授予和回收sysdba或sysoper权限。

2.none值。当取该值时,禁止客户端以sysdba或sysoper权限登录到数据库实例中完成数据库管理操作;

               且禁止授予和回收sysdba或sysoper权限。

3.shared值。当取该值时,允许客户端以sysdba或sysoper权限登录到数据库实例中完成数据库管理操

                  作;但禁止授予和回收sysdba或sysoper权限。

二、查看v$pwfile_users视图是否有sys记录

SQL> select * from v$pwfile_users;
no rows selected

三、授权sysdba权限给sys用户,此时会无法授权,丢失密码文件

SQL> grant sysdba to sys;
grant sysdba to sys
*
ERROR at line 1:
ORA-01994: GRANT failed: password file missing or disabled

四、重建密码文件
[oracle@localhost ~]$ orapwd file=/oradata/oracle/112/database/orapworcl.ora password=qaz entries=10 force=y

OPW-00001: Unable to open password-file
注意 :密码文件的路径不能写错了。本centos系统的oracle密码文件是在/oradata/oracle/112/dbs这个路径下。
[oracle@localhost ~]$ orapwd file=/oradata/oracle/112/dbs/orapworcl.ora password=qaz entries=10 force=y
创建成功。

五、再次查看该视图,有sys记录了
SQL> select * from v$pwfile_users;

USERNAME                       SYSDB SYSOP SYSAS
------------------------------ ----- ----- -----
SYS                            TRUE  TRUE  FALSE

六、执行授权sysdba给sys用户,成功
SQL> grant sysdba to sys;

Grant succeeded.

七、再次以sys用户登录数据库,发现又报错了,内存不够。

[oracle@localhost ~]$ sqlplus /nolog

SQL*Plus: Release 11.2.0.1.0 Production on Thu Apr 12 14:12:52 2012

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

SQL> conn sys/xxx@orcl as sysdba
Connected to an idle instance.
SQL> startup
ORA-00845: MEMORY_TARGET not supported on this system
 

八、通过df -h查看,发现没有tmpfs文件系统了

九、增加tmpfs系统大小并挂载。查看我的另一篇博客 tmpfs文件系统

十一、再次启动oracle服务成功

SQL> startup
ORACLE instance started.

Total System Global Area  523108352 bytes
Fixed Size                  1337632 bytes
Variable Size             327157472 bytes
Database Buffers          188743680 bytes
Redo Buffers                5869568 bytes
Database mounted.
Database opened.
 


原文地址:https://www.cnblogs.com/lanzi/p/2444136.html