Adding a date to an export filename
I've just inherited an Oracle database, and I don't have the first clue as to how to write code for it. I do however know how to search on the web, and have come up with this script.
**********************************************************************
f:
cd Oracle_Backup
REM Column instnc new_value v_instnc noprint
REM column instdate new_value v_instdate noprint
REM SELECT name instnc
REM FROM v$database;
REM SELECT TO_DATE(sysdate,'DDMMYYHH') instdate
REM FROM dual;
exp system/manager@swp
REM file=swp_full&&v_instexp&&v_inst_exp&&v_instdate..dmp
REM log=swp_full&&v_instexp&&v_inst_exp&&v_instdate..log
full=y
**********************************************************************
The REM lines are what I gleaned off another site, and the file and log commands originally looked like:
file=swp_full.dmp
log=swp_full.log
But were changed to this per the borrowed script:
swp_full&&v_instexp&&v_inst_exp&&v_instdate..dmp
swp_full&&v_instexp&&v_inst_exp&&v_instdate..log
So, I can almost follow what is being done in the script, but since I have ZERO Oracle experience, I need help. If you can help me please contact me. I would greatly appreciate it.
Re: Adding a date to an export filename
Quote:
Originally posted by OracleNewb7731
I've just inherited an Oracle database, and I don't have the first clue as to how to write code for it. I do however know how to search on the web, and have come up with this script.
**********************************************************************
f:
cd Oracle_Backup
REM Column instnc new_value v_instnc noprint
REM column instdate new_value v_instdate noprint
REM SELECT name instnc
REM FROM v$database;
REM SELECT TO_DATE(sysdate,'DDMMYYHH') instdate
REM FROM dual;
exp system/manager@swp
REM file=swp_full&&v_instexp&&v_inst_exp&&v_instdate..dmp
REM log=swp_full&&v_instexp&&v_inst_exp&&v_instdate..log
full=y
**********************************************************************
The REM lines are what I gleaned off another site, and the file and log commands originally looked like:
file=swp_full.dmp
log=swp_full.log
But were changed to this per the borrowed script:
swp_full&&v_instexp&&v_inst_exp&&v_instdate..dmp
swp_full&&v_instexp&&v_inst_exp&&v_instdate..log
So, I can almost follow what is being done in the script, but since I have ZERO Oracle experience, I need help. If you can help me please contact me. I would greatly appreciate it.
what do you actually want to do? take an export of the database? or are you trying to understand what this does?
There are much easier ways than that