• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 811
  • Last Modified:

Purge ddl

How do I purge any ddl statments. I really appreciate your help
0
hussainkhan22
Asked:
hussainkhan22
  • 4
  • 2
  • 2
  • +1
1 Solution
 
slightwv (䄆 Netminder) Commented:
What do you mean 'purge' ddl?

There is a purge command for the recycle bin but that's not ddl.
0
 
HainKurtSr. System AnalystCommented:
did you deleted/updated some important data @ your company and you want to hide what sql's executed on server?
0
 
Alex MatzingerDatabase AdministratorCommented:
By purge do you mean export.  You can use the exp command and set rows=n to just get the ddl.

EXP FULL=Y ROWS=N
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
hussainkhan22Author Commented:
Sorry for confusion. I need to find the SQL statement executed for creating an existing tablespace so that I can create use tablespaces using that SQL statement.
0
 
Alex MatzingerDatabase AdministratorCommented:
This is a way to do that:

exp userid=user/password TABLESPACES=<list of the tablespaces>

Open in new window


i beleive that is what you are looking for
0
 
slightwv (䄆 Netminder) Commented:
Try dbms_metadata.get_ddl('TABLESPACE','SOMENAME')
0
 
hussainkhan22Author Commented:
Getting error when I issue dbms_metadata.get_ddl.   Can you please provide me the exact command for oracle 11g database on linux . I really appreciate your help.
0
 
slightwv (䄆 Netminder) Commented:
I provided the correct syntax.  Please refer to the online docs for further assistance with the command or post your code and error message.
0
 
slightwv (䄆 Netminder) Commented:
Since you never posted back I guess you never referred to the docs?

http://download.oracle.com/docs/cd/E11882_01/appdev.112/e16760/d_metada.htm#BGBIEDIA

Table 87-11 DBMS_METADATA: Object Types

In Table 87-11 you see TABLESPACES?




SQL> select  dbms_metadata.get_ddl('TABLESPACE','SYSTEM') from dual;

  CREATE TABLESPACE "SYSTEM" DATAFILE
  'C:\JUNK\SYSTEM01.DBF' SIZE 2147483648
  AUTOEXTEND ON NEXT 52428800 MAXSIZE 65535M
  LOGGING ONLINE PERMANENT BLOCKSIZE 16384
  EXTENT MANAGEMENT LOCAL AUTOALLOCATE DEFAULT NOCOMPRESS  SEGMENT SPACE MANAGEMENT MANUAL

Open in new window

0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 4
  • 2
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now