虚拟化容器,大数据,DBA,中间件,监控。

linux下root用户登陆oracle10g2

16 11月
作者:admin|分类:DBA运维
linux下root用户登陆oracle10g2


将oracle用户下的环境变量文件.bash_prife文件拷到root用户下,不然不能使用oracle的相关命令。
一般情况下登陆oracle时用以下命令:

#[root@yupan ~]# sqlplus /nolog

SQL*Plus: Release 10.2.0.1.0 - Production on Mon Dec 6 09:31:22 2010

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

#SQL> connect sys/yupan80614621 as sysdba
ERROR:
ORA-12546: TNS:permission denied

这是在root用户下登陆,报orac-12546错识。

SQL> connect as sysdba
Enter user-name: sys
Enter password:
ERROR:
ORA-12546: TNS:permission denied

SQL> connect /as sysdba
ERROR:
ORA-12546: TNS:permission denied

系统验证方式登陆也不可以。
要登陆oracle有两种方式,一个是su oracle 命令,
进入oracle用户下。可能正常登陆。
另一种方式:登陆时加上oracle SID
如下命令:
SQL> connect sys/yupan80614621@yupan as sysdba
Connected.

不想泄露密码就如此登陆:
SQL> connect sys/yupan80614621@yupan as sysdba
Connected.
SQL>

如此就可以在root用户下正常登陆oracle10g.

但是有个问题,
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORA-12514: TNS:listener does not currently know of service requested in connect descriptor

关闭数据库后,再重新启动数据库,报以上错识。
而且也不能再用以上方式登陆数据库了。

SQL> connect sys@yupan as sysdba
Enter password:
ERROR:
ORA-12514: TNS:listener does not currently know of service requested in connect
descriptor

后来发现只能在oracle用户下,进oracle然后开启数据库。

[root@yupan ~]# su oracle
[oracle@yupan root]$ sqlplus /nolog

SQL*Plus: Release 10.2.0.1.0 - Production on Mon Dec 6 11:24:14 2010

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

SQL> connect /as sysdba
Connected to an idle instance.
SQL> startup
ORACLE instance started.

Total System Global Area 243269632 bytes
Fixed Size                  1218748 bytes
Variable Size              88082244 bytes
Database Buffers          150994944 bytes
Redo Buffers                2973696 bytes
Database mounted.
Database opened.
SQL>



浏览2423 评论0
返回
目录
返回
首页
OC4J Configuration issue. 报错,无法启动数据库服务。 LVS+Keepalived实现高可用集群