how to alter a tablespace  through pl /sql procedure

Posted on 2009-02-12
Last Modified: 2012-05-06
I want to alter a tablespace through pl/sql procedure
Question by:ashis1278
    LVL 73

    Expert Comment

    create or replace procedure alter_my_tablespace(p_tablespace in varchar2)
            execute immediate 'alter tablespace ' || p_tablespace || ' coalesce';

    change "coalesce" to whatever command you want
    LVL 34

    Accepted Solution

    Yes, the "execute immediate" command will allow you to execute DDL commands in a PL\SQL procedure.  But are you sure this is the best solution to the problem?  Using PL\SQL to do DDL commands (something that PL\SQL is not designed or optimized to do) is not usually the best option.

    What is the business problem that you are trying to solve?

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    PRTG Network Monitor: Intuitive Network Monitoring

    Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

    Subquery in Oracle: Sub queries are one of advance queries in oracle. Types of advance queries: •      Sub Queries •      Hierarchical Queries •      Set Operators Sub queries are know as the query called from another query or another subquery. It can …
    Note: this article covers simple compression. Oracle introduced in version 11g release 2 a new feature called Advanced Compression which is not covered here. General principle of Oracle compression Oracle compression is a way of reducing the d…
    This video shows how to copy a database user from one database to another user DBMS_METADATA.  It also shows how to copy a user's permissions and discusses password hash differences between Oracle 10g and 11g.
    This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

    761 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    10 Experts available now in Live!

    Get 1:1 Help Now