Oracle启停与sqlplus登陆命令笔记
1. How does one use the SQL*Plus utility?
Start using SQL*Plus by executing the “sqlplus” command-line utility from the $ORACLE_HOME/bin directory. Some of the command line options:
userid/password@db — Connection details
/nolog — Do not login to Oracle. You will need to do it yourself.
-s or -silent — start sqlplus in silent mode. Not recommended for beginners!
@myscript — Start executing script called “myscript.sql”
Logon |
has the following syntax:
{username[/password][@connect_identifier | / } [AS {SYSOPER|SYSDBA}] | /NOLOG |
Logon
username[/password]
sqlplus username[/password]
it could be viewable by anyone on your system. Some operating systems have monitoring tools that list all executing commands and their arguments.
If you omit username and password, SQL*Plus prompts you for them. If you omit only password, SQL*Plus prompts you for password. When prompting, SQL*Plus does not display password on your terminal screen. In silent mode, username and password prompts are not visible – your username will appear as you type it, but not your password.
@connect_identifier
/
AS {SYSOPER|SYSDBA}
If you use this option, you need to quote the command arguments on many operating systems, for example:
SQLPLUS "/ AS SYSDBA" SQLPLUS "SYSTEM/your_password AS SYSOPER"
/NOLOG
Look at this example session:
sqlplus /nolog SQL> CONNECT scott/tiger SQL> SELECT * FROM tab; SQL> disconnect SQL> exit |
c:> sqlplus /nolog sql> CONNECT sys/manager AS sysdba sql>shutdown immediate sql> startup sql> exit |
sqlplus / AS sysdba SQL>startup SQL>quit |
2. 启停Oracle
——————————–Stop Oracle DB:———————————-
su - oracle sqlplus / AS sysdba SQL>shutdown immediate |
————————-Start Oracle DB:—————————————–
su - oracle lsnrctl START export ORACLE_SID=cdlteva3 //cdlteva3 IS the db name , IF there are more than 1 db instance ON the machine sqlplus / AS sysdba SQL>startup SQL>quit |
——————————–Check listener status:———————————-
su - oracle lsnrctl STATUS |
——————————Start listener:—————————–
su - oracle lsnrctl START |
——————————Stop listener:—————————–
su - oracle
lsnrctl stop |
——————————————————————
3. 查看数据库是否启动
tnsping ora10gcsdl |
看着你这个日志我就想起我前天和大前天都是早上7点睡的。。。为了oracle的project。。。
Oracle的project? 现在去甲骨文了? 注意休息啊要。。
没有这么厉害。。。course project而已啦。。。今天刚联系了一个oracle的人 告诉我人家马上要人。。。我得等年底毕业才能工作 算是拒了。。。