oracle登录
sqlplus sys/oracle as sysdba
这个登录之后呢
会出现这个:
Connected to an idle instance.
这一步是连接上
[oracle@redhat ~]$ sqlplus sys/oracle as sysdba
SQL*Plus: Release 12.1.0.2.0 Production on Mon Jun 13 13:04:36 2016
Copyright (c) 1982, 2014, Oracle. All rights reserved.
Connected to an idle instance.
创建实例
SQL> startup
ORACLE instance started.
Total System Global Area 792723456 bytes
Fixed Size 2929400 bytes
Variable Size 545262856 bytes
Database Buffers 239075328 bytes
Redo Buffers 5455872 bytes
Database mounted.
Database opened.
SQL> ed
SP2-0107: Nothing to save.
果然oracle啥都不懂,说实话我还去应聘了一家公司的dba,我也是没谁了
Linux环境下启动oracle实例
在linux环境下启动和关闭oracle实例,一般是在SQL * Plus提示下分别采用startup和shutdown命令来实现的
Connected to an idle instance.
startup
startup nomount
startup open
在SQL>下用startup正常启动Oracle数据库实例
1:sqlplus /nolog
2:connect /as sysdba
3:startup
新安装oracle时,默认scott账户为锁定,需要用sys的身份来解锁
以sys登录之后
alter user scott account unlock;
解锁成功之后,在启动sqlplus后发现口令过期,需要更改口令
alter user scott identified by tiger;
再次登录
sqlplus scott/tiger;
SQL> alter user scott account unlock;
alter user scott account unlock
*
ERROR at line 1:
ORA-01918: user ‘SCOTT’ does not exist
ctrl+backspace组合键可以回删错误的命令
oracle scott已经被移除,我已哭晕在厕所。。。
还是要先startup一下
不能直接运行scott.sql
不然会报错