shell

来源:互联网 发布:有个性的淘宝自动回复 编辑:程序博客网 时间:2024/06/06 08:44

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;

 

原创粉丝点击