shell

alias ll='ls -alh'
ls -l|sort
sort<myfile.txt>myfile_dort.txt

1、查询表空间大小:
SELECT tablespace_name, SUM(bytes)/1024/1024/1024 FROM dba_data_files GROUP BY tablespace_name;
SELECT tablespace_name, SUM(bytes)/1024/1024/1024 FROM dba_free_space  GROUP BY tablespace_name;
select   username,default_tablespace,temporary_tablespace   from   dba_users
where   (default_tablespace='SYSTEM'   or   temporary_tablespace='SYSTEM')   and   username   not   in   ('SYSTEM','SYS');
select tablespace_name,(bytes/1024/1024) M from dba_data_files;

 

2、新建数据空间
create tablespace tableSpaceName datafile 'pathONile' size Size AUTOEXTEND OFF;
例:
create tablespace cbs_default_dat datafile '/dev/vx/dsk/vgbmpdata/lvworkdbs1' size 8000M autoextend off;
create tablespace cbp_workdbs datafile '/dev/rlvworkdbs1' size 8150M autoextend off;

增加表空间:
alter tablespace tablespace add datafile 'pathONile' size Size ;
例:
alter tablespace cbs_user_dat add datafile '/dev/vx/dsk/vgbmpdata1/lvworkdbs1' size 8000M;
alter tablespace CBS_DEFAULT_DAT add datafile '/dev/vx/dsk/vgbmpdata/lvworkdbs1' size 8100M;
alter tablespace cbp_workdbs add datafile '/dev/rlvworkdbs2' size 8150M;

3、删除表空间:
drop tablespace cbs_user_dat including contents;
例:
drop tablespace CBS_DEFAULT_DAT including contents;
drop tablespace cbp_workdbs including contents;

4、查看数据库连接:
select sid,serial#,username,program,machine,status from v$session;

干掉某个连接:
alter system kill session 'SID,SERIAL#';

5、查看数据库文件的状态
select file_name,status from dba_data_files;

6、创建用户
create user xbb identified by xbb default tablespace users temporary tablespace TEMP;
grant connect, resource,dba to xbb;

create user ops$frscu identified by ops$frscu default tablespace users temporary tablespace TEMP;
grant connect, resource,dba to ops$frscu;

create user cbpdb identified by cbpdb default tablespace users temporary tablespace TEMP;
grant connect, resource,dba to cbpdb;

修改用户密码
alter user ops$c04scp5 identified by c04scp5;
alter user ops$srscu identified by srscu;
alter user ops$otscu identified by otscu;
alter user xbb  identified by xbb;
alter user ops$sascu identified by sascu;
alter user ops$dxscu identified by dxscu;
alter user ops$frscu identified by frscu;
alter user cbpdb identified by cbpdb;

alter user ops$scp67 identified by scp67;

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值