Oracle常用的一些操作,記錄下來(lái):
![](/upload/ad_content/xuanchuantu-26.jpg)
創(chuàng)新互聯(lián)建站是專(zhuān)業(yè)的泰順網(wǎng)站建設(shè)公司,泰順接單;提供
網(wǎng)站制作、成都網(wǎng)站設(shè)計(jì),網(wǎng)頁(yè)設(shè)計(jì),網(wǎng)站設(shè)計(jì),建網(wǎng)站,PHP網(wǎng)站建設(shè)等專(zhuān)業(yè)做網(wǎng)站服務(wù);采用PHP框架,可快速的進(jìn)行泰順網(wǎng)站開(kāi)發(fā)網(wǎng)頁(yè)制作和功能擴(kuò)展;專(zhuān)業(yè)做搜索引擎喜愛(ài)的網(wǎng)站,專(zhuān)業(yè)的做網(wǎng)站團(tuán)隊(duì),希望更多企業(yè)前來(lái)合作!1.建立表空間和用戶(hù)的步驟:
用戶(hù)
建立:create user 用戶(hù)名 identified by "密碼";
授權(quán):grant create session to 用戶(hù)名;
grant create table to 用戶(hù)名;
grant create tablespace to 用戶(hù)名;
grant create view to 用戶(hù)名;
2.表空間
建立表空間(一般建N個(gè)存數(shù)據(jù)的表空間和一個(gè)索引空間):
create tablespace 表空間名
datafile ' 路徑(要先建好路徑)\***.dbf ' size *M
tempfile ' 路徑\***.dbf ' size *M
autoextend on --自動(dòng)增長(zhǎng)
--還有一些定義大小的命令,看需要
default storage(
initial 100K,
next 100k,
);
例子:創(chuàng)建表空間
create tablespace DEMOSPACE
datafile 'E:/oracle_tablespaces/DEMOSPACE_TBSPACE.dbf'
size 1500M
autoextend on next 5M maxsize 3000M;
刪除表空間
drop tablespace DEMOSPACE including contents and datafiles
3.用戶(hù)權(quán)限
授予用戶(hù)使用表空間的權(quán)限:
alter user 用戶(hù)名 quota unlimited on 表空間;
或 alter user 用戶(hù)名 quota *M on 表空間;
4.--表空間
CREATE TABLESPACE sdt
DATAFILE 'F:\tablespace\demo' size 800M
EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTO;
--索引表空間
CREATE TABLESPACE sdt_Index
DATAFILE 'F:\tablespace\demo' size 512M
EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTO;
--2.建用戶(hù)
create user demo identified by demo
default tablespace demo;
--3.賦權(quán)
grant connect,resource to demo;
grant create any sequence to demo;
grant create any table to demo;
grant delete any table to demo;
grant insert any table to demo;
grant select any table to demo;
grant unlimited tablespace to demo;
grant execute any procedure to demo;
grant update any table to demo;
grant create any view to demo;
5.--導(dǎo)入導(dǎo)出命令
ip導(dǎo)出方式: exp demo/demo@127.0.0.1:1521/orcl file=f:/f.dmp full=y
exp demo/demo@orcl file=f:/f.dmp full=y
imp demo/demo@orcl file=f:/f.dmp full=y ignore=y
6.--創(chuàng)建數(shù)據(jù)鏈
create database link ygbgtest_portaltest_link
connect to portal identified by portal
using '(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.104.102)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = orcl)
)
)';
select * from portal_information@ygbgtest_portaltest_link;
7.--創(chuàng)建臨時(shí)表以獲取遠(yuǎn)程表數(shù)據(jù)
Create global temporary table temp_ygbg_information on commit preserve rows
as select * from portal_information@ygbgtest_portaltest_link;
select count(1) from temp_ygbg_information t;
select * from temp_ygbg_information;
8.--從臨時(shí)表中將數(shù)據(jù)插入到目的表中
insert into portal_information
(id,
title,
picture_url,
status,
author_id,
author_name,
create_time,
modify_date,
delete_date,
view_num,
order_flag,
summary,
type,
promulgation_charge,
information_source,
sort_num,
sub_title,
is_slidenews)
select
SEQ_PORTAL_INFORMATION.NEXTVAL,
title,
picture_url,
status,
author_id,
author_name,
create_time,
modify_date,
delete_date,
view_num,
order_flag,
summary,
type,
promulgation_charge,
information_source,
sort_num,
sub_title,
is_slidenews from temp_ygbg_information t1 where t1.id=3338;
另外有需要云服務(wù)器可以了解下創(chuàng)新互聯(lián)cdcxhl.cn,海內(nèi)外云服務(wù)器15元起步,三天無(wú)理由+7*72小時(shí)售后在線,公司持有idc許可證,提供“云服務(wù)器、裸金屬服務(wù)器、高防服務(wù)器、香港服務(wù)器、美國(guó)服務(wù)器、虛擬主機(jī)、免備案服務(wù)器”等云主機(jī)租用服務(wù)以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡(jiǎn)單易用、服務(wù)可用性高、性?xún)r(jià)比高”等特點(diǎn)與優(yōu)勢(shì),專(zhuān)為企業(yè)上云打造定制,能夠滿足用戶(hù)豐富、多元化的應(yīng)用場(chǎng)景需求。
新聞名稱(chēng):Oracle常用操作-創(chuàng)新互聯(lián)
分享地址:http://aaarwkj.com/article20/cdhijo.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供做網(wǎng)站、微信小程序、搜索引擎優(yōu)化、ChatGPT、服務(wù)器托管、品牌網(wǎng)站建設(shè)
廣告
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶(hù)投稿、用戶(hù)轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源:
創(chuàng)新互聯(lián)