restoration of oracle database - oracle10g

Can i restore different dumps(databases) on a single database created through the database configuration assistant in oracle 10g.
i mean to say that the previous tablespaces must be overwritten by the new one thus saving the time to create new tablespace everytime we restore a dump file.

yes it is possile by creating a new user.the new user will act as a new schema and can exist with the previously imported data without overwriting it.
how ever if i want to import different data using the same user then the previously stored data must be dropped along with the user first,the agin the user must be created;
Command to do this is
DROP USER CASCADE;
This will drop the previously stored data without deleting the tablespaces thus saving time to create new tablespaces.

Related

Pgadmin 4 restore database at a certain location

I have a database I want to restore at certain location, my second hd. How I do this in PgAdmin 4?
If your backup file is at a certain location, select it in the backup and restore dialog window.
If you want your database to save data to a certain location, you can achieve that with tablespaces. You can move stuff in db between different tablespaces using an alter query.
If you want the database to save data by default and only to that certain location, you can install a new cluster/instance and set its data directory to your desired location from the start, then restore your database to that. It's also possible to move an existing cluster to a new location and do the same.

Backup and Restoration of Running Schema In Another Database That Already Have Other Schemas

I have a running database with only one dba (i.e. other than sys, system) "abc". Under this oracle user I have tables, views, sequences, procedures, functions etc. Now I have to copy both the data and schema to another database at another machine that already have a dozen schemas running (one under each separate dba). I have following concerns:
(1) I have to rename the schema at old machine, from "abc" to "pqr" before moving to the new machine.
(2) Inside my procedures and functions, I am using AUTHID CURRENT_USER, therefore have to use "abc." qualifier before name of tables, views, sequences, procedures, functions. When changing schema name, is there some automatic way to change qualifiers too.
(3) In order to copy data, I know only one way, which is to take backup of database of only one user "abc" (i.e. not take backup of sys, system). Then restore that to the new database. Can this in anyway destroy the other schemas or their data.
(4) In my schema, I am creating oracle users with limited rights using a procedure. The new usernames are stored in a Users table. I am also creating database roles and associating users with roles. The rolenames are stored in a Roles table. When migrating to new machine I have to make sure to prefix my users and roles with something unique so I not disturb oracle users created by other schemas.
(5) I know that in the new database, there have to be a new dba user called "pqr". Do I also have to have sysdba privilege. I am not responsible about the whole database at new machine, I am responsible about my schema only. Being a sysdba, can I in anyway hurt other dbas (like dropping them, or changing their schemas). If I not have sysdba privilege, what limitations do I get. I am using OracleText so have to use some built-in packages. I also have to create physical directory on file system in windows. I also have to create, alter (change password), drop roles and users via stored procedures when connected to database using "pqr".
Both old and new database are running on separate dedicated machines. Its windows server 2003 with oracle 10gr1.
The simplest option would be to use the Oracle export utility (classic or DataPump) to take a logical backup of the abc schema in the first database and to import the backup using the Oracle import utility into the new database. If you're using the classic version, you'd use the FROMUSER and TOUSER parameters to specify that you want to import the data into a different schema. If you're using the DataPump version, you'd use the REMAP_SCHEMA parameter. The DataPump version will be more efficient if you have a relatively large amount of data.
Unfortunately, though, there is no way to change explicit schema qualifiers. You'll need to edit the code after you import it or pull the code from your source control system, edit the code, and deploy it to the new database.

How can I update only a few tables using a pre-populated Core Data database via an App Store Update

We have an app in the app store right now that uses a pre-populated Core Data database. We want to update all the tables in the database, except for 1 table which is the Favorites table where users store their Favourite bus routes or stops. Currently, we are accomplishing this update having the app delegate use the SQLite C API, and NSFileManager to do the following:
Create a temporary Favorites database
Copy the favourites from the database on the disk to the temporary database
Delete the database on disk ([fileManager removeItemAtPath:storePath error:NULL] )
Copy the new database from the app bundle to disk ([fileManager copyItemAtPath:databaseBundlePath toPath:storePath error:&copyError])
Copy Favourites from the Temp database into the new database.
Delete the temporary Favorites database.
I was wondering if there was another way to do this because there have been a lot of complaints with our app crashing during the splash screen which is the time where the database copying happens.
I heard of Core Data Migration, but my understanding of Core Data Migration is that you can migrate data only when a the model changes, but in our case the model hasn't changed.
Why don't you leave the database as it is and just insert/remove the data into it as needed instead of copying a prefilled database?
Alternatively you can also take the opposite approach: leave the original database, copy the prefilled one with a new name, insert the favorites from the original database into the new one, remove the original one, and now only use the new one. Like this, you are always sure nothing happens to your user's favorites.
Or you could write the favorites first into a text file, and then do the same thing you describe. If anything happens (like a crash), you always still have the favorites in the saved text file.
It also may work with core data migration, but up to now I avoided that ... any structural database change is something I would rather avoid, I think ...

Manifold/PostGIS data manipulation and export

I'm currently working on a GIS database project using Manifold Ultimate.
I am able to import data from PostGIS via the database console, and edit the data as a table object within Manifold.
How do i 'commit' these changes back to PostGIS?
I am required to submit the exported database. What format is expected for a PostGIS export and how is the exporting done?
#mdsumner is correct. Linking the PostGIS data is the way to go.
If you have exported the complete table and edited records it's not simple to replace the data present in PostGIS by a new export. This will fail until you have deleted all the tables with index, triggers and sequences whose names are derived from the same name of exported drawing (with inconsistend handling of lower case). It's not enought to drop the table.
Note that with Manifolds linked storage model you have no client buffer of edited, added or deleted records that are written back in a process of commitment of a transaction. Every edit of every single column is written to PostGIS at once.
Concerning your 2. question: That depends on the target system. Manifold exports GEOMETRY type geometries. Other PostGIS clients may digest only a single type point, line or polygon. You can edit the type in "geometry_columns.type" as long as you have added only the one type of object to the drawing.
I think that if you imported the data it is no longer linked to the DB and you would need to export it and replace what is in the DB. If you link the data the edits you make are commited "live" as the data is not a copy but remains stored by the DB.
I'm not that familiar with this, but that's what the Database Console topic in help describes.

Will delete user for Oracle 10g database deleted the data corrsopds to the user?

I am new to the Administration part of the Oracle server,Just want to know will deleting a user means data related to that user will also get deleted?
Thanks you.
Review cascade option for drop user command
http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/statements_9008.htm#SQLRF01811
Depends upon what you mean by "related". Every user in the database has a corresponding schema, with tables, indexes and so on. If you drop a user, their schema and all the data in it goes too. If the user has put data into other tables, that data does not go anywhere.