Tag Info

New answers tagged

0

If you are using a SQL editor like Toad, this script may help as well. You can copy/paste the results in a new window. SELECT DISTINCT 'GRANT Select ON TABLE ' || rtrim (tabschema) || '.' || rtrim (tabname) || ' TO USER USERNAME;' FROM syscat.tables WHERE tabschema = 'Schema' UNION SELECT 'GRANT Select ON VIEW ' || rtrim ...


0

If there is less than a few GB of data in all the tables and indexes, then mysqld may use only 3GB of RAM. Look on disk in the datadir; see what the total size if that dir tree is. That will be an approximation of how much RAM might be used. A well tuned mysql will run with under 5% CPU. That includes tuning of the VARIABLES, adding necessary INDEXes, ...


0

You can refer HERE using perl on *nix: You can use perl to replace the death lines to any delimiter you want (I used comma in this example). File: Command: perl -wnlpi -e 's/\s+/,/g;' text.txt Result:


1

Another option that could handle this and possibly allow for a bit more flexibility is to use a SQLCLR function or stored procedure that makes use of the SqlBulkCopy class (which is essentially the same framework used by BCP.EXE, BULK INSERT, etc). While writing such a function/procedure might not be worth the time/effort for a one-off project, there is ...


1

Try to flashback your table ALTER TABLE your_table ENABLE ROW MOVEMENT; FLASHBACK TABLE your_table TO TIMESTAMP (SYSTIMESTAMP - INTERVAL '1' minute);


6

You could use Flashback to return the table data back to its original state. Is Flashback enabled? Database needs to be in archive mode: select log_mode from v$database; Should return "ARCHIVEMODE" Check if flashback is enabled: select flashback_on from v$database; Should return "YES" If "NO", you can enable flashback by runing: alter database ...


3

The constraints are kept for the renamed table. Drop them before you import the tables with the correct data. alter table t1 drop constraint c; There is also another way to do it if you do not want to lose the wrong data. You can create a new table based on the 2 tables: create table t1 as select * from t; Then you must disable the constraints and ...


0

The last_number column in all_sequences was different in both the databases (11g and 12c) ideally it should be the same. What I did was I incremented the sequnce number of 12c database higher than the sequence number as that of 11g database. And the error did not show up. All is well.!


2

You wrote 12c db has the exact data of 11g (expdp/impdp) But are you sure? 1) Did you make a consistent export of your tables? This means all table data is from the same point in time. For this it is sufficient that you stop all other write activity on the database during export. Or you set the flashback_scn parameter when using expdp or the ...


2

I'm assuming based on the post that the PostgreSQL database server and the process restoring the dump are on the same machine. If so: Is it possible to pause the import of the database? Not really. You could SIGSTOP the pg_restore or psql process and/or the corresponding postgres backend, but I wouldn't consider that my first-choice option. If not, ...


0

count lines/records in your textfile import count records after import if count1=count2 then continue tidy up fields (update blablabla set changefield='new' where myfield='badinfo') test tidy up : select count(*) from blablabla where myfield='badinfo' and changefield<>'new' if testTidyUp-count = 0 then cleanup = correct ... continue count records after ...



Top 50 recent answers are included