473,396 Members | 1,860 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Database import/export with putty.

1
Hi. I receive a database backup on a daily basis. I then import this dump on another server which I use for software development. There is two db's being hosted on this server. We test software upgrades against these two db's. The "refresh" needs to be completed at least once a day, sometimes 4-5 times a day. I need the quickest way of doing this task. I have extremely limited knowledge on scripting. What I need is something that I can just click, and then automatically do the import onto my training environment. My current procedure is something like this:

This procedure will refresh the UAT database from the latest live database export. The live export is a daily generated file -->
WED_mvdl.dmp.gz
THU_mvdl.dmp.gz
FRI_mvdl.dmp.gz
etc...

For the import to work, the dump must be copied from the live server’s export directory to the UAT server’s import directory. Keep in mind that the dump is GZipped and will be unzipped with a simple putty command.


Copy the newest -DUMP- to the Server’s –IMPORT- directory.

Sort the files by date. The file we need is the newest dump; its type is “GZ”

• The path to the dump export folder is:
\\192.168.11.210\database exports
Username: root
Password: root01
• The path to the training/uat server’s import folder is:
\\192.168.11.202\backup\exports
Username: root
Password: root01
• Copy the newest dump. (for instance: WED_mvdl.dmp.gz)






Note that the TRNG and UAT db’s is hosted on the same server. This is the training server and is not in the server room. Connect to the training server via putty. All the following happens in the putty session:
(Oracle user)
• Putty to: 192.168.11.202
Username: Oracle
Password: Ora528i

Type the following into putty’s prompt window.
• Sqlplus / as sysdba (enter)
SQL>Select name from v$database;
This should be displayed to indicate a trng db connection:

NAME
---------
TRNG
The following procedure will drop the UAT user from any active sessions that it may have. Keep in mind that we are working on a standalone testing and training environment so no serious damage can be done. There is no risk in performing these steps if the correct procedures are followed.
• Shutdown immediate;
• Startup;
• Drop user uat cascade;
• Copy all of this text into putty session:


spool create_UAT_user.log
CREATE USER UAT PROFILE DEFAULT IDENTIFIED BY NAUAT DEFAULT TABLESPACE TIS_DATA QUOTA UNLIMITED ON TIS_DATA QUOTA UNLIMITED ON TIS_INDEX TEMPORARY TABLESPACE TEMP;
GRANT CREATE PROCEDURE TO UAT;
GRANT CREATE SEQUENCE TO UAT;
GRANT CREATE SESSION TO UAT;
GRANT CREATE TABLE TO UAT;
GRANT CREATE VIEW TO UAT;
GRANT CREATE TRIGGER TO UAT;
GRANT EXECUTE ANY PROCEDURE TO UAT;
GRANT CONNECT TO UAT;
connect sys/sys528i@trng as sysdba
grant select on SYS.V_$DATABASE to UAT;
GRANT SELECT ON SYS.V_$MYSTAT TO UAT;
GRANT SELECT ON SYS.V_$SESSION TO UAT;
GRANT SELECT ON SYS.V_$PARAMETER TO UAT;
spool off


• Exit;



cd /u03/backup/exports
su root
Password root01
pwd // NB The Path must be “/u03/backup/exports”
chown oracle:dba *.dmp*
exit


With the following command we will unzip the dump file on the server:

• gunzip FRI_mvdl.dmp.gz
If prompted to overwrite the file type “Y” for yes.
This takes roughly a minute.
• imp system@trng file=FRI_mvdl.dmp log=imp_uat.log fromuser=TANZ touser=UAT

Password sys528i
This operation will take about 15minutes
Note!! On completion, the sentence: The import completed successfully…






If anyone can help me I'd appreciate it alot. Any simplified steps or script solution will be welcomed. Thank you.
Jul 30 '07 #1
0 9711

Sign in to post your reply or Sign up for a free account.

Similar topics

11
by: Mike MacSween | last post by:
My client has an MS Access database application on her local machine. I have full access to that in terms of changing the design. I've got a simple PHP/MySql application on shared hosting, so no...
3
by: Cristina | last post by:
Hallo i am a beginner into Oracle Technologies.I would like to make backup of my database,but i dont know how.Is there tools?Can i schedule the backup plan? thanks Cristina
3
by: Bennett Haselton | last post by:
I'm working on an ASP.Net project where I want to test code on a local machine using a local database as a back-end, and then export it to the production machine where it uses the hosting...
3
by: Xerxes | last post by:
Hi, I would like to import the tables from MySQL database into Access database and I am not sure how to go about it. I tired to "Import External Data" from Access, selected "ODBC database" from...
6
by: Frank Fiene | last post by:
How does this work? I have one database SBO_DB (SAP BusinessOne) I want to copy tablespace TS_SEW_ACCESS_DEMO to TS_TEST2. The directory of the database is: F:\DB2\NODE0000\SQL00002 Please...
4
by: Max2006 | last post by:
Hi, We are developing a SQL server based asp.net application. As part of requirement we should allow users import/export some relational data through web user interface. We are investigation...
6
by: mirianCalin | last post by:
i am doing the programming at home and our teacher checks it in school that's why i need to export/import my database.. but i dont know how.. i've found this instruction on the net but i cant...
39
by: alex | last post by:
I've converted a latin1 database I have to utf8. The process has been: # mysqldump -u root -p --default-character-set=latin1 -c --insert-ignore --skip-set-charset mydb mydb.sql # iconv -f...
0
by: kkshansid | last post by:
i cannot export my sql server database to msaccess database which i usually did successfully 3weeks ago pls help me to find the error so that i can correct it in future error is - Validating...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.