【Oracle】第三次实验报告
重命名数据文件:
SQL> create tablespace ts1 datafile ‘c:\1.dbf’ size 2m,‘c:\2.dbf’ size 5m;
Tablespace created
SQL> create tablespace ts2 datafile ‘c:\3.dbf’ size 2m,‘c:\4.dbf’ size 5m;
Tablespace created
SQL> alter tablespace ts2 offline;
Tablespace altered
SQL> alter tablespace ts2 rename datafile ‘c:\3.dbf’ to ‘e:\3copy.dbf’;
Tablespace altered
SQL> alter tablespace ts2 online;
Tablespace altered
扩充tablespace的容量:
SQL> create tablespace ts3 datafile ‘c:\5.dbf’ size 3m autoextend on next 3m maxsize 10m;
Tablespace created
SQL> alter tablespace ts3 add datafile ‘6.dbf’ size 5m;
Tablespace altered
SQL> alter database orcl datafile ‘c:\5.dbf’ resize 100m;
Database altered
SQL> alter database orcl datafile ‘c:\5.dbf’ autoextend on next 3m maxsize 10m;
Database altered
查询归档文件的状态:
SQL*Plus: Release 10.2.0.3.0 - Production on 星期五 10月 29 15:05:38 2021
Copyright © 1982, 2006, Oracle. All Rights Reserved.
连接到:
Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - Production
With the Partitioning, OLAP and Data Mining options
SQL> archive log list;
数据库日志模式 非存档模式
自动存档 禁用
存档终点 USE_DB_RECOVERY_FILE_DEST
最早的联机日志序列 25
当前日志序列 27
SQL> select name,log_mode from v$database;
NAME LOG_MODE
--------- ------------
ORCL NOARCHIVELOG
SQL> shutdown immediate;
数据库已经关闭。
已经卸载数据库。
ORACLE 例程已经关闭。
SQL> startup nomount;
ORACLE 例程已经启动。
Total System Global Area 612368384 bytes
Fixed Size 1292036 bytes
Variable Size 285214972 bytes
Database Buffers 318767104 bytes
Redo Buffers 7094272 bytes
SQL> alter database mount;
数据库已更改。
SQL> alter database archivelog;
数据库已更改。
SQL> alter database open;
数据库已更改。
SQL> archive log list;
数据库日志模式 存档模式
自动存档 启用
存档终点 USE_DB_RECOVERY_FILE_DEST
最早的联机日志序列 25
下一个存档日志序列 27
当前日志序列 27