sqlplus "sys/test1234 as sysbda"
desc $controlfile
select status,name form v$controlfile;
desc v$datafile
select file#,status from v$datafile;
desc v$logfile
select member from v$logfile;
SGA :
DB buffer, 大共享區, 共享池, Redo buffer, 固定SGA
DB高速緩存池(DB buffer): 默認緩存池, 保持緩池, 再生緩存池
共享池: 庫緩存區(共享SQL區 PL/SQL區), 字典緩存區
塊(block 8K 操作系統的整數倍) 盤區(extent) 段(segment) 表空間(tablespace) 數據文件(datafile)
我們只能指定表在那個表空間中
sqlplus/nolog
connect sys/test1234 as sysdba
startup 實例 控制文件 數據文件
startup mount 啟動數據文件 但是不啟動控制文件
archive log list
startup mount alter database open 非歸檔方式改為歸檔方式
startup nomount 控制文件失的時間,重新創建控制文件
shutdown immediate
shutdown
shutdown transactional
shutdown abort 強行關閉數據庫
http://192.168.1.93:5560/isqlplus
alter user TESTUSER account unlock;
create user "test" identifIEd by "test";
grant connect to "test";
sqlplus scott/tiger
help index
select * from dept
? set
set sqlblanklines on 支持空格行
替代變量
select * from dept where deptno=10
select * from dept where deptno=&tt
查看命令
list l
l 1 2
c /n/m
l
/
? change
del 4
l
del 2 3
l
a from dept
save d:\Oracle\test.txt
l
@c:\Oracle\test.txt
get c:\orcle\text.txt
edit
/
? col
col deptno heading "編號"
desc dept
col dname format a10 heading "部門名稱"
col deptno format 999,999,999
connect sys/test1234 as sysdba
set linesize 50
ttitle center "我的標題" skip 1-
left "測試報表" right "頁" -
format 999 sql.pno skip 2
ttitle off
break
? conp
break on pub
select * from books
conp count label "計數" of books_name on pub
spool d:\1.txt
spool off
edit d:\1.txt
視圖學習
視圖稱為虛表
視圖的作用 安全性 方便 一致性
create or replace view myvIEw
as
select * from dept
create or replace view myvIEw
as
select * from books where price>30
with check option
edit c:\1.txt
@ c:\1.txt
create or r