Oracle 高级操作

10.查表空间磁盘参数
ACCEPT sth PROMPT '请输入要查看的表空间名:'
col tablespace_name for a15
select tablespace_name,initial_extent,next_extent,max_extents,pct_increase,min_extlen
from dba_tablespaces
where lower (tablespace_name) like '%&sth%'
/
11.查表空间的类型
ACCEPT sth PROMPT '请输入要查询的表空间名称:'
select tablespace_name,status,contents
from dba_tablespaces
where lower(tablespace_name) like '%&sth%'
/
12.查表空间对应的数据文件
ACCEPT sth PROMPT '请输入要查询表空间的名称:'
col file_name for a30
select tablespace_name,file_id,file_name,autoextensible
from dba_data_files
where lower(tablespace_name) like '%&sth%'
/
13.查对象创建日期
ACCEPT object_name PROMPT '请输入对象名(table,view,index,sequence,synonym):'
select object_name,object_type,created,last_ddl_time,status
from  user_objects
where lower(object_type)= '&object_name'
/
14.查临时表空间对应的数据文件
col file for a30
col tablespace for a25
select f.file#,t.ts#,f.name "File",t.name "Tablespace"
from v$tempfile f,V$tablespace t
where f.ts# = t.ts#
/
15.查默认表空间
col property_name for a20
col property_value for a20
col description for a20
select *
from database_properties
where property_name like 'DEFAULT%'
/
16.查同义词信息
select synonym_name,table_owner,table_name
from user_synonyms
/
17.查序列号信息
select  sequence_name,min_value,max_value,increment_by,last_number
from user_sequences
/
18.查用户下的所有表
select table_name from user_tables
/
19.创表空间
ACCEPT tablespace_name PROMPT '请输入要创建的表空间名称:'
ACCEPT add PROMPT '请输入数据文件地址:'
ACCEPT size PROMPT '请输入数据文件大小:'
ACCEPT usize PROMPT '请输入区段extent的大小:'
create tablespace &tablespace_name
datafile '&add'
size &size
extent management local
uniform size &usize
/
20.创还原表空间
ACCEPT sth1 PROMPT '请输入要创建还原表空间名称:'
ACCEPT sth2 PROMPT '请输入数据文件地址:'
ACCEPT sth3 PROMPT '请输入数据文件大小:'
create undo tablespace &sth1
datafile '&sth2'
size &sth3
/
21.创临时表空间
ACCEPT sth1 PROMPT '请输入要创建临时表空间名称:'
ACCEPT sth2 PROMPT '请输入临时数据文件地址:'
ACCEPT sth3 PROMPT '请输入临时数据文件大小:'
ACCEPT sth4 PROMPT '请输入区段extent的大小:'
create temporary tablespace &sth1
tempfile '&sth2'
size &sth3
extent management local
uniform size &sth4
/
22.创同义词
ACCEPT s PROMPT '请输入简称:'
ACCEPT sss PROMPT '请输入要替代的名称:'
create synonym &s
for &sss
/
23.创序列号
ACCEPT sequence_name PROMPT '请输入序列号名:'
ACCEPT start_number PROMPT '请输入开始数目:'
ACCEPT increment_number PROMPT '请输入增幅:'
ACCEPT maxvalue PROMPT '请输入能增长的最大值:'
create sequence &sequence_name
start with &start_number
increment by &increment_number
maxvalue &maxvalue
nocycle
/
24.改默认临时表空间
ACCEPT sth PROMPT '请输入默认临时表空间为:'
alter database default temporary tablespace &sth
/
25.改数据文件为自动扩展
ACCEPT sth1 PROMPT '请输入要扩展的完整的文件名:'
alter database datafile
'&sth1' autoextend on
next 1M
/
26.改序列号增幅
ACCEPT  name PROMPT '请输入要改的序列号名:'
ACCEPT increment PROMPT '请输入修改后的增幅为:'
alter sequence &name
increment by &increment
/
27.改序列号最大值
ACCEPT  name PROMPT '请输入要改的序列号名:'
ACCEPT maxvalue PROMPT '请输入修改后的最大值为:'
alter sequence &name
maxvalue  &maxvalue
/
28.改序列号最小值
ACCEPT  name PROMPT '请输入要改的序列号名:'
ACCEPT minvalue PROMPT '请输入修改后的最小值为:'
alter sequence &name
minvalue  &minvalue
/
29.删表空间
ACCEPT sth1 PROMPT '请输入要删除表空间名:'
drop tablespace &sth1
/
30.删表空间及数据文件
ACCEPT sth1 PROMPT '请输入要删除的表空间名称(包括数据文件):'
drop tablespace &sth1 including contents and datafiles
/
31.删同义词
ACCEPT s PROMPT '请输入要删除同义词名:'
drop synonym &s
/
32.删序列号
ACCEPT sequence_name PROMPT '请输入要删除序列号名:'
drop sequence &sequence_name;

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Contents iii 3 Enhancements to the GROUP BY Clause Objectives 3-2 Review of Group Functions 3-3 Review of the GROUP BY Clause 3-4 Review of the HAVING Clause 3-5 GROUP BY with ROLLUP and CUBE Operators 3-6 ROLLUP Operator 3-7 ROLLUP Operator Example 3-8 CUBE Operator 3-9 CUBE Operator: Example 3-10 GROUPING Function 3-11 GROUPING Function: Example 3-12 GROUPING SETS 3-13 GROUPING SETS: Example 3-15 Composite Columns 3-17 Composite Columns: Example 3-19 Concatenated Groupings 3-21 Concatenated Groupings Example 3-22 Summary 3-23 Practice 3 Overview 3-24 4 Advanced Subqueries Objectives 4-2 What Is a Subquery? 4-3 Subqueries 4-4 Using a Subquery 4-5 Multiple-Column Subqueries 4-6 Column Comparisons 4-7 Pairwise Comparison Subquery 4-8 Nonpairwise Comparison Subquery 4-9 Using a Subquery in the FROM Clause 4-10 Scalar Subquery Expressions 4-11 Scalar Subqueries: Examples 4-12 Correlated Subqueries 4-14 Using Correlated Subqueries 4-16 Using the EXISTS Operator 4-18 Using the NOT EXISTS Operator 4-20 Correlated UPDATE 4-21 The WITH Clause 4-26 WITH Clause: Example 4-27 Summary 4-29 Practice 4 Overview 4-31 iv 5 Hierarchical Retrieval Objectives 5-2 Sample Data from the EMPLOYEES Table 5-3 Natural Tree Structure 5-4 Hierarchical Queries 5-5 Walking the Tree 5-6 Walking the Tree: From the Bottom Up 5-8 Walking the Tree: From the Top Down 5-9 Ranking Rows with the LEVEL Pseudocolumn 5-10 Formatting Hierarchical Reports Using LEVEL and LPAD 5-11 Pruning Branches 5-13 Summary 5-14 Practice 5 Overview 5-15 6 Oracle9i Extensions to DML and DDL Statements Objectives 6-2 Review of the INSERT Statement 6-3 Review of the UPDATE Statement 6-4 Overview of Multitable INSERT Statements 6-5 Types of Multitable INSERT Statements 6-7 Multitable INSERT Statements 6-8 Unconditional INSERT ALL 6-10 Conditional INSERT ALL 6-11 Conditional FIRST INSERT 6-13 Pivoting INSERT 6-15 External Tables 6-18 Creating an External Table 6-19 Example of Creating an External Table 6-20 Querying External Tables 6-23 CREATE INDEX with CREATE TABLE Statement 6-24 Summary 6-25 Practice 6 Overview 6-26 A Practice Solutions B Table Descriptions and Data C Writing Advanced Scripts D Oracle Architectural Components Index Additional Practices Additional Practice Solutions Additional Practices: Table Descriptions and Data

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值