Oracle 11.2 Admin SQL

查看ROLE的權限

SELECT * FROM ROLE_SYS_PRIVS

CONNECT : CREATE SESSION

RESOURCE : CREATE SEQUENCE/TRIGGER/CLUSTER/PROCEDURE/TYPE/OPERATOR/TABLE/INDEXTYPE

 建立使用者

CREATE USER [USER] IDENTIFIED BY [PWD];

GRANT CONNECT TO [USER];

GRANT RESOURCE TO [USER];

GRANT CREATE VIEW TO [USER];

GRANT UNLIMITED TABLESPACE TO [USER];

移除使用者

DROP USER [USER] CASCADE;

 TABLE筆數 (Approximate)

SELECT TABLE_NAME,NUM_ROWS FROM USER_TABLES;

建立Data Link

CREATE DATABASE LINK [DB Link Name] CONNECT TO [Remote User] IDENTIFIED BY [PWD] USING ‘IP:Port/SID’;

使用方式

SELECT * FROM [Table]@[DB Link Name];

建立Synonym

CREATE SYNONYM [Synonym] FOR [Table]@[DB Link Name];

使用方式

SELECT * FROM [Synonym];

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s