运行sql*plus的步骤
同时按住”win“(一般在ctrl键和alt键中间)+”r“(字母键)
输入”cmd“,之後按回车(enter)
在命令行输入”sqlplus“,进入oracle的sql*plus,输入数据库的用户名和密码进行登录操作
oracle的sql*plus是与oracle进行交互的客户端工具,借助sql*plus可以查看、修改数据库记录。在sql*plus中,可以运行sql*plus命令与sql语句。
startup 开启
shutdown immediate 关闭
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!