Pass sql into pl/sql and create RMAN duplicate script.
Posted on
16th Feb 2014 07:03 pm by
admin
Hi,
I'm new to pl/sql and I'm trying to write a script that will generate some RMAN commands to do a database clone.
Did you know?Explore Trending and Topic pages for more stories like this.
I want to able to run the script and it prompt me for variables to be used in the script.
I've done some research but I've been unable to find any examples of how to do this.
Basic script is (there would obviously be a lot more to the final script):
declare
dbname varchar2(9) := &dbname;
BEGIN
DBMS_OUTPUT.ENABLE(2000);
DBMS_OUTPUT.PUT_LINE(' DUPLICATE TARGET DATABASE TO '|| dbname ||';');
end;
/
Gives me:
Enter value for dbname: ORCL4
old 3: dbname varchar2(9) := &dbname;
new 3: dbname varchar2(9) := ORCL4;
dbname varchar2(9) := ORCL4;
*
ERROR at line 3:
ORA-06550: line 3, column 24:
PLS-00201: identifier 'ORCL4' must be declared
ORA-06550: line 3, column 9:
PL/SQL: Item ignored
ORA-06550: line 7, column 66:
PLS-00320: the declaration of the type of this expression is incomplete or malformed
ORA-06550: line 7, column 9:
PL/SQL: Statement ignored
Thanks,
No comments posted yet
Your Answer:
Login to answer
277
49
Other forums
JSON SORT WITH PHP
I have two products that I want to sort by say "Id:17, value: xxx" using php
The page w
creating a 1 to 100 in a table
hi guys I am a newb in php need some help.
I have a table with 1 column and 100 rows and in
HOW to get the bind variables list.
I've the following problem : I've some SQL queries stored in my DB as VARCHAR2 values.
I need t
Help with Password Encoding/Decoding?
Trying to design a "change password" tool. On my signup code I'm using base64_encode, now
with clause
hi all, i have a big query that usually access the same table more than once. for example, i have s
Why is this query failing?
Why is this not working?
$query = "SELECT * FROM `users` WHERE `userid` = " . $USERID
Apart from cron
I need to run a php file every one hour. Is there any other solution apart from cron job?
query help
Hi experts.
i have a table rep2 like this
PROD_COD ACCT_NO DUE_DAYS BALANCE
help removing unwanted graphic
How do I remove the small elongated rectangular shape between the "Latest post" and "
array help
Does anyone know how to require 10 text fields for individual grades and output class average? (10 p