首页 > 开发 > 综合 > 正文

常用sql script

2024-07-21 02:33:26
字体:
来源:转载
供稿:网友

  CREATE TABLESPACE "apps"
  DATAFILE '/db/oradata/apps01.dbf' SIZE 1000M,
  '/db/oradata/apps02.dbf' SIZE 1000M
  EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTO ;
  
  CREATE TEMPORARY TABLESPACE "TEMP"
  TEMPFILE '/db/oradata/temp01.dbf' SIZE 1000M EXTENT MANAGEMENT
  LOCAL UNIFORM SIZE 1M;
  
  CREATE USER "apps" IDENTIFIED BY "apps"
  DEFAULT TABLESPACE "apps"
  TEMPORARY TABLESPACE "TEMP"
  ACCOUNT UNLOCK;
  GRANT "CONNECT" TO "INTEGRATION";
  GRANT "RESOURCE" TO "INTEGRATION";
  
  alter database add logfile group 1 ('D:/Oracle/ORADATA/orcl1/REDO01.LOG') size 1M;
  
  alter database drop logfile group 1;
  
  alter system switch logfile;
  alter database backup controlfile to trace ;
  
  select a.name,a.value,b.name,b.value,(a.value*100)/b.value'%' "radio"
  from v$sysstat a,v$sysstat b
  where a.name='redo buffer allocation retries'
  and b.name='redo entries';
  
  这个比率小于1%才好,否则增加log_buffer的大小
  
  select * from v$nls_parameters
  
  select banner from sys.v_$version
  
  set long 20000
  
  十进制转十六进制 select to_char(33,'xxxx') from dual
  
  drop table table_name cascade constraints;
  
  alter table test move tablespace apps
  /*索引重建*/
  alter index index_name rebuild tablespace tablespace_name;
  
  select /*+ index(tablename index_name)*/ from tablename

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表