查看監聽:lsnrctl status
停止監聽:lsnrctl stop
1、oracle 數據服務器包括:實例進程和數據庫;
實例進程包括:memory structure(sga)以及background process(pmon(進程監控)、smon(系統監控system monitor,空間整理3秒)、dbwr(髒數據處理)、lgwr(將redo buffer文件寫會log),ckpt(checkpoint,同步數據,先寫日誌、髒數據)等進程);
數據庫包括:數據文件、控制文件,redo log 文件,三者是必須的,至於 參數文件、密碼文件、歸檔文件是可選的,根據數據庫的狀態而定;
2、pga:包括user process 和server process,user process通過server process來與oracle的實例進行進行通信。
3、sga=share pool+database buffer cache+redo log buffer + other structures(large pool,java pool可選)
shared_pool=library cache(sql共享,緩衝sql的執行計劃,採用最近最少使用算法) + data dictionary cache(row cache,數據字典);
database buffer cache(db_cache_size):oracle以block size最爲基本的數據讀寫單位
redo log buffer cache:
4、改變參數:
alter system set shared_pool_size=64m;
alter system set db_cache_size=64m;
alter system set large_pool_size=64m;
5、os驗證用戶:
create user id
create group (ora_dba,ora_databasename_dba,ora_oper,ora_databasename_oper)
add user id to group id
edit sqlnet.ora (sqlnet.authentication_services=(nts))
6、忘記system/sys的密碼:
刪掉E:oracleproduct10.2.0db_1databasepwdtestdb.ora;
使用命令:orapwd file=d:pwdtestdb.ora password=admin1 entries=10;將密碼設置爲admin1;
或則:
sqlplus /@testdb as sysdba
alter user sys identified by 新密碼;
alter user system identified by 新密碼;
7、block(塊) extend(盤區) segment(段) tablespace(表空間)
8、網絡服務的配置信息在D:oracleproduct10.2.0db_1NETWORKADMIN nsnames.ora文件中記錄
數據庫的啓動命令
1、啓動TNS監聽
C:Documents and SettingsAdministrator>lsnrctl start
2、啓動Oracle Services
C:Documents and SettingsAdministrator>net start OracleServiceOrcl
3、以sysdba身份登錄
SQL> connect system as sysdba
4、啓動isqlplus
C:Documents and SettingsAdministrator>isqlplusctl start
5、啓動database control
C:Documents and SettingsAdministrator>emctl start dbconsole
如果啓動錯誤,很可能是ip地址進行了修改,可採取如下措施:
set oracle_hostname=主機名
emca -config dbcontrol db,進行相應的配置。
6、http://localhost:1158/em/
<打開控制檯輸出>
1、show all
serveroutput OFF
2、set serveroutput on
啓動及關閉模式
Oracle數據庫的幾種啓動和關閉方式
有以下幾種啓動方式:
1、startup nomount
非安裝啓動,這種方式啓動下可執行:重建控制文件、重建數據庫
讀取init.ora文件,啓動instance,即啓動SGA和後臺進程,這種啓動只需要init.ora文件。
2、startup mount dbname
安裝啓動,這種方式啓動下可執行:
數據庫日誌歸檔、
數據庫介質恢復、
使數據文件聯機或脫機,
重新定位數據文件、重做日誌文件。
執行“nomount”,然後打開控制文件,確認數據文件和聯機日誌文件的位置,
但此時不對數據文件和日誌文件進行校驗檢查。
3、startup open dbname
先執行“nomount”,然後執行“mount”,再打開包括Redo log文件在內的所有數據庫文件,
這種方式下可訪問數據庫中的數據。
4、startup,等於以下三個命令
startup nomount
alter database mount
alter database open
5、startup restrict
約束方式啓動
這種方式能夠啓動數據庫,但只允許具有一定特權的用戶訪問
非特權用戶訪問時,會出現以下提示:
ERROR:
ORA-01035: ORACLE 只允許具有 RESTRICTED SESSION 權限的用戶使用
6、startup force
強制啓動方式
當不能關閉數據庫時,可以用startup force來完成數據庫的關閉
先關閉數據庫,再執行正常啓動數據庫命令
7、startup pfile=參數文件名
帶初始化參數文件的啓動方式
先讀取參數文件,再按參數文件中的設置啓動數據庫
例:startup pfile=E:Oracleadminoradbpfileinit.ora
8、startup EXCLUSIVE
============================================
有三種啓動方式:
1、shutdown normal
正常方式關閉數據庫。
2、shutdown immediate
立即方式關閉數據庫。
在SVRMGRL中執行shutdown immediate,數據庫並不立即關閉,
而是在Oracle執行某些清除工作後才關閉(終止會話、釋放會話資源),
當使用shutdown不能關閉數據庫時,shutdown immediate可以完成數據庫關閉的操作。
3、shutdown abort
直接關閉數據庫,正在訪問數據庫的會話會被突然終止,
如果數據庫中有大量操作正在執行,這時執行shutdown abort後,重新啓動數據庫需要很長時間。