Oracle 10g to Oracle 12c migration on solaris 10 - database

I have been assigned to move 10g database to Oracle 12c on a Solaris. Size of data is around 68 GB.
So far I have managed to install the Oracle 12c on Solaris and also created the default DB it asks for. Now I'm trying to import the dump into Oracle 12c db which is proving to be problematic to me. I didn't take the dump, it was provided to me and told me that it was taken of the entire DB with exp utility.
I'm trying to import it using this:
imp file=/bkofa/dump/backup_dmp.dmp full=y;
and then
when it asks me for Username I provide this:
/ as sysdba
but it never imports anything and always gives me with errors like Users this and this doesn't exist and so on>
So I tried to create Users manually like this:
CREATE USER c##AFXAML
IDENTIFIED BY VALUES 'B010B6069516DE73'
DEFAULT TABLESPACE AFXUSER
PROFILE DEFAULT
ACCOUNT UNLOCK;
I also tried with simply providing name like AFXAML without appending c## but still gives me an error that invalid username.
Please help me how to resolve this by either pointing me to a guide that shows how to setup a 12c db from the get go for import and please tell me why the full option doesn't work and it asks to create all the users separately. Currently there's something like 30 users and 4 tablespaces.

Related

Why does the creation of a pluggable database in Oracle XE 21c fail with ORA-65100: "missing or invalid path prefix"?

I need to set up a new Oracle XE database after the server holding our old XE testing database suddenly died.
To do this I do have a .dmp file from when the database was functional.
The server is a Windows machine.
The database structure was originally created in an Oracle 11g environment but the server had been updated since so the .dmp was created in a 19c environment.
The new Oracle XE database I'm trying to set up is 21c.
The installation of Oracle XE worked, but trying to create a PDB fails with ORA-65100 "missing or invalid path prefix".
Issued the following statements in sqlplus via command line:
create pluggable database DATABASE_MAIN
admin user USERNAME identified by PASSWORD
storage (maxsize 2G)
default tablespace TS_DATA
datafile '/disk1/Oracle/product/21c/dbhomeXE/pdbs/DATABASE_MAIN/DATABASE_MAIN.dbf' size 250M autoextend on
path_prefix = '/disk1/Oracle/product/21c/dbhomeXE/pdbs/DATABASE_MAIN/'
file_name_convert = ('/disk1/Oracle/product/21c/dbhomeXE/pdbs/pdbseed', '/disk1/Oracle/product/21c/dbhomeXE/pdbs/DATABASE_MAIN/');
So this line is currently throwing the error:
path_prefix = '/disk1/Oracle/product/21c/dbhomeXE/pdbs/DATABASE_MAIN/'
Things I've tried to get around the error:
ran cmd as administrator in case its a simple permission issue
created the missing folders myself ( /pdbs/DATABASE_MAIN )
replaced /disk1 with /diskc to see if it makes a difference
omitted /disk1 and started the string with /Oracle
tried a different path ( /disk1/Oracle/product/21c/pdbs/DATABASE_MAIN/ )
removed the trailing '/' at the end of the path prefix
Searching online for what invalidates the path prefix sadly didn't give me any answers however Oracle's documentation states the following as a valid example path prefix:
PATH_PREFIX = '/disk1/oracle/dbs/salespdb/'
This is my first time interacting with this "new" Oracle database structure of CDB/PDB as I've only worked with older databases so far that were built with the user/schema structure.
As noted in the comments, the issue was due to the UNIX style paths rather than Windows styled.
So changing the paths from
/disk1/foo/bar
to
C:\foo\bar
resolved the issue.
Here's the functional create-statement as run in sqlplus:
create pluggable database DATABASE_MAIN
admin user USERNAME identified by PASSWORD
storage (maxsize 2G)
default tablespace TS_DATA
datafile 'C:\Oracle\product\21c\oradata\XE\DATABASE_MAIN\DATABASE_MAIN.dbf' size 250M autoextend on
path_prefix = 'C:\Oracle\product\21c\oradata\XE\DATABASE_MAIN'
file_name_convert = ('C:\Oracle\product\21c\oradata\XE\pdbseed','C:\Oracle\product\21c\oradata\XE\DATABASE_MAIN');

Oracle sql Developer 10g - How to import/replace a ,dmp database to existing database

i have an existing database which is old version and i want to replace it with the latest version of database(.dmp file).i am newbie so Could someone show me step by step on how to import a full database to it.
Thanks in advance.
FYI: i put the oracle sql developer in virtualbox ,WIN7 64bit.
To replace everything, it's usually easier and faster to just drop and recreate the schema instead of dropping all objects in the schema individually.
drop user WHATEVERMYNAMEIS cascade;
create user WHATEVERMYNAMEIS identified by MYSECREDPASSWORD default tablespace USERS;
grant CONNECT, RESOURCE to WHATEVERMYNAMEIS;
(Note that this is just an example. You need to supply your own username, password, tablespace name, privileges etc.)
Once that is done, the .dmp file can easily be imported from the command line:
imp WHATEVERMYNAMEIS/MYSECREDPASSWORD#MYDATABASE file=whatever.dmp fromuser=WHATEVERMYNAMEIS touser=WHATEVERMYNAMEIS

how to tell if oracle database is installed on pc

i work for a company as java developer, they gave me laptop that was previously used by another person, to test my java application i need to have oracle on laptop and create some sample database with sample data. when I got the laptop i found that there is oracle installed on it, but i don't know if this is only oracle client or full oracle installation (server + client)
please can you tell me how to figure out if there is only oracle client on laptop or full database installation, plus i need to know if there is some default username and password so that i can access the database and create schema and tables in it, so that i can test my java application.
i thinking to see DBA but i thought of dropping a question here first, maybe i can solve the problem by myself
If it is an Oracle Client, it doesn't have bin/dbca
Oracle Home may indicate the installation's type. The default Oracle Home folder names are:
Oracle Database: dbhome_1
Oracle Client: client_1
Although to make sure, you should check the services looking for OracleServiceSID entry on Windows.
Run Command sqlplus on command prompt.
Check services of windows to know that the oracle database was installed on laptop or not.
Try to find oracle universal installer in all programs by this also you can get which version of database is installed.
Your second question is about default username/password
For this you can give username : "/ as sysdba".
It will not ask for password because it will authenticate thorugh OS authentication.
after login you can able to create new schema or user and tables.
You can check simply using command prompt. Open command prompt and type connect. Provide the username and password and press Enter. It will show "connected" if the database is in your system.
Username: system (default)
Password: (what you provided while installing)
Firstly goto my computer/ this pc and then click on
downloads option and see your app and check that Oracle
is available there or not.

db2 database creation

I installed db2 client in my system for personal use. I am not able to understand from where to create the database so that i can create tables on that db and play around with sql queries as of now.
This is totally related to my personal use and learning purpose.
Please inform how to create a dummy database and play around with it with db2 client?
Regards,
Are you on Windows? Are you using DB2 Express-C? I'm assuming you are, since you say this is for personal work.
After you have the DB2 binaries installed, you should have been prompted with the "DB2 First Steps" application, where you could have the application go through a GUI to create the database for you. If you missed it, you should be able to find it in your start menu with Start -> Programs -> IBM DB2 -> DB2COPY1 (Default) -> Set-up Tools -> First Steps.
If you prefer the command line, you can use the following:
First, determine if your installation created a default instance (on Windows, this will be called DB2) by using the db2ilist command. In the DB2 Command Window, if you're not on the instance you want to create a database in, you can switch with the following command:
set db2instance=DB2
Be sure to not include spaces around the equal sign.
Now, in order to create a database in the current instance, you use this command:
db2 create database mydatbase
For further reading, IBM has produced a Getting Started ebook, and I would highly recommend you check it out!
The DB2 client is just that - a client only. It does not include the database engine.
To create a database you have to install the server. The server includes the client portions.

"Cannot open user default database. Login failed." after installing SQL Server Management Studio Express

I have a database in a local file that is used by a program. The program has limited functionality and I needed to run some quick queries. I installed SQL Server Management Studio Express 2005 (SSMSE), connected to the SQL Server instance, attached the database file, and ran the queries. Now the original program will no longer connect to the database. I receive the error:
Cannot open user default database. Login failed. Login failed for user 'MyComputer\MyUserName'.
I've gone back into SSMSE and tried to set the default database. I've opened up Security, Logins, BUILTIN\Administrators and BUILTIN\Users. Under General, I have set the default database to the program's database. Under User Mappings, I made sure the database is ticked and that db_datareader and db_datawriter are ticked.
The program uses the connection string:
Server=(local)\Instance; AttachDbFilename=C:\PathToDatabase\Database.mdf; Integrated Security=True; User Instance=True;
I know jack-all about database administration. What else am I missing?
This may not be answering your question specifically, but it may help others with similar issue caused by different problem
In my case the problem was my user is defaulted to a database which is not accessible for any reason (can be renamed, removed, corrupted or ...)
To solve the issue just follow the following instruction
Try to login again on the login page there is other tabs select
"Connection Properties".
under the tab locate "Connect to database" and select an existing database you have access to like tempdb or master
Once you are connected to the SQL Server Instance execute the below TSQL to assign the login a new default database.
Use master
GO
ALTER LOGIN [yourloginname] WITH DEFAULT_DATABASE = TempDB
GO
Alternatively once you connected change your default database name to master via UI
Article taken from :
http://www.mytechmantra.com/LearnSQLServer/Fix-cannot-open-user-default-database-Login-failed-Login-failed-for-user-SQL-Server-Error/
This problem manifested for me when I took my default db offline. Next thing I know I couldn't login. Switching to the Connection Properties tab and selecting the drop down to change the database I want to connect to also failed.
It let me in right away once I manually typed master as the db I wanted to connect to (on the Connection Properties tab).
First, try to isolate your problem:
Take a backup of the file! Some of the steps below can, apparently, in some circumstances cause the file to vanish.
Are you sure you are connecting to the same instance through Management Studio as the program is?
If possible, try to shut down the instance that you are not expecting to use.
Set the user's default database to master and try to make the program logon.
Try to login as the user through Management Studio - since you have integrated security, you should open Management Studio as the program's user.
Are you using "User instances" - perhaps without knowing it? If so, this may be helpful: http://blogs.msdn.com/b/sqlexpress/archive/2006/11/22/connecting-to-sql-express-user-instances-in-management-studio.aspx
I haven't worked much with files being attached in the way your program does - but you write that you attached the DB in the Management Studio as well. Have you tried detaching it there before running your program? Perhaps you are seeing the Management Studio and your program competing for exclusive access to the MDF-file?
EDIT: I added point 6 above - this is new in my own list of TODOs when troubleshooting this type of Login failed. But it does sound a lot like what you're experiencing.
EDIT2: In the first edit, new item was added to the list. So the numbers in the comments doesn't correspond with the numbers in the answer.
I finally figured this out, and my situation is different than every other I've read about tonight.
I had restored my database from a backup. I knew that there was a particular login user that I had been using, so I created that user in SSMS. However, there was already a user by that name under the database that had come in with the backup.
Since I had screwed around so much trying to fix this, I wasn't able to delete the user under the DB easily. I deleted the database and restored again. Then:
Delete the user under the Databases->[my database]->Users
Create the user again in Security->Logins (not under your DB, although that probably works too.
Go to the newly created user. Select properties. Then under User Mappings, tell it to make your database the default. Give it read and write access.
Summary: I had two users. One that came with the DB, and one that I had created. Remove the one that came with the DB and create your own.
First click on Option>> Button of “Connect to Server” Prompt.
Now change the connect to database to any existing database on your server like master or msdb.
More Details
https://blog.sqlauthority.com/2008/11/04/sql-server-fix-error-4064-cannot-open-user-default-database-login-failed-login-failed-for-user/
I've also had this same problem, it turned out that I was trying to access the built in membership classes (in a view), and that .Net was trying to create the database in the App_Data folder:
#Membership.GetUser().ProviderUserKey
This will trigger the system to try and create a database based in the built in membership system, which may not be the way your system is setup.
I had a similar problem had to simply download SQL Express Utility that is capable of starting User Instances. SSEUtil is a tool written by the Visual Studio team to help troubleshoot User Instance issues, you can read more about it in the read me file that is installed with the utility.
http://www.microsoft.com/downloads/details.aspx?FamilyID=fa87e828-173f-472e-a85c-27ed01cf6b02&DisplayLang=en.
Hope this will help.
In my case I had to set "connect to any database" right path:
On your instance, go to Security , then to Logins.
Right Click on there, you will see properties and you should click on Securables.
There it give possibility to connect to any database.

Resources