急急急 如何在SQL*Plus中,用命令行关闭和开启Oracle数据库服务器?
答案:2 悬赏:10 手机版
解决时间 2021-02-01 21:15
- 提问者网友:不爱我么
- 2021-02-01 10:25
高人帮忙啊
最佳答案
- 五星知识达人网友:猎心人
- 2021-02-01 12:00
1. Set up your Oracle environment.
If you are using Windows operating system, do the followings:
set ORACLE_HOME=C:\oracle\product\10.2.0.1.0
set ORACLE_SID=xxxxxxx
(Change C:\oracle\product\10.2.0.1.0 to your own Oracle Home)
(Change xxxxxxx to your database name)
If you are using UNIX (e.g. HP-UX) operating system, do the followings:
export ORACLE_SID=xxxxxxx
export ORACLE_HOME=/u01/app/oracle/product/10.2.0.1.0
(Change /u01/app/oracle/product/10.2.0.1.0 to your own Oracle Home)
(Change xxxxxxx to your database name)
2. connect as sysdba
Start SQL*Plus, and connect to the database as sysdba. Use the following command:
connect sys/aaaaaaa@bbbbbbb as sysdba
(aaaaaaa is your password for sys)
(bbbbbbb is the connection string defined in tnsnames.ora)
3. Shut down or start up database.
To shut down, use this command:
shutdowm immediate
If the database has problem, and it hangs, use this command:
shutdown abort
To startup, use this command:
startup
If the database does not use spfile, and the pfile is not in the default location, use this command:
startup pfile=C:\aaa\bbb\ccc\ddd\init.ora
(C:\aaa\bbb\ccc\ddd\init.ora should be the init.ora file’s path of your database)
Good luck!
If you are using Windows operating system, do the followings:
set ORACLE_HOME=C:\oracle\product\10.2.0.1.0
set ORACLE_SID=xxxxxxx
(Change C:\oracle\product\10.2.0.1.0 to your own Oracle Home)
(Change xxxxxxx to your database name)
If you are using UNIX (e.g. HP-UX) operating system, do the followings:
export ORACLE_SID=xxxxxxx
export ORACLE_HOME=/u01/app/oracle/product/10.2.0.1.0
(Change /u01/app/oracle/product/10.2.0.1.0 to your own Oracle Home)
(Change xxxxxxx to your database name)
2. connect as sysdba
Start SQL*Plus, and connect to the database as sysdba. Use the following command:
connect sys/aaaaaaa@bbbbbbb as sysdba
(aaaaaaa is your password for sys)
(bbbbbbb is the connection string defined in tnsnames.ora)
3. Shut down or start up database.
To shut down, use this command:
shutdowm immediate
If the database has problem, and it hangs, use this command:
shutdown abort
To startup, use this command:
startup
If the database does not use spfile, and the pfile is not in the default location, use this command:
startup pfile=C:\aaa\bbb\ccc\ddd\init.ora
(C:\aaa\bbb\ccc\ddd\init.ora should be the init.ora file’s path of your database)
Good luck!
全部回答
- 1楼网友:动情书生
- 2021-02-01 12:24
运行sql*plus的步骤
同时按住”win“(一般在ctrl键和alt键中间)+”r“(字母键)
输入”cmd“,之後按回车(enter)
在命令行输入”sqlplus“,进入oracle的sql*plus,输入数据库的用户名和密码进行登录操作
oracle的sql*plus是与oracle进行交互的客户端工具,借助sql*plus可以查看、修改数据库记录。在sql*plus中,可以运行sql*plus命令与sql语句。
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯