一.表空间的创建1.创建普通表空间指定初始大小,自动扩展,最大大小:(Oracle允许的单个smallfile数据文件最大大小为 4194302*bl
一.表空间的创建
1.创建普通表空间指定初始大小,自动扩展,最大大小:
(Oracle允许的单个smallfile数据文件最大大小为 4194302*blocksize,单个bigfile数据文件最大可达到(32-128)TB)
(默认创建表空间为标准的8k数据块,smallfile表空间)
create tablespace t1 datafile '/u01/oracle/product/oradata/orcl/t1.dbf' size 10m autoextend on next 5m maxsize 100m;
2.创建非标准块大小的表空间:
alter system set db_16k_cache_size=100m scope=spfile;
shutdown immediate;
startup;
create tablespace t2 datafile '/u01/oracle/product/oradata/orcl/t2.dbf' size 10m blocksize 16k;
3.创建大文件表空间(大文件表空间只允许有一个数据文件):
create bigfile tablespace t3 datafile '/u01/oracle/product/oradata/orcl/t3.dbf' size 10m ;
二.修改表空间(如果修改临时表空间,,注意将语句中的datafile改为tempfile):
1.在表空间中添加数据文件:
alter tablespace t1 add datafile '/u01/oracle/product/oradata/orcl/t11.dbf' size 1m;
2.在表空间中删除数据文件:
alter tablespace t1 drop datafile '/u01/oracle/product/oradata/orcl/t11.dbf';
3.修改指定数据文件的大小
alter database datafile '/u01/oracle/product/oradata/orcl/t1.dbf' resize 1m;
三。表空间与数据文件的offline与online
1.表空间的脱机与联机
alter tablespace t1 offline;
alter tablespace t1 online;
2.数据文件的脱机与联机(数据文件的脱机与联机需要使用归档模式,数据文件脱机后一定要执行数据文件介质恢复,否则会报错)
shutdown immediate;
startup mount;
alter database archivelog;
alter database open;
alter database datafile '/u01/oracle/product/oradata/orcl/t1.dbf' offline;
recover datafile 5;
alter database datafile '/u01/oracle/product/oradata/orcl/t1.dbf' online;
四。表空间改名
alter tablespace t1 rename to t4;
五.表空间删除
1。正常删除表空间,不删除数据文件:
drop tablespace t4 ;
2.删除表空间同时删除所有相关数据文件;
drop tablespace t2 including contents and datafiles;
六。使用已经存在但未使用的数据文件创建表空间:
SQL> create tablespace t1 datafile '/u01/oracle/product/oradata/orcl/t1.dbf' size 10m;
create tablespace t1 datafile '/u01/oracle/product/oradata/orcl/t1.dbf' size 10m
*
ERROR at line 1:
ORA-01119: error in creating database file
'/u01/oracle/product/oradata/orcl/t1.dbf'
ORA-27038: created file already exists
Additional information: 1
SQL> create tablespace t1 datafile '/u01/oracle/product/oradata/orcl/t1.dbf' reuse;
Tablespace created.

This article explores optimizing MySQL memory usage in Docker. It discusses monitoring techniques (Docker stats, Performance Schema, external tools) and configuration strategies. These include Docker memory limits, swapping, and cgroups, alongside

This article addresses MySQL's "unable to open shared library" error. The issue stems from MySQL's inability to locate necessary shared libraries (.so/.dll files). Solutions involve verifying library installation via the system's package m

The article discusses using MySQL's ALTER TABLE statement to modify tables, including adding/dropping columns, renaming tables/columns, and changing column data types.

This article compares installing MySQL on Linux directly versus using Podman containers, with/without phpMyAdmin. It details installation steps for each method, emphasizing Podman's advantages in isolation, portability, and reproducibility, but also

This article provides a comprehensive overview of SQLite, a self-contained, serverless relational database. It details SQLite's advantages (simplicity, portability, ease of use) and disadvantages (concurrency limitations, scalability challenges). C

This guide demonstrates installing and managing multiple MySQL versions on macOS using Homebrew. It emphasizes using Homebrew to isolate installations, preventing conflicts. The article details installation, starting/stopping services, and best pra

Article discusses configuring SSL/TLS encryption for MySQL, including certificate generation and verification. Main issue is using self-signed certificates' security implications.[Character count: 159]

Article discusses popular MySQL GUI tools like MySQL Workbench and phpMyAdmin, comparing their features and suitability for beginners and advanced users.[159 characters]


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

VSCode Windows 64-bit Download
A free and powerful IDE editor launched by Microsoft

SublimeText3 Linux new version
SublimeText3 Linux latest version

Notepad++7.3.1
Easy-to-use and free code editor

EditPlus Chinese cracked version
Small size, syntax highlighting, does not support code prompt function

Zend Studio 13.0.1
Powerful PHP integrated development environment
