码迷,mamicode.com
首页 > 数据库 > 详细

oracle基础

时间:2015-10-09 15:11:03      阅读:193      评论:0      收藏:0      [点我收藏+]

标签:

 2015-10-09

-------------------------------------------
第01章 oracle数据库基础

SQL语言
1.DDL(Data Definition Language)数据定义语言
create,alter,drop
rename
truncate
grant,revoke
audit,noaudit
comment

2.DML(Data Manipulation Language)数据操作语言
select
insert
update
merge
delete
explain plan
lock table

3.DCL(Data Control Language)数据控制语言
commit
rollback
savepoint
set transaction
alter session
set role
alter system
declare cursor,open,close
declare database,connect
declare statement
describe
whenever
prepare,execute,execute immediate
fetch

----------------------------------------
第02章 oracle数据库连接

sqlplus 用户名/密码 as 角色
sqlplus sys/oracle as sysdba
sqlplus scott/tiger as sysdba

查看当前数据库名
SQL> select name from v$database;

-----------------------------------------
第03章 数据库的启动与关闭

数据库启动到NOMOUNT状态
$sqlplus / nolog
SQL> connect / as sysdba
SLQ> startup
查看告警追踪文件位置
SQL> show parameter background_dump_dest;

NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
background_dump_dest string /u01/app/oracle/diag/rdbms/orc
l/orcl/trace

查看控制文件是否打开
SQL> select * from v$controlfile;

STATUS
-------
NAME
--------------------------------------------------------------------------------
IS_ BLOCK_SIZE FILE_SIZE_BLKS
--- ---------- --------------

/u01/app/oracle/oradata/orcl/control01.ctl
NO 16384 594


/u01/app/oracle/flash_recovery_area/orcl/control02.ctl
NO 16384 594

STATUS
-------
NAME
--------------------------------------------------------------------------------
IS_ BLOCK_SIZE FILE_SIZE_BLKS
--- ---------- --------------

查看控制文件位置
SQL> show parameter control_files;

NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
control_files string /u01/app/oracle/oradata/orcl/c
ontrol01.ctl, /u01/app/oracle/
flash_recovery_area/orcl/contr
ol02.ctl


SQL> select * from scott.dept;

DEPTNO DNAME LOC
---------- -------------- -------------
10 ACCOUNTING NEW YORK
20 RESEARCH DALLAS
30 SALES CHICAGO
40 OPERATIONS BOSTON

 

oracle基础

标签:

原文地址:http://www.cnblogs.com/cenliang/p/4863934.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!