Home » RDBMS Server » Server Utilities » Automating Export/Import of 8i db in NT4
Automating Export/Import of 8i db in NT4 [message #72280] Thu, 01 May 2003 09:21 Go to next message
Noah Pullen
Messages: 7
Registered: May 2003
Junior Member
First, thank you for this forum and for taking the time to read my question. I am new at being a DBA but will try to ask my question in as a descriptive way a possible.

I thoroughly understand how to export and import my database. I work in a production enviroment that has 3 shifts and seldom get the opportunity to performa a DBdump due to the near round the clock usage and deperately want to learn how to automate this task.

I have moderate experience making batch files but have found that this task is beyond my current skill set and would greatly appreciate it if someone could send me some reference material that I could use to accoplish this task.

I am a staunch do it yourselfer an am not looking for someone to do this for me rather I seek to be under the tutlage of a seasoned vet.

My Goals:
Automate the export using the AT command
Automate the dropping tables that belong to SYSADM ( i have a script to accoplish this called dropsysadm.sql)
Automate the import using the AT command

Thank you in advance
Re: Automating Export/Import of 8i db in NT4 [message #72281 is a reply to message #72280] Thu, 01 May 2003 09:36 Go to previous messageGo to next message
Noah Pullen
Messages: 7
Registered: May 2003
Junior Member
Would like to add that this would be a dump of the production db to the test db both are on the same server.
Re: Automating Export/Import of 8i db in NT4 [message #72283 is a reply to message #72280] Thu, 01 May 2003 12:02 Go to previous messageGo to next message
Noah Pullen
Messages: 7
Registered: May 2003
Junior Member
Update: needs lessen.

I have figured out how to get my batch file to kick off the export. After backupexe finishes my cold backups I have it start a .bat file that starts my db's and I use the CALL command to kick off my export.bat file that sets the targeted sid and parfile.

Now I need to know how to kick off my dropsysdba.sql script on my test db prior to running my import.bat.

Thanks in adavnce.
Re: Automating Export/Import of 8i db in NT4 [message #72284 is a reply to message #72280] Thu, 01 May 2003 12:26 Go to previous messageGo to next message
Noah Pullen
Messages: 7
Registered: May 2003
Junior Member
looks like this may be the direction i need to head with the execution of my script but not sure how to pass the SID so it knows which db to run against.

Please help.

sqlplus -s usr/pwd @script.sql
Re: Automating Export/Import of 8i db in NT4 [message #72288 is a reply to message #72284] Fri, 02 May 2003 02:55 Go to previous messageGo to next message
Barbara Boehmer
Messages: 9101
Registered: November 2002
Location: California, USA
Senior Member
sqlplus -s usr/pwd@connect_string @script.sql

example:

sqlplus -s scott/tiger@oracle81.world @script.sql
Re: Automating Export/Import of 8i db in NT4 [message #72291 is a reply to message #72288] Fri, 02 May 2003 05:51 Go to previous messageGo to next message
Noah Pullen
Messages: 7
Registered: May 2003
Junior Member
Thanks for the update Barbara. I had found that late in the day yesterday and tested it but have since found that I need to connect internal as sysdba.

Is there a way to do this with sqlplus or svrmgrl that would allow me to pass the @script.sql at the same time or am I a reaching for the unattainable here. I have been busily reading tips from different sources but it is hard to find information that fits this specific need.

Being a rookie it is even harder to figure out what sort of latitude one has with this type of cmd line work. Thanks again and have a pleasant weekend.
Re: Automating Export/Import of 8i db in NT4 [message #72292 is a reply to message #72291] Fri, 02 May 2003 06:08 Go to previous messageGo to next message
Barbara Boehmer
Messages: 9101
Registered: November 2002
Location: California, USA
Senior Member
To connect internal on Windows NT, you would either:

CONNECT SYS/change_on_install@connect_string;

or:

CONNECT SYSTEM/manager@connect_string AS SYSDBA;

change_on_install is the original password for SYS and manager is the original password for SYSTEM. SYS is internal, so you don't need AS SYSDBA, which is used to connect.

You could try running your script as:

sqlplus -s SYS/change_on_install@connect_string @script.sql
Re: Automating Export/Import of 8i db in NT4 [message #72293 is a reply to message #72292] Fri, 02 May 2003 06:35 Go to previous messageGo to next message
Noah Pullen
Messages: 7
Registered: May 2003
Junior Member
Excellent. I will give this a try. It seems that you cannot log in with svrmgrl the same you can with sqlplus. By this i mean the sytax that sqlplus uses in such as the examples, such as this sqlplus -s SYS/change_on_install@connect_string @script.sql, you have given. Is that the case, svrmgrl won't take something like this svrmgrl usr/pwd@cnct_strng @sql.sql?

Thanks again for helping me through this.
Re: Automating Export/Import of 8i db in NT4 [message #72296 is a reply to message #72293] Fri, 02 May 2003 13:16 Go to previous messageGo to next message
Noah Pullen
Messages: 7
Registered: May 2003
Junior Member
I am able to run the script now, many thanks, however I do not think that it has the permissions it needs to execute it properly. this is line 1 which I get a repated error through the script from that says error line 1 as the script processing contiunes.

drop user sysadm cascade;

I f I connect using svrmgrl connect internal as sysdba I do not get the repested error that says error line 1.

Do you have any thoughts as to what could cause this disparity?

Thanks,

NP
Re: Automating Export/Import of 8i db in NT4 [message #72299 is a reply to message #72296] Sat, 03 May 2003 01:12 Go to previous message
Barbara Boehmer
Messages: 9101
Registered: November 2002
Location: California, USA
Senior Member
I don't know. It could be a privileges problem as you suspect. Or, it could be that you receive an error when trying to drop the user because it has already been dropped from a previous run. I would have to see a cut and paste of the whole connection, run, and error messages. I am not sure why you are trying to drop sysadm to begin with. You aren't trying to export SYS objects, are you? I am hoping someone else reading this, who has more experience with this sort of thing, will jump in at this point, and offer some advice.
Previous Topic: Index copy
Next Topic: Manipulating a CSV file load in sqlldr
Goto Forum:
  


Current Time: Tue Dec 24 06:42:44 CST 2024