連接ORACLE數(shù)據(jù)庫:
1、在Oracle Database Assistant中建立自己的數(shù)據(jù)庫;
2、在Oracle Net8 Easy config中建立連接與自己的數(shù)據(jù)庫的連接,取一個(gè)service名,IP:為本地IP 127.0.0.1,database sid為你所建立的
數(shù)據(jù)庫的SID,用戶名為:system,密碼:manager或是自己設(shè)的密碼;
3、在SQLPLUS中連接自己的數(shù)據(jù)庫,用戶名為:system,密碼:manager或是自己設(shè)的密碼,tom:你剛建立的service名.
4、顯示當(dāng)前連接用戶:show user;
5、新建用戶并授權(quán):sql>create user tom identified by 密碼;
sql> grant connect,resource to tom;//授權(quán)
注:授權(quán)還有:create any procedure,select any dictionary(登陸oem需要),select any table等.
6、在sqlplus中用剛建立的用戶:tom/密碼,連接;
7、建立表空間。
數(shù)據(jù)庫的初始化參數(shù)文件:init+實(shí)例名.ora文件,編輯此文件中的內(nèi)容,可以改變數(shù)據(jù)庫使用的方法和分配的資源.
啟動(dòng)ORACLE數(shù)據(jù)庫,在DOS方式下運(yùn)行svrmgr30,然后輸入connect internal,密碼為:oracle,再輸入startup即可.
表空間的建立:storage manager
回滾段可在storage manager中建立
啟動(dòng)oracle數(shù)據(jù)庫
在DOS窗口下,輸入svrmgr30,啟動(dòng)服務(wù)器管理器,輸入connect internal,輸入密碼oracle,輸入shutdown,關(guān)閉數(shù)據(jù)庫,輸入startup,啟動(dòng)數(shù)據(jù)庫.
1. Oracle安裝完成后的初始口令?10g以后安裝的時(shí)候選高級,密碼都可以自己設(shè)置,呵呵,scott/tiger是不變的。
internal/oracle
sys/change_on_install
system/manager
scott/tiger
sysman/oem_temp
建立表空間
create tablespace test1 datafile 'd:tabletest1.dbf' size 1M;
創(chuàng)建名為wjq的用戶,其缺省表空間為test1。在SQL*PLUS以SYS用戶連接數(shù)據(jù)庫,運(yùn)行以下腳本。
create user wjq identified by password default tablespace test1;
以用戶wjq連接sqlplus
建立表:CREATE TABLE t1(empno NUMBER(5) PRIMARY KEY, ename VARCHAR2(15) NOT NULL, job VARCHAR2(10), mgr NUMBER(5),hiredate
DATE DEFAULT (sysdate), sal NUMBER(7,2), comm NUMBER(7,2));
建立表T2并指定此表的表空間為test1:CREATE TABLE t2(empno NUMBER(5) PRIMARY KEY,ename VARCHAR2(15) NOT NULL,
job VARCHAR2(10),mgr NUMBER(5),hiredate DATE DEFAULT (sysdate),sal NUMBER(7,2),comm NUMBER(7,2)) TABLESPACE test1;
插入記錄:insert into t1 values(101,'wang','it',25,'',20,20);