DBA - Wiki

AskDBA.org Forum » DBA - Wiki

using instr function to get filesytem structure for manual db clone (1 post)

About This Topic

Tags

  1. Amit Bansal

    Oracle DBA
    Joined: Jun '08
    Posts: 73

    offline

    Posted 2 years ago
    #

    While performing a manual db cloning, you are required to create database directories. Using instr and substr function can help you with this and can list the create directory script

    select distinct('mkdir -p '||substr(file_name,1,instr(file_name,'/',-1,1)-1)) from dba_data_files
    union
    select distinct('mkdir -p '||substr(name,1,instr(name,'/',-1,1)-1)) from v$controlfile
    union
    select distinct('mkdir -p '||substr(member,1,instr(member,'/',-1,1)-1)) from v$logfile
    union
    select distinct('mkdir -p '||substr(file_name,1,instr(file_name,'/',-1,1)-1)) from dba_temp_files;
    

    Hope this helps

  2. Anonymous



    Posts: 3

    offline

    Posted 1 year ago
    #

    Thanks man for the help i was trying to get a shortcut to create the database and you have done a lot for me by providing this function

Reply

You must log in to post.

AskDBA.org Forum » DBA - Wiki
251 posts in 104 topics over 45 months by 63 of 110 members. Latest: xiaoling, Williams29, Agatha