Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Oracle tablespace file system migration to ASM

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

1. Configure the test environment

Create a data tablespace

Create tablespace test logging datafile'/ home/oracle/test.dbf' size 10m autoextend on next 10m maxsize 2048m extent management local

Create a user and specify a tablespace

Create user test identified by 123456 default tablespace test

Grant permissions to users

Grant connect,resource,dba to test

Create a tabl

Sqlplus test/123456@orcl

CREATE TABLE test2 (userId number (8), username varchar2 (40), tep number (20)) PARTITION BY RANGE (userId) (PARTITION p1 VALUES LESS THAN (10000), PARTITION p2 VALUES LESS THAN (20000), PARTITION p3 VALUES LESS THAN (30000))

Query the tables under the current user:

Select tname from tab

two。 Migration of file system tablespaces to ASM

Rman target /

Report schema; view tablespaces

Sql 'alter tablespace test offline'; offline tablespace

Backup as copy datafile 5 format'+ DATA';Copy type backup tablespace

Switch datafile 5 to copy; switches tablespace files to copy copies

Sql 'alter tablespace test online'; online tablespace

Report schema

Sqlplus / as sysdba

Select ts#,name from v$tablespace where name='TEST' union all select file#,name from v$datafile where ts#=6

Select * from v$dbfile

Sqlplus test/123456@orcl

Select tname from tab

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report