ALTER TABLE NOMBRE_TABLA MOVE TABLESPACE NUEVO_TABLESPACE;
Además, después de esto es importante reconstruir todos los índices que tenga la tabla usando la siguiente instrucción SQL:
ALTER INDEX NOMBRE_INDICE REBUILD;
Bienvenidos a mí blog, en éste espacio comparto mis experiencias y conocimientos relacionados con las tecnologías de integración de sistemas, lenguajes de programación, desarrollo de software, bases de datos y Agilismo. Sí tienes comentarios, inquietudes o sugerencias, no dudes en escribirlos...
ALTER TABLE NOMBRE_TABLA MOVE TABLESPACE NUEVO_TABLESPACE;
ALTER INDEX NOMBRE_INDICE REBUILD;
SELECT segment_name AS "TABLE_NAME", SUM (BYTES) AS "[Bytes]", SUM (BYTES) / 1024 AS "[Kb]", SUM (BYTES) / (1024*1024) AS "[Mb]", SUM (BYTES) / (1024*1024*1024) AS "[Gb]" FROM dba_segments WHERE segment_name = 'NOMBRE_TABLA' and segment_type = 'TABLE' GROUP BY segment_name;
<GlobalNamingResources>
<Resource name="jms/ConnectionFactory"
auth="Container"
type="org.apache.activemq.ActiveMQConnectionFactory"
description="JMS Connection Factory"
factory="org.apache.activemq.jndi.JNDIReferenceFactory"
brokerURL="tcp://127.0.0.1:61616"
brokerName="activeMQBroker"/>
<Resource auth="Container"
name="jms/MiCola"
type="org.apache.activemq.command.ActiveMQQueue"
description="Cola de mensajes"
factory="org.apache.activemq.jndi.JNDIReferenceFactory"
physicalName="com.blogspot.ingmmurillo.queue"/>
</GlobalNamingResources>
Nótese que en brokerURL se especifica el servidor en dónde está corriendo Apache ActiveMQ, en este caso se encuentra en la misma máquina. Además, es necesario especificar todas las colas y tópicos a los cuáles se va a conectar, en este caso voy a conectarme a la cola com.blogspot.ingmmurillo.queue<Context>
<ResourceLink global="jms/ConnectionFactory" name="jms/ConnectionFactory" type="javax.jms.ConnectionFactory"/>
<ResourceLink global="jms/MiCola" name="jms/MiCola" type="javax.jms.Queue"/>
</Context>
<resource-ref>
<description>JMS Connection</description>
<res-ref-name>jms/ConnectionFactory</res-ref-name>
<res-type>javax.jms.ConnectionFactory</res-type>
<res-auth>Container</res-auth>
<res-sharing-scope>Shareable</res-sharing-scope>
</resource-ref>
<resource-ref>
<res-ref-name>jms/MiCola</res-ref-name>
<res-type>javax.jms.Queue</res-type>
<res-auth>Container</res-auth>
<res-sharing-scope>Shareable</res-sharing-scope>
</resource-ref>
//...
Context initContext = new InitialContext();
Context jndiContext = (Context) initContext.lookup("java:comp/env");
ActiveMQConnectionFactory qFactory = (ActiveMQConnectionFactory)jndiContext.lookup("jms/ConnectionFactory");
QueueConnection qConnect = qFactory.createQueueConnection();
qConnect.start();
QueueSession qSession = qConnect.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
Queue requestQ = (Queue) jndiContext.lookup("jms/MiCola");
QueueSender qSender = qSession.createSender(requestQ);
ObjectMessage msg = qSession.createObjectMessage(new String("Hola, ActiveMQ"));
qSender.send(msg);
qConnect.stop();
package com.blogspot.ingmmurillo.jaxb;
import com.tandicorp.tandiesb.jaxb.XMLOutputStream;
import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Marshaller;
import javax.xml.bind.annotation.XmlRootElement;
import java.io.IOException;
import java.io.Serializable;
import java.util.Date;
@XmlRootElement
public class CustomerDTO implements Serializable {
private String identification;
private String internalIdentifier;
private String firstName;
private String lastName;
private Date birthday;
public String getIdentification() {
return identification;
}
public void setIdentification(String identification) {
this.identification = identification;
}
public String getInternalIdentifier() {
return internalIdentifier;
}
public void setInternalIdentifier(String internalIdentifier) {
this.internalIdentifier = internalIdentifier;
}
public String getFirstName() {
return firstName;
}
public void setFirstName(String firstName) {
this.firstName = firstName;
}
public String getLastName() {
return lastName;
}
public void setLastName(String lastName) {
this.lastName = lastName;
}
public Date getBirthday() {
return birthday;
}
public void setBirthday(Date birthday) {
this.birthday = birthday;
}
@Override
public String toString() {
XMLOutputStream xmlOutput = new XMLOutputStream();
JAXBContext contextObj = null;
Marshaller marshallerObj = null;
try {
contextObj = JAXBContext.newInstance(this.getClass());
marshallerObj = contextObj.createMarshaller();
marshallerObj.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);
marshallerObj.marshal(this, xmlOutput);
xmlOutput.flush();
xmlOutput.close();
} catch (JAXBException e) {
e.printStackTrace();
return e.getMessage();
} catch (IOException e) {
e.printStackTrace();
return e.getMessage();
} finally {
if (contextObj != null) {
contextObj = null;
}
if (marshallerObj != null) {
marshallerObj = null;
}
}
return xmlOutput.toString();
}
}
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<customerDTO>
<birthday>1983-07-13T13:23:27.436-05:00</birthday>
<firstName>Mauricio</firstName>
<identification>1845122451</identification>
<internalIdentifier>877441000001</internalIdentifier>
<lastName>Murillo</lastName>
</customerDTO>
package com.blogspot.ingmmurillo.jaxb;
import com.tandicorp.tandiesb.jaxb.XMLOutputStream;
import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Marshaller;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;
import javax.xml.bind.annotation.XmlType;
import java.io.IOException;
import java.io.Serializable;
import java.util.Date;
@XmlRootElement(name = "customer")
@XmlType(propOrder = {"firstName", "lastName", "identification", "birthday"})
public class CustomerDTO implements Serializable {
private String identification;
private String internalIdentifier;
//...
@XmlTransient
public String getInternalIdentifier() {
return internalIdentifier;
}
}
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<customer>
<firstName>Mauricio</firstName>
<lastName>Murillo</lastName>
<identification>1845122451</identification>
<birthday>1983-07-13T14:28:48.079-05:00</birthday>
</customer>