oracle create tablespace

create tablespace ZGECM 
 logging datafile 'G:\oracle\product\10.2.0\ZGECM.DBF'
 size 500M autoextend on
 next 10M maxsize 500M extent management local


create user sms2 identified by sms2 default tablespace ECM2 
temporary tablespace temp profile default;

--6 授权给新建用户
grant connect,resource to sms2;
grant dba to sms2;


exp xuner_ecm/xuner_ecm@192.168.1.139/SMS FILE=E:/xunerecm0910_server.DMP OWNeR=xuner_ecm

imp scjt/scjt@SMS fromuser=ecm touser=sms2 file='G:\sms.dmp' 


imp SMS/SMS@LOCAL_SMS fromuser=SMS touser=SMS file='G:\sms.dmp'  

select userenv('language') from dual;     //查询oracle服务器端的字符

select nls_charset_name(to_number('0354','0354'))
 from dual;



CREATE DATABASE LINK sms CONNECT TO sms IDENTIFIED BY sms
USING 'SMS';



insert into XSJBXXB select * from sms.xsjbxxb@zhang2

insert into XSJBXXB select * from sms.xsjbxxb@to_test

--创建dblink
 create database link to_test
  connect to sms identified by sms
  using 'ZHANG';

'(DESCRIPTION =(
ADDRESS_LIST =(
ADDRESS =(
PROTOCOL = TCP)(
HOST = 192.168.0.100)(PORT = 1521)))
(CONNECT_DATA =(SERVICE_NAME = AAA)))'

--查询约束
select owner,constraint_name,table_name from user_constraints 
where constraint_name='SYS_C00119759'



-----------------------------------------------------


/*分为四步 */
/*第1步:创建临时表空间  */
create temporary tablespace user_temp  
tempfile 'D:\oracle\oradata\Oracle9i\user_temp.dbf' 
size 50m  
autoextend on  
next 50m maxsize 20480m  
extent management local;  
 
/*第2步:创建数据表空间  */
create tablespace user_data  
logging  
datafile 'D:\oracle\oradata\Oracle9i\user_data.dbf' 
size 50m  
autoextend on  
next 50m maxsize 20480m  
extent management local;  
 
/*第3步:创建用户并指定表空间  */
create user username identified by password  
default tablespace user_data  
temporary tablespace user_temp;  
 
/*第4步:给用户授予权限  */
grant connect,resource,dba to username;


--Error dropping MEM_GENINF:
--ORA-00054: 资源正忙, 但指定以 NOWAIT 方式获取资源 
--Record is locked by another user

--1.查看锁
select t2.username,t2.sid,t2.serial#,t2.logon_time 
from v$locked_object t1,v$session t2 where t1.session_id=t2.sid ; 

--2、Kill 
alter system kill session 'sid,serial#'; 
alter system kill session '151,14678';


  • 1
    点赞
  • 15
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值