Linux下和Windows下建立Oracle使用者和資料表空間

來源:互聯網
上載者:User

通過SSH工具或是XShell工具進入遠程Linux下。

其中,通過SSH工具登入的介面如下:

其中Host Name是遠程伺服器的ip地址。User Name是伺服器的一個使用者名稱,連接埠號碼預設22,Connect進去後可以填寫伺服器的密碼。

通過XShell工具登入的介面如下:

點擊上面的New按鈕,填寫HOST主機地址,即伺服器的IP地址,點擊OK即可。

輸入命令:    cd /    到根目錄下

啟動tomcat

usr/local/tomcat/bin/startup.sh(這是tomcat所在的路徑)

關閉tomcat

usr/local/tomcat/bin/shutdown.sh(這個是tomcat所在的路徑)

 

Linux下建立Oracle使用者和資料表空間,賦予許可權等操作

通過sqlplus遠端連線Oracle,其表示:sqlplus 使用者名稱/密碼@遠程Oracle伺服器位址:Oracle連接埠號碼/Oracle的service_name

sqlplus sys/nmc601@10.28.17.129:1521/nmcdb.nmc.gov.cn as sysdba;

如果存在TS_MISPS資料表空間,則刪除此資料表空間和其附帶的檔案

drop tablespace TS_MISPS including contentsand datafiles cascade constraints;

查看串連著的用

select username,sid,serial# from v$session;

//串聯刪除使用者

drop user MISPS cascade;

//建立資料表空間,檔案放在Oracle安裝目錄內部的oradata目錄下

create tablespace TS_MISPS datafile '/home/oracle/app/oracle/oradata/TS_MISPS.dbf'size 300m;

//讓資料表空間自動變化

alter database datafile '/home/oracle/app/oracle/oradata/TS_MISPS.dbf'autoextend on next 10m;

create user MISPS identified by ‘MISPS;

//讓使用者使用這個資料表空間

alter user MISPS default tablespaceTS_MISPS;

//分配session的許可權

grant create session to MISPS;

//分配建立表的許可權

grant create table to MISPS;

//分配建立視圖的許可權

grant create view to MISPS;

//分配建立觸發器的許可權

grant create trigger to MISPS;

//這行必須有

grant unlimited tablespace to MISPS;

//分配建立索引的許可權

grant create any index to MISPS;

//分配修改表的許可權

grant alter any table to misps;

//分配修改預存程序的許可權

grant alter any procedure to MISPS;

//分配刪除表的許可權

grant drop any table to MISPS;

//賦予刪除視圖的許可權

grant drop any view to MISPS;

//賦予刪除索引的許可權

grant drop any INDEX to MISPS;

//賦予刪除預存程序的許可權

grant drop any procedure to MISPS;

//賦予查詢,插入,更新,刪除表的許可權

grant select any table,insert anytable,update any table,delete any table to MISPS;

//讓表unlock,沒有這句會出現ORA-28000: the account is locked錯誤

alter user MISPS account unlock;

//必須賦予connect,resource許可權

grant connect,resource,DBA to MISPS;

//這一句是修改密碼的sql

alter user MISPS identified by MISPS;

更多詳情請繼續閱讀第2頁的內容:

Linux系統下Oracle建立和刪除資料表空間及使用者 

Undo 資料表空間損壞導致無法open

Undo資料表空間失敗的處理方法

  • 1
  • 2
  • 下一頁

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.