02.03. creation of "DEV001 Database"

                 <<< Back   Next >>>
1. Create snapshot
[oracle]$
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=/u01/app/19.0/grid
/sbin/acfsutil snap create -w -p rw_bank rw_bank001 /u02/oradata/bank
### enable quota to snapshot
/sbin/acfsutil snap quota 100g rw_bank001 /u02/oradata/bank
### create link to snapshot
/sbin/acfsutil snap link -s rw_bank001 /u02/oradata/bank/bank001
### info
acfsutil snap info /u02/oradata/bank
### drop
### /sbin/acfsutil snap delete rw_bank001 /u02/oradata/bank


2. Replacing paths for files
[oracle]$
export ORACLE_SID=bank001
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=/u01/app/oracle/19.0/dbhome_1
$ORACLE_HOME/bin/sqlplus '/ as sysdba' <<EOF
startup mount;
begin
FOR z IN
(select 'alter database rename file '''||name||''' to ''/u02/oradata/bank/bank001/'||substr(name,instr(name,'/',-1)+1)||'''' name from
(select name from v\$datafile union
select name from v\$tempfile union
select member name from v\$logfile) order by 1)
LOOP
begin
execute immediate z.name;
exception when others then NULL;
end;
END LOOP;
end;
/
EOF

3. Open database
[oracle]$
$ORACLE_HOME/bin/sqlplus '/ as sysdba' <<EOF
alter database open;
EOF
                 <<< Back   Next >>>

No comments:

Post a Comment