熟悉SHELL的哥们帮下忙

[复制链接]
查看11 | 回复9 | 2011-11-1 16:21:15 | 显示全部楼层 |阅读模式
这个是SHELL中的一段
conn / as sysoper
shutdown immediate
EOF
然后执行
SQL> Connected.
SQL> SQL> Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> Disconnected from Oracle Database 10g Enterprise Edition Release 10.1.0.4.0 - Production
数据库可以正常关闭.
但是我加了一个ALTER SYSTEM SWITCH LOGFILE
conn / as sysoper
alter system swich logfile
shutdown immediate
EOF
SQL> Connected.
SQL> 23Disconnected from Oracle Database 10g Enterprise Edition Release 10.1.0.4.0 - Production
With the Partitioning, Oracle Label Security and Data Mining Scoring Engine options
Database "sun" shut down.
却报这个,不知道这个alter system swich logfile应该怎么写才好
回复

使用道具 举报

千问 | 2011-11-1 16:21:15 | 显示全部楼层
ALTER SYSTEM SWITCH LOGFILE后要有分号
回复

使用道具 举报

千问 | 2011-11-1 16:21:15 | 显示全部楼层
加分号
回复

使用道具 举报

千问 | 2011-11-1 16:21:15 | 显示全部楼层
注意sqlplus命令与sql语句的区别
回复

使用道具 举报

千问 | 2011-11-1 16:21:15 | 显示全部楼层
最初由 rejoice999 发布
[B]加分号 [/B]


conn / as sysoper
alter system switch logfile ;
shutdown immediate
EOF
改成这样之后,还是不可以
Copyright (c) 1982, 2005, Oracle.All rights reserved.
SQL> Connected.
SQL> alter system switch logfile
*
ERROR at line 1:
ORA-01031: insufficient privileges
回复

使用道具 举报

千问 | 2011-11-1 16:21:15 | 显示全部楼层
insufficient privileges
权限不够
conn / as sysoper 之前加一个spool a.log
之后 show user
spool off看看connect / as sysoper 是不是有问题 ?
回复

使用道具 举报

千问 | 2011-11-1 16:21:15 | 显示全部楼层
sysoper 没有 alter system switch logfile ; 的权限
回复

使用道具 举报

千问 | 2011-11-1 16:21:15 | 显示全部楼层
谢谢,我改成这样了,还是不可以
connect sys/systemas sysdba
alter system switch logfile ;
shutdown immediate;

Copyright (c) 1982, 2005, Oracle.All rights reserved.
SQL> ERROR:
ORA-01031: insufficient privileges
SQL> SP2-0640: Not connected
SQL> ORA-01012: not logged on
回复

使用道具 举报

千问 | 2011-11-1 16:21:15 | 显示全部楼层
兄弟把所有的脚本贴出来看看吧,别这样挤牙膏了,挤呀挤挤呀挤
回复

使用道具 举报

千问 | 2011-11-1 16:21:15 | 显示全部楼层
connect sys/system as sysdba
SQL> ERROR:
ORA-01031: insufficient privileges
SQL> SP2-0640: Not connected
SQL> ORA-01012: not logged on

你看这个提示是登陆失败啊
要么你密码不对,要么你这个用户没有 os认证的权限(比如不属于dba组)
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行