Generate Flashback Query commands from a script
Hello community,
I'm trying to locate a command or a script that I can keep on hand in case I needed to restore the data on every table in a tablespace using Flashback Query. I am having some problems of syntax. I'm trying to capture all the table names in a tablespace and generate orders create table for all people. It's playback my values of time because links. Did anyone see a way to fix this? The escape character \ is not recognized.
(11.1.0.7) connected as the owner of the schema.
SQL > Select 'create table TESTER1.' | table_name| "_BAK in select * from TESTER1.' | table_name |
' 2 ' from timestamp TO_TIMESTAMP ('2015-05-20 12:30 ',' YYYY-MM-DD HH24:MI:SS 'YYYY-MM-DD HH24:MI:SS') e |
"3 from user_tables where nom_tablespace = superior '(& 1)";
Enter the value 1: testtbl
"old 3: from user_tables where nom_tablespace = superior '(& 1).
3 new: from user_tables where tablespace_name = upper '(testtbl)'
SP2-0552: Bind 'MI' undeclared variable.
Thanks in advance.
It works now.
I've used quote that makes it easy operator use the quote.
SQL > col col1 format a70 word_wrap
SQL >
SQL > select "create a table TESTER1." | table_name | "_BAK in select * from TESTER1.' | table_name |
2 q'[from timestamp TO_TIMESTAMP ('2015-05-20 12:30 ',' ' YYYY-MM-DD HH24:MI:SS);] "as col1
3 from user_tables where nom_tablespace = upper('&1');)
Enter the value 1: example
old 3: from user_tables where nom_tablespace = upper ('& 1')
3 new: from user_tables where nom_tablespace = upper ('example')
COL1
----------------------------------------------------------------------
create table TESTER1. T3_BAK in select * from TESTER1. T3 as a
timestamp TO_TIMESTAMP ('2015-05-20 12:30 ',' YYYY-MM-DD)
('HH24:MI:SS);
create table TESTER1. T1_BAK in select * from TESTER1. T1 to the
timestamp TO_TIMESTAMP ('2015-05-20 12:30 ',' YYYY-MM-DD)
('HH24:MI:SS);
create table TESTER1. T2_BAK in select * from TESTER1. T2 to the
timestamp TO_TIMESTAMP ('2015-05-20 12:30 ',' YYYY-MM-DD)
('HH24:MI:SS);
COL1
----------------------------------------------------------------------
SQL > create table TESTER1. T3_BAK in select * from TESTER1. T3 as a
2 timestamp TO_TIMESTAMP ('2015-05-20 12:30 ',' YYYY-MM-DD)
3 HH24:MI:SS');
create table TESTER1. T3_BAK in select * from TESTER1. T3 as a
*
ERROR on line 1:
ORA-00942: table or view does not exist
SQL > ed
A written file afiedt.buf
1. create the Bhavesh.T3_BAK table in select * from Mary. T3 as a
2 timestamp TO_TIMESTAMP ('2015-05-20 12:30 ',' YYYY-MM-DD)
3 * ' HH24:MI:SS)
SQL > /.
Table created.
Tags: Database
Similar Questions
-
How to generate xml with CDATA from a query
I have the following query
and the output iswith data_tab as ( select 'Geetha' "code" ,'Book' "category" from dual union select 'Nokia' "code" ,'mobile' "category" from dual ) select Xmltype(cursor(select * from data_tab)) from dual
but I want to insert ot XML CDATA.<?xml version="1.0"?> <ROWSET> <ROW> <code>Geetha</code> <category>Book</category> </ROW> <ROW> <code>Nokia</code> <category>mobile</category> </ROW> </ROWSET>
Is that I need this xml file in the following format.
Please help me on this. In my original query, I am selecting from a record type, and it is nested. So I can not change the query select * from data_tab<?xml version="1.0"?> <ROWSET> <ROW> <code>![CDATA[Geetha]]</code> <category>![CDATA[Book]]</category> </ROW> <ROW> <code>![CDATA[Nokia]]</code> <category>![CDATA[mobile]]</category> </ROW> </ROWSET>
Manjusha Muraleedas wrote:
Is there another solution.Well, Yes and no...
No, because a CDATA section is supposed to be built directly on the data source, so that the content is preserved as is, with no escaped character.
Yes, you can transform the XML to add CDATA sections thereafter, but what would be the point? The XMLType constructor already still escaped characters that are not valid.Out of curiosity, why do you require CDATA instead of escape sequences?
-
Operating system command from PL/SQL Windows
Hi all
I develop an app of proto. I have Oracle 11 GR 2 standard edition 1 on Windows 8.1.
My requirement is OS of PL/SQL command execution. The PLSQLOSCOMMAND.zip meets all the requirements as file ZIP and LOB.
Oracle PL/SQL, OS command execution. SourceForge.net
(1) first, I run the install.sql script against my user (STK_BIN). It is to have role DBA. No errors.
2) connect as SYS and running the following commands:
Start
dbms_java.grant_permission ('STK_BIN', 'SYS:java.io.FilePermission', "< < all FILES > >", "read, write, execute, delete");
commit;
dbms_java.grant_permission ("STK_BIN", "SYS:java.lang.RuntimePermission", "readFileDescriptor", ");
commit;
dbms_java.grant_permission ("STK_BIN", "SYS:java.lang.RuntimePermission", "writeFileDescriptor", ");
commit;
end;
(3) select * from dba_java_policy watch
GRANT STK_BIN SYS java.io.FilePermission < < all FILES > > read, write, execute, delete ACTIVE 151 GRANT STK_BIN SYS java.lang.RuntimePermission readFileDescriptor ACTIVE 152 GRANT STK_BIN SYS java.lang.RuntimePermission writeFileDescriptor ACTIVE 153 ((4) select * from table(file_pkg.get_file_list(file_pkg.get_file('\')));
Shows the correct file and directory details
(5) but when I run the command
Select os_command.exec double '(mkdir STK_BIN_DIR');
It gives me error
ERROR on line 1:
ORA-29532: Java completed by eception Java exception appeal:
java.io.IOException: Exception when creating the process:
java.io.IOException: the handle is invalid.
ORA-06512: at "STK_BIN. OS_COMMAND', line 68
What I did wrong. Why any windows OS running order giving the error?
3DS wrote:
(5) but when I run the command
Select os_command.exec double '(mkdir STK_BIN_DIR');
It gives me error
ERROR on line 1:
ORA-29532: Java completed by eception Java exception appeal:
java.io.IOException: Exception when creating the process:
java.io.IOException: the handle is invalid.
ORA-06512: at "STK_BIN. OS_COMMAND', line 68
I guess that the stored proc Java is designed to run external programs? In this case, there is no mkdir.exe program to load and run. Instead, he entered CLI to the cmd.exe program.
Under the hood, probably the CreateProcess() kernel is called. Have a look to understand the statement of core works to create a process.
-
Hello
My version of the database: Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64 bit Production
Select flashback_on in the database of v$.
FLASHBACK_ON ------------------
NO. But when I run the present:
my session: select count (*) from < my_table >
-------------
31336
another session: delete from < my_table > where... then validate
my count (*) session: < my_table > selection from to_timestamp ('08.10.2013 10,00', 'dd.mm.yyyy hh24.mi') TIMESTAMP
-----------
186
Why I got so flashback is not active?
FLASHBACK DATABASE is different from FLASHBACK QUERY. FLASHBACK QUERY does not require the database to allow Flashback. It requires only that UNDO_RETENTION (or Auto_Tuned_Undo_Retention) is sufficient.
Hemant K Collette
-
How to set the parameters of the ipmi/ILO for feeding from a script management?
I have an installation script entirely work for our guests esx4, the only thing missing is implemented ipmi/ILO settings.
I searched and can't find answers for this, anyone know how to do it from a script?
If it is ESX, so part of your kickstart could generate the thumbprint and download these results on a NFS server including vMA has access to perhaps a list of host names + digital fingerprint. You could write a small script which basically monitors a directory for updates and then automatically add to vCenter once the system is ready to go, you can probably do something similar with ESXi, but it will be more complicated that you have not a real way to "launch" the host. However, you can change the image and put your own scripts such as a python script to extract the footprint and again do the same thing by dumping at the exit of a volume shared including vMA has access to.
If you are interested in editing script ESXi, take a look at 4 part of Maish's article on how you can configure the ESXi ping to a management host host - http://technodrone.blogspot.com/2010/04/esxi-deployment-solution-beginning.html
=========================================================================
William Lam
VMware vExpert 2009,2010
VMware scripts and resources at: http://www.virtuallyghetto.com/
Introduction to the vMA (tips/tricks)
Getting started with vSphere SDK for Perl
VMware Code Central - Scripts/code samples for developers and administrators
If you find this information useful, please give points to "correct" or "useful".
-
Hello
Is it possible to use hierarchical XML DB indexes with flashback query? Is it possible to use the flashback with an index field query at all?
When I create a file test.xml in public and subsequently remove and try to pick up after deleting it doesn't seem to be there:
However, if I try it it works all of a sudden:SELECT any_path FROM resource_view AS OF TIMESTAMP TO_TIMESTAMP('20101129125302','YYYYMMDDHH24MISS') WHERE EQUALS_PATH(res,'/public/test.xml')=1
It seems therefore that the hierarchical index used if I use EQUALS_PATH is still "stuck in time present" and does not behave as it would if it was 5 minutes ago.SELECT any_path FROM resource_view AS OF TIMESTAMP TO_TIMESTAMP('20101129125302','YYYYMMDDHH24MISS') WHERE ANY_PATH='/public/test.xml'
Confusing all this jump back in time. I hope you get the idea. ;-)In general flashback is not supported with the repository, sorry...
-
Question about flashback Query
You can compare a line to an earlier version of himself by using the Flashback Query feature? Without changing the current value of update?
In a situation such as;
Is it possible to make an ACE OF the request to give a difference of the current value of the field AMOUNT reduced by the previous value?CREATE TABLE EX (ID NUMBER(5) PRIMARY KEY, AMOUNT NUMBER(5)); INSERT INTO EX VALUES (1,100); commit; UPDATE EX SET AMOUNT = AMOUNT - 50 WHERE ID = 1; commit;
Something like...
SELECT ID... Less old news...
WHERE ID = 1
TIA
Published by: kmc5117 on October 4, 2010 19:05
Published by: kmc5117 on October 4, 2010 21:32
Published by: kmc5117 on October 4, 2010 21:32Hello
Of course, you can do:
CREATE TABLE EX (ID NUMBER(5) PRIMARY KEY, AMOUNT NUMBER(5)); INSERT INTO EX VALUES (1,100); commit; ACCEPT x PROMPT "===== Wait at least 5 seconds, then press [ENTER] =====" UPDATE EX SET AMOUNT = AMOUNT - 50 WHERE ID = 1 ; commit; SELECT w.amount AS was , i.amount AS is_now , w.amount - i.amount AS old_minus_new FROM ex AS OF TIMESTAMP (SYSTIMESTAMP - INTERVAL '5' SECOND) w JOIN ex i ON w.id = i.id ;
Output:
Table created. 1 row created. Commit complete. ===== Wait at least 5 seconds, then press [ENTER] ===== 1 row updated. Commit complete. WAS IS_NOW OLD_MINUS_NEW ---------- ---------- ------------- 100 50 50
-
Firefox is from a script that accesses a malicious Web site?
When I start Firefox, Avast gives me a warning that Firefox is from a script that is trying to access the website https://boncom.demdex.net. I tried ہ disabled add-ons Firefox and it still runs this script. None of the other browsers for this when I open them.
Avast is calling it a HTML:Script-inf, which sometimes seems to be a false positive, but in this case I don't want anything to access websites weird anyway, so how I disable anything that attempts to access this site when I run Firefox?
It may have infected your folder of Firefox
-
I'm working on a network to restrict access to the ISSO role USB mass storage, only. Management wants to access USB Mass Storage for ISSOs on all workstations while blocking access to USB mass storage to all others... on all the workstations. They also want to that USB ports remain available for everything except Mass Storage.
There are many ways to do it, but the only 'reliable' method, I found so far is to point the HKLM\System\CurrentControlSet\Services\UBSSTOR\ImagePath key to some fake file to block ports and rename it back to access it again.
To do this, I need to do things more two 2...
1. make sure that the ImagePath key always has the false value at startup, and
2. create a login script that affects the ImagePath value when a member of the ISSO group connects... and reset it when they log off.
Which meet the requirements of the direction if only it worked! The problem is that USB devices must be listed again to re-read the ImagePath registry key after each change. Reconnect the device will do, but it would be unwise to rely on a user to restrict access (fox/Coop).
The following Microsoft KB seems to be the way to go, but we do not have compilers on the network...
http://support.Microsoft.com/kb/259695
I know that this hack to the system is not the most elegant, but I'm just trying to make the management happy.
Nobody knows...
1. any (more elegant) way to meet the specified requirement, or
2. a way to re - enumerate USB devices from a script.
Thank you! ... Todd
Hi Todd,
The issue of Windows XP, you have posted is better suited for the IT Pro TechNet public. Please ask your question in the TechNet forums for assistance.
Hope the helps of information.
-
Epson Stylus Color 400 is unresponsive to commands from the computer
Although it worked fine for the past three years, my Epson Stylus Color 400 suddenly stopped to respond to commands from the computer. I have checked all connections and assured cartridges are full and OK. After turning off the power and unplug the printer from the computer, then press the power button and the power button together and then release the two buttons (all according to the Epson manual) prints a number and alignment to check properly. What did I miss?
Hi Brian,
Thanks for posting your question in the Microsoft Community forums.
I see from the description of the problem, that this printer is not responding.
I imagine the inconvenience that you are experiencing. We are here to help and guide you in the right direction.
To provide the proper resolution, that I would need more information on your side.
Do you get any error messages?This problem can occur if the cables are not properly connected, corrupt, drivers, incompatible drivers, the printer settings, missing updates, and problems related to the printer.
Method 1:
First, let's run this fixit who will help resolve the problem.Diagnose and automatically fix problems printing and printer http://support.Microsoft.com/mats/printing_problems/
Method 2:
If the first method does not resolve the problem, you can try the procedure described in the article and check if it helps.Printer in Windows problems
http://Windows.Microsoft.com/en-us/Windows/help/printer-problems-in-WindowsCheck out the link for more information.
Why can I not print?
http://Windows.Microsoft.com/en-us/Windows7/why-cant-I-printLet us know the status of the issue after you perform the troubleshooting steps. If you need help or information about the issue with printing, I'll be happy to help you. We, at tender Microsoft to excellence.
-
Is it possible to get the name of the tool selected from a script?
Hello
Is it possible to get the name of the tool currently selected from a script?
I found this:
https://forums.adobe.com/thread/579195
https://forums.adobe.com/thread/2161923
But these works in Photoshop... So, it is possible to get the name of the tool currently selected in InDesign? Is there a universal method that will work in other applications?
I think that there is a toolBoxTools, app.toolBoxTools...
P.
-
Snapshot too old with flashback query
Hello
Using oracle as a result of sql 11.2.0.3
create table < table_name > nologging
tablespace mis_data
ACE
Select *
de retailer_trn_report_type rt
UNMIS
Select *
de retailer_trn_report_type as of timestamp systimestamp - interval '4' hourTable was about 300 lines added 12 rows to it.
When tried previously obtained snapshot too old message. put comprae as had before backup did insert but curious mentioned dba got the alert message
: EM Event: WARNING: IKW - capture instant too old error found: SQL ID cf4z1f0v9t12f, instant 0x0036.90d69b46 YVERT, YVERT recent 0x0036.92433b72, Undo Tablespace UNDOTBS1, current undo retention 2 082.
Why is it when the table is so small - it reason for flashback query.
Thank you
Big undo tablespace that is more space.
-
Best way to run a script from a script
Hello world
I'm looking for running a script from an After Effects script, so far, there is aftereffects.executeScript (scriptContent) who use eval to run the script. The problem is that it uses eval so it is not really sure and he is slower. So I would like to know what is actually used when we file-> Script-> Run script file.
As seen in the Javascript tool Guide CC page 168 in the section QAnywhere Corss-DOM.
aftereffects.executeScript(theScriptContent); // Doesn't work with a script which as comments AND the script has access to my scope
In addition, if there are comments like / * * / or / * / in the script I want to run, it no longer works.
So, what is the best way to run a script from a script?
If you want to evaluate a whole script file, you can use $.evalFile (file, timeout) - see description in ESTK object model viewer
To evaluate a bit of code, you can use eval, that's for sure.
Xavier
-
a small question, how to call from a script "redraw force"?
For purposes of "debugging", I would like to call from a script a refreshment 'force' the window of current layout (default keyboard shortcut SHIFT + F5). I can't find anything like that in the DOM, and I thought to invoke a menu... but cannot find the menu item for it either...
anyone?
Or perhaps minimize, maximize the specific layoutWindow of the document?
'Force refresh' should be available by its ID 318 value:
//Invoke the menu "Force Redraw": try{app.scriptMenuActions.itemByID(318).invoke()}catch(e){$.writeln(e.message)};
Uwe
-
I'm looking for the Scripts directory from a script.
Hi all! After playing with Photoshop scripts, I'm now playing with AE also, and in my first test I stuck to find the path of scripts from the script itself.
In Photoshop, there was this piece of code that someone in the forum scripts Photoshop kindly shared:
var scriptsPath = new folder (app.path + ' / ' + locate ("' $$$ / ScriptingSupport/InstalledScripts = settings presets/Scripts" "));
But this line does not work in After Effects because there is no variable app.path (very funny, I thought that Photoshop and After Effects share the same basic app variables) and the required path "find" does not go in AE (I think that "$$$" means nothing to her).
Can someone give me a clue on how to fix this? Thank you very much in advance :-)
This script shows some examples that you can try. The first part shows a way to get the record in that of the running script is located. The second gets the main AE app folder but I do not know if appFolder runs on Windows (you still need to add \Scripts on/SupportFiles/Scripts on Win or Mac).
var thisScript = new File($.fileName);
var containingFolder = new Folder (thisScript.parent.absoluteURI);
Alert ("this script is in" + containingFolder.absoluteURI);
var appFolder = new Folder (Folder.appPackage.parent.absoluteURI);
Alert ("the app folder is at" + Folder.decode (appFolder.absoluteURI));
Maybe you are looking for
-
Satellite Pro A210 PSAFHE: How to disable the Symantec start at startup screen
Hello Just treated with a virus - had to restore restore cd - I have now an annoying splash screen, trying to persuade me to sign up for norton symantec internet security I do not wish to subscribe to this program - how to stop this loading screencon
-
PC laptop 15 HP TouchSmart: keyboard problem
My keyboard does not work properly. A lot of keys (20) does not work. in the beginning, it was 4
-
I'm building a robot for a school project I need to use custom NXT inputs and outputs. For my entry, I need the NXT to recognize a power transmitted by a detector of metal (between 1.5 and 1.9 volts) and then do an engine, specific degrees that corr
-
I have two accounts of users, administrators and identical in every way, but the calendar control will run only in one of them, even if add it to the account register for the account that do not work and remove the other. Has anyone else had a simil
-
I can see the CD/DVD drive in Device Manager, but it will play all discs.
LG GH 22N S50 DVD/CD PLAYER WON'T PLAY DISC LIES IN THE MANAGER OF DEVICES AND MY VISTA ULTIMATE 64 BIT, GIGABYTE MOTHERBOARD INTEL E8500 CPU COMPUTER IS A CHIPSET ISSUE? DOWNLOAD FIRMWARE OF SAMSUNG USA SITE AND of GETTING "Cannot FIND TARGET" WHEN