下載oracle

網址http://www.oracle.com/technetwork/index.html

wKiom1ghdZSBH0aJAABVKBvkArM436.png-wh_50

wKioL1ghdZWRT85BAABZOJttG8U465.png-wh_50

根據你的機型選擇下載安裝不同版本,首先你得註冊一個oracle賬戶才能下載。

官網EX Edition是學習免費用的。

我的電腦是64位所以選擇了一下版本。

wKiom1ghdZXhyzEXAAAtpxOkiKM919.png-wh_50

解壓安裝

 

1

wKioL1ghdZWhneL2AAAVkJgRJBU137.png-wh_50

2

wKiom1ghdZbwua2bAACLH7xvp_w497.png-wh_50

3

wKiom1ghdZfCLtmyAABBSCMDYWE843.png-wh_50


4

wKioL1ghdZeQMXYPAAAyJR44xSI159.png-wh_50


我安裝的在D盤空間足夠大

5輸入口令隨意取自己,但要自己記住哦,我輸入的是1234


wKioL1ghdZfwaOFmAAAh2EUtktQ132.png-wh_50


6)安裝

wKiom1ghdZiwjTmEAAAriyp7puk152.png-wh_50


7

wKioL1ghdZjgzzbdAAAvFThb-0E780.png-wh_50


配置oracle

1)啓動

wKiom1ghdZmBetCmAABuwPJ_yzo938.png-wh_50


2sqlplus 連接數據庫用戶system 密碼1234(前邊設置的)

1.  建立表空間和用戶的步驟:  

2.  用戶  

3.  建立:create user 用戶名 identified by "密碼";  

4.  授權:grant create session to 用戶名;  

5.              grant create table to  用戶名;  

6.              grant create tablespace to  用戶名;  

7.              grant create view to  用戶名;  

例如:

建立:create user myuseridentified by "password"; 

授權:grant createsession to myuser; 

     grant create table to myuser; 

     grant create tablespace to myuser; 

      grant create view to  myuser; 

grant connect,resource to myuser;  

grant create any sequence to myuser;  

grant delete any table to myuser;  

grant insert any table to myuser;  

grant select any table to myuser;  

grant unlimited tablespace to myuser;  

grant execute any procedure to myuser;  

grant update any table to myuser;  

wKioL1ghdZmTOdKqAAA54A_t8oI315.png-wh_50

wKiom1ghdZnAr_xBAAAi4zgAQhI752.png-wh_50


 

1.  表空間  

2.  建立表空間(一般建N個存數據的表空間和一個索引空間)  

3.  create tablespace 表空間名  

4.  datafile 路徑(要先建好路徑)\***.dbf  ' size *M  

5.  tempfile 路徑\***.dbf ' size *M  

6.  autoextend on  --自動增長  

7.  --還有一些定義大小的命令,看需要  

8.   default storage(  

9.   initial 100K,  

10. next 100k,  

11.); 

 

例子:創建表空間 

create tablespace DEMOSPACE  

datafile'D:\soft\oracle\app\oracle\oradata\oracle_tablespaces\DEMOSPACE_TBSPACE.dbf'size 1500M

autoextend on next 5M maxsize 3000M; 

刪除表空間 

drop tablespace DEMOSPACE including contentsand datafiles  

wKiom1ghdZnxHhRzAAAZsyeYiuE404.png-wh_50

 

  1. 1.  備份數據庫

  2. 2.  --導入導出命令     

  3. 3.  ip導出方式: exp myuser/[email protected]:1521/orcl file=f:/f.dmp full=y  

  4. 4.  exp myuser/[email protected] file=f:/f.dmp full=y  

  5. 5.  imp myuser/[email protected] file=f:/f.dmp full=y ignore=y  

重新登錄

使用創建的用戶登錄

wKioL1ghdZqhB4wTAAAePORNBbE145.png-wh_50



使用plsql

配置tns

wKioL1ghdZrCoVTKAAAZHOBVcAs108.png-wh_50

LISTENER_ORCL =

 (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))


安裝plsql 配置oci

wKiom1ghdZqxmywmAAB6XLN193Y113.png-wh_50

登錄

wKioL1ghdZvQxbp2AADGxcNe4yU249.png-wh_50